d3.json: “Uncaught TypeError: Cannot read property 'children' of undefined”

后端 未结 5 2122
面向向阳花
面向向阳花 2021-01-05 16:14

I am trying out d3 as a tool for representing biological data.

I am trying to open the following example in my chrome browser so that I can understand how it works

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 16:22

    In order to get it to work I had to replace the line

    d3.json("flare.json", function(error, root) {
    

    with

    d3.json("flare.json", function(root) {
    

    I used my intuition here and I still do not understand how it worked on the example website and not mine, or what the true significance of my change in the code is. If you know how to answer this in a more in-depth fashion, please contribute and I will accept your answer.

提交回复
热议问题