[wdmmg-dev] Uganda visualisation - changing the years

Mark Brough mark.brough at publishwhatyoufund.org
Wed Aug 3 14:58:26 UTC 2011


Hi Gregor, all



We think the visualisation and data now looks great and is ready to share
with the Ugandan MoF, so hopefully we will be able to send it off today.



You can see the visualisation here:

http://www.publishwhatyoufund.org/testarea/uganda.htm



I’ve done something pretty hacky and janky right now to enable you to switch
between the years – by adding an additional namespace type thing (^) onto
the hash. This requires the page to be reloaded in a new window. I didn’t
want to delve into bubbletree.js (which I’d have thought is the place this
should really be dealt with).



So, I just added this before `new OpenSpending.Aggregator` is called:







                var year;

                function setYear(hash) {

                                if (hash) {

                                                year = hash.substr(3,4);


$('#uganda-'+year).addClass('selected');

                                } else {

                                                year = '2005';


$('#uganda-'+year).addClass('selected');

                                }

                                if (year == 'aid-') {

                                                year = '2005';


$('#uganda-'+year).addClass('selected');

                                }

                };

                $.history.init(setYear);







The cut is then set as ‘year:’+year



I also altered aggregation.js to allow you to define the order in the API
call, although I’m not sure that’s actually working.



I know there’s a much better way of doing this, but thought it might be good
to think about in the context of combining the visualisation and the data.



Thanks,

Mark





--
Mark Brough
Research Officer, Publish What You Fund
*New Address: *Suite 1A, 2nd Floor, Royal London House, 22-25 Finsbury
Square, London. EC2A 1DX, UK

*New Tel*: +44 20 7920 6401

Mobile: +44 7817 600 835
Skype: mark-brough
Mark.Brough at PublishWhatYouFund.org


www.PublishWhatYouFund.org <http://www.publishwhatyoufund.org/>
twitter at aidtransparency
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20110803/2e0d0e03/attachment.html>


More information about the openspending-dev mailing list