feat(#612): Intelligent Color Scheme Generation for data visualizations#708
Open
temi-Dee wants to merge 1 commit into
Open
feat(#612): Intelligent Color Scheme Generation for data visualizations#708temi-Dee wants to merge 1 commit into
temi-Dee wants to merge 1 commit into
Conversation
Implement AI/ML-assisted color scheme generation for data visualizations.
- Add IntelligentColorSchemeGenerator (src/lib/intelligentColorScheme.ts)
- Color theory–based palette generation: complementary, analogous, triadic,
split-complementary, tetradic, monochromatic harmonies
- WCAG accessibility constraint checking via themeTypes helpers
- Preference learning via localStorage (tracks selections to bias future
recommendations with recency-weighted exponential decay)
- Data-characteristic aware generation: categorical, sequential, diverging
- Synchronous, deterministic, sub-50ms generation
- enforceAccessibility() method to adjust colors to meet WCAG target
- generateChartColors() helper for drop-in chart integration
- Add useColorScheme React hook (src/hooks/useColorScheme.ts)
- Wraps the generator with React state
- Exposes regenerate(), applyScheme(), enforceAccessibility()
- Syncs preferences on window focus
- Integrate with themeTypes.ts
- generateChartColorsForTheme() (async, uses the full generator)
- generateChartColorsForThemeSync() (sync, suitable for rendering hot paths)
- Export useColorScheme from src/hooks/index.ts barrel
- Add 48 unit tests (all passing, < 50ms generation verified)
Closes Nanle-code#612
|
@temi-Dee is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@temi-Dee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #612 — AI/ML-assisted intelligent color scheme generation for data visualizations.
Changes
New:
src/lib/intelligentColorScheme.tsCore generator class
IntelligentColorSchemeGeneratorwith:calculateContrastRatio/getWCAGLevelfromthemeTypes.ts; configurable minimum WCAG levelNew:
src/hooks/useColorScheme.tsReact hook exposing
scheme,allSchemes,regenerate(),applyScheme(),enforceAccessibility().Modified:
src/styles/themeTypes.tsAdded
generateChartColorsForTheme()(async) andgenerateChartColorsForThemeSync()(sync).Modified:
src/hooks/index.tsExports
useColorSchemefrom the barrel.New:
tests/unit/lib/intelligentColorScheme.test.ts48 unit tests — all passing.
Test Results
Closes #612