[openspending-dev] #500 and #501

Vitor Baptista vitor at vitorbaptista.com
Fri Jan 11 16:25:09 UTC 2013


Hey,

2013/1/11 Friedrich Lindenberg <friedrich.lindenberg at okfn.org>

> Hey Vitor,
>
> On Wed, Jan 9, 2013 at 9:50 PM, Vitor Baptista <vitor at vitorbaptista.com>wrote:
>
>> I've finished a first version of the timeseries graphs. It's in the
>> feature/time-series branch on openspendingjs. There're a few things missing.
>>
>
> I tried to check it out, but didn't get it working. Can you see what I'm
> doing wrong? http://cl.ly/image/0n0h391K2432
>

Did you did "python -m SimpleHTTPServer" on openspendingjs' root? I just
double-checked if I haven't forgot to commit any files, but everything
seems OK.


> First, I was thinking in how to limit the entries' amount. I tried to
>> simply change Aggregator's pagesize, but that kinda sucks. The best
>> solution is to limit the number of entities shown over a period of time,
>> but pagesize limits the number of elements returned. If I set a pagesize to
>> 100, I might receive 100 entries of a single entity, or 100 different
>> entities.
>>
>
> Hm, I don't quite get this - can you explain? Don't you just drill-down
> over time and whatever dimension you want to display and get the maximum
> result set size?
>

For example, check
http://openspending.org/api/2/aggregate?dataset=ukgov-25k-spending&drilldown=time|from&order=amount:desc&cut=time.year:2012&pagesize=10
.

It returns me 10 entries, but the first 3 are from the Department of
Health, and there's no guarantee that these 3 are all of its entries on
2012 (i.e. there might be one as the 11th element).

What I would like to get is "The 10 first entities of that dataset on
2012". It doesn't matter if the Department of Health has 3 or 300 entries,
I want them all.

Does it make sense?

Second, it makes more sense to select a range in the slider, instead of
>> simply the year. There're even datasets that simply don't work if you
>> select only a year (i.e. Slovakia's). But, for it to work, I would need a
>> way to get ranges through the API. I could find none. The only way was to
>> cut by every year inside the range, but that's another hack. Also, it won't
>> work if we allow selecting month (or day) ranges. Ideas?
>>
>
> Again, I'm not sure what you mean - are you trying to limit the result set
> of the years? If so, a two-button slider would certainly be cool to have.
>

Yes. For example, Slovakia's datasets have only yearly data, at January 1st
of each year. If I cut by only that year, the visualization looks awful.
Just a bunch of dots (or bars, or whatever) on that day. So I need to cut
by a range of years, so I can see the progress.

The problem is: the API doesn't have something like cut=time.year>2010. My
workaround is to do cut=time.year:2010|time.year:2011|time.year:2012. It
works for now, but if we imagine having a range slider, it would be good to
be able to select a range in months as well (not only years). It breaks
this workaround.


> And last, I haven't checked it yet, but could you point me where to look
>> to add the widget inside openspending?
>>
>
> It's in in the .ini config, openspending.widgets = treemap bubbletree
> aggregate_table rickshaw timeseries
>

Thanks :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20130111/27594987/attachment.html>


More information about the openspending-dev mailing list