MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / update_figure

Function update_figure

sagemaker-dash/tutorials/app8.py:31–45  ·  view source on GitHub ↗
(selected_year)

Source from the content-addressed store, hash-verified

29@app.callback(Output('graph-with-slider', 'figure'),
30 Input('year-slider', 'value'))
31def update_figure(selected_year):
32 filtered_df = df[df.year == selected_year]
33
34 fig = px.scatter(filtered_df,
35 x="gdpPercap",
36 y="lifeExp",
37 size="pop",
38 color="continent",
39 hover_name="country",
40 log_x=True,
41 size_max=55)
42
43 fig.update_layout(transition_duration=500)
44
45 return fig
46
47
48if __name__ == '__main__':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected