openspending-archive / openspendingjs

OpenSpending js library and mini-apps including visualizations
http://community.openspending.org/
Apache License 2.0
35 stars 25 forks source link

Revive idea for time series - bar charts #55

Open anderspeders opened 11 years ago

anderspeders commented 11 years ago

Here is @vitorbaptista's work on this from earlier this year: https://github.com/openspending/openspendingjs/tree/feature/time-series

On the bar chart idea I would add CIVIO's project as well: http://www.dondevanmisimpuestos.es/ccaa/

Question:

Comments @vitorbaptista @tryggvib ?

trickvi commented 11 years ago

Here is the bar chart @fractied66rotterdam added: https://github.com/openspending/openspendingjs/blob/build-process/src/visualisations/jquery.barchart.js

It's a standalone version you can quickly get working on your website but it might need some extra work like drilldowns etc. (and a merge of the build process branch which I just have to find time to do)

anderspeders commented 11 years ago

Adding some more inspiration for bar charts and time series here :-)

1) Arlington: http://www.arlingtonvisualbudget.org/funds/2013/l/d42b2bb7

Source code and readme here: https://github.com/goinvo/Visual-Town-Budget

2) http://philogb.github.io/budgetvis/ (not openly sourced)

rufuspollock commented 10 years ago

@tryggvib @anderspeders we already have this branch with time series stuff https://github.com/openspending/openspendingjs/tree/feature/time-series

@vitorbaptista could you update on what happened here?

vitorbaptista commented 10 years ago

There's a prototype using RickshawJS on the feature/time-series branch. I had, basically, two issues with OpenSpending's API.

First, take the uk-25k dataset. It has hundreds of entities (suppliers, public bodies, etc.). If I plot them on a timeseries graph, it'll turn into spaghetti. So it would be useful IMO to be able to ask for the "top 10 entities" or something like that. There's no way to do it right now. You can only limit the number of results. The workaround I did just for test purposes was to get lots of results, and filter the number of entities in the client-side, which sucks (https://github.com/openspending/openspendingjs/blob/feature/time-series/widgets/timeseries/main.js#L121).

The other problem was being unable to get results in a date range. There's no way to get all results from 03-06-2011 to 08-01-2012, for example. The closest I can get is asking for each year (i.e. time.year:2011|time.year:2012), but there's no way to do something like the http://square.github.io/crossfilter/ example.

I remember having some performance issues as well, but I'm not sure.

Apart from these problems, the code in the branch is working.

rufuspollock commented 10 years ago

@tryggvib @vitorbaptista could we get this moving again? Also what changes would we need in the API to filter by time?

trickvi commented 10 years ago

This (bar charts) is now possible in the new (and first) release of openspendingjs. Use drilldown 'year' to get time series.

Just include the javascript in the releases folder and do this:

<div class="barchart" data-dataset="ukgov-25k-cra"

data-drilldowns="year,cofog1,cofog2,cofog3">

On 2013 12 18 15:50, "Rufus Pollock" notifications@github.com wrote:

@tryggvib https://github.com/tryggvib @vitorbaptistahttps://github.com/vitorbaptistacould we get this moving again? Also what changes would we need in the API to filter by time?

— Reply to this email directly or view it on GitHubhttps://github.com/openspending/openspendingjs/issues/55#issuecomment-30852370 .

rufuspollock commented 10 years ago

@vitorbaptista what would it take to get your branch merged in? Would you need a review from someone?

trickvi commented 10 years ago

@rgrp Do you want to merge it into master?

rufuspollock commented 10 years ago

@tryggvib @vitorbaptista not without understanding where we stand ...