figure=dict( data=[dict(x=0, y=0)], layout=dict( paper_bgcolor="#F4F4F8", plot_bgcolor="#F4F4F8", autofill=True, margin=dict(t=75, r=50, b=100, l=50), ), ), ), ], ), html.Div( id="header", children=[ html.Img(id="logo", src=app.get_asset_url("dash-logo.png")), html.H4(children="Rate of US Poison-Induced Deaths"), html.P( id="description", children= "† Deaths are classified using the International Classification of Diseases, \ Tenth Revision (ICD–10). Drug-poisoning deaths are defined as having ICD–10 underlying \ cause-of-death codes X40–X44 (unintentional), X60–X64 (suicide), X85 (homicide), or Y10–Y14 \ (undetermined intent).", ), ], ), html.Div( id="app-container", children=[ html.Div(
'cyan': '#00FFFF', 'magenta': '#FF00FF', 'black' : '#000000', } for colour, values in state.items(): timestamps = [datetime.fromtimestamp(int(0.001*ts)) for _, ts, _ in values if ts > 0] #users = [user for user, ts, _ in values if ts > 0] levels = [level for _, ts, level in values if ts > 0] if colour in colors: colour_series[colour] = pd.Series(levels, index=timestamps).groupby(level=0).first() df = pd.DataFrame(colour_series).fillna(method="ffill").reset_index()[-25:] traces = [go.Scatter(y=df[colour], x=df['index'], name=colour, line=dict(color=colors.get(colour, '#000000')), ) for colour in colour_series] return {'data':traces, #'layout': go.Layout } localState = DjangoDash("LocalState", serve_locally=True) localState.layout = html.Div([html.Img(src=localState.get_asset_url('image_one.png')), html.Img(src='assets/image_two.png'), ])
] #users = [user for user, ts, _ in values if ts > 0] levels = [level for _, ts, level in values if ts > 0] if colour in colors: colour_series[colour] = pd.Series( levels, index=timestamps).groupby(level=0).first() df = pd.DataFrame(colour_series).fillna(method="ffill").reset_index()[-25:] traces = [ go.Scatter( y=df[colour], x=df['index'], name=colour, line=dict(color=colors.get(colour, '#000000')), ) for colour in colour_series ] return { 'data': traces, #'layout': go.Layout } localState = DjangoDash("LocalState", serve_locally=True) localState.layout = html.Div([ html.Img(src=localState.get_asset_url('image_one.png')), html.Img(src='assets/image_two.png'), ])
id="banner-title", children=[ html.A( "Support Vector Machine (SVM) Explorer", href="https://github.com/plotly/dash-svm", style={ "text-decoration": "none", "color": "inherit", }, ) ], ), html.A( id="banner-logo", children=[ html.Img(src=app.get_asset_url( "dash_apps-logo-new.png")) ], href="https://plot.ly/products/dash/", ), ], ) ], ), html.Div( id="body", className="container scalable", children=[ html.Div( id="app-container", # className="row", children=[