Skip to content

Commit 21332fc

Browse files
committed
Serve geojson remotely entirely
1 parent a70570b commit 21332fc

264 files changed

Lines changed: 3 additions & 54418 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/dash-opioid-epidemic/app.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import pathlib
33
import re
4-
import json
54

65
import dash
76
import dash_core_components as dcc
@@ -59,7 +58,7 @@
5958
"24.1-26",
6059
"26.1-28",
6160
"28.1-30",
62-
"30+",
61+
">30",
6362
]
6463

6564
DEFAULT_COLORSCALE = [
@@ -290,23 +289,19 @@ def display_map(year, figure):
290289
dragmode="lasso",
291290
)
292291

293-
# base_url = "https://raw.githubusercontent.com/jackparmer/mapbox-counties/master/"
292+
base_url = "https://raw.githubusercontent.com/jackparmer/mapbox-counties/master/"
294293
for bin in BINS:
295-
link = os.path.join(APP_PATH, os.path.join("data", os.path.join(str(year) + "/" + bin + ".geojson")))
296-
297294
geo_layer = dict(
298295
sourcetype="geojson",
299-
source=link,
296+
source=base_url + str(year) + "/" + bin + ".geojson",
300297
type="fill",
301298
color=cm[bin],
302-
# color="blue",
303299
opacity=DEFAULT_OPACITY,
304300
# CHANGE THIS
305301
fill=dict(outlinecolor="#afafaf"),
306302
)
307303
layout["mapbox"]["layers"].append(geo_layer)
308304

309-
310305
fig = dict(data=data, layout=layout)
311306
return fig
312307

apps/dash-opioid-epidemic/data/1999/0-2.geojson

Lines changed: 0 additions & 836 deletions
This file was deleted.

apps/dash-opioid-epidemic/data/1999/10.1-12.geojson

Lines changed: 0 additions & 91 deletions
This file was deleted.

apps/dash-opioid-epidemic/data/1999/12.1-14.geojson

Lines changed: 0 additions & 35 deletions
This file was deleted.

apps/dash-opioid-epidemic/data/1999/14.1-16.geojson

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/dash-opioid-epidemic/data/1999/16.1-18.geojson

Lines changed: 0 additions & 13 deletions
This file was deleted.

apps/dash-opioid-epidemic/data/1999/18.1-20.geojson

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)