File tree Expand file tree Collapse file tree
apps/dash-opioid-epidemic Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22import pathlib
33import re
4+ import json
45
56import dash
67import dash_core_components as dcc
@@ -289,19 +290,29 @@ def display_map(year, figure):
289290 dragmode = "lasso" ,
290291 )
291292
292- base_url = "https://raw.githubusercontent.com/jackparmer/mapbox-counties/master/"
293+ # base_url = "https://raw.githubusercontent.com/jackparmer/mapbox-counties/master/"
294+ base_url = APP_PATH
293295 for bin in BINS :
294296 geo_layer = dict (
295297 sourcetype = "geojson" ,
296- source = base_url + str (year ) + "/" + bin + ".geojson" ,
298+ source = os . path . join ( base_url , os . path . join ( "data" , os . path . join ( str (year ) + "/" + bin + ".geojson" ))) ,
297299 type = "fill" ,
298300 color = cm [bin ],
301+ # color="blue",
299302 opacity = DEFAULT_OPACITY ,
300303 # CHANGE THIS
301304 fill = dict (outlinecolor = "#afafaf" ),
302305 )
303306 layout ["mapbox" ]["layers" ].append (geo_layer )
304307
308+ link = os .path .join (base_url , os .path .join ("data" , os .path .join (str (year ) + "/" + "10.1-12" + ".geojson" )))
309+
310+ with open ("/home/kids_on_drugs/Documents/Plotly/dash-sample-apps/apps/dash-opioid-epidemic/data/1999/0-2.geojson" ) as f :
311+ data = json .load (f )
312+ print ("REACH" )
313+ for feature in data ["features" ]:
314+ print (feature )
315+
305316 fig = dict (data = data , layout = layout )
306317 return fig
307318
You can’t perform that action at this time.
0 commit comments