7 Days of Source Day #4 – BC Budget Visualization Tool

BC Budget Visualization Tool

Project: BC Budget Visualization Tool
Date: September, 2009
Language: Processing
Key Concepts: Data visualization, data organization, sticking it to the man

Overview:

More and more data is being released to the public every day. Big initiatives like the US data.gov and the UK’s upcoming data.hmg.gov.uk are resulting in a mountain of interesting data sets. These transparency initiatives are a step in the right direction, but we are quickly going to find ourself with a surfeit of data, and a very limited number of people with the skill set to do something with it.

One solution to this is to standardize the data so that generic tools can be built to dig into the data sets. This is a great idea – but it will take a lot of work, along with something that governments are not typically too good at: consensus.

Until that happens, tools like Processing offer another solution – make small, custom tools for individual data sets which can be built quickly and can be used specifically to work with the characteristics of a specific data set. Because Processing is fairly simple, journalists, researchers and activists can all be empowered to investigate data themselves, without having to rely on expensive or difficult to acquire resources.

This sketch is an example of how this might work. I wanted to investigate the recently announced staggering Arts & Culture cuts in my local government‘s budget, and built a simple tool to do that. All told, it took about 5 hours to gather the data, produce this tool and get the results out on the web – certainly a turnaround time that would be useful for media and for activists looking to be quick with their responses.

Getting Started:

Move the sketches into your Processing sketch folder. Open Processing and open the BCBudget sketch from the File > Sketchbook menu. You’ll find detailed instructions in the header of the main tab (the BCBudget.pde file).

Thanks:

Again, this project uses Karsten Schmidt’s amazing and incredibly useful toxiclibs.

Download: BCBudget.zip (12k)


CC-GNU GPL

This software is licensed under theĀ CC-GNU GPL version 2.0 or later.

17 thoughts on “7 Days of Source Day #4 – BC Budget Visualization Tool”

  1. Thanks for sharing this code.

    When I try to run the sketch, I get an error: NumberFormatException: empty String. This happens for the string cs in the function process() in CBA.pde.

    Any ideas?

    1. Hi guys,

      Can you put this println call into the process function on the CBA tab and tell me what happens (you should get a whole pile of numbers output):

      void process(String s) {
      String[] sa = split(s, \” \”);
      amounts = new float[sa.length];
      for (int i = 0; i < sa.length; i++) {
      String[] ca = sa[i].split(\”,\”);
      String cs = join(ca, \”\”);
      println(cs); //**** ADD THIS LINE
      float d = Float.parseFloat(cs);
      amounts[i] = d;
      if (d > maxx) maxx = d;
      };
      };

  2. I'm still getting the error: "NumberFormatException: empty String." I commented out the entire function and the sketched seemed to load and run, but the only thing it displayed was a single zero in the middle of the screen.

  3. Hi Jer,

    I am trying to run your sketch but I get the error "The package toxi.util does not exist". Any ideas on how this can be resolved?

    I have installed the toxiclabscore library into my "libraries" folder but still no go… I suspect the issue is with finding "import toxi.util.datatypes.*;" but am not sure as I am still learning the Processing environment.

    Any help would be much appreciated.

    -Akash

    1. Hi Akash,

      You can remove the import line:

      //FIRST, IMPORT SOME LIBRARIES —————————-
      import processing.video.*;

      //import toxi.util.datatypes.*; << remove or comment out this line
      import toxi.math.noise.*;
      import toxi.math.waves.*;
      import toxi.geom.*;
      import toxi.math.*;
      import toxi.math.conversion.*;
      import toxi.geom.util.*;

      It's actually not used in the sketch. I'll post up a revised version later today.

      Cheers,

      -Jer

      1. Thank you for the quick response Jer!

        I will try it out later today.

        Again, thank you for sharing your source code. It definitely helps the learning process.

        -Akash

  4. hi,

    I get the error message
    "package "processing.video" does not exist. You might missing a library.

    which processing.video libary are using there?

    1. Hi,

      This is the standard Processing video library – you should be able to import it from the menu bar: Sketch > Import Library … > Video

      Cheers,

      -Jer

  5. Hi Jer. Questions for the budget.txt source data:

    what do the 4 numerical amounts represent: *41,608 53,984 28,254 26,596* & how are they represented in the visualization?

    and

    are the titles: *Aboriginal Relations and Reconciliation* differentiated from the line items: *Negotiations*

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>