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

Tryggvi Björgvinsson tryggvi.bjorgvinsson at okfn.org
Fri Jul 26 23:41:30 UTC 2013

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


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/9de785ae/attachment.html>

More information about the openspending-dev mailing list