Skip to content

PlotlyFigure: buttons and sliders in the site's colours - #57

Merged
max-models merged 2 commits into
develfrom
plotly-controls
Nov 7, 2026
Merged

max-models merged 2 commits into
develfrom
plotly-controls

Conversation

@max-models

@max-models max-models commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

An animation's Play button and slider (updatemenus, sliders) were drawn in Plotly's defaults: white, with the light text of dark mode, so they could not be read.

  • themeControls (in lib/plotly-theme.ts, with tests) gives the buttons and sliders the page's colours: text, --sl-color-gray-6 background, hairline borders, and the accent for the dragged handle. They follow the theme toggle like the rest of the figure.
  • Button menus (type: "buttons") get showactive: false unless they set it themselves. Plotly draws the active button in a fixed light blue, which a Play button doesn't need.

I checked this on the example animation of the maxplotlib "Web figures" guide (max-models/maxplotlib#89), in light and dark mode. npm run test:js: 84 passed.

@max-models
max-models merged commit d619380 into devel Nov 7, 2026
9 checks passed
This was referenced Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant