• Stars
    star
    1,208
  • Rank 38,795 (Top 0.8 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A platform for creating interactive data visualizations

owid-grapher

Actions Status Test coverage Storybook

The monorepo we use at Our World in Data to create and publish embeddable, interactive visualizations like this one:

A Grapher chart showing world-wide life expectancy at birth. Click for interactive.

โœ‹ Disclaimer

This repo is currently not well-designed for reuse as a visualization library, nor for reproducing the full production environment we have at Our World in Data, as our tools are tightly coupled with our database structure.

We're gradually making steps towards making our work more reusable, however we still prioritize needs specific to our project that can be at odds with making our tools reusable.

You are still very welcome to reuse and adapt any of our code for your own purposes, and we welcome contributions!

๐ŸŽ ย Quick start

To quickly get a version of the site running for developing Grapher features, we recommend following the local development setup guide.

Additional setup options are also available for other use cases.

๐Ÿ—‚ Overview

Multiple projects are maintained in this repo:

Grapher

A client-side interactive data visualization library used by almost every chart on Our World in Data.

All grapher data is stored in a MySQL database that contains both JSON configuration objects for individual charts as well as the data values that they ingest.

The Grapher project is built with Lerna and tsup.

Explorer

A Grapher-based tool that creates more complex data visualization user interfaces.

Each explorer can be configured via a panel in the admin client. Their config files are stored in a separate repository.

Grapher Admin

  • A client-side project that provides a user interface for configuring graphers, explorers, and managing and uploading data.

  • A server-side project that manages the MySQL database used by graphers.

WordPress

The CMS we use to manage articles published on Our World in Data. It's a relatively stock setup, with a custom plugin to provide additional blocks for the Gutenberg editor.

Our Wordpress content and configuration is stored in a MySQL database, which currently isn't shared publicly.

We are currently in the process of migrating off of WordPress to a publishing flow based on ArchieML with Google Docs. See the Site README for more information.

Baker

A PM2 project that builds a static copy of the Our World in Data website by merging the content authored in Wordpress with the grapher charts created in Grapher Admin.

Site

The React code for rendering our content in pages, used by the Grapher Admin and Baker.

As of March 2023, code exists for rendering both WordPress posts and Google Docs as we work on the transition away from WordPress.

Tooling

Much of our code is based around reactive programming using React and Mobx.

All non-WordPress code is written in TypeScript.

Visual Studio Code is recommended for autocompletion and other awesome editor analysis features enabled by static typing.

Why did we start this project?

The following is an excerpt explaining the origin of this repo and what the alternatives tried were (source: Max Roser's Reddit AMA on Oct 17, 2017)

We built the Grapher because there is no similar external tool available. Datawrapper, Tableau, Plotly, various libraries based on d3 are out there but nothing is similar to what the Grapher does for our project.

Before we developed this tool, we built interactive web visualizations by hand through a difficult process of preparing individual spreadsheets of data and then writing custom HTML and JavaScript code to process the contents for each individual visualization. That was pretty painful and it took me hours sometimes to built a chart.

The owid-grapher solves this problem by using a single visualization codebase and crucially a single database into which all of our data is placed. Once the data has been imported, the process of creating a visualization is reduced to simply choosing what kind of visualization is needed and then selecting the relevant variables in the Grapher user interface. The result may then be customized, and is published to the web with the press of a button.

Using our own system has very important advantages:

  • Integration with our global development database: Our database of global development metrics is integrated into our visualization tool so that when we add and update empirical data the visualizations are all updated. (In contrast to this, a pre-existing tool would make the exploration of a database impossible and would require the preparation of each dataset separately for each visualisation.)

  • Flexibility: We can use automation to change our entire system all at once. For example, if we decide we want to use a different source referencing style, we could easily update this across hundreds of charts. This makes it possible to scale our publication and to sustainably improve our work without starting from scratch at each round.

  • Risk mitigation: We hope(!) that Our World in Data is a long-term project and we want the visualizations we produce to continue to be useful and available years from now. An external web service may be shut down or change for reasons we cannot control. We have had this experience in the past and learned our lesson from it.

  • Keeping everything up-to-date: Because we want to be a useful resource for some time we make sure that we have a technology in place that allows us to keep all of our work up-to-date without starting from scratch each time. We have our global development database directly integrated in the Grapher and as soon as new data becomes available (for example from a UN agency) we can run a script that pulls in that data and updates all the visualizations that present that data.


Cross-browser testing provided by BrowserStack

Client-side bug tracking provided by

More Repositories

1

covid-19-data

Data on COVID-19 (coronavirus) cases, deaths, hospitalizations, tests โ€ข All countries โ€ข Updated daily by Our World in Data
Python
5,659
star
2

owid-datasets

OWID Dataset Collection
655
star
3

co2-data

Data on CO2 and greenhouse gas emissions by Our World in Data
Python
639
star
4

energy-data

Data on energy by Our World in Data
Python
285
star
5

etl

A compute graph for loading and transforming OWID's data
Python
79
star
6

notebooks

Our World In Data jupyter notebooks
HTML
74
star
7

owid-catalog-py

A Pythonic API for working with OWID's data catalog.
Python
29
star
8

sdg-tracker.org

Sustainable Development Goals tracker website
TypeScript
25
star
9

poverty-data

Data on poverty by Our World in Data
Python
17
star
10

importers

Bulk import scripts for ingesting large external datasets into OWID's master dataset.
Python
16
star
11

data-api

API for accessing data from our data catalog.
Jupyter Notebook
15
star
12

owid-importer

A collection of Python bulk import scripts for various data sources
Python
15
star
13

slides

reveal.js template and slides for Our World in Data
HTML
10
star
14

owid-datasette

An experiment of publishing articles and variable metadata as a datasette instance
Python
10
star
15

monkeypox

Analyzing the data produced by the World Health Organization on the 2022 mpox outbreak
Python
10
star
16

owid-grapher-py

Python
10
star
17

owid-content

Python
9
star
18

walden

A prototype catalog of data sources that OWID's datasets are built from.
Python
8
star
19

owid-wordpress

ourworldindata.org headless Wordpress (with development environment)
PHP
7
star
20

owid-datautils-py

Data util library by the Data Team at @owid
Python
6
star
21

africaindata.org

Slides about African development on custom domain
CSS
5
star
22

owid-grapher-svgs

4
star
23

cartograms

JavaScript
4
star
24

.github

4
star
25

owid.github.io

HTML
4
star
26

owid-wordpress-admin

Our World in Data wordpress admin plugin
JavaScript
3
star
27

owid-jupyter-demo

Jupyter Notebook
3
star
28

global-change-data-lab.org

Homepage for the Global Change Data Lab
HTML
2
star
29

orae-major-conflicts

OCR of historical conflicts report
JavaScript
2
star
30

actions

2
star
31

owid-theme

Wordpress theme for Our World in Data
TypeScript
2
star
32

owid-repack-py

Repack Pandas data frames into more compact types
Python
1
star
33

importer-bp-statistical-review

Python
1
star
34

owid-feedback

OWID feedback form, powered by Netlify Functions & Mailgun
TypeScript
1
star