Using CSS Variables in JS
✓ Published0🌍 Public
This interactive scatter plot demonstrates dynamic theme switching through CSS variables. A menu lets users toggle between three color palettes—ggplot, Tableau 10, and BBC Primary—with selections persisted via localStorage. D3’s `select`, `join`, and event handlers render six circles positioned from static data, while `getComputedStyle` reads the active theme’s CSS custom properties to update fill colors on each theme change.
AI-generated descriptionMIT Licensed