├── .gitignore ├── LICENSE ├── Procfile ├── Procfile.windows ├── README.md ├── app.py ├── data ├── IHME_GBD_2017_HEALTH_SDG_1990_2030_OVERVIEW_Y2018M11D08.PDF ├── IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_CODEBOOK_Y2018M11D08.CSV ├── IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_Y2018M11D08.CSV └── location_metadata.csv ├── notebooks └── 2019_02_17_plotly_graph_development.ipynb ├── readme_images └── heroku_app.gif ├── requirements.txt ├── runtime.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *.cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | 59 | # DotEnv configuration 60 | .env 61 | 62 | # API credentials 63 | /src/data/credentials.yaml 64 | 65 | # Some notebooks shouldn't be tracked 66 | /notebooks/2019_01_24_DHS_API_practice.ipynb 67 | /notebooks/2019_01_24_GBD_API_testing.ipynb 68 | 69 | # Database 70 | *.db 71 | *.rdb 72 | 73 | # Pycharm 74 | .idea 75 | 76 | # VS Code 77 | .vscode/ 78 | 79 | # Spyder 80 | .spyproject/ 81 | 82 | # Jupyter NB Checkpoints 83 | .ipynb_checkpoints/ 84 | 85 | # exclude data from source control by default 86 | /data/raw 87 | 88 | # Mac OS-specific storage files 89 | .DS_Store 90 | 91 | # vim 92 | *.swp 93 | *.swo 94 | 95 | # Mypy cache 96 | .mypy_cache/ 97 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Zane Rankin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn app:server --log-file=- 2 | -------------------------------------------------------------------------------- /Procfile.windows: -------------------------------------------------------------------------------- 1 | web: python app.py runserver 0.0.0.0:5000 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A Gentle Introduction to Developing and Deploying Dash via Heroku 2 | This Git repo accompanies the tutorial article on Medium 3 | 4 | The Heroku app is hosted at https://dash-dev-tutorial.herokuapp.com/ 5 | 6 | ![](readme_images/heroku_app.gif) 7 | 8 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import dash 2 | import dash_core_components as dcc 3 | import dash_html_components as html 4 | from dash.dependencies import Input, Output 5 | import pandas as pd 6 | import plotly.graph_objs as go 7 | 8 | external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] 9 | 10 | app = dash.Dash(__name__, external_stylesheets=external_stylesheets) 11 | 12 | server = app.server 13 | 14 | ################################################################################################################ 15 | # LOAD AND PROCESS DATA 16 | df0 = pd.read_csv('./data/IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_Y2018M11D08.CSV') 17 | loc_meta = pd.read_csv('./data/location_metadata.csv') 18 | 19 | # Indicator Value by country in wide format 20 | df = df0.pivot(index='location_name', columns='indicator_short', values='scaled_value') 21 | df = pd.merge(loc_meta, df.reset_index()) 22 | indicators = df0.indicator_short.unique().tolist() 23 | indicator_key = df0.drop_duplicates('indicator_short').set_index('indicator_short')[ 24 | 'ihme_indicator_description'].to_dict() 25 | 26 | ################################################################################################################ 27 | 28 | 29 | top_markdown_text = ''' 30 | ### Dash Tutorial - Sustainable Development Goals 31 | #### Zane Rankin, 2/17/2019 32 | The [Institute for Health Metrics and Evaluation](http://www.healthdata.org/) publishes estimates for 41 health-related SDG indicators for 33 | 195 countries and territories. 34 | I downloaded the [data](http://ghdx.healthdata.org/record/global-burden-disease-study-2017-gbd-2017-health-related-sustainable-development-goals-sdg) 35 | for a tutorial on Medium and Github 36 | **Indicators are scaled 0-100, with 0 being worst observed (e.g. highest mortality) and 100 being best.** 37 | ''' 38 | 39 | app.layout = html.Div([ 40 | 41 | # HEADER 42 | dcc.Markdown(children=top_markdown_text), 43 | 44 | # LEFT - CHOROPLETH MAP 45 | html.Div([ 46 | dcc.Dropdown( 47 | id='x-varname', 48 | options=[{'label': i, 'value': i} for i in indicators], 49 | value='SDG Index' 50 | ), 51 | dcc.Markdown(id='x-description'), 52 | dcc.Graph(id='county-choropleth'), 53 | dcc.Markdown('*Hover over map to select country for plots*'), 54 | 55 | ], style={'float': 'left', 'width': '39%'}), 56 | 57 | # RIGHT - SCATTERPLOT 58 | html.Div([ 59 | dcc.Dropdown( 60 | id='y-varname', 61 | options=[{'label': i, 'value': i} for i in indicators], 62 | value='Under-5 Mort' 63 | ), 64 | dcc.Markdown(id='y-description'), 65 | dcc.Graph(id='scatterplot'), 66 | ], style={'float': 'right', 'width': '59%'}), 67 | 68 | ]) 69 | 70 | 71 | @app.callback( 72 | Output('x-description', 'children'), 73 | [Input('x-varname', 'value')]) 74 | def x_description(i): 75 | return f'{indicator_key[i]}' 76 | 77 | 78 | @app.callback( 79 | Output('y-description', 'children'), 80 | [Input('y-varname', 'value')]) 81 | def y_description(i): 82 | return f'{indicator_key[i]}' 83 | 84 | 85 | @app.callback( 86 | Output('county-choropleth', 'figure'), 87 | [Input('x-varname', 'value')]) 88 | def update_map(x_varname): 89 | return dict( 90 | data=[dict( 91 | locations=df['ihme_loc_id'], 92 | z=df[x_varname], 93 | text=df['location_name'], 94 | autocolorscale=False, 95 | reversescale=True, 96 | type='choropleth', 97 | )], 98 | layout=dict( 99 | title=x_varname, 100 | height=400, 101 | margin={'l': 0, 'b': 0, 't': 40, 'r': 0}, 102 | geo=dict(showframe=False, 103 | projection={'type': 'Mercator'})) 104 | ) 105 | 106 | 107 | @app.callback( 108 | Output('scatterplot', 'figure'), 109 | [Input('x-varname', 'value'), 110 | Input('y-varname', 'value'), 111 | Input('county-choropleth', 'hoverData'),]) 112 | def update_graph(x_varname, y_varname, hoverData): 113 | if hoverData is None: # Initialize before any hovering 114 | location_name = 'Nigeria' 115 | else: 116 | location_name = hoverData['points'][0]['text'] 117 | 118 | # Make size of marker respond to map hover 119 | df['size'] = 12 120 | df.loc[df.location_name == location_name, 'size'] = 30 121 | 122 | return { 123 | 'data': [ 124 | go.Scatter( 125 | x=df[df['super_region_name'] == i][x_varname], 126 | y=df[df['super_region_name'] == i][y_varname], 127 | text=df[df['super_region_name'] == i]['location_name'], 128 | mode='markers', 129 | opacity=0.7, 130 | marker={ 131 | 'size': df[df['super_region_name'] == i]['size'], 132 | 'line': {'width': 0.5, 'color': 'white'} 133 | }, 134 | name=i 135 | ) for i in df.super_region_name.unique() 136 | ], 137 | 'layout': go.Layout( 138 | height=400, 139 | xaxis={'title': x_varname}, 140 | yaxis={'title': y_varname}, 141 | margin={'l': 40, 'b': 40, 't': 10, 'r': 10}, 142 | # legend={'x': 0, 'y': 1}, 143 | hovermode='closest' 144 | ) 145 | } 146 | 147 | if __name__ == '__main__': 148 | app.run_server(debug=True) 149 | -------------------------------------------------------------------------------- /data/IHME_GBD_2017_HEALTH_SDG_1990_2030_OVERVIEW_Y2018M11D08.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwrankin/dash_tutorial/932925bd4ade4b11ecd65aa9e8ea9d1c92ebff3c/data/IHME_GBD_2017_HEALTH_SDG_1990_2030_OVERVIEW_Y2018M11D08.PDF -------------------------------------------------------------------------------- /data/IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_CODEBOOK_Y2018M11D08.CSV: -------------------------------------------------------------------------------- 1 | File: ,IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_Y2018M11D08.CSV,,,,,,,,,,,,, 2 | Variable:,location_id,location_name,year_id,estimate_type,indicator_id,indicator_short,ihme_indicator_description,indicator_outline,indicator_unit,target_description,goal_description,scaled_value,scaled_lower,scaled_upper 3 | Label:,Location ID,Country,year_id,Estimate Type,Indicator ID,Indicator Short Name,IHME Indicator Description,Position in the SDG Indicator Outline,Indicator Unit,Target Description,Goal Description,Scaled value,Scaled - 95% Uncertainty Interval - Lower Bound,Scaled - 95% Uncertainty Interval - Upper Bound 4 | Value coding:,6,China,1990,past,1000,HIV Incid,"Indicator 3.3.1: Age-standardised rate of new HIV infections (per 1,000 population)",3.3.1,Scaled/Normalized value ranging from 0-100,"By 2030, end the epidemics of AIDS, tuberculosis, malaria and neglected tropical diseases and combat hepatitis, water-borne diseases and other communicable diseases.",Ensure healthy lives and promote well-being for all at all ages.,,, 5 | ,7,North Korea,1991,projection,1001,TB Incid,"Indicator 3.3.2: Age-standardised rate of tuberculosis cases (per 100,000 population)",3.3.2,,"By 2030, build the resilience of the poor and those in vulnerable situations and reduce their exposure and vulnerability to climate-related extreme events and other economic, social and environmental shocks and disasters.",End poverty in all its forms everywhere.,,, 6 | ,8,Taiwan,1992,,1002,Malaria Incid,"Indicator 3.3.3: Age-standardised rate of malaria cases (per 1,000 population)",3.3.3,,"By 2030, reduce by one third premature mortality from non-communicable diseases through prevention and treatment and promote mental health and well-being.","Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable, and inclusive institutions at all levels.",,, 7 | ,10,Cambodia,1993,,1003,Hep B Incid,"Indicator 3.3.4: Age-standardised rate of hepatitis B incidence (per 100,000 population)",3.3.4,,"By 2020, halve the number of global deaths and injuries from road traffic accidents.","End hunger, achieve food security and improved nutrition, and promote sustainable agriculture.",,, 8 | ,11,Indonesia,1994,,1004,NTD Prev,Indicator 3.3.5: Age-standardised prevalence of the sum of 18 neglected tropical diseases (NTDs) (%),3.3.5,,"By 2030, substantially reduce the number of deaths and illnesses from hazardous chemicals and air, water and soil pollution and contamination.","Make cities and human settlements inclusive, safe, resilient, and sustainable.",,, 9 | ,12,Laos,1995,,1019,Disaster Mort,"Indicator 1.5.1: Death rate due to exposure to forces of nature (per 100,000 population) ",1.5.1,,Significantly reduce all forms of violence and related death rates everywhere.,Achieve gender equality and empower all women and girls.,,, 10 | ,13,Malaysia,1996,,1020,NCD Mort,"Indicator 3.4.1: Age-standardised death rate due to cardiovascular disease, cancer, diabetes, and chronic respiratory disease in populations aged 30-70 (per 100,000 population)",3.4.1,,"By 2030, end all forms of malnutrition, including achieving, by 2025, the internationally agreed targets on stunting and wasting in children under 5 years of age, and address the nutritional needs of adolescent girls, pregnant and lactating women and older persons.",Ensure availability and sustainable management of water and sanitation for all.,,, 11 | ,14,Maldives,1997,,1025,Suicide Mort,"Indicator 3.4.2: Age-standardised death rate due to self-harm (per 100,000 population)",3.4.2,,"By 2030, reduce the global maternal mortality ratio to less than 70 per 100,000 live births.","Ensure access to affordable, reliable, and sustainable modern energy for all.",,, 12 | ,15,Myanmar,1998,,1026,Road Inj Mort,"Indicator 3.6.1: Age-standardised death rate due to road injuries (per 100,000 population)",3.6.1,,"By 2030, ensure universal access to sexual and reproductive healthcare services, including for family planning, information and education, and the integration of reproductive health into national strategies and programs.",,,, 13 | ,16,Philippines,1999,,1027,Poisoning Mort,"Indicator 3.9.3: Age-standardised death rate due to unintentional poisonings (per 100,000 population)",3.9.3,,"Achieve universal health coverage, including financial risk protection, access to quality essential health-care services and access to safe, effective, quality and affordable essential medicines and vaccines for all.","Promote sustained, inclusive and sustainable economic growth, full and productive employment and decent work for all.",,, 14 | ,17,Sri Lanka,2000,,1030,Homicide,"Indicator 16.1.1: Age-standardised death rate due to interpersonal violence (per 100,000 population)",16.1.1,,"By 2030, reduce the adverse per capita environmental impact of cities, including by paying special attention to air quality and municipal and other waste management.","Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable and inclusive institutions at all levels.",,, 15 | ,18,Thailand,2001,,1031,Conflict Mort,"Indicator 16.1.2: Death rate due to conflict and terrorism (per 100,000 population)",16.1.2,,"By 2030, end preventable deaths of newborns and children under 5 years of age, with all countries aiming to reduce neonatal mortality to at least as low as 12 per 1,000 live births and under-5 mortality to at least as low as 25 per 1,000 live births.",Strengthen the means of implementation and revitalize the global partnership for sustainable development.,,, 16 | ,19,Timor-Leste,2002,,1032,Child Overweight,Indicator 2.2.2b: Prevalence of overweight in children aged 2-4 (%),2.2.2b,,"Strengthen the implementation of the World Health Organization Framework Convention on Tobacco Control in all countries, as appropriate.",,,, 17 | ,20,Vietnam,2003,,1033,Mat Mort Ratio,"Indicator 3.1.1: Maternal mortality ratio (maternal deaths per 100,000 livebirths) in women aged 10-54 years",3.1.1,,"Eliminate all forms of violence against all women and girls in the public and private spheres, including trafficking and sexual and other types of exploitation.",,,, 18 | ,22,Fiji,2004,,1034,Skilled Birth Attend,Indicator 3.1.2: Proportion of births attended by skilled health personnel (%),3.1.2,,"Strengthen the prevention and treatment of substance abuse, including narcotic drug abuse and harmful use of alcohol.",,,, 19 | ,23,Kiribati,2005,,1035,"FP Need Met, Mod",Indicator 3.7.1: Proportion of women of reproductive age (15-49 years) who have their need for family planning satisfied with modern methods (%),3.7.1,,"By 2030, achieve universal and equitable access to safe and affordable drinking water for all.",,,, 20 | ,24,Marshall Islands,2006,,1036,Adol Birth Rate,"Indicator 3.7.2: Number of livebirths per 1,000 women aged 10-19 years old",3.7.2,,"By 2030, achieve access to adequate and equitable sanitation and hygiene for all and end open defecation, paying special attention to the needs of women and girls and those in vulnerable situations.",,,, 21 | ,25,Federated States of Micronesia,2007,,1037,UHC Index,"Indicator 3.8.1: Coverage of essential health services, as defined by the UHC service coverage index of 9 tracer interventions and risk-standardised death rates or mortality-to-incidence ratios from 32 causes amenable to personal healthcare.",3.8.1,,"By 2030, ensure universal access to affordable, reliable and modern energy services.",,,, 22 | ,26,Papua New Guinea,2008,,1039,Mean PM2.5,Indicator 11.6.2: Population-weighted mean levels of fine particulate matter smaller than 2.5 microns in diameter (PM2.5),11.6.2,,"Protect labor rights and promote safe and secure working environments for all workers, including migrant workers, in particular women migrants, and those in precarious employment.",,,, 23 | ,27,Samoa,2009,,1040,Under-5 Mort,"Indicator 3.2.1: Under-5 mortality rate (probability of dying before the age of 5 per 1,000 livebirths)",3.2.1,,"Target 3.b: Support the research and development of vaccines and medicines for the communicable and non-communicable diseases that primarily affect developing countries, provide access to affordable essential medicines and vaccines, in accordance with the Doha Declaration on the TRIPS Agreement and Public Health, which affirms the right of developing countries to use to the full the provisions in the Agreement on Trade-Related Aspects of Intellectual Property Rights regarding flexibilities to protect public health, and, in particular, provide access to medicines for all.",,,, 24 | ,28,Solomon Islands,2010,,1041,Neonatal Mort,"Indicator 3.2.2: Neonatal mortality rate (probability of dying during the first 28 days of life per 1,000 livebirths)",3.2.2,,"End abuse, exploitations, trafficking and all forms of violence against and torture of children.",,,, 25 | ,29,Tonga,2011,,1042,Air Poll Mort,"Indicator 3.9.1: Age-standardised death rate attributable to household air pollution and ambient air pollution (per 100,000 population)",3.9.1,,"Substantially increase health financing and the recruitment, development, training and retention of the health workforce in developing countries, especially in least developed countries and small island developing States.",,,, 26 | ,30,Vanuatu,2012,,1043,WaSH Mort,"Indicator 3.9.2: Age-standardised death rate attributable to unsafe water, sanitation, and hygiene (WaSH) (per 100,000 population)",3.9.2,,"By 2030, build on existing initiatives to develop measurements of progress on sustainable development that complement gross domestic product, and support statistical capacity-building in developing countries.",,,, 27 | ,33,Armenia,2013,,1044,Child Stunting,Indicator 2.2.1: Prevalence of stunting in children under 5 (%),2.2.1,,,,,, 28 | ,34,Azerbaijan,2014,,1045,Child Wasting,Indicator 2.2.2a: Prevalence of wasting in children under 5 (%),2.2.2a,,,,,, 29 | ,35,Georgia,2015,,1046,Smoking Prev,Indicator 3.a.1: Age-standardised prevalence of current smoking in populations aged 10 and older (%),3.a.1,,,,,, 30 | ,36,Kazakhstan,2016,,1047,Int Partner Viol,Indicator 5.2.1: Age-standardised prevalence of ever-partnered women aged 15 years and older who experienced physical or sexual violence by a current or former intimate partner in the last 12 months (%),5.2.1,,,,,, 31 | ,37,Kyrgyzstan,2017,,1048,Alcohol Use,"Indicator 3.5.2: Risk-weighted prevalence of alcohol consumption, as measured by the summary exposure value (SEV) for alcohol use (%)",3.5.2,,,,,, 32 | ,38,Mongolia,2018,,1049,Water,"Indicator 6.1.1: Risk-weighted prevalence of populations using unsafe or unimproved water sources, as measured by the summary exposure value (SEV) for unsafe water (%)",6.1.1,,,,,, 33 | ,39,Tajikistan,2019,,1051,Sanitation,"Indicator 6.2.1a: Risk-weighted prevalence of populations using unsafe or unimproved sanitation, as measured by the summary exposure value (SEV) for unsafe sanitation (%)",6.2.1a,,,,,, 34 | ,40,Turkmenistan,2020,,1052,Hygiene,"Indicator 6.2.1b: Risk-weighted prevalence of populations without access to a handwashing facility, as measured by the summary exposure value (SEV) for unsafe hygiene (%)",6.2.1b,,,,,, 35 | ,41,Uzbekistan,2021,,1053,HH Air Poll,"Indicator 7.1.2: Risk-weighted prevalence of household air pollution, as measured by the summary exposure value (SEV) for household air pollution (%)",7.1.2,,,,,, 36 | ,43,Albania,2022,,1054,SDG Index,SDG Index: Geometric mean of all health-related SDG indicators (scale of 0 to 100),,,,,,, 37 | ,44,Bosnia and Herzegovina,2023,,1056,Occ Burden,"Indicator 8.8.1: Age-standardised all-cause disability-adjusted life year (DALY) rates attributable to occupational risks (per 100,000 population)",8.8.1,,,,,, 38 | ,45,Bulgaria,2024,,1061,Vaccine Cov,Indicator 3.b.1: Coverage of eight vaccines in target populations (%),3.b.1,,,,,, 39 | ,46,Croatia,2025,,1064,Child Sex Abuse,Indicator 16.2.3: Age-standardised prevalence of women and men aged 18-29 years who experienced sexual violence by age 18 (%),16.2.3,,,,,, 40 | ,47,Czech Republic,2026,,1094,Physical Violence,Indicator 16.1.3a: Age-standardised prevalence of physical violence experienced by populations in the past 12 months (%),16.1.3a,,,,,, 41 | ,48,Hungary,2027,,1095,Sexual Violence,Indicator 16.1.3c: Age-standardised prevalence of sexual violence experienced by populations in the past 12 months (%),16.1.3c,,,,,, 42 | ,49,Macedonia,2028,,1096,Health Worker Dens,"Indicator 3.c.1: Physicians, nurses and midwives, and pharmacists per 1,000 population",3.c.1,,,,,, 43 | ,50,Montenegro,2029,,1098,Non-Int Partner Sex Viol,Indicator 5.2.2: Age-standardised prevalence of women aged 15 years and older who experienced physical or sexual violence by non-intimate partner in the last 12 months (%),5.2.2,,,,,, 44 | ,51,Poland,2030,,1101,Cert Death Reg,Indicator 17.19.2c: Percentage of well-certified deaths by a vital registration system among a country's total population (%),17.19.2c,,,,,, 45 | ,52,Romania,,,,,,,,,,,, 46 | ,53,Serbia,,,,,,,,,,,, 47 | ,54,Slovakia,,,,,,,,,,,, 48 | ,55,Slovenia,,,,,,,,,,,, 49 | ,57,Belarus,,,,,,,,,,,, 50 | ,58,Estonia,,,,,,,,,,,, 51 | ,59,Latvia,,,,,,,,,,,, 52 | ,60,Lithuania,,,,,,,,,,,, 53 | ,61,Moldova,,,,,,,,,,,, 54 | ,62,Russian Federation,,,,,,,,,,,, 55 | ,63,Ukraine,,,,,,,,,,,, 56 | ,66,Brunei,,,,,,,,,,,, 57 | ,67,Japan,,,,,,,,,,,, 58 | ,68,South Korea,,,,,,,,,,,, 59 | ,69,Singapore,,,,,,,,,,,, 60 | ,71,Australia,,,,,,,,,,,, 61 | ,72,New Zealand,,,,,,,,,,,, 62 | ,74,Andorra,,,,,,,,,,,, 63 | ,75,Austria,,,,,,,,,,,, 64 | ,76,Belgium,,,,,,,,,,,, 65 | ,77,Cyprus,,,,,,,,,,,, 66 | ,78,Denmark,,,,,,,,,,,, 67 | ,79,Finland,,,,,,,,,,,, 68 | ,80,France,,,,,,,,,,,, 69 | ,81,Germany,,,,,,,,,,,, 70 | ,82,Greece,,,,,,,,,,,, 71 | ,83,Iceland,,,,,,,,,,,, 72 | ,84,Ireland,,,,,,,,,,,, 73 | ,85,Israel,,,,,,,,,,,, 74 | ,86,Italy,,,,,,,,,,,, 75 | ,87,Luxembourg,,,,,,,,,,,, 76 | ,88,Malta,,,,,,,,,,,, 77 | ,89,Netherlands,,,,,,,,,,,, 78 | ,90,Norway,,,,,,,,,,,, 79 | ,91,Portugal,,,,,,,,,,,, 80 | ,92,Spain,,,,,,,,,,,, 81 | ,93,Sweden,,,,,,,,,,,, 82 | ,94,Switzerland,,,,,,,,,,,, 83 | ,95,United Kingdom,,,,,,,,,,,, 84 | ,97,Argentina,,,,,,,,,,,, 85 | ,98,Chile,,,,,,,,,,,, 86 | ,99,Uruguay,,,,,,,,,,,, 87 | ,101,Canada,,,,,,,,,,,, 88 | ,102,United States,,,,,,,,,,,, 89 | ,105,Antigua and Barbuda,,,,,,,,,,,, 90 | ,106,The Bahamas,,,,,,,,,,,, 91 | ,107,Barbados,,,,,,,,,,,, 92 | ,108,Belize,,,,,,,,,,,, 93 | ,109,Cuba,,,,,,,,,,,, 94 | ,110,Dominica,,,,,,,,,,,, 95 | ,111,Dominican Republic,,,,,,,,,,,, 96 | ,112,Grenada,,,,,,,,,,,, 97 | ,113,Guyana,,,,,,,,,,,, 98 | ,114,Haiti,,,,,,,,,,,, 99 | ,115,Jamaica,,,,,,,,,,,, 100 | ,116,Saint Lucia,,,,,,,,,,,, 101 | ,117,Saint Vincent and the Grenadines,,,,,,,,,,,, 102 | ,118,Suriname,,,,,,,,,,,, 103 | ,119,Trinidad and Tobago,,,,,,,,,,,, 104 | ,121,Bolivia,,,,,,,,,,,, 105 | ,122,Ecuador,,,,,,,,,,,, 106 | ,123,Peru,,,,,,,,,,,, 107 | ,125,Colombia,,,,,,,,,,,, 108 | ,126,Costa Rica,,,,,,,,,,,, 109 | ,127,El Salvador,,,,,,,,,,,, 110 | ,128,Guatemala,,,,,,,,,,,, 111 | ,129,Honduras,,,,,,,,,,,, 112 | ,130,Mexico,,,,,,,,,,,, 113 | ,131,Nicaragua,,,,,,,,,,,, 114 | ,132,Panama,,,,,,,,,,,, 115 | ,133,Venezuela,,,,,,,,,,,, 116 | ,135,Brazil,,,,,,,,,,,, 117 | ,136,Paraguay,,,,,,,,,,,, 118 | ,139,Algeria,,,,,,,,,,,, 119 | ,140,Bahrain,,,,,,,,,,,, 120 | ,141,Egypt,,,,,,,,,,,, 121 | ,142,Iran,,,,,,,,,,,, 122 | ,143,Iraq,,,,,,,,,,,, 123 | ,144,Jordan,,,,,,,,,,,, 124 | ,145,Kuwait,,,,,,,,,,,, 125 | ,146,Lebanon,,,,,,,,,,,, 126 | ,147,Libya,,,,,,,,,,,, 127 | ,148,Morocco,,,,,,,,,,,, 128 | ,149,Palestine,,,,,,,,,,,, 129 | ,150,Oman,,,,,,,,,,,, 130 | ,151,Qatar,,,,,,,,,,,, 131 | ,152,Saudi Arabia,,,,,,,,,,,, 132 | ,153,Syria,,,,,,,,,,,, 133 | ,154,Tunisia,,,,,,,,,,,, 134 | ,155,Turkey,,,,,,,,,,,, 135 | ,156,United Arab Emirates,,,,,,,,,,,, 136 | ,157,Yemen,,,,,,,,,,,, 137 | ,160,Afghanistan,,,,,,,,,,,, 138 | ,161,Bangladesh,,,,,,,,,,,, 139 | ,162,Bhutan,,,,,,,,,,,, 140 | ,163,India,,,,,,,,,,,, 141 | ,164,Nepal,,,,,,,,,,,, 142 | ,165,Pakistan,,,,,,,,,,,, 143 | ,168,Angola,,,,,,,,,,,, 144 | ,169,Central African Republic,,,,,,,,,,,, 145 | ,170,Congo,,,,,,,,,,,, 146 | ,171,Democratic Republic of the Congo,,,,,,,,,,,, 147 | ,172,Equatorial Guinea,,,,,,,,,,,, 148 | ,173,Gabon,,,,,,,,,,,, 149 | ,175,Burundi,,,,,,,,,,,, 150 | ,176,Comoros,,,,,,,,,,,, 151 | ,177,Djibouti,,,,,,,,,,,, 152 | ,178,Eritrea,,,,,,,,,,,, 153 | ,179,Ethiopia,,,,,,,,,,,, 154 | ,180,Kenya,,,,,,,,,,,, 155 | ,181,Madagascar,,,,,,,,,,,, 156 | ,182,Malawi,,,,,,,,,,,, 157 | ,183,Mauritius,,,,,,,,,,,, 158 | ,184,Mozambique,,,,,,,,,,,, 159 | ,185,Rwanda,,,,,,,,,,,, 160 | ,186,Seychelles,,,,,,,,,,,, 161 | ,187,Somalia,,,,,,,,,,,, 162 | ,189,Tanzania,,,,,,,,,,,, 163 | ,190,Uganda,,,,,,,,,,,, 164 | ,191,Zambia,,,,,,,,,,,, 165 | ,193,Botswana,,,,,,,,,,,, 166 | ,194,Lesotho,,,,,,,,,,,, 167 | ,195,Namibia,,,,,,,,,,,, 168 | ,196,South Africa,,,,,,,,,,,, 169 | ,197,Swaziland,,,,,,,,,,,, 170 | ,198,Zimbabwe,,,,,,,,,,,, 171 | ,200,Benin,,,,,,,,,,,, 172 | ,201,Burkina Faso,,,,,,,,,,,, 173 | ,202,Cameroon,,,,,,,,,,,, 174 | ,203,Cape Verde,,,,,,,,,,,, 175 | ,204,Chad,,,,,,,,,,,, 176 | ,205,Cote d'Ivoire,,,,,,,,,,,, 177 | ,206,The Gambia,,,,,,,,,,,, 178 | ,207,Ghana,,,,,,,,,,,, 179 | ,208,Guinea,,,,,,,,,,,, 180 | ,209,Guinea-Bissau,,,,,,,,,,,, 181 | ,210,Liberia,,,,,,,,,,,, 182 | ,211,Mali,,,,,,,,,,,, 183 | ,212,Mauritania,,,,,,,,,,,, 184 | ,213,Niger,,,,,,,,,,,, 185 | ,214,Nigeria,,,,,,,,,,,, 186 | ,215,Sao Tome and Principe,,,,,,,,,,,, 187 | ,216,Senegal,,,,,,,,,,,, 188 | ,217,Sierra Leone,,,,,,,,,,,, 189 | ,218,Togo,,,,,,,,,,,, 190 | ,298,American Samoa,,,,,,,,,,,, 191 | ,305,Bermuda,,,,,,,,,,,, 192 | ,349,Greenland,,,,,,,,,,,, 193 | ,351,Guam,,,,,,,,,,,, 194 | ,376,Northern Mariana Islands,,,,,,,,,,,, 195 | ,385,Puerto Rico,,,,,,,,,,,, 196 | ,422,"Virgin Islands, U.S.",,,,,,,,,,,, 197 | ,435,South Sudan,,,,,,,,,,,, 198 | ,522,Sudan,,,,,,,,,,,, 199 | -------------------------------------------------------------------------------- /data/location_metadata.csv: -------------------------------------------------------------------------------- 1 | location_id,ihme_loc_id,location_name,super_region_name,region_name 2 | 33,ARM,Armenia,"Central Europe, Eastern Europe, and Central Asia",Central Asia 3 | 34,AZE,Azerbaijan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 4 | 35,GEO,Georgia,"Central Europe, Eastern Europe, and Central Asia",Central Asia 5 | 36,KAZ,Kazakhstan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 6 | 37,KGZ,Kyrgyzstan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 7 | 38,MNG,Mongolia,"Central Europe, Eastern Europe, and Central Asia",Central Asia 8 | 39,TJK,Tajikistan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 9 | 40,TKM,Turkmenistan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 10 | 41,UZB,Uzbekistan,"Central Europe, Eastern Europe, and Central Asia",Central Asia 11 | 43,ALB,Albania,"Central Europe, Eastern Europe, and Central Asia",Central Europe 12 | 44,BIH,Bosnia and Herzegovina,"Central Europe, Eastern Europe, and Central Asia",Central Europe 13 | 45,BGR,Bulgaria,"Central Europe, Eastern Europe, and Central Asia",Central Europe 14 | 46,HRV,Croatia,"Central Europe, Eastern Europe, and Central Asia",Central Europe 15 | 47,CZE,Czech Republic,"Central Europe, Eastern Europe, and Central Asia",Central Europe 16 | 48,HUN,Hungary,"Central Europe, Eastern Europe, and Central Asia",Central Europe 17 | 49,MKD,Macedonia,"Central Europe, Eastern Europe, and Central Asia",Central Europe 18 | 50,MNE,Montenegro,"Central Europe, Eastern Europe, and Central Asia",Central Europe 19 | 51,POL,Poland,"Central Europe, Eastern Europe, and Central Asia",Central Europe 20 | 52,ROU,Romania,"Central Europe, Eastern Europe, and Central Asia",Central Europe 21 | 53,SRB,Serbia,"Central Europe, Eastern Europe, and Central Asia",Central Europe 22 | 54,SVK,Slovakia,"Central Europe, Eastern Europe, and Central Asia",Central Europe 23 | 55,SVN,Slovenia,"Central Europe, Eastern Europe, and Central Asia",Central Europe 24 | 57,BLR,Belarus,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 25 | 58,EST,Estonia,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 26 | 59,LVA,Latvia,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 27 | 60,LTU,Lithuania,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 28 | 61,MDA,Moldova,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 29 | 62,RUS,Russian Federation,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 30 | 63,UKR,Ukraine,"Central Europe, Eastern Europe, and Central Asia",Eastern Europe 31 | 71,AUS,Australia,High-income,Australasia 32 | 72,NZL,New Zealand,High-income,Australasia 33 | 66,BRN,Brunei,High-income,High-income Asia Pacific 34 | 67,JPN,Japan,High-income,High-income Asia Pacific 35 | 68,KOR,South Korea,High-income,High-income Asia Pacific 36 | 69,SGP,Singapore,High-income,High-income Asia Pacific 37 | 101,CAN,Canada,High-income,High-income North America 38 | 349,GRL,Greenland,High-income,High-income North America 39 | 102,USA,United States,High-income,High-income North America 40 | 97,ARG,Argentina,High-income,Southern Latin America 41 | 98,CHL,Chile,High-income,Southern Latin America 42 | 99,URY,Uruguay,High-income,Southern Latin America 43 | 74,AND,Andorra,High-income,Western Europe 44 | 75,AUT,Austria,High-income,Western Europe 45 | 76,BEL,Belgium,High-income,Western Europe 46 | 77,CYP,Cyprus,High-income,Western Europe 47 | 78,DNK,Denmark,High-income,Western Europe 48 | 79,FIN,Finland,High-income,Western Europe 49 | 80,FRA,France,High-income,Western Europe 50 | 81,DEU,Germany,High-income,Western Europe 51 | 82,GRC,Greece,High-income,Western Europe 52 | 83,ISL,Iceland,High-income,Western Europe 53 | 84,IRL,Ireland,High-income,Western Europe 54 | 85,ISR,Israel,High-income,Western Europe 55 | 86,ITA,Italy,High-income,Western Europe 56 | 87,LUX,Luxembourg,High-income,Western Europe 57 | 88,MLT,Malta,High-income,Western Europe 58 | 89,NLD,Netherlands,High-income,Western Europe 59 | 90,NOR,Norway,High-income,Western Europe 60 | 91,PRT,Portugal,High-income,Western Europe 61 | 367,MCO,Monaco,High-income,Western Europe 62 | 92,ESP,Spain,High-income,Western Europe 63 | 93,SWE,Sweden,High-income,Western Europe 64 | 94,CHE,Switzerland,High-income,Western Europe 65 | 396,SMR,San Marino,High-income,Western Europe 66 | 95,GBR,United Kingdom,High-income,Western Europe 67 | 121,BOL,Bolivia,Latin America and Caribbean,Andean Latin America 68 | 122,ECU,Ecuador,Latin America and Caribbean,Andean Latin America 69 | 123,PER,Peru,Latin America and Caribbean,Andean Latin America 70 | 105,ATG,Antigua and Barbuda,Latin America and Caribbean,Caribbean 71 | 106,BHS,The Bahamas,Latin America and Caribbean,Caribbean 72 | 107,BRB,Barbados,Latin America and Caribbean,Caribbean 73 | 108,BLZ,Belize,Latin America and Caribbean,Caribbean 74 | 305,BMU,Bermuda,Latin America and Caribbean,Caribbean 75 | 109,CUB,Cuba,Latin America and Caribbean,Caribbean 76 | 110,DMA,Dominica,Latin America and Caribbean,Caribbean 77 | 111,DOM,Dominican Republic,Latin America and Caribbean,Caribbean 78 | 112,GRD,Grenada,Latin America and Caribbean,Caribbean 79 | 113,GUY,Guyana,Latin America and Caribbean,Caribbean 80 | 114,HTI,Haiti,Latin America and Caribbean,Caribbean 81 | 115,JAM,Jamaica,Latin America and Caribbean,Caribbean 82 | 385,PRI,Puerto Rico,Latin America and Caribbean,Caribbean 83 | 393,KNA,Saint Kitts and Nevis,Latin America and Caribbean,Caribbean 84 | 116,LCA,Saint Lucia,Latin America and Caribbean,Caribbean 85 | 117,VCT,Saint Vincent and the Grenadines,Latin America and Caribbean,Caribbean 86 | 118,SUR,Suriname,Latin America and Caribbean,Caribbean 87 | 119,TTO,Trinidad and Tobago,Latin America and Caribbean,Caribbean 88 | 422,VIR,"Virgin Islands, U.S.",Latin America and Caribbean,Caribbean 89 | 125,COL,Colombia,Latin America and Caribbean,Central Latin America 90 | 126,CRI,Costa Rica,Latin America and Caribbean,Central Latin America 91 | 127,SLV,El Salvador,Latin America and Caribbean,Central Latin America 92 | 128,GTM,Guatemala,Latin America and Caribbean,Central Latin America 93 | 129,HND,Honduras,Latin America and Caribbean,Central Latin America 94 | 130,MEX,Mexico,Latin America and Caribbean,Central Latin America 95 | 131,NIC,Nicaragua,Latin America and Caribbean,Central Latin America 96 | 132,PAN,Panama,Latin America and Caribbean,Central Latin America 97 | 133,VEN,Venezuela,Latin America and Caribbean,Central Latin America 98 | 135,BRA,Brazil,Latin America and Caribbean,Tropical Latin America 99 | 136,PRY,Paraguay,Latin America and Caribbean,Tropical Latin America 100 | 160,AFG,Afghanistan,North Africa and Middle East,North Africa and Middle East 101 | 139,DZA,Algeria,North Africa and Middle East,North Africa and Middle East 102 | 140,BHR,Bahrain,North Africa and Middle East,North Africa and Middle East 103 | 141,EGY,Egypt,North Africa and Middle East,North Africa and Middle East 104 | 142,IRN,Iran,North Africa and Middle East,North Africa and Middle East 105 | 143,IRQ,Iraq,North Africa and Middle East,North Africa and Middle East 106 | 144,JOR,Jordan,North Africa and Middle East,North Africa and Middle East 107 | 145,KWT,Kuwait,North Africa and Middle East,North Africa and Middle East 108 | 146,LBN,Lebanon,North Africa and Middle East,North Africa and Middle East 109 | 147,LBY,Libya,North Africa and Middle East,North Africa and Middle East 110 | 148,MAR,Morocco,North Africa and Middle East,North Africa and Middle East 111 | 149,PSE,Palestine,North Africa and Middle East,North Africa and Middle East 112 | 150,OMN,Oman,North Africa and Middle East,North Africa and Middle East 113 | 151,QAT,Qatar,North Africa and Middle East,North Africa and Middle East 114 | 152,SAU,Saudi Arabia,North Africa and Middle East,North Africa and Middle East 115 | 522,SDN,Sudan,North Africa and Middle East,North Africa and Middle East 116 | 153,SYR,Syria,North Africa and Middle East,North Africa and Middle East 117 | 154,TUN,Tunisia,North Africa and Middle East,North Africa and Middle East 118 | 155,TUR,Turkey,North Africa and Middle East,North Africa and Middle East 119 | 156,ARE,United Arab Emirates,North Africa and Middle East,North Africa and Middle East 120 | 157,YEM,Yemen,North Africa and Middle East,North Africa and Middle East 121 | 161,BGD,Bangladesh,South Asia,South Asia 122 | 162,BTN,Bhutan,South Asia,South Asia 123 | 163,IND,India,South Asia,South Asia 124 | 164,NPL,Nepal,South Asia,South Asia 125 | 165,PAK,Pakistan,South Asia,South Asia 126 | 6,CHN,China,"Southeast Asia, East Asia, and Oceania",East Asia 127 | 7,PRK,North Korea,"Southeast Asia, East Asia, and Oceania",East Asia 128 | 8,TWN,Taiwan,"Southeast Asia, East Asia, and Oceania",East Asia 129 | 298,ASM,American Samoa,"Southeast Asia, East Asia, and Oceania",Oceania 130 | 320,COK,Cook Islands,"Southeast Asia, East Asia, and Oceania",Oceania 131 | 25,FSM,Federated States of Micronesia,"Southeast Asia, East Asia, and Oceania",Oceania 132 | 22,FJI,Fiji,"Southeast Asia, East Asia, and Oceania",Oceania 133 | 351,GUM,Guam,"Southeast Asia, East Asia, and Oceania",Oceania 134 | 23,KIR,Kiribati,"Southeast Asia, East Asia, and Oceania",Oceania 135 | 24,MHL,Marshall Islands,"Southeast Asia, East Asia, and Oceania",Oceania 136 | 376,MNP,Northern Mariana Islands,"Southeast Asia, East Asia, and Oceania",Oceania 137 | 26,PNG,Papua New Guinea,"Southeast Asia, East Asia, and Oceania",Oceania 138 | 369,NRU,Nauru,"Southeast Asia, East Asia, and Oceania",Oceania 139 | 374,NIU,Niue,"Southeast Asia, East Asia, and Oceania",Oceania 140 | 380,PLW,Palau,"Southeast Asia, East Asia, and Oceania",Oceania 141 | 27,WSM,Samoa,"Southeast Asia, East Asia, and Oceania",Oceania 142 | 28,SLB,Solomon Islands,"Southeast Asia, East Asia, and Oceania",Oceania 143 | 413,TKL,Tokelau,"Southeast Asia, East Asia, and Oceania",Oceania 144 | 29,TON,Tonga,"Southeast Asia, East Asia, and Oceania",Oceania 145 | 416,TUV,Tuvalu,"Southeast Asia, East Asia, and Oceania",Oceania 146 | 30,VUT,Vanuatu,"Southeast Asia, East Asia, and Oceania",Oceania 147 | 10,KHM,Cambodia,"Southeast Asia, East Asia, and Oceania",Southeast Asia 148 | 11,IDN,Indonesia,"Southeast Asia, East Asia, and Oceania",Southeast Asia 149 | 12,LAO,Laos,"Southeast Asia, East Asia, and Oceania",Southeast Asia 150 | 13,MYS,Malaysia,"Southeast Asia, East Asia, and Oceania",Southeast Asia 151 | 14,MDV,Maldives,"Southeast Asia, East Asia, and Oceania",Southeast Asia 152 | 183,MUS,Mauritius,"Southeast Asia, East Asia, and Oceania",Southeast Asia 153 | 15,MMR,Myanmar,"Southeast Asia, East Asia, and Oceania",Southeast Asia 154 | 16,PHL,Philippines,"Southeast Asia, East Asia, and Oceania",Southeast Asia 155 | 17,LKA,Sri Lanka,"Southeast Asia, East Asia, and Oceania",Southeast Asia 156 | 186,SYC,Seychelles,"Southeast Asia, East Asia, and Oceania",Southeast Asia 157 | 18,THA,Thailand,"Southeast Asia, East Asia, and Oceania",Southeast Asia 158 | 19,TLS,Timor-Leste,"Southeast Asia, East Asia, and Oceania",Southeast Asia 159 | 20,VNM,Vietnam,"Southeast Asia, East Asia, and Oceania",Southeast Asia 160 | 168,AGO,Angola,Sub-Saharan Africa,Central Sub-Saharan Africa 161 | 169,CAF,Central African Republic,Sub-Saharan Africa,Central Sub-Saharan Africa 162 | 170,COG,Congo,Sub-Saharan Africa,Central Sub-Saharan Africa 163 | 171,COD,Democratic Republic of the Congo,Sub-Saharan Africa,Central Sub-Saharan Africa 164 | 172,GNQ,Equatorial Guinea,Sub-Saharan Africa,Central Sub-Saharan Africa 165 | 173,GAB,Gabon,Sub-Saharan Africa,Central Sub-Saharan Africa 166 | 175,BDI,Burundi,Sub-Saharan Africa,Eastern Sub-Saharan Africa 167 | 176,COM,Comoros,Sub-Saharan Africa,Eastern Sub-Saharan Africa 168 | 177,DJI,Djibouti,Sub-Saharan Africa,Eastern Sub-Saharan Africa 169 | 178,ERI,Eritrea,Sub-Saharan Africa,Eastern Sub-Saharan Africa 170 | 179,ETH,Ethiopia,Sub-Saharan Africa,Eastern Sub-Saharan Africa 171 | 180,KEN,Kenya,Sub-Saharan Africa,Eastern Sub-Saharan Africa 172 | 181,MDG,Madagascar,Sub-Saharan Africa,Eastern Sub-Saharan Africa 173 | 182,MWI,Malawi,Sub-Saharan Africa,Eastern Sub-Saharan Africa 174 | 184,MOZ,Mozambique,Sub-Saharan Africa,Eastern Sub-Saharan Africa 175 | 185,RWA,Rwanda,Sub-Saharan Africa,Eastern Sub-Saharan Africa 176 | 187,SOM,Somalia,Sub-Saharan Africa,Eastern Sub-Saharan Africa 177 | 435,SSD,South Sudan,Sub-Saharan Africa,Eastern Sub-Saharan Africa 178 | 189,TZA,Tanzania,Sub-Saharan Africa,Eastern Sub-Saharan Africa 179 | 190,UGA,Uganda,Sub-Saharan Africa,Eastern Sub-Saharan Africa 180 | 191,ZMB,Zambia,Sub-Saharan Africa,Eastern Sub-Saharan Africa 181 | 193,BWA,Botswana,Sub-Saharan Africa,Southern Sub-Saharan Africa 182 | 194,LSO,Lesotho,Sub-Saharan Africa,Southern Sub-Saharan Africa 183 | 195,NAM,Namibia,Sub-Saharan Africa,Southern Sub-Saharan Africa 184 | 196,ZAF,South Africa,Sub-Saharan Africa,Southern Sub-Saharan Africa 185 | 197,SWZ,Swaziland,Sub-Saharan Africa,Southern Sub-Saharan Africa 186 | 198,ZWE,Zimbabwe,Sub-Saharan Africa,Southern Sub-Saharan Africa 187 | 200,BEN,Benin,Sub-Saharan Africa,Western Sub-Saharan Africa 188 | 201,BFA,Burkina Faso,Sub-Saharan Africa,Western Sub-Saharan Africa 189 | 202,CMR,Cameroon,Sub-Saharan Africa,Western Sub-Saharan Africa 190 | 203,CPV,Cape Verde,Sub-Saharan Africa,Western Sub-Saharan Africa 191 | 204,TCD,Chad,Sub-Saharan Africa,Western Sub-Saharan Africa 192 | 205,CIV,Cote d'Ivoire,Sub-Saharan Africa,Western Sub-Saharan Africa 193 | 206,GMB,The Gambia,Sub-Saharan Africa,Western Sub-Saharan Africa 194 | 207,GHA,Ghana,Sub-Saharan Africa,Western Sub-Saharan Africa 195 | 208,GIN,Guinea,Sub-Saharan Africa,Western Sub-Saharan Africa 196 | 209,GNB,Guinea-Bissau,Sub-Saharan Africa,Western Sub-Saharan Africa 197 | 210,LBR,Liberia,Sub-Saharan Africa,Western Sub-Saharan Africa 198 | 211,MLI,Mali,Sub-Saharan Africa,Western Sub-Saharan Africa 199 | 212,MRT,Mauritania,Sub-Saharan Africa,Western Sub-Saharan Africa 200 | 213,NER,Niger,Sub-Saharan Africa,Western Sub-Saharan Africa 201 | 214,NGA,Nigeria,Sub-Saharan Africa,Western Sub-Saharan Africa 202 | 215,STP,Sao Tome and Principe,Sub-Saharan Africa,Western Sub-Saharan Africa 203 | 216,SEN,Senegal,Sub-Saharan Africa,Western Sub-Saharan Africa 204 | 217,SLE,Sierra Leone,Sub-Saharan Africa,Western Sub-Saharan Africa 205 | 218,TGO,Togo,Sub-Saharan Africa,Western Sub-Saharan Africa 206 | -------------------------------------------------------------------------------- /notebooks/2019_02_17_plotly_graph_development.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Make plotly graphs\n", 8 | "It can be unwieldy to do data munging and graph development in the app itself. Much of this can be done in a Jupyter notebook then transferred into the app " 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "metadata": {}, 15 | "outputs": [], 16 | "source": [ 17 | "import numpy as np\n", 18 | "import pandas as pd\n", 19 | "import seaborn as sns\n", 20 | "import matplotlib.pyplot as plt" 21 | ] 22 | }, 23 | { 24 | "cell_type": "markdown", 25 | "metadata": {}, 26 | "source": [ 27 | "## Load data" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 2, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "df0 = pd.read_csv('../data/IHME_GBD_2017_HEALTH_SDG_1990_2030_SCALED_Y2018M11D08.csv')\n", 37 | "loc_meta = pd.read_csv('../data/location_metadata.csv')" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 3, 43 | "metadata": {}, 44 | "outputs": [ 45 | { 46 | "data": { 47 | "text/html": [ 48 | "
\n", 49 | "\n", 62 | "\n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | "
Unnamed: 0location_idlocation_nameyear_idestimate_typeindicator_idindicator_shortihme_indicator_descriptionindicator_outlineindicator_unittarget_descriptiongoal_descriptionscaled_valuescaled_lowerscaled_upper
0276China2017past1000HIV IncidIndicator 3.3.1: Age-standardised rate of new ...3.3.1Scaled/Normalized value ranging from 0-100By 2030, end the epidemics of AIDS, tuberculos...Ensure healthy lives and promote well-being fo...74.567.682.8
1687North Korea2017past1000HIV IncidIndicator 3.3.1: Age-standardised rate of new ...3.3.1Scaled/Normalized value ranging from 0-100By 2030, end the epidemics of AIDS, tuberculos...Ensure healthy lives and promote well-being fo...76.941.1100.0
21098Taiwan2017past1000HIV IncidIndicator 3.3.1: Age-standardised rate of new ...3.3.1Scaled/Normalized value ranging from 0-100By 2030, end the epidemics of AIDS, tuberculos...Ensure healthy lives and promote well-being fo...84.577.790.7
315010Cambodia2017past1000HIV IncidIndicator 3.3.1: Age-standardised rate of new ...3.3.1Scaled/Normalized value ranging from 0-100By 2030, end the epidemics of AIDS, tuberculos...Ensure healthy lives and promote well-being fo...63.349.381.1
419111Indonesia2017past1000HIV IncidIndicator 3.3.1: Age-standardised rate of new ...3.3.1Scaled/Normalized value ranging from 0-100By 2030, end the epidemics of AIDS, tuberculos...Ensure healthy lives and promote well-being fo...59.855.363.4
\n", 176 | "
" 177 | ], 178 | "text/plain": [ 179 | " Unnamed: 0 location_id location_name year_id estimate_type indicator_id \\\n", 180 | "0 27 6 China 2017 past 1000 \n", 181 | "1 68 7 North Korea 2017 past 1000 \n", 182 | "2 109 8 Taiwan 2017 past 1000 \n", 183 | "3 150 10 Cambodia 2017 past 1000 \n", 184 | "4 191 11 Indonesia 2017 past 1000 \n", 185 | "\n", 186 | " indicator_short ihme_indicator_description \\\n", 187 | "0 HIV Incid Indicator 3.3.1: Age-standardised rate of new ... \n", 188 | "1 HIV Incid Indicator 3.3.1: Age-standardised rate of new ... \n", 189 | "2 HIV Incid Indicator 3.3.1: Age-standardised rate of new ... \n", 190 | "3 HIV Incid Indicator 3.3.1: Age-standardised rate of new ... \n", 191 | "4 HIV Incid Indicator 3.3.1: Age-standardised rate of new ... \n", 192 | "\n", 193 | " indicator_outline indicator_unit \\\n", 194 | "0 3.3.1 Scaled/Normalized value ranging from 0-100 \n", 195 | "1 3.3.1 Scaled/Normalized value ranging from 0-100 \n", 196 | "2 3.3.1 Scaled/Normalized value ranging from 0-100 \n", 197 | "3 3.3.1 Scaled/Normalized value ranging from 0-100 \n", 198 | "4 3.3.1 Scaled/Normalized value ranging from 0-100 \n", 199 | "\n", 200 | " target_description \\\n", 201 | "0 By 2030, end the epidemics of AIDS, tuberculos... \n", 202 | "1 By 2030, end the epidemics of AIDS, tuberculos... \n", 203 | "2 By 2030, end the epidemics of AIDS, tuberculos... \n", 204 | "3 By 2030, end the epidemics of AIDS, tuberculos... \n", 205 | "4 By 2030, end the epidemics of AIDS, tuberculos... \n", 206 | "\n", 207 | " goal_description scaled_value \\\n", 208 | "0 Ensure healthy lives and promote well-being fo... 74.5 \n", 209 | "1 Ensure healthy lives and promote well-being fo... 76.9 \n", 210 | "2 Ensure healthy lives and promote well-being fo... 84.5 \n", 211 | "3 Ensure healthy lives and promote well-being fo... 63.3 \n", 212 | "4 Ensure healthy lives and promote well-being fo... 59.8 \n", 213 | "\n", 214 | " scaled_lower scaled_upper \n", 215 | "0 67.6 82.8 \n", 216 | "1 41.1 100.0 \n", 217 | "2 77.7 90.7 \n", 218 | "3 49.3 81.1 \n", 219 | "4 55.3 63.4 " 220 | ] 221 | }, 222 | "execution_count": 3, 223 | "metadata": {}, 224 | "output_type": "execute_result" 225 | } 226 | ], 227 | "source": [ 228 | "df0.head()" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 4, 234 | "metadata": {}, 235 | "outputs": [ 236 | { 237 | "data": { 238 | "text/html": [ 239 | "
\n", 240 | "\n", 253 | "\n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | "
location_idihme_loc_idlocation_namesuper_region_nameregion_nameAdol Birth RateAir Poll MortAlcohol UseCert Death RegChild Overweight...Sexual ViolenceSkilled Birth AttendSmoking PrevSuicide MortTB IncidUHC IndexUnder-5 MortVaccine CovWaSH MortWater
033ARMArmeniaCentral Europe, Eastern Europe, and Central AsiaCentral Asia52.441.163.097.420.3...99.099.538.155.863.271.868.995.876.496.6
134AZEAzerbaijanCentral Europe, Eastern Europe, and Central AsiaCentral Asia36.634.952.686.318.8...93.396.342.886.341.860.837.972.358.288.3
235GEOGeorgiaCentral Europe, Eastern Europe, and Central AsiaCentral Asia35.237.943.966.318.0...100.099.035.960.049.464.765.484.675.688.9
336KAZKazakhstanCentral Europe, Eastern Europe, and Central AsiaCentral Asia47.051.329.688.338.6...98.799.639.612.048.067.659.666.972.888.6
437KGZKyrgyzstanCentral Europe, Eastern Europe, and Central AsiaCentral Asia40.639.751.697.665.9...90.799.652.147.640.060.751.272.760.581.9
\n", 403 | "

5 rows × 46 columns

\n", 404 | "
" 405 | ], 406 | "text/plain": [ 407 | " location_id ihme_loc_id location_name \\\n", 408 | "0 33 ARM Armenia \n", 409 | "1 34 AZE Azerbaijan \n", 410 | "2 35 GEO Georgia \n", 411 | "3 36 KAZ Kazakhstan \n", 412 | "4 37 KGZ Kyrgyzstan \n", 413 | "\n", 414 | " super_region_name region_name \\\n", 415 | "0 Central Europe, Eastern Europe, and Central Asia Central Asia \n", 416 | "1 Central Europe, Eastern Europe, and Central Asia Central Asia \n", 417 | "2 Central Europe, Eastern Europe, and Central Asia Central Asia \n", 418 | "3 Central Europe, Eastern Europe, and Central Asia Central Asia \n", 419 | "4 Central Europe, Eastern Europe, and Central Asia Central Asia \n", 420 | "\n", 421 | " Adol Birth Rate Air Poll Mort Alcohol Use Cert Death Reg \\\n", 422 | "0 52.4 41.1 63.0 97.4 \n", 423 | "1 36.6 34.9 52.6 86.3 \n", 424 | "2 35.2 37.9 43.9 66.3 \n", 425 | "3 47.0 51.3 29.6 88.3 \n", 426 | "4 40.6 39.7 51.6 97.6 \n", 427 | "\n", 428 | " Child Overweight ... Sexual Violence Skilled Birth Attend \\\n", 429 | "0 20.3 ... 99.0 99.5 \n", 430 | "1 18.8 ... 93.3 96.3 \n", 431 | "2 18.0 ... 100.0 99.0 \n", 432 | "3 38.6 ... 98.7 99.6 \n", 433 | "4 65.9 ... 90.7 99.6 \n", 434 | "\n", 435 | " Smoking Prev Suicide Mort TB Incid UHC Index Under-5 Mort Vaccine Cov \\\n", 436 | "0 38.1 55.8 63.2 71.8 68.9 95.8 \n", 437 | "1 42.8 86.3 41.8 60.8 37.9 72.3 \n", 438 | "2 35.9 60.0 49.4 64.7 65.4 84.6 \n", 439 | "3 39.6 12.0 48.0 67.6 59.6 66.9 \n", 440 | "4 52.1 47.6 40.0 60.7 51.2 72.7 \n", 441 | "\n", 442 | " WaSH Mort Water \n", 443 | "0 76.4 96.6 \n", 444 | "1 58.2 88.3 \n", 445 | "2 75.6 88.9 \n", 446 | "3 72.8 88.6 \n", 447 | "4 60.5 81.9 \n", 448 | "\n", 449 | "[5 rows x 46 columns]" 450 | ] 451 | }, 452 | "execution_count": 4, 453 | "metadata": {}, 454 | "output_type": "execute_result" 455 | } 456 | ], 457 | "source": [ 458 | "# Make sure our data is unique by location and indicator\n", 459 | "assert df0.duplicated(['location_name', 'indicator_id']).sum() == 0\n", 460 | "\n", 461 | "# Indicator Value by country in wide format\n", 462 | "df = df0.pivot(index='location_name', columns='indicator_short', values='scaled_value')\n", 463 | "df = pd.merge(loc_meta, df.reset_index())\n", 464 | "df.head()" 465 | ] 466 | }, 467 | { 468 | "cell_type": "markdown", 469 | "metadata": {}, 470 | "source": [ 471 | "# Develop plots\n", 472 | "- Show seaborn version\n", 473 | "- Make plotly version " 474 | ] 475 | }, 476 | { 477 | "cell_type": "code", 478 | "execution_count": 5, 479 | "metadata": {}, 480 | "outputs": [ 481 | { 482 | "data": { 483 | "text/plain": [ 484 | "" 485 | ] 486 | }, 487 | "execution_count": 5, 488 | "metadata": {}, 489 | "output_type": "execute_result" 490 | }, 491 | { 492 | "data": { 493 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1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Xr8ZWAT+speu+pKZnUOD32N3XwD+BDhON8C/BBym2e9zX9j7mltMq3Ogt4DHGltCZGa/ANwP3OLu/1h2e/JiZh8AXnT3w4MPBxzapPd6I/A24Ivuvg34KQ1K0wTp5aWvAy4C3gicQzd1MaxJ7/M4uf1/XudA/xxw4cDPFwDPl9SWXJlZh26Qv9fdH+g9/JP+17reny+W1b6MXQV80MyeoZuO20m3hz/V+4oPzXuvnwOec/eDvZ/30Q38TX2PAX4TeNrdF919BXgAeCfNfp/7wt7X3GJanQP93wBv6Y3Sn0V3IOehktuUuV5++svAk+7+pwP/9BBwU+/vNwEPFt22PLj7be5+gbtvpfuePuruNwL7gQ/3DmvM9QK4+98Bz5pZfyf4dwPfp6Hvcc9xYIeZber9P96/5sa+zwPC3teHgN/rVd/sAF7qp3hSc/fa/ge8H/h/wN8C/7Hs9uR0jb9O9+vbd4Ejvf/eTzdv/S3gB70/zyu7rTlc+7uAb/b+/mbg/wI/BL4OnF12+zK+1iuAQ733eQ44t+nvMfAZ4Cnge8B/B85u2vsM3Ed3DGKFbo/942HvK93UzZ/34tlRuhVJmbRDM2NFRBquzqkbERGJQIFeRKThFOhFRBpOgV5EpOEU6EVEGk6BXkSk4RToRUQaToFeRKTh/j9QhzHDYpaATwAAAABJRU5ErkJggg==\n", 494 | "text/plain": [ 495 | "
" 496 | ] 497 | }, 498 | "metadata": { 499 | "needs_background": "light" 500 | }, 501 | "output_type": "display_data" 502 | } 503 | ], 504 | "source": [ 505 | "plt.scatter(df['Adol Birth Rate'], df['Under-5 Mort'])" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "execution_count": 6, 511 | "metadata": {}, 512 | "outputs": [ 513 | { 514 | "data": { 515 | "text/html": [ 516 | "" 517 | ], 518 | "text/vnd.plotly.v1+html": [ 519 | "" 520 | ] 521 | }, 522 | "metadata": {}, 523 | "output_type": "display_data" 524 | } 525 | ], 526 | "source": [ 527 | "# Import plotly and set to work offline (ie, render plots here rather than plotly)\n", 528 | "import plotly.plotly as py\n", 529 | "import plotly.graph_objs as go\n", 530 | "from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot\n", 531 | "init_notebook_mode(connected=True)" 532 | ] 533 | }, 534 | { 535 | "cell_type": "markdown", 536 | "metadata": {}, 537 | "source": [ 538 | "### Note - Plotly offline doesn't render in github" 539 | ] 540 | }, 541 | { 542 | "cell_type": "code", 543 | "execution_count": 7, 544 | "metadata": {}, 545 | "outputs": [ 546 | { 547 | "data": { 548 | "application/vnd.plotly.v1+json": { 549 | "data": [ 550 | { 551 | "marker": { 552 | "line": { 553 | "color": "white", 554 | "width": 0.5 555 | }, 556 | "size": 12 557 | }, 558 | "mode": "markers", 559 | "name": "Central Europe, Eastern Europe, and Central Asia", 560 | "opacity": 0.7, 561 | "text": [ 562 | "Armenia", 563 | "Azerbaijan", 564 | "Georgia", 565 | "Kazakhstan", 566 | "Kyrgyzstan", 567 | "Mongolia", 568 | "Tajikistan", 569 | "Turkmenistan", 570 | "Uzbekistan", 571 | "Albania", 572 | "Bosnia and Herzegovina", 573 | "Bulgaria", 574 | "Croatia", 575 | "Czech Republic", 576 | "Hungary", 577 | "Macedonia", 578 | "Montenegro", 579 | "Poland", 580 | "Romania", 581 | "Serbia", 582 | "Slovakia", 583 | "Slovenia", 584 | "Belarus", 585 | "Estonia", 586 | "Latvia", 587 | "Lithuania", 588 | "Moldova", 589 | "Russian Federation", 590 | "Ukraine" 591 | ], 592 | "type": "scatter", 593 | "x": [ 594 | 52.4, 595 | 36.6, 596 | 35.2, 597 | 47, 598 | 40.6, 599 | 49.7, 600 | 30.3, 601 | 59.4, 602 | 45.2, 603 | 59.6, 604 | 77, 605 | 39.3, 606 | 77.6, 607 | 71, 608 | 55.7, 609 | 64.1, 610 | 73.8, 611 | 70.6, 612 | 42.7, 613 | 65.1, 614 | 54.2, 615 | 96.2, 616 | 59.5, 617 | 67.8, 618 | 60.1, 619 | 64.7, 620 | 53.8, 621 | 51.5, 622 | 50.2 623 | ], 624 | "y": [ 625 | 68.9, 626 | 37.9, 627 | 65.4, 628 | 59.6, 629 | 51.2, 630 | 45.4, 631 | 31.1, 632 | 42.4, 633 | 47.2, 634 | 62.2, 635 | 78.3, 636 | 74.1, 637 | 88.1, 638 | 97.5, 639 | 85.4, 640 | 68.8, 641 | 89.4, 642 | 87.3, 643 | 71.1, 644 | 84.3, 645 | 80.1, 646 | 100, 647 | 78.2, 648 | 96.5, 649 | 85, 650 | 85.2, 651 | 59.2, 652 | 74.9, 653 | 69.1 654 | ] 655 | }, 656 | { 657 | "marker": { 658 | "line": { 659 | "color": "white", 660 | "width": 0.5 661 | }, 662 | "size": 12 663 | }, 664 | "mode": "markers", 665 | "name": "High-income", 666 | "opacity": 0.7, 667 | "text": [ 668 | "Australia", 669 | "New Zealand", 670 | "Brunei", 671 | "Japan", 672 | "South Korea", 673 | "Singapore", 674 | "Canada", 675 | "Greenland", 676 | "United States", 677 | "Argentina", 678 | "Chile", 679 | "Uruguay", 680 | "Andorra", 681 | "Austria", 682 | "Belgium", 683 | "Cyprus", 684 | "Denmark", 685 | "Finland", 686 | "France", 687 | "Germany", 688 | "Greece", 689 | "Iceland", 690 | "Ireland", 691 | "Israel", 692 | "Italy", 693 | "Luxembourg", 694 | "Malta", 695 | "Netherlands", 696 | "Norway", 697 | "Portugal", 698 | "Spain", 699 | "Sweden", 700 | "Switzerland", 701 | "United Kingdom" 702 | ], 703 | "type": "scatter", 704 | "x": [ 705 | 69.2, 706 | 57.4, 707 | 70.9, 708 | 99.9, 709 | 100, 710 | 98.9, 711 | 70.2, 712 | 37.3, 713 | 55.7, 714 | 28.2, 715 | 37.9, 716 | 30.5, 717 | 95.9, 718 | 79.9, 719 | 84.7, 720 | 99.9, 721 | 98.2, 722 | 86.9, 723 | 84.8, 724 | 83.3, 725 | 79.3, 726 | 78.3, 727 | 75.5, 728 | 73.8, 729 | 93.2, 730 | 90.3, 731 | 70.6, 732 | 99.8, 733 | 92.7, 734 | 76.4, 735 | 82.2, 736 | 95, 737 | 100, 738 | 65.5 739 | ], 740 | "y": [ 741 | 90.4, 742 | 86.9, 743 | 70.2, 744 | 99.6, 745 | 94.2, 746 | 100, 747 | 82.3, 748 | 60.2, 749 | 77.2, 750 | 65.6, 751 | 75.4, 752 | 70.2, 753 | 100, 754 | 93.3, 755 | 91.8, 756 | 96.9, 757 | 91.1, 758 | 100, 759 | 90.2, 760 | 92, 761 | 87, 762 | 100, 763 | 93.4, 764 | 92.1, 765 | 94.8, 766 | 100, 767 | 79.9, 768 | 90.2, 769 | 99.5, 770 | 93.2, 771 | 94.9, 772 | 98.5, 773 | 90.8, 774 | 87 775 | ] 776 | }, 777 | { 778 | "marker": { 779 | "line": { 780 | "color": "white", 781 | "width": 0.5 782 | }, 783 | "size": 12 784 | }, 785 | "mode": "markers", 786 | "name": "Latin America and Caribbean", 787 | "opacity": 0.7, 788 | "text": [ 789 | "Bolivia", 790 | "Ecuador", 791 | "Peru", 792 | "Antigua and Barbuda", 793 | "The Bahamas", 794 | "Barbados", 795 | "Belize", 796 | "Bermuda", 797 | "Cuba", 798 | "Dominica", 799 | "Dominican Republic", 800 | "Grenada", 801 | "Guyana", 802 | "Haiti", 803 | "Jamaica", 804 | "Puerto Rico", 805 | "Saint Lucia", 806 | "Saint Vincent and the Grenadines", 807 | "Suriname", 808 | "Trinidad and Tobago", 809 | "Virgin Islands, U.S.", 810 | "Colombia", 811 | "Costa Rica", 812 | "El Salvador", 813 | "Guatemala", 814 | "Honduras", 815 | "Mexico", 816 | "Nicaragua", 817 | "Panama", 818 | "Venezuela", 819 | "Brazil", 820 | "Paraguay" 821 | ], 822 | "type": "scatter", 823 | "x": [ 824 | 22.4, 825 | 27.7, 826 | 20.5, 827 | 31.8, 828 | 43.6, 829 | 38.5, 830 | 28.1, 831 | 80.5, 832 | 34.8, 833 | 35.5, 834 | 16.6, 835 | 33.7, 836 | 24.3, 837 | 32.6, 838 | 37.9, 839 | 45.7, 840 | 35.9, 841 | 27.5, 842 | 28.7, 843 | 39.3, 844 | 30.9, 845 | 25.9, 846 | 30.5, 847 | 26.2, 848 | 21.2, 849 | 17.2, 850 | 23.3, 851 | 18.9, 852 | 20.5, 853 | 15.6, 854 | 31.7, 855 | 26.1 856 | ], 857 | "y": [ 858 | 42.1, 859 | 54.6, 860 | 57.5, 861 | 65.3, 862 | 62.5, 863 | 61.5, 864 | 54, 865 | 83.7, 866 | 83.6, 867 | 41.4, 868 | 42.3, 869 | 59.2, 870 | 46.2, 871 | 25.5, 872 | 59, 873 | 67.8, 874 | 60.2, 875 | 55.9, 876 | 42.8, 877 | 55.8, 878 | 71.4, 879 | 59.5, 880 | 72.8, 881 | 62.7, 882 | 46.5, 883 | 58.9, 884 | 57.1, 885 | 57.9, 886 | 54.9, 887 | 57.3, 888 | 53.4, 889 | 59.9 890 | ] 891 | }, 892 | { 893 | "marker": { 894 | "line": { 895 | "color": "white", 896 | "width": 0.5 897 | }, 898 | "size": 12 899 | }, 900 | "mode": "markers", 901 | "name": "North Africa and Middle East", 902 | "opacity": 0.7, 903 | "text": [ 904 | "Afghanistan", 905 | "Algeria", 906 | "Bahrain", 907 | "Egypt", 908 | "Iran", 909 | "Iraq", 910 | "Jordan", 911 | "Kuwait", 912 | "Lebanon", 913 | "Libya", 914 | "Morocco", 915 | "Palestine", 916 | "Oman", 917 | "Qatar", 918 | "Saudi Arabia", 919 | "Sudan", 920 | "Syria", 921 | "Tunisia", 922 | "Turkey", 923 | "United Arab Emirates", 924 | "Yemen" 925 | ], 926 | "type": "scatter", 927 | "x": [ 928 | 14.8, 929 | 77.8, 930 | 65.7, 931 | 27.3, 932 | 50.2, 933 | 28.3, 934 | 50.9, 935 | 82.4, 936 | 29.2, 937 | 69.3, 938 | 58.1, 939 | 21, 940 | 71.1, 941 | 73.8, 942 | 78, 943 | 18.4, 944 | 42.7, 945 | 89.8, 946 | 51, 947 | 71.1, 948 | 19.5 949 | ], 950 | "y": [ 951 | 27.7, 952 | 48.2, 953 | 75.2, 954 | 52.3, 955 | 59.2, 956 | 46, 957 | 59.2, 958 | 73.8, 959 | 72.9, 960 | 59.3, 961 | 51.7, 962 | 60.5, 963 | 66.4, 964 | 75.1, 965 | 73.4, 966 | 30.7, 967 | 51.6, 968 | 66.7, 969 | 59.5, 970 | 75.9, 971 | 31.6 972 | ] 973 | }, 974 | { 975 | "marker": { 976 | "line": { 977 | "color": "white", 978 | "width": 0.5 979 | }, 980 | "size": 12 981 | }, 982 | "mode": "markers", 983 | "name": "South Asia", 984 | "opacity": 0.7, 985 | "text": [ 986 | "Bangladesh", 987 | "Bhutan", 988 | "India", 989 | "Nepal", 990 | "Pakistan" 991 | ], 992 | "type": "scatter", 993 | "x": [ 994 | 23.3, 995 | 42.4, 996 | 51.5, 997 | 28.4, 998 | 36.8 999 | ], 1000 | "y": [ 1001 | 39.4, 1002 | 42.3, 1003 | 33.5, 1004 | 40.6, 1005 | 26 1006 | ] 1007 | }, 1008 | { 1009 | "marker": { 1010 | "line": { 1011 | "color": "white", 1012 | "width": 0.5 1013 | }, 1014 | "size": 12 1015 | }, 1016 | "mode": "markers", 1017 | "name": "Southeast Asia, East Asia, and Oceania", 1018 | "opacity": 0.7, 1019 | "text": [ 1020 | "China", 1021 | "North Korea", 1022 | "Taiwan", 1023 | "American Samoa", 1024 | "Federated States of Micronesia", 1025 | "Fiji", 1026 | "Guam", 1027 | "Kiribati", 1028 | "Marshall Islands", 1029 | "Northern Mariana Islands", 1030 | "Papua New Guinea", 1031 | "Samoa", 1032 | "Solomon Islands", 1033 | "Tonga", 1034 | "Vanuatu", 1035 | "Cambodia", 1036 | "Indonesia", 1037 | "Laos", 1038 | "Malaysia", 1039 | "Maldives", 1040 | "Mauritius", 1041 | "Myanmar", 1042 | "Philippines", 1043 | "Sri Lanka", 1044 | "Seychelles", 1045 | "Thailand", 1046 | "Timor-Leste", 1047 | "Vietnam" 1048 | ], 1049 | "type": "scatter", 1050 | "x": [ 1051 | 80, 1052 | 100, 1053 | 99.8, 1054 | 42.2, 1055 | 40.9, 1056 | 43.4, 1057 | 35.8, 1058 | 40, 1059 | 25.2, 1060 | 39.7, 1061 | 28.2, 1062 | 37.4, 1063 | 27, 1064 | 62, 1065 | 32.3, 1066 | 36.8, 1067 | 49.3, 1068 | 26.7, 1069 | 74.1, 1070 | 61.7, 1071 | 53.9, 1072 | 52.2, 1073 | 30.9, 1074 | 60.3, 1075 | 28.6, 1076 | 44.8, 1077 | 27.5, 1078 | 52.3 1079 | ], 1080 | "y": [ 1081 | 63.5, 1082 | 48.4, 1083 | 85.7, 1084 | 67.5, 1085 | 54.6, 1086 | 45.4, 1087 | 60.7, 1088 | 33.2, 1089 | 48.9, 1090 | 71.9, 1091 | 28.4, 1092 | 59.7, 1093 | 45.1, 1094 | 55.8, 1095 | 42.3, 1096 | 40.5, 1097 | 45.1, 1098 | 26.3, 1099 | 75.6, 1100 | 74.1, 1101 | 60.2, 1102 | 32.4, 1103 | 44.6, 1104 | 71.6, 1105 | 62.5, 1106 | 71.1, 1107 | 37.6, 1108 | 61.4 1109 | ] 1110 | }, 1111 | { 1112 | "marker": { 1113 | "line": { 1114 | "color": "white", 1115 | "width": 0.5 1116 | }, 1117 | "size": 12 1118 | }, 1119 | "mode": "markers", 1120 | "name": "Sub-Saharan Africa", 1121 | "opacity": 0.7, 1122 | "text": [ 1123 | "Angola", 1124 | "Central African Republic", 1125 | "Congo", 1126 | "Democratic Republic of the Congo", 1127 | "Equatorial Guinea", 1128 | "Gabon", 1129 | "Burundi", 1130 | "Comoros", 1131 | "Djibouti", 1132 | "Eritrea", 1133 | "Ethiopia", 1134 | "Kenya", 1135 | "Madagascar", 1136 | "Malawi", 1137 | "Mozambique", 1138 | "Rwanda", 1139 | "Somalia", 1140 | "South Sudan", 1141 | "Tanzania", 1142 | "Uganda", 1143 | "Zambia", 1144 | "Botswana", 1145 | "Lesotho", 1146 | "Namibia", 1147 | "South Africa", 1148 | "Swaziland", 1149 | "Zimbabwe", 1150 | "Benin", 1151 | "Burkina Faso", 1152 | "Cameroon", 1153 | "Cape Verde", 1154 | "Chad", 1155 | "Cote d'Ivoire", 1156 | "The Gambia", 1157 | "Ghana", 1158 | "Guinea", 1159 | "Guinea-Bissau", 1160 | "Liberia", 1161 | "Mali", 1162 | "Mauritania", 1163 | "Niger", 1164 | "Nigeria", 1165 | "Sao Tome and Principe", 1166 | "Senegal", 1167 | "Sierra Leone", 1168 | "Togo" 1169 | ], 1170 | "type": "scatter", 1171 | "x": [ 1172 | 8.7, 1173 | 17.3, 1174 | 23.6, 1175 | 17.5, 1176 | 11.8, 1177 | 26.5, 1178 | 31.1, 1179 | 36.1, 1180 | 33, 1181 | 33.5, 1182 | 16.8, 1183 | 23.1, 1184 | 6.9, 1185 | 10.9, 1186 | 14.2, 1187 | 46.2, 1188 | 14.7, 1189 | 6.6, 1190 | 13.9, 1191 | 11.4, 1192 | 12.4, 1193 | 35.4, 1194 | 23.5, 1195 | 29.3, 1196 | 28.3, 1197 | 22.3, 1198 | 13.8, 1199 | 18.5, 1200 | 14.1, 1201 | 15.8, 1202 | 41.7, 1203 | 0.1, 1204 | 13.6, 1205 | 22.4, 1206 | 32.9, 1207 | 8.9, 1208 | 16.3, 1209 | 13.9, 1210 | 3.3, 1211 | 23.4, 1212 | 0, 1213 | 16, 1214 | 29, 1215 | 21.4, 1216 | 14.1, 1217 | 31.3 1218 | ], 1219 | "y": [ 1220 | 23.3, 1221 | 8, 1222 | 27.3, 1223 | 17.9, 1224 | 27.8, 1225 | 37.9, 1226 | 18.2, 1227 | 30.6, 1228 | 32, 1229 | 31.3, 1230 | 26.8, 1231 | 32.6, 1232 | 20.3, 1233 | 23.3, 1234 | 20.3, 1235 | 31.1, 1236 | 12.5, 1237 | 12, 1238 | 24.6, 1239 | 25.2, 1240 | 24.3, 1241 | 48.4, 1242 | 21.9, 1243 | 35.4, 1244 | 39.1, 1245 | 32, 1246 | 26.8, 1247 | 17.5, 1248 | 11.7, 1249 | 20.4, 1250 | 51, 1251 | 9.4, 1252 | 17.5, 1253 | 30.7, 1254 | 27.1, 1255 | 13.9, 1256 | 20.5, 1257 | 20, 1258 | 8.9, 1259 | 32.1, 1260 | 11.3, 1261 | 12.3, 1262 | 42.3, 1263 | 30.5, 1264 | 10.7, 1265 | 22.7 1266 | ] 1267 | } 1268 | ], 1269 | "layout": {} 1270 | }, 1271 | "text/html": [ 1272 | "
" 1273 | ], 1274 | "text/vnd.plotly.v1+html": [ 1275 | "
" 1276 | ] 1277 | }, 1278 | "metadata": {}, 1279 | "output_type": "display_data" 1280 | } 1281 | ], 1282 | "source": [ 1283 | "x_varname = 'Adol Birth Rate'\n", 1284 | "y_varname = 'Under-5 Mort'\n", 1285 | "\n", 1286 | "data = [\n", 1287 | " go.Scatter(\n", 1288 | " x=df[df['super_region_name'] == i][x_varname],\n", 1289 | " y=df[df['super_region_name'] == i][y_varname],\n", 1290 | " text=df[df['super_region_name'] == i]['location_name'],\n", 1291 | " mode='markers',\n", 1292 | " opacity=0.7,\n", 1293 | " marker={\n", 1294 | " 'size': 12,\n", 1295 | " 'line': {'width': 0.5, 'color': 'white'}\n", 1296 | " },\n", 1297 | " name=i\n", 1298 | " ) for i in df.super_region_name.unique()\n", 1299 | " ]\n", 1300 | "\n", 1301 | "layout = go.Layout(\n", 1302 | " title='Testing testing'\n", 1303 | ")\n", 1304 | "\n", 1305 | "iplot(data, layout)" 1306 | ] 1307 | }, 1308 | { 1309 | "cell_type": "code", 1310 | "execution_count": null, 1311 | "metadata": {}, 1312 | "outputs": [], 1313 | "source": [] 1314 | } 1315 | ], 1316 | "metadata": { 1317 | "kernelspec": { 1318 | "display_name": "Python 3", 1319 | "language": "python", 1320 | "name": "python3" 1321 | }, 1322 | "language_info": { 1323 | "codemirror_mode": { 1324 | "name": "ipython", 1325 | "version": 3 1326 | }, 1327 | "file_extension": ".py", 1328 | "mimetype": "text/x-python", 1329 | "name": "python", 1330 | "nbconvert_exporter": "python", 1331 | "pygments_lexer": "ipython3", 1332 | "version": "3.7.2" 1333 | } 1334 | }, 1335 | "nbformat": 4, 1336 | "nbformat_minor": 2 1337 | } 1338 | -------------------------------------------------------------------------------- /readme_images/heroku_app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwrankin/dash_tutorial/932925bd4ade4b11ecd65aa9e8ea9d1c92ebff3c/readme_images/heroku_app.gif -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | backcall==0.1.0 2 | bleach==3.1.0 3 | certifi==2018.11.29 4 | chardet==3.0.4 5 | Click==7.0 6 | colorama==0.4.1 7 | dash==0.35.1 8 | dash-core-components==0.42.1 9 | dash-daq==0.1.0 10 | dash-html-components==0.13.4 11 | dash-renderer==0.17.0 12 | dash-table==3.1.11 13 | decorator==4.3.2 14 | defusedxml==0.5.0 15 | entrypoints==0.3 16 | Flask==1.0.2 17 | Flask-Compress==1.4.0 18 | gunicorn==19.9.0 19 | idna==2.8 20 | ipykernel==5.1.0 21 | ipython==7.2.0 22 | ipython-genutils==0.2.0 23 | ipywidgets==7.4.2 24 | itsdangerous==1.1.0 25 | jedi==0.13.2 26 | Jinja2==2.10 27 | jsonschema==2.6.0 28 | jupyter==1.0.0 29 | jupyter-client==5.2.4 30 | jupyter-console==6.0.0 31 | jupyter-core==4.4.0 32 | MarkupSafe==1.1.0 33 | mistune==0.8.4 34 | nbconvert==5.4.0 35 | nbformat==4.4.0 36 | notebook==5.7.4 37 | numexpr==2.6.9 38 | numpy==1.15.4 39 | pandas==0.24.0 40 | pandocfilters==1.4.2 41 | parso==0.3.2 42 | pickleshare==0.7.5 43 | plotly==3.6.0 44 | prometheus-client==0.5.0 45 | prompt-toolkit==2.0.8 46 | Pygments==2.3.1 47 | python-dateutil==2.7.5 48 | pytz==2018.9 49 | pywinpty==0.5.5 50 | pyzmq==17.1.2 51 | qtconsole==4.4.3 52 | requests==2.21.0 53 | retrying==1.3.3 54 | scipy==1.2.0 55 | Send2Trash==1.5.0 56 | six==1.12.0 57 | terminado==0.8.1 58 | testpath==0.4.2 59 | tornado==5.1.1 60 | traitlets==4.3.2 61 | urllib3==1.24.1 62 | wcwidth==0.1.7 63 | webencodings==0.5.1 64 | Werkzeug==0.14.1 65 | widgetsnbextension==3.4.2 66 | wincertstore==0.2 67 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.7.2 2 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | setup( 4 | name='src', 5 | packages=find_packages(), 6 | version='0.1.0', 7 | description='Tutorial for Developing and Deploying Dash App on Heroku', 8 | author='Zane Rankin', 9 | license='MIT', 10 | ) 11 | --------------------------------------------------------------------------------