-1
我是D3的新手,我開始將示例氣泡圖從v3轉換爲v4。我得到bubble.nodes is not a function
類似於this question。在D3中將氣泡圖從V3轉換爲V4
但是,我不知道如何應用過濾器。我已將我的代碼放入plunker。有人可以幫忙嗎?
在此先感謝。
我是D3的新手,我開始將示例氣泡圖從v3轉換爲v4。我得到bubble.nodes is not a function
類似於this question。在D3中將氣泡圖從V3轉換爲V4
但是,我不知道如何應用過濾器。我已將我的代碼放入plunker。有人可以幫忙嗎?
在此先感謝。
佈局功能d3
更改substantially between versions 3 and 4。其要點是,您現在需要在將數據傳遞到佈局之前調用d3.hiearchy
到preprocess。返工你的代碼看起來是這樣的:
d3.json("flare.json", function(json) {
var root = d3.hierarchy(classes(json))
.sum(function(d) { return d.value; });
var node = vis.selectAll("g.node")
.data(bubble(root).leaves())
.enter().append("svg:g")
...
更新plunker here。
非常感謝您的幫助 – Selva
'bubble(節點)'與'bubble.nodes'有很大的不同。 –