rufuspollock-okfn / bubbletree

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

Handle negative amounts #5

Open gka opened 12 years ago

gka commented 12 years ago

Moved from https://github.com/okfn/openspending/issues/320

Original issue:

The bubbletree doesn't produce a good error message when it gets negative amounts. It scales the radii of its circles to these amounts, and thus cannot handle the case of amounts which are negative. We should at the very least do something other than display a blank page when this condition is encountered.

Comments:

@pudo: I think this should either be in bubbletree or in the explorer plugin - putting it before means potentially screwing up the aggregator API to support JS that does not know negative nums.

gka commented 12 years ago

I see the following options:

a) ignoring bubbles with negative amounts (= set amount to zero) – not so smart of a solution b) allowing bubbletree to handle negative amounts (= scale radii to abs(amount), but show negative values in label/tooltip) – might be misleading, though..

opinions?

gka commented 12 years ago

urgs, as of looking at https://github.com/okfn/openspending/issues/177 I noticed that negative values break the entire concept of the bubbletree, because they might add up to zero..

therefore I will chose a)

gka commented 12 years ago

btw, a) is the current behaviour, but bubbles aren't ignored but displayed as tiny dots.

The problem with both solutions is that the sums of the "parent" bubbles are incorrectly set when some of the amounts are negative. It seems that negative amounts are fundamentally violating the concept of the bubbletree, which is to show the hierarchical breakdown of amounts into smaller chunks..

Not sure what to do about this..