Skip to content

Commit

Permalink
Added JSON spec for plastic production
Browse files Browse the repository at this point in the history
  • Loading branch information
gchure committed Sep 23, 2020
1 parent 05b9a97 commit c37953e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Binary file modified anthro/__pycache__/io.cpython-37.pyc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Global Plastic Resin Production

## Description
This dataset reports the
This dataset reports the plastic resin production from 1950 through 2015.

## Key Numbers
Global production of plastic in 2015 ≈ 381 Mt
Expand All @@ -15,4 +15,4 @@ Fill out the table below for each data set.
* **Bias**: This data comes from a 2017 scientific publication and the authors have declared no competing interest

## Notes
These data come from Table S2 of the manuscript and reflect a composite of other data sets referenced by the authors.
These data come from Table S1 of the manuscript and reflect a composite of other data sets referenced by the authors.
16 changes: 16 additions & 0 deletions data/anthropocentric/Geyer2017_plastic_production/viz/generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#%%
import numpy as np
import pandas as pd
import altair as alt
import anthro.io

# Load the produciton data.
data = pd.read_csv('../processed/Geyer2017_plastic_production.csv')
data['year'] = pd.to_datetime(data['year'], format='%Y')

chart = alt.Chart(data).encode(
x=alt.X(field='year', timeUnit='year', title='year'),
y=alt.Y(field='resin_production_Mt', type='quantitative',
title='')
)
# %%
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, "layer": [{"mark": {"type": "line", "color": "dodgerblue"}, "encoding": {"tooltip": [{"type": "temporal", "field": "year", "timeUnit": "year", "title": "year"}, {"type": "quantitative", "field": "resin_production_Mt", "title": "produced mass [Mt]"}], "x": {"type": "temporal", "field": "year", "timeUnit": "year", "title": "year"}, "y": {"type": "quantitative", "field": "resin_production_Mt", "title": "plastic resin produced [Mt]"}}, "height": 300, "width": "container"}, {"mark": {"type": "point", "color": "dodgerblue", "filled": true}, "encoding": {"tooltip": [{"type": "temporal", "field": "year", "timeUnit": "year", "title": "year"}, {"type": "quantitative", "field": "resin_production_Mt", "title": "produced mass [Mt]"}], "x": {"type": "temporal", "field": "year", "timeUnit": "year", "title": "year"}, "y": {"type": "quantitative", "field": "resin_production_Mt", "title": "plastic resin produced [Mt]"}}, "height": 300, "width": "container"}], "data": {"name": "data-da1cde8e61602201c28c4c252d8ec561"}, "$schema": "https://vega.github.io/schema/vega-lite/v4.8.1.json", "datasets": {"data-da1cde8e61602201c28c4c252d8ec561": [{"year": "1950-01-01T00:00:00", "resin_production_Mt": 2}, {"year": "1951-01-01T00:00:00", "resin_production_Mt": 2}, {"year": "1952-01-01T00:00:00", "resin_production_Mt": 2}, {"year": "1953-01-01T00:00:00", "resin_production_Mt": 3}, {"year": "1954-01-01T00:00:00", "resin_production_Mt": 3}, {"year": "1955-01-01T00:00:00", "resin_production_Mt": 4}, {"year": "1956-01-01T00:00:00", "resin_production_Mt": 5}, {"year": "1957-01-01T00:00:00", "resin_production_Mt": 5}, {"year": "1958-01-01T00:00:00", "resin_production_Mt": 6}, {"year": "1959-01-01T00:00:00", "resin_production_Mt": 7}, {"year": "1960-01-01T00:00:00", "resin_production_Mt": 8}, {"year": "1961-01-01T00:00:00", "resin_production_Mt": 9}, {"year": "1962-01-01T00:00:00", "resin_production_Mt": 11}, {"year": "1963-01-01T00:00:00", "resin_production_Mt": 13}, {"year": "1964-01-01T00:00:00", "resin_production_Mt": 15}, {"year": "1965-01-01T00:00:00", "resin_production_Mt": 17}, {"year": "1966-01-01T00:00:00", "resin_production_Mt": 20}, {"year": "1967-01-01T00:00:00", "resin_production_Mt": 23}, {"year": "1968-01-01T00:00:00", "resin_production_Mt": 27}, {"year": "1969-01-01T00:00:00", "resin_production_Mt": 32}, {"year": "1970-01-01T00:00:00", "resin_production_Mt": 35}, {"year": "1971-01-01T00:00:00", "resin_production_Mt": 38}, {"year": "1972-01-01T00:00:00", "resin_production_Mt": 44}, {"year": "1973-01-01T00:00:00", "resin_production_Mt": 51}, {"year": "1974-01-01T00:00:00", "resin_production_Mt": 52}, {"year": "1975-01-01T00:00:00", "resin_production_Mt": 46}, {"year": "1976-01-01T00:00:00", "resin_production_Mt": 54}, {"year": "1977-01-01T00:00:00", "resin_production_Mt": 59}, {"year": "1978-01-01T00:00:00", "resin_production_Mt": 64}, {"year": "1979-01-01T00:00:00", "resin_production_Mt": 71}, {"year": "1980-01-01T00:00:00", "resin_production_Mt": 70}, {"year": "1981-01-01T00:00:00", "resin_production_Mt": 72}, {"year": "1982-01-01T00:00:00", "resin_production_Mt": 73}, {"year": "1983-01-01T00:00:00", "resin_production_Mt": 80}, {"year": "1984-01-01T00:00:00", "resin_production_Mt": 86}, {"year": "1985-01-01T00:00:00", "resin_production_Mt": 90}, {"year": "1986-01-01T00:00:00", "resin_production_Mt": 96}, {"year": "1987-01-01T00:00:00", "resin_production_Mt": 104}, {"year": "1988-01-01T00:00:00", "resin_production_Mt": 110}, {"year": "1989-01-01T00:00:00", "resin_production_Mt": 114}, {"year": "1990-01-01T00:00:00", "resin_production_Mt": 120}, {"year": "1991-01-01T00:00:00", "resin_production_Mt": 124}, {"year": "1992-01-01T00:00:00", "resin_production_Mt": 132}, {"year": "1993-01-01T00:00:00", "resin_production_Mt": 137}, {"year": "1994-01-01T00:00:00", "resin_production_Mt": 151}, {"year": "1995-01-01T00:00:00", "resin_production_Mt": 156}, {"year": "1996-01-01T00:00:00", "resin_production_Mt": 168}, {"year": "1997-01-01T00:00:00", "resin_production_Mt": 180}, {"year": "1998-01-01T00:00:00", "resin_production_Mt": 188}, {"year": "1999-01-01T00:00:00", "resin_production_Mt": 202}, {"year": "2000-01-01T00:00:00", "resin_production_Mt": 213}, {"year": "2001-01-01T00:00:00", "resin_production_Mt": 218}, {"year": "2002-01-01T00:00:00", "resin_production_Mt": 231}, {"year": "2003-01-01T00:00:00", "resin_production_Mt": 241}, {"year": "2004-01-01T00:00:00", "resin_production_Mt": 256}, {"year": "2005-01-01T00:00:00", "resin_production_Mt": 263}, {"year": "2006-01-01T00:00:00", "resin_production_Mt": 280}, {"year": "2007-01-01T00:00:00", "resin_production_Mt": 295}, {"year": "2008-01-01T00:00:00", "resin_production_Mt": 281}, {"year": "2009-01-01T00:00:00", "resin_production_Mt": 288}, {"year": "2010-01-01T00:00:00", "resin_production_Mt": 313}, {"year": "2011-01-01T00:00:00", "resin_production_Mt": 325}, {"year": "2012-01-01T00:00:00", "resin_production_Mt": 338}, {"year": "2013-01-01T00:00:00", "resin_production_Mt": 352}, {"year": "2014-01-01T00:00:00", "resin_production_Mt": 367}, {"year": "2015-01-01T00:00:00", "resin_production_Mt": 381}]}}

0 comments on commit c37953e

Please sign in to comment.