-
-
Notifications
You must be signed in to change notification settings - Fork 730
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: highlighting flags chart #8237
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
@@ -82,6 +82,11 @@ export const createBarChartOptions = ( | |||
return { | |||
plugins: { | |||
legend: plugins?.legend, | |||
// required to avoid the highlight plugin highlighting empty annotation | |||
annotation: { |
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.
even though we don't use annotations on this chart it is used in the network data usage. ChartJs has global registrations so this page can be affected.
@@ -1,9 +1,8 @@ | |||
import type { Chart } from 'chart.js'; | |||
|
|||
export const customHighlightPlugin = { | |||
export const customHighlightPlugin = (width = 46, bottomOverflow = 34) => ({ |
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.
defaults optimized for the network data usage where I took it from for reuse
About the changes
Adding highlighter shadow to each data point
I had to explicitly disable annotations highlighting since ChartJS has a global registry of plugins and the annotation plugin from the data network tab was doing this registration. As a result if you open network data usage and then go to your dashboard you'd get the entire chart highlighted from the invisible annotation.
Important files
Discussion points