-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Utility function to render chart tooltips #27950
feat: Utility function to render chart tooltips #27950
Conversation
superset-frontend/plugins/plugin-chart-echarts/src/utils/TooltipRenderer.ts
Outdated
Show resolved
Hide resolved
One question I have isn't about the PR itself (which is lookin' good!) but about the new component's potential future, and thus its location in the codebase. Since the TooltipRenderer component doesn't seem to rely on anything ECharts related, do you think it would make sense to move it out of the ECharts plugin and into Superset-UI/core or similar? It seems like we could use it on other plugins (ECharts or not) to standardize the UI even further across Superset. Having that might also pave the way to add a customization controls to it down the road, enabling templating (handlebars/jinja/whatever) and replacing the JS Tooltips used by DeckGL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super exciting, I'm really looking forward to standardizing the tooltip renderer! First pass comment regarding potential readability/performance.
...frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
Outdated
Show resolved
Hide resolved
@justinpark @villebro @rusackas Thank you for the comments. I'm still working on the component's API and implementation as I continue to iterate on each plugin. I'm still not sure what will be the final API and implementation because each plugin has a unique set of requirements. For that reason, I'll first make sure all ECharts plugins are using the renderer, to have a clear view of all requirements, and then work on optimizations. Feel free to review this PR while it evolves or wait for when it leaves the draft state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Maybe add a few tests, but other than that, once CI clears this looks much better than the current state of affairs.
8d4e7b6
to
09a2995
Compare
253c438
to
ae46232
Compare
3c3c3b1
to
10cfb22
Compare
Wow this is a nice improvement! 🤩 Thank you for including all of the before/after screenshots. This will implement the following feature requests: |
Thanks for linking the resources @sfirke! |
superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
Outdated
Show resolved
Hide resolved
10cfb22
to
636227f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Really nice feature indeed ! Will this feature be also available for the other types of charts (Country Map, World Map, Bar chart...) any time soon ? Thanks |
I think we all WANT it to get there, but it's probably not a high priority at the moment. If you have the means to contribute that as a PR, we'd be super excited to review it! |
SUMMARY
This PR adds an utility function to render chart tooltips with the following objectives:
This PR will only format ECharts tooltips to limit the scope of work but other plugins can also benefit from the utility function.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Test consists in checking how the tooltip is displayed for all ECharts plugins and their different control combinations.
ADDITIONAL INFORMATION