Repository navigation
Update Chartist and add hover line and tooltip plugins - #973
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the manual mouseover tooltip with two decoupled Chartist plugins: `hoverLine` draws a vertical line on the point nearest to the pointer and emits `hover-line:change` and `hover-line:leave`, `hoverTooltip` shows the tooltip in response to them. The chart is now drawn with the `lineChart` function and works with touch input too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
This pull request updates the Chartist library to version 2.2.0 and introduces a new hover interaction for charts, including a vertical hover line and tooltip support. The changes modernize how tooltips are displayed on chart points, replacing manual event handling with a plugin-based approach.
Chartist Library Upgrade:
chartistfrom version 1.5.0 to 2.2.0 in bothpackage.jsonandpnpm-lock.yaml, updating all related lockfile entries. [1] [2] [3] [4]New Hover Line and Tooltip Plugins:
chartist-hover-line.tsthat displays a vertical line on the nearest chart point and emits custom events (hover-line:change,hover-line:leave) when the pointer moves or leaves the chart area.chartist-hover-tooltip.tsthat listens for hover events and shows a tooltip on the highlighted point using the provided rendering logic.Refactor of Chart Tooltip Handling:
statistics-chart.tsto use the new Chartist plugins for hover line and tooltip, removing the old manual tooltip logic and event listeners. Now tooltips are rendered via the plugin system, improving maintainability and consistency. [1] [2] [3]