feat(chart): React-native tooltip for TimeseriesChart#537
Merged
mattrothenberg merged 11 commits intoMay 28, 2026
Conversation
commit: |
Contributor
Docs PreviewCommit: |
Contributor
Collaborator
|
/bonk review |
Contributor
|
UnknownError: ProviderInitError |
Contributor
|
@mattrothenberg Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
71ebe97 to
0412910
Compare
…rolled DOM mutation
- Replace manual mousemove/translate3d positioning with Base UI's
Tooltip primitive and trackCursorAxis
- Add tooltipFollowCursor prop ('both' | 'x') for axis-locked mode
- Add tooltipMode and tooltipMaxItems props from Thomas's original work
- Memoize TooltipContent, cache Intl.NumberFormat at module scope
- Match tooltip styling to kumo's standard Tooltip (bg-kumo-base,
outline-kumo-fill, shadow-kumo-tip-shadow)
- Add interactive TooltipFollowCursorDemo to timeseries docs page
- Register ToolboxComponent in chart demos to fix console warning
0412910 to
becf88e
Compare
Collaborator
|
/bonk what do you think of these changes? |
Collaborator
|
/bonk please thoroughly review our changes here, looking for subtle API breakages, performance issues, etc |
Contributor
|
I fetched the PR diff, read all changed files plus the base |
mattrothenberg
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.













































Why
The existing tooltip was built on ECharts' HTML-string formatter — inline styles,
anytypes everywhere,getComputedStylecalled on every mouse move to read CSS variables, and a deaddimColorvariable that was computed but never used. It also couldn't escape its containing element, so tooltips were clipped when the chart was inside a constrained layout.What changed
Tooltip is now a proper React component rendered via
createPortalintodocument.body, wrapped in adata-modediv so Kumo CSS variables resolve correctly despite being outside the component tree.Positioning is decoupled from content (same architecture as ECharts' own implementation):
updateAxisPointerevent — one render cycle behind, imperceptible for textmousemovelistener usingtransform: translate3d(GPU-composited, no layout cost). Quadrant-based anchoring flips the tooltip side when the cursor crosses the chart midpoint, with acubic-bezier(0.23,1,0.32,1)transition on switches.New props:
tooltipMode:"all"(default) |"single"— single mode shows only the series nearest the cursor, useful for dense chartstooltipMaxItems: caps rows in"all"mode with a+N morefooter (default10)Other improvements:
May 26, 13:04:21instead of ISO stringtoLocaleString— no scientific notationfindNearestbinary search replaces ECharts series index lookupAlternatives considered
Keeping ECharts' formatter but injecting computed CSS variable values — simpler but still
getComputedStyleon every hover, still HTML strings, still no real types.