rufuspollock-okfn / bubbletree

Radial Bubble Tree Visualization
http://okfnlabs.org/bubbletree
152 stars 69 forks source link

node.breakdowns undefined #14

Closed maxious closed 12 years ago

maxious commented 12 years ago

The minimal demo does not work out of the box because node.breakdowns is undefined (but not explicitly null) at line 212: $.each(node.breakdowns, function (c,bd) { https://github.com/okfn/bubbletree/commit/a89575047a64b2f5717b802afc7dd2b894bf4b6a#L1R212

This results in an error "Uncaught TypeError: Cannot read property 'length' of undefined" in jQuery and the bubbletree does not display.

I worked around this by making the conditional on line 210: if (node.breakdowns !== null && typeof node.breakdowns != "undefined") {

but I don't know if that's the right way to do it. It does make the minimal demo work again though.

gka commented 12 years ago

thx for reporting. changed the line to `ìf (node.breakdowns)`` which should fix the problem.