[openspending-dev] Cuts and Programmatically Generated Visualizations in OpenSpending?

Marc Joffe marc at publicsectorcredit.org
Sat Jul 27 00:23:29 UTC 2013



Thanks for your response.  I think the proposed button is a good idea.  It
would be unfortunate to deprecate the functionality in the Views screen; I
wonder if there is some way funding could be found to complete the
functionality.  One way to do this work at low cost (assuming a volunteer
cannot be found) would be to locate Python programmers in developing
countries through Elance <http://www.elance.com/>  and have them do the


I would be happy to call the functionality from a satellite site.  Where
would I find API documentation to instruct me on how to do this?


With respect to the existing OpenSpending site, would it help if I divided
the data set into annual chunks (2012, 2011, etc.) and uploaded each one





From: openspending-dev-bounces at lists.okfn.org
[mailto:openspending-dev-bounces at lists.okfn.org] On Behalf Of Tryggvi
Sent: Friday, July 26, 2013 4:42 PM
To: openspending-dev at lists.okfn.org
Subject: Re: [openspending-dev] Cuts and Programmatically Generated
Visualizations in OpenSpending?


Hey Marc!

On fös 26.júl 2013 17:50, Marc Joffe wrote:

In the Views tab of the Manage function, I cannot figure out how to "cut"
the data by year.  I tried using years and dates (e.g. 1/1/12), but no luck.
Can someone have a look at my data set at
http://openspending.org/pscs_ca_cities and tell me what I am doing wrong?
Also, I am not clear on whether or how I can manipulate the data set
programmatically so that I can generate one view for each city.

The default views implementation in OpenSpending is quite limited at the
moment and not very well documented.

What you're trying to do isn't supported - Sorry :(

OpenSpending tries to guess what year to show and asks for that year.
Defining year in cuts (which is a good place to do so) will not remove the
guess OpenSpending is making so it'll always mix in the most recent year it
can (in your case 2012). If you remove the cuts in one of your views the
treemap will be shown for the year 2012.

I would actually go as far as to say that this functionality should be
deprecated. It just confues people. The way I recommend is to create what we
call a satellite site. That's a simple site that uses the openspending
database as a backend and gives you way more freedom to do what you want
(breakdown by cities in a user friendly way, show years etc.).

There is an open ticket (opened recently) about adding a button (or
something) to our visualisation builder that allows users to set default
visualisations for datasets:


It hasn't been implement yet and it doesn't really solve your problem
regarding showing different years (since it assumes one visualisation) but
that might be an easier way to create these visualisation tabs. I'd like to
hear your input since you've gone through the process of trying to use the
views json builder (you can comment here or in the commenting system on


Tryggvi Björgvinsson

Technical Lead, OpenSpending

The Open Knowledge Foundation <http://okfn.org> 

Empowering through Open Knowledge

http://okfn.org/ | @okfn <http://twitter.com/OKFN>  | OKF on Facebook
<https://facebook.com/OKFNetwork>  | Blog <http://blog.okfn.org/>  |
Newsletter <http://okfn.org/about/newsletter> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20130726/3ee3c9d1/attachment.html>

More information about the openspending-dev mailing list