0
我想在我的頁面上運行Mike Bostock的Zoomable Circle Paking example,但我遇到了問題。Zoomable Circle packing - parent undefined
我把代碼放在了一個閉包中,因爲我在一個頁面上有多個可視化。像這樣:
<script>
(function(){
//zoomable circle packing code here ...
})(window,d3);
</script>
可視化加載罰款,但是當我點擊任何一個圓或區域,我得到以下錯誤:「(指數):2444遺漏的類型錯誤:無法讀取的不確定財產‘父’ 「
似乎是指向行:
transition.selectAll("text")
.filter(function(d) { return d.parent === focus || this.style.display === "inline"; })
...
無法理解爲什麼父節點未被發現。