Is it posible to manipulate variables in by using a Plotly slider?
I want to increase the number of nodes by using a slider.
Yes, absolutely. If βgraphβ is the id of your networkx graph and βsliderβ is the id of your slider it would look something like:
@app.callback(
Output("graph", "figure"),
Input("slider", "value"),
State("graph", "figure")
)
def update_graph(slider_value, figure):
# apply some change to figure based on slider value
return figure
Any time the slider value is changed this callback will be executed and the figure will be updated.
1 Like