Setting custom themes in echarts #129
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to make the echarts theme configurable. It sorta works but sending as a RFC to ask if you see a better ways to do things.
The themes documentation is here: https://echarts.apache.org/handbook/en/concepts/style/#
And the few actual themes are stolen from here: https://echarts.apache.org/en/theme-builder.html .
The theme is customizable per panel. This is a bit too much but felt like the most natural place to put the customization.
I don't like that the theme may be registered several times. Also
currently doesn't cause problems I guess because on changing the theme every component re-renders, but in theory different configurations could be registered under the same name (in a global registry?).
The solutions I see kinda all feel like an overkill of sorts:
customTheme-${themeConfig}as a theme nameMaybe 1) would be cleaner or maybe there's another I'm missing?
The user can provide own configuration in dashboards.tsx, of course.
If the general approach seems fine, I will add variable use to other places in dashboards.tsx and also add remaining themes from the echarts examples.