I have three inputs for my map in the plotly dash and I want to use px.scatter_mapbox as the map type. Meanwhile, the data has three categorical columns, including 'region', 'country' and 'status', with one metric column of '4/24/20'. These three dimensions are multiple dropdown which I think they have no problem (normal to show up). The problem is the callback below. It is always showing the error of 'Lengths must compare to match'. I am totally lost.
@app.callback(
Output('map-graph', 'figure'),
[Input('region_dropdown_id', 'value'),
Input('country_dropdown_id', 'value'),
Input('status_dropdown_id', 'value')
],
)
def map_selection(input1, input2, input3):
import plotly.express as px
MBToken = 'your token'
px.set_mapbox_access_token(MBToken)
dff = df
dff = dff[dff["4/24/20"]>0]
filtered_df = dff[(dff['region'] == input1) & (dff['country'] == input2) & (dff['status'] == input3)]
fig = px.scatter_mapbox(filtered_df, lat="Lat", lon="Long", color= input3, size="4/24/20",
color_continuous_scale=px.colors.cyclical.IceFire, size_max=100, zoom=0)
return fig
