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: basic theme builder layout with qualitative scale customization #2926

Merged

Conversation

ramenhog
Copy link
Contributor

Description

This adds some basic functionality and layout updates for the theme builder app:

  • Allows user to choose from predefined themes
  • Allows user to customize a theme's qualitative color scale
  • Adds 2 preview charts (stacked area and stacked bar) that updates their themes accordingly as the selected theme changes

Screen recording:

(Doesn't show the native color picker UI dropdown 🥲)

2024-10-21 11 26 24

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested on Chrome, desktop

Copy link

changeset-bot bot commented Oct 21, 2024

⚠️ No Changeset found

Latest commit: a407f6f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Oct 21, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
victory ⬜️ Ignored (Inspect) Oct 21, 2024 3:28pm

@ramenhog ramenhog requested a review from carbonrobot October 21, 2024 15:30
Copy link
Member

@nlkluth nlkluth left a comment

Choose a reason for hiding this comment

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

few small questions. no blockers!

.writeText(JSON.stringify(config, null, 2))
.then(() => {
setCopyStatus("Copied successfully.");
return "Theme config copied to clipboard";
Copy link
Member

Choose a reason for hiding this comment

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

Does this string get used at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not 😬 but the linter complains about .then() not returning anything, so I just put that in there.

</div>
<h2>Theme Config Preview</h2>
<pre style={codeStyles}>{JSON.stringify(config, null, 2)}</pre>
<button onClick={handleClose} style={closeButtonStyles}>
Copy link
Member

Choose a reason for hiding this comment

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

maybe an aria-label here 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I'll fix this in my next PR


const ThemeBuilder = () => {
const [activeTheme, setActiveTheme] = React.useState<ThemeOption>(themes[0]);
const [activeColorScale] = React.useState<ColorScalePropType | undefined>(
Copy link
Member

Choose a reason for hiding this comment

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

can this state be removed? doesn't look like it's being changed anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to add a handler for adjusting the color scale in my next PR so I added this for now so that the charts could read from this state.

@ramenhog ramenhog merged commit dac4af3 into feat/theme-builder-setup Oct 22, 2024
2 checks passed
@ramenhog ramenhog deleted the feat/theme-builder-basic-functionality branch October 22, 2024 17:09
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