Here is my code, it’s a graph that updates based on dropdown selections. It seems like there should be a very simple explanation, but this is my first app and I’m a bit stumped. Why aren’t there markers on the graph for each point that makes up the line?
import dash
#import dash_table
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
#import plotly.graph_objs as go
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([dcc.Dropdown(id="veh_drop", options=df_vehDrop.to_dict('records'), placeholder="Select Vehicle"),
dcc.Dropdown(id="pcode_drop", options=df_pDrop.to_dict('records'), placeholder="Select Code"),
dcc.Graph(id = "mapbox", style = {"height": "100%"})])
@app.callback(Output(component_id='mapbox',component_property='figure'),
[Input('pcode_drop', 'value'),
Input('veh_drop', 'value')])
def update_map(pcode_drop, veh_drop):
if not pcode_drop in uniq_pcodes or not veh_drop:
raise PreventUpdate
df_u = df[df['veh_no'] == veh_drop]
df_p = df_l[df_l['pcode'] == pcode_drop]
signal = df_p['label'].to_list()
ydataList = df_u[signal[0] + " (n/a)"].to_list()
xdataList = df_u.index.to_list()
#xdataList = df_u['time_stamp'].to_list()
return {'data': [(dict(x = xdataList,
y = ydataList,
marker=dict(color='rgb(55, 83, 109)')))],
'layout': dict(title= veh_drop + " - " + pcode_drop)}