bubbletree icon indicating copy to clipboard operation
bubbletree copied to clipboard

Handle negative amounts

Open gka opened this issue 13 years ago • 3 comments

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 avatar Jan 31 '12 20:01 gka

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 avatar Jan 31 '12 20:01 gka

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 avatar Jan 31 '12 20:01 gka

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..

gka avatar Jan 31 '12 21:01 gka