Skip to content
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

Merged
merged 1 commit into from
Sep 25, 2024
Merged

feat: highlighting flags chart #8237

merged 1 commit into from
Sep 25, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Sep 24, 2024

About the changes

Adding highlighter shadow to each data point
Screenshot 2024-09-24 at 16 19 02

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

Copy link

vercel bot commented Sep 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ❌ Failed (Inspect) Sep 24, 2024 2:21pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Sep 24, 2024 2:21pm

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

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: {
Copy link
Contributor Author

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) => ({
Copy link
Contributor Author

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

@kwasniew kwasniew merged commit e33f71a into main Sep 25, 2024
9 of 10 checks passed
@kwasniew kwasniew deleted the highlighting-flags-chart branch September 25, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants