Skip to content

feat: Remove UI theme from PlotlyExpressChartModel#251

Merged
mattrunyon merged 3 commits intodeephaven:mainfrom
mattrunyon:plotly-express-theme
Feb 16, 2024
Merged

feat: Remove UI theme from PlotlyExpressChartModel#251
mattrunyon merged 3 commits intodeephaven:mainfrom
mattrunyon:plotly-express-theme

Conversation

@mattrunyon
Copy link
Copy Markdown
Collaborator

@mattrunyon mattrunyon commented Feb 2, 2024

Fixes #216

PlotlyExpressChartModel should just remove the colors on the traces instead of setting them to the UI theme. The UI theme then gets applied via the template colorway

@mattrunyon mattrunyon added the plotly-express Involves plotly-express plugin label Feb 2, 2024
@mattrunyon mattrunyon requested a review from bmingles February 2, 2024 22:56
@mattrunyon mattrunyon self-assigned this Feb 2, 2024
@mattrunyon mattrunyon force-pushed the plotly-express-theme branch from 724699f to 5150680 Compare February 6, 2024 19:54
@mattrunyon mattrunyon force-pushed the plotly-express-theme branch from 5150680 to f5bbfa5 Compare February 8, 2024 19:23
bmingles added a commit to deephaven/web-client-ui that referenced this pull request Feb 13, 2024
This PR 
- Move theme colors down to `layout.template.layout` so that they are
used as defaults. Some of the theme colors had to be set in
`layout.template.data` for specific trace types
- Chart component now responds to ChartTheme context changes (this
should enable chart theme switching, but it depends on some follow up
plugins repo work to complete it).

**Testing**
For now, we should just make sure charts behave as they did before. Not
all charts will update in response to a theme change, but re-running
queries should show the theme change. I have tested this and have not
seen any changes to existing behavior introduced by this PR

Once the following plugins repo PRs have merged, the chart should fully
respond to theme changes:
deephaven/deephaven-plugins#243
deephaven/deephaven-plugins#251

resolves #1728

BREAKING CHANGE: 
- Renamed `ColorUtils.getColorwayFromTheme` to `normalizeColorway`
- Removed `chartTheme` arg from functions in `ChartUtils`,
`ChartModelFactory` and `FigureChartModel` in @deephaven/chart
Copy link
Copy Markdown
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Tested locally and verified theme changing works.

@mattrunyon mattrunyon merged commit 4cbe4ca into deephaven:main Feb 16, 2024
@mattrunyon mattrunyon deleted the plotly-express-theme branch February 16, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plotly-express Involves plotly-express plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove UI theme from plotly express model

2 participants