0
以下のコードはd3v3で動作しますが、v4では失敗します。d3js tree.nodes()は関数ではありません
var nodes = tree.nodes(root).reverse(),
links = tree.links(nodes);
Uncaught TypeError: tree.nodes is not a function
V4でのそれのための代替とは何ですか?
以下のコードはd3v3で動作しますが、v4では失敗します。d3js tree.nodes()は関数ではありません
var nodes = tree.nodes(root).reverse(),
links = tree.links(nodes);
Uncaught TypeError: tree.nodes is not a function
V4でのそれのための代替とは何ですか?
import { hierarchy, tree } from 'd3-hierarchy'
// create a hierarchy from the root
const treeRoot = hierarchy(root)
tree(treeRoot)
// nodes
const nodes = treeRoot.descendants()
// links
const links = treeRoot.links()
あなたはTSではなくJavascriptですか? –
JSで行うことをお勧めできます –