-
Notifications
You must be signed in to change notification settings - Fork 425
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
fix: 💄 Add new chart event onDataPointHover that triggers only on data point change #4008
fix: 💄 Add new chart event onDataPointHover that triggers only on data point change #4008
Conversation
…a point change Current onCrosshairMove triggers multiple times for small mouse movements even if the mouse is kept on the same data point. Added an event that triggers only when the logical data point id changes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/web/components/chart/historical-chart.tsxOops! Something went wrong! :( ESLint: 8.50.0 ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct. The config "next/core-web-vitals" was referenced from the config file in "/packages/web/.eslintrc.json". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. WalkthroughThis pull request introduces modifications across three chart components: Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (5)packages/web/components/chart/light-weight-charts/chart.tsx (3)
The new
The implementation effectively solves the infinite render issue by:
The chart initialization correctly uses the new internal callback, ensuring consistent event handling. packages/web/components/chart/historical-volume-chart.tsx (1)Line range hint The component correctly implements the new packages/web/components/chart/historical-chart.tsx (1)Line range hint The component correctly implements the new Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Current onCrosshairMove triggers multiple times for small mouse movements even if the mouse is kept on the same data point. Added an event that triggers only when the logical data point id changes
What is the purpose of the change:
Fixes an "infinite render" that in reality was an hover event triggered each millisecond the mouse was hovering the element instead of triggering on enter
Linear Task
https://linear.app/osmosis/issue/FE-1272/fix-infinite-rendering-of-portfolio-chartheader-in-osmosis-fe
Brief Changelog
Notes
The other charts did not display such an issue because they update a mobx store that was filtering rerenders when no data was changed. That said it is best to implement this new event at the base chart and use it for future components to avoid such issues in the future