Skip to content

feat: Theming - Charts#1608

Merged
bmingles merged 16 commits intodeephaven:mainfrom
bmingles:1572-theming-charts
Nov 7, 2023
Merged

feat: Theming - Charts#1608
bmingles merged 16 commits intodeephaven:mainfrom
bmingles:1572-theming-charts

Conversation

@bmingles
Copy link
Copy Markdown
Contributor

@bmingles bmingles commented Oct 31, 2023

Added ChartThemeProvider, added support for resolving css variables in chart theme, and updated chart theme to use css variables.

resolves #1572

BREAKING CHANGE:

  • ChartThemeProvider is now required to provide ChartTheme
  • ChartModelFactory and ChartUtils now require chartTheme args
  • Any runtime references to ChartTheme will need to be updated

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 31, 2023

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (61d1a53) 46.71% compared to head (fa1435e) 46.71%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1608   +/-   ##
=======================================
  Coverage   46.71%   46.71%           
=======================================
  Files         583      586    +3     
  Lines       36308    36340   +32     
  Branches     9094     9095    +1     
=======================================
+ Hits        16961    16977   +16     
- Misses      19295    19311   +16     
  Partials       52       52           
Flag Coverage Δ
unit 46.71% <58.22%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ckages/app-utils/src/components/ThemeBootstrap.tsx 100.00% <100.00%> (ø)
packages/chart/src/Chart.tsx 0.00% <ø> (ø)
packages/chart/src/ChartTheme.ts 100.00% <100.00%> (ø)
packages/chart/src/FigureChartModel.ts 54.14% <100.00%> (-0.14%) ⬇️
packages/components/src/theme/ThemeUtils.ts 99.06% <100.00%> (-0.94%) ⬇️
packages/components/src/theme/theme-dark/index.ts 100.00% <ø> (ø)
packages/chart/src/ChartModelFactory.ts 81.81% <50.00%> (+4.89%) ⬆️
packages/chart/src/ChartUtils.ts 64.99% <80.00%> (+0.72%) ⬆️
packages/console/src/HeapUsage.tsx 0.00% <0.00%> (ø)
packages/chart/src/useChartTheme.tsx 0.00% <0.00%> (ø)
... and 6 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmingles bmingles force-pushed the 1572-theming-charts branch 2 times, most recently from 289bc10 to 144d2fe Compare November 1, 2023 19:50
@bmingles bmingles marked this pull request as ready for review November 2, 2023 13:16
@bmingles bmingles requested a review from mofojed November 2, 2023 13:16
@bmingles bmingles force-pushed the 1572-theming-charts branch from ee3eb43 to d7b4adc Compare November 2, 2023 17:11
@bmingles bmingles force-pushed the 1572-theming-charts branch from ed0c47e to fd9a477 Compare November 2, 2023 21:03
Comment thread packages/components/src/theme/theme-dark/theme-dark-semantic-chart.css Outdated
Comment thread packages/chart/src/ChartThemeProvider.tsx Outdated
Comment thread packages/chart/src/ChartTheme.ts Outdated
Comment on lines +21 to +32
static _theme: ChartTheme;

static get theme(): ChartTheme {
/* eslint-disable no-underscore-dangle */
if (MockChartModel._theme == null) {
MockChartModel._theme = initChartTheme();
}

return MockChartModel._theme;
/* eslint-enable no-underscore-dangle */
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't the theme be passed in to the constructor? As it is I don't see how this would update to if the user changes the theme in the Style Guide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to only be used in static methods, so there's not really a constructor involved. I can probably just expose a setter that can be used by the Styleguide to change it, but I'll defer that until I implement the theme picker unless you have any objections.

Comment thread packages/chart/src/useChartTheme.tsx Outdated
Comment thread packages/console/src/HeapUsage.tsx Outdated
Comment thread packages/dashboard-core-plugins/src/ChartBuilderPlugin.tsx Outdated
@bmingles bmingles force-pushed the 1572-theming-charts branch from fd9a477 to 9a9bf88 Compare November 3, 2023 20:27
@bmingles bmingles force-pushed the 1572-theming-charts branch from d1ece51 to ff57e85 Compare November 6, 2023 20:19
@bmingles bmingles requested a review from mofojed November 6, 2023 21:10
@bmingles bmingles merged commit d5b3b48 into deephaven:main Nov 7, 2023
@bmingles bmingles deleted the 1572-theming-charts branch November 7, 2023 21:40
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theming - Charts and Plots

2 participants