[openspending-dev] Sanity checking numbers on Minas Gerais' satellite site

Vitor Baptista vitor at vitorbaptista.com
Thu Feb 14 19:34:15 UTC 2013


If you open http://minasgerais.playground.openspending.org/bubblemap.html,
and set a breakpoint into aggregator.js, line 183, you can see:

> nodes.root.amount
61554809596.11001
> total = 0; for (i in nodes.root.breakdowns) { total += nodes.root.breakdowns[i].amount; }
73659290793.70004
> total = 0; for (i in nodes.root.children) { total += nodes.root.children[i].amount; }
61554809596.11003

The difference between nodes.root.amount and the sum of nodes.root.children
amounts seems to be just a precision error. But the breakdowns have a huge
difference. I'm trying to understand what's happening, but haven't had much
luck.

My first hypothesis was that we're counting a few values twice. I thought
about it because, if you check:

> data.drilldown[0].region.id
"1"

I thought that Aggregator.toNode could change that to "root__1", which
would conflict with a cofog1 ID. But doesn't seems to be the case.

Any ideas?


Cheers,

Vítor.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20130214/3a288bf4/attachment.html>


More information about the openspending-dev mailing list