Changing active slider value doesn't change the displayed data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
How can I change the displayed data subset when using animation_frame? fig.update_layout(sliders=[dict(active=...)]), shown in the docs, only changes the value selected on the slider itself, but not the actual data. In this example, it's still showing the data associated with z=1 (notebook).
import plotly.express as px
import pandas as pd
df = pd.DataFrame(dict(x=[0, 1, 0, 1],
y=[0, 1, 1, 0],
z=[0, 0, 1, 1]))
fig = px.line(df, "x", "y", animation_frame="z")
fig.update_layout(sliders=[dict(active=1)])
fig.show()
Also posted to StackOverflow
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported Python example using Plotly Express animation_frame and fig.update_layout(sliders=[dict(active=1)]), then compare the slider selection with the displayed data in the linked notebook. Reproduce the mismatch and trace how the animation frame and slider state are handled; done means changing the active slider displays the corresponding data subset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100
