This is the project we use internally at the University of Oxford to create embeddable visualizations for Our World in Data. Note that it is not yet a mature OSS project and may be difficult to apply elsewhere as a full package. That said, you are very welcome to read and reuse any of our code!
An example of what this can make (click for interactive):
The owid-grapher visualization frontend code can run isomorphically under node to render data directly to an SVG string, which is how the above image works!
The grapher is a Python + JavaScript hybrid project, using Django and webpack. You will need: MySQL, Python 3.6+, Node 9.3+ and Yarn.
Running pip install -r requirements.txt
and yarn install
in the repo root will grab the remaining dependencies.
An initial test database can be imported from grapher_admin/fixtures/owid_data.sql
. For example, if your database is called grapher
:
mysql -u root -p -D grapher < grapher_admin/fixtures/owid_data.sql
Now copy .env.example
to .env
and fill in your database details in that file.
Run yarn dev
and head to localhost:8000
. If everything is going to plan, you should see a login screen! The default user account is "[email protected]" with a password of "admin".
owid-grapher is heavily based around reactive programming using the libraries Preact and Mobx, allowing it to do pretty heavy client-side data processing efficiently. New code should be written using PEP 484 type hints and TypeScript. Visual Studio Code is recommended for the autocompletion and other awesome editor analysis features enabled by static typing.
owid-grapher was originally created by Zdenek Hynek for Our World in Data. It is currently being developed by Jaiden Mispy and Aibek Aldabergenov with design assistance from Max Roser and the OWID research team.