The var root is set where it calls a function (classes), but when that function is defined it is passing in the root object.
No, it simply has a parameter that is named
root. This has nothing to do with the
root variable outside of the function.
You could rename the function parameter for example
function classes(foobar), and inside
recurse(null, foobar);), and things would still work exactly the same.
Your confusion is completely understandable, considering there are two uses of
root, and they don't refer to the same thing.
classes is invoked by
classes(data), so the
root in the
classes function refers to the data loaded in
flare.json, while the
root in your data loading function is a d3 object, returned by
I would recommend renaming the
root parameter in
classes so there's less confusion.
- How do I assign ticks to be equal to a different key value from the same object from the one on which the axis is based on in D3.js?
- What object type is the instance element parameter pass into the link function of an angular directive?
- D3: use nest function to turn flat data with parent key into a hierarchy
- Why Babel 7 uses require() function for browser which knows nothing about it?
- Map function in D3, confused about multiple functions passed in
- Passing Object function into data() in d3
- How to call a function on click of a checkbox which is a popup on click of d3 element like rect
More Query from same tag
- d3-drag - rescale y-axis with drag in d3v5
- Need to create a line within x and y axis in d3 v5
- Rickshaw : data for multiple series not working
- Responsive d3 bubble chart
- Styling not working in Mozilla Firefox
- Forcing y-axis to 0 when using chained transitions
- How can I color one Y-axis line different from the other grid-lines?
- How to use elements of a JSON object to change attributtes in animation of a D3 bubble chart
- more minimaler cubism.js horizon chart from json example
- Want to Make my chart look responsive in D3
- D3 forced layout zoom and pan not working
- Scaling geographic shapes to a similar size in D3
- Sum Of count in D3
- How can I perform this d3.js magic (Grouped Bar Chart) with JSON rather than CSV?
- d3 map point only drawed in topleft corner
- Controlling bar position with tickValues in d3.js
- Custom coordinates and axis range on leaflet.js
- Why are there no ticks on my X (time) axis?
- D3 tree with predefined depths
- Iterating over array elements in d3.js to add to button
- Learning Map / Syllabus Visualization
- Why is .delay() not iterating properly?
- How to find out about loaded d3.js extensions and their versions at runtime?
- Setting color in D3 based on data like a boss
- Multi Line Graph D3.js
- Change color on a map D3
- JS D3 Update force Graph with Websocket
- sorting nested data in d3.v4
- How to remove extras lines using stylesheet from axies in the D3.js
- d3 force layout - positioning nodes