how to make intertransition frame button(radio buttons) for dataframe using python plotly dash?

  plotly-dash, plotly-python, python

the code i writed

termo = data.características.unique()

app = dash.Dash(__name__)
app.layout = html.Div([
    html.P("termo:"),
    dcc.RadioItems(
        id='termo', 
        options=[{'value': x, 'label': x} 
                 for x in termo],
        value=termo[0],
        labelStyle={'display': 'inline-block'}
    ),
    dcc.Graph(id="choropleth"),
])
@app.callback(
    Output("choropleth", "figure"), 
    [Input("termo", "value")])
def display_choropleth(termo):
    fig = px.choropleth(data,
                     locations='id',
                     geojson = regioes,
                     color='dados',
                     hover_data=['dados_'],
                     hover_name="regioes_do_brasil",
                     title ="Praticantes de atividades esportivas por regiões e características",
                       )
    return fig
if __name__ == '__main__':
    app.run_server(debug=True, use_reloader=False)

csv file im using

when clicking on each button i wanted that data also change with each caracteristic button on plotly map but when i click on buttons it dont change any data kindly please guide me where im making error

Source: Python Questions

LEAVE A COMMENT