Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding custom data to GapMinder

Does anyone have any experience adding their own data to GapMinder, the really cool software that Hans Rosling uses in his TED talks? I have an array od objects in JSON that would be easy to show in moving bubbles. This would be really cool.

I can see that my Ubuntu box has what looks like data in /opt/Gapminder Desktop/share/assets/graphs/world, but I would need to figure out:

  1. How to add a measure to a graph
  2. How to add a data series
  3. How to set the time range of the data
  4. Identify the measures to follow at each time step

and so on.

like image 755
hughdbrown Avatar asked Feb 23 '23 04:02

hughdbrown


2 Answers

Just for the record: if you want to use Gapminder with your own dataset, you have to convert your data in a format suitable to Gapminder. More specifically, looking in the assets/graphs/world, you will have to:

  • Edit the file overview.xml, which contains the tree structure of all the indicators (just copy/paste an entry and specify your own data);
  • Convert your data copying the structure of the xml files in that directory (this is the tricky part): you can specify some metadata in the preamble, and then specify your own data series, with something like:
    • <t1 m="i20,50.0,99.0,1992" d="90.0, ... ,50.0, ..."/> where i20 is the country id, which is followed by the minima and maxima of the series, and the year it refers to.

In my humble opinion, Gapminder is a great app but it definitely needs more work on integration with other datasets. Way better to use Google Motion Chart as you did, or MooGraph (site and doc), which is unfortunately not as great as Gapminder.

like image 104
StefanoP Avatar answered Mar 14 '23 22:03

StefanoP


@Stefano
the information you provided is very valuable. Is somewhere available a detailed specification of the XML files containing the data?

Anyway, just to enrich your response, I also found that:

overview.xml file

  1. The link between Nations and their IDs is in this file
  2. The structure of the menus for the selection of the indicators is also in the same file (at the bottom) under the section <indicatorCategorization>

The structure of the datafile XML

  1. For each line the year represents the first year of the serie, and then the values follow one per year, comma separated.

Grazie,
Max

like image 24
cdm Avatar answered Mar 14 '23 20:03

cdm