You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue involving an unresponsive treemap which kept giving me garbage NaN values, even though my value properties were filled out correctly. I traced it to this call in positionNode in the D3 source:
function positionNode(node) {
var p = paddingStack[node.depth],
...
paddingStack is a list which gets initialized with length 1, and I was trying to run treemap on a node that I had indexed out of my original root node which had a depth property of 1.
I think this requirement (that the first node should have a depth of 0, and every child thereafter should increment by 1) should be noted in the docs as a prerequisite for running treemap(node). In reading them I thought that the depth property was just syntactic sugar, and that the only thing that mattered was having value properties correctly labelled...I hadn't realized it was used this way in layout!
The text was updated successfully, but these errors were encountered:
I ran into an issue involving an unresponsive treemap which kept giving me garbage
NaN
values, even though myvalue
properties were filled out correctly. I traced it to this call inpositionNode
in theD3
source:paddingStack
is a list which gets initialized with length 1, and I was trying to runtreemap
on a node that I had indexed out of my original root node which had adepth
property of 1.Once I figured this issue out, the fix was easy:
I think this requirement (that the first node should have a
depth
of 0, and every child thereafter should increment by 1) should be noted in the docs as a prerequisite for runningtreemap(node)
. In reading them I thought that thedepth
property was just syntactic sugar, and that the only thing that mattered was havingvalue
properties correctly labelled...I hadn't realized it was used this way in layout!The text was updated successfully, but these errors were encountered: