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: highcharts configs #534

Merged
merged 4 commits into from
Jan 31, 2025
Merged

feat: highcharts configs #534

merged 4 commits into from
Jan 31, 2025

Conversation

jared-dickman
Copy link
Collaborator

@jared-dickman jared-dickman commented Jan 31, 2025

Summary

  • Add constants, in the form of chart configs, and shaded colors
  • This logic is extracted from analytics, to ensure the same styles are applied across all highcharts

TODO: REFERENCE PRS

  • Nancy pr
  • Analytics pr

Testing Plan

  • Was this tested locally? If not, explain why.
  • linked locally in nancy, with corresponding story
  • tested in analytics via dist in branch

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

color: 'rgba(56, 60, 67, 0.7)',
} as const

export const ChartConfig = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a type for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully!

yes we can def add a type from Highcharts, but i didnt yet (in 2 minutes) find a highcharts type-only package. we do not want to add all of highchairs to the aquarium, only the types

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I wonder if we could just add the highcharts package and rely on vite's tree-shaking? https://vite.dev/guide/features#named-imports

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point, added!

Copy link

github-actions bot commented Jan 31, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-01-31 19:59 UTC

@@ -87,6 +87,7 @@
"wait-on": "7.2.0"
},
"optionalDependencies": {
"@esbuild/darwin-x64": "0.24.2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

necessary to build locally for linking into nancy on my mac 🤷

export const ChartColors: string[] = [0, -42, 37, -69, 62]
.map(alpha => Object.values(chartBaseColors).map(hex => shadeColor(hex, alpha)))
.flat()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taken from analytics, this creates an array of 100 colors from the original 20, with darker and ligher shades applied

@@ -64,6 +64,7 @@
"eslint-plugin-react-hooks": "4.6.0",
"factory.ts": "1.4.1",
"http-server": "14.1.1",
"highcharts": "12.1.2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installed for Options type, other features tree shaken out by vite

@jared-dickman jared-dickman merged commit 588bebe into main Jan 31, 2025
12 checks passed
mparticle-automation added a commit that referenced this pull request Jan 31, 2025
# [1.38.0-chore-update-upload-artifact.1](v1.37.2...v1.38.0-chore-update-upload-artifact.1) (2025-01-31)

### Features

* highcharts configs ([#534](#534)) ([588bebe](588bebe))
@mparticle-automation
Copy link
Collaborator

🎉 This PR is included in version 1.38.0-chore-update-upload-artifact.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

mparticle-automation added a commit that referenced this pull request Jan 31, 2025
# [1.38.0](v1.37.2...v1.38.0) (2025-01-31)

### Features

* highcharts configs ([#534](#534)) ([588bebe](588bebe))
@mparticle-automation
Copy link
Collaborator

🎉 This PR is included in version 1.38.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants