Documentation / Product UI

Data visualization

Load for charts, KPI tiles, sparklines, maps, reports and any screen that turns numbers into a judgment.

skills/design-skill/references/data-visualization.md

Load for charts, KPI tiles, sparklines, maps, reports and any screen that turns numbers into a judgment. Pair with product UI for dashboards and color for palettes. Requirement = correctness/accessibility obligation; Pattern = adaptable starting point; Taste hypothesis = design judgment to validate in context.

1. Choose the form from the question

Start with the question, not the chart type

  • Confidence Level: Pattern
  • Purpose: Make every chart answer something.
  • Reasoning: Charts picked for variety ("let's add a donut") decorate instead of inform.
  • Constraint: Write the question the reader brings, then pick the simplest form that answers it.
Question Use Avoid
How is one number doing? Big number + delta + comparison period; sparkline if shape matters Gauge, single-value donut
How does it change over time? Line (continuous), column (discrete periods, under ~20 bars) Area stacks with many series, 3D
How do categories compare? Horizontal bar, sorted by value, labels on the left Pie with more than 3 slices, radar
What is the share of a whole? Stacked bar or 100% bar; a pie/donut only for 2–3 parts Many-slice pie
How is it distributed? Histogram, box/strip plot Bar of averages hiding spread
How do two measures relate? Scatter, optionally sized Dual-axis line
Where is it happening? Choropleth with normalised values, or a bar chart of regions Raw counts on a map (it just shows population)
How does a flow progress? Funnel as horizontal bars with step conversion Sankey for a simple funnel
What exactly is the value? A table Any chart
  • Example:
    • Bad: A seven-slice donut of revenue by plan, colours hard to tell apart.
    • Good: A sorted horizontal bar of revenue by plan with values at the bar ends.
  • Exceptions: Brand storytelling pages may use bespoke visuals if the reading stays accurate.

Tell the reader what to see

  • Confidence Level: Pattern
  • Purpose: Lower the effort to reach the insight.
  • Reasoning: A neutral title forces every reader to do the analysis again.
  • Constraint: In reports and narrative dashboards, title with the takeaway ("Churn halved after onboarding redesign") and put the metric name and unit in the subtitle. Annotate the event that explains a change directly on the chart. In exploratory tools where readers form their own judgment, use neutral descriptive titles.
  • Exceptions: Monitoring views use neutral labels.

2. Encoding and honesty

Keep scales truthful

  • Confidence Level: Requirement
  • Purpose: Avoid misleading readers.
  • Reasoning: Truncated baselines and inconsistent scales exaggerate change.
  • Constraint: Bar and area charts start at zero. Line charts may zoom the y-axis but must label it clearly. Small multiples share the same scale unless labelled otherwise. Do not use dual y-axes; use two aligned charts. Use the same period for comparisons and say which ("vs previous 7 days"). Label estimates, forecasts and incomplete periods (dashed line, lighter fill, "partial" label for the current week).
  • Exceptions: Log scales for data spanning orders of magnitude, clearly labelled.

Reduce ink, keep the data

  • Confidence Level: Pattern
  • Purpose: Let the data be the loudest element.
  • Reasoning: Heavy grids, borders and legends compete with the marks.
  • Constraint: Light horizontal gridlines only (border colour at low alpha), no vertical grid for time series, no chart borders or background fills, no 3D, no drop shadows. Axis text 11–12px muted; 4–6 ticks with round values. Label lines directly at their end instead of a legend when there are 2–5 series. Lines 1.5–2px; bars with 2–4px radius at the end only, gaps about 30–50% of bar width.
  • Exceptions: Print and presentation charts may need heavier weights.

3. Colour for data

Use palettes by data type

  • Confidence Level: Pattern
  • Purpose: Map colour to meaning.
  • Reasoning: Rainbow scales and brand-coloured categories make data harder to read and harder for colour-blind readers.
  • Constraint: Categorical: up to 6–8 distinct hues of similar lightness, ordered so adjacent series differ most; beyond eight, group into "Other" or use small multiples. Sequential (low→high): one hue varying lightness, light = low on light themes. Diverging (below/above a midpoint): two hues with a neutral middle, midpoint meaningful (zero, target, average). Highlight: grey everything, colour the one series the story is about. Never encode with red/green alone; add labels, position or shape. Check the palette with a colour-vision-deficiency simulator and against both theme backgrounds (3:1 for marks that carry meaning).
  • Example:
    • Bad: A rainbow heatmap where yellow, the brightest colour, sits in the middle of the range.
    • Good: A single-blue sequential scale with a labelled legend from 0 to 1,000.
  • Exceptions: Established domain conventions (election maps, terrain) when they are understood by the audience.

Status colours carry meaning only

  • Confidence Level: Requirement
  • Purpose: Keep semantic colours trustworthy.
  • Reasoning: If brand green and "healthy" green are the same, every green chart looks like good news.
  • Constraint: Reserve success, warning and danger hues for status. Do not use them as categorical series. Define which direction is good per metric (lower churn is good) so a falling line is not automatically red.
  • Exceptions: None.

4. Numbers and labels

Format numbers for humans

  • Confidence Level: Requirement
  • Purpose: Make values readable and comparable.
  • Reasoning: "1234567.891" in a tile is noise; inconsistent decimals look like errors.
  • Constraint: Use Intl.NumberFormat with the user's locale. Abbreviate large numbers in tiles and axes (1.2M, 34.5K) but show the full value in tooltips and tables. Same decimal places within a column or series. Percentages: 0 decimals for big shares, 1 for small changes. Always show units and currency. Deltas carry a sign and an arrow plus words ("+12%", "↓ 3 pts"). Use tabular-nums wherever numbers update or align. Dates: relative for recent events ("5 min ago") with the absolute time on hover/focus; absolute and unambiguous elsewhere ("12 Mar 2026").
  • Exceptions: Scientific and financial contexts may require exact precision everywhere.

5. Interaction and access

Tooltips, states and alternatives

  • Confidence Level: Requirement
  • Purpose: Make exact values available to everyone.
  • Reasoning: Hover-only tooltips exclude keyboard, touch and screen-reader users.
  • Constraint: Tooltips follow the nearest point on the x-axis (crosshair) rather than requiring a precise hover; show all series values at that x, sorted, with series colour keys. Make the chart focusable with arrow-key navigation, or provide the data as a table (visible toggle or visually hidden). Give the chart an accessible name and a short text summary of the takeaway. Loading: a skeleton at final size. Empty: say there is no data for the period and suggest a wider range. Error: explain and retry. Keep chart geometry stable while data loads.
  • Example:
    • Bad: A canvas chart with no text alternative and tooltips only on hover over 4px dots.
    • Good: A crosshair tooltip, "View as table" toggle and aria-label="Weekly signups, up 18% over 8 weeks".
  • Exceptions: Decorative sparklines inside a tile that already states the value can be aria-hidden.

Responsive charts

  • Confidence Level: Pattern
  • Purpose: Keep charts legible on small screens.
  • Reasoning: Shrinking a desktop chart makes labels collide.
  • Constraint: Reduce ticks and series on narrow widths, rotate to horizontal bars instead of tilting labels, move direct labels or legends below the chart, and let detailed charts link to a full-screen view. Minimum chart height about 200px on mobile.
  • Exceptions: None.

6. Data visualization checklist

  1. The chart type matches the question; a table would not be clearer.
  2. Title states the takeaway or the neutral metric; units and period are visible.
  3. Bars start at zero; comparisons share periods and scales; partial data is marked.
  4. Palette matches the data type, survives colour-vision simulation and both themes.
  5. Numbers are localised, abbreviated consistently and tabular.
  6. Exact values are reachable without hover; the chart has an accessible name and summary.
  7. Loading, empty and error states keep the chart's size.

Guides & section titles

IntroductionWhat Design Skill does and when to use it.What is Design Skill?IntroductionHow to think about itIntroductionStart buildingIntroductionInstallationAdd Design Skill to your coding assistant.Install with the skills CLIInstallationInstall from a local checkoutInstallationVerify the installationInstallationDesign workflowFrom understanding the product to inspecting the result.Understand and chooseDesign workflowCompose and expressDesign workflowBuild and interactDesign workflowVerify and reviseDesign workflowCommands & promptsWays to ask your assistant to use Design Skill.Request conventionsCommands & promptsAn example briefCommands & promptsGuidance & exceptionsUnderstand requirements, patterns and design judgment.Instruction rolesGuidance & exceptionsWhen to break a patternGuidance & exceptionsResearch with referencesGuidance & exceptionsSkill filesRead the actual Markdown included in the skill.Explore the sourceSkill filesLoad guidance selectivelySkill filesSkill libraryEvery file in the skill, rendered from the same Markdown and CSS your assistant reads.Start hereSkill libraryDirection & compositionSkill libraryVisual craftSkill libraryProduct UISkill libraryBuild & behaviorSkill libraryQualitySkill libraryCSS kitsSkill libraryCustomizationAdapt Design Skill to your brand and project.Bring your own directionCustomizationWrite useful constraintsCustomizationPair with Glaze componentsCustomizationTroubleshootingResolve installation, discovery and output issues.The assistant cannot find Design SkillTroubleshootingThe result feels genericTroubleshootingCopy or theme is unavailableTroubleshootingVerificationCheck the implementation and report evidence honestly.Before shippingVerificationEvaluating the skillVerificationCurrent evidence limitsVerificationSources & licenseAttribution, license and reference use.Source acknowledgmentsSources & licenseMIT licenseSources & licenseSKILL.mdThe entry point: workflow, instruction roles, what to load when and the four request modes.Instruction rolesSKILL.mdWorkflowSKILL.mdLoad selectivelySKILL.mdCommands (assistant request conventions)SKILL.mdCoherence without samenessSKILL.mdCategory playbookLoad at the start of any landing, marketing or brand page.Technical productsCategory playbookConsumer apps and servicesCategory playbookCommerceCategory playbookLocal businesses and servicesCategory playbookCreative work and peopleCategory playbookEvents, community and causesCategory playbookCombining rowsCategory playbookStyle directionsLoad after the category playbook suggests directions, or whenever a page needs a defined look.1. Clean productStyle directions2. Dark technicalStyle directions3. Luminous AIStyle directions4. EditorialStyle directions5. Warm organicStyle directions6. Luxury refinedStyle directions7. Bold expressiveStyle directions8. PlayfulStyle directions9. Brutalist rawStyle directions10. Retro nostalgicStyle directions11. Trust and clarityStyle directions12. Cinematic immersiveStyle directions13. Commerce catalogStyle directionsLanding page compositionLoad when building or redesigning a landing, marketing, launch or waitlist page.Pick one hero patternLanding page compositionHero anatomyLanding page compositionSection libraryLanding page compositionBento gridsLanding page compositionKeep it honestLanding page compositionLanding-page reference researchLoad when exploring reference libraries or real landing pages to inform a composition.Research the question, not the trendLanding-page reference researchTranslate observation into a decisionLanding-page reference researchCompose around evidenceLanding-page reference researchKeep rights separate from inspirationLanding-page reference researchOptional research sourcesLanding-page reference researchDirection, composition and assetsLoad when choosing a visual direction, comparing compositions or sourcing images, fonts and other assets.Compare meaningful directionsDirection, composition and assetsChoose a personality carrierDirection, composition and assetsUse references responsiblyDirection, composition and assetsComposition and layoutLoad when setting hierarchy, proportions, density and depth on any screen.Compose before polishingComposition and layoutCoherent roles, varied screensComposition and layoutDepth must preserve usabilityComposition and layoutVisual craft baselineLoad for any marketing page, landing page, portfolio or product screen where visual quality matters, and whenever the project has no established design system.1. TypographyVisual craft baseline2. Space and layoutVisual craft baseline3. SurfacesVisual craft baseline4. ColourVisual craft baseline5. ControlsVisual craft baseline6. The visualVisual craft baseline7. Motion detailVisual craft baseline8. Craft checklist before shippingVisual craft baselineStarter kitLoad when building a landing page, marketing page or product screen without an existing design system.TokensStarter kitComponentsStarter kitHero markupStarter kitSectionsStarter kitProduct kitStarter kitTailwind mappingStarter kitAfter buildingStarter kitTypographyLoad when choosing typefaces, setting type hierarchy and rhythm, or loading fonts.Choose for actual contentTypographySet hierarchy and rhythmTypographyLoad fonts responsiblyTypographyColor roles and contrastLoad when defining colour roles, palettes, contrast or light and dark themes.Choose roles before countsColor roles and contrastMeasure contrast in contextColor roles and contrastDeliberate themesColor roles and contrastBuild palettes systematicallyColor roles and contrastDesign tokens, theming and dark modeLoad when setting up or extending a design system, adding dark mode or themes, mapping a design into Tailwind/shadcn/CSS variables, or auditing hard-coded values.1. Token architectureDesign tokens, theming and dark mode2. Colour scalesDesign tokens, theming and dark mode3. Dark modeDesign tokens, theming and dark mode4. Mapping tokens into common stacksDesign tokens, theming and dark mode5. Tokens checklistDesign tokens, theming and dark modeIcons, images and mediaLoad when choosing icons, placing photography, screenshots, logos, avatars, video or illustration, and when optimising media.1. IconsIcons, images and media2. Images and photographyIcons, images and media3. Logos, avatars and brand marksIcons, images and media4. Delivering mediaIcons, images and media5. Media checklistIcons, images and mediaBackgrounds and surfacesLoad when choosing page surfaces, background imagery, gradients or textures.Choose from the contentBackgrounds and surfacesLayer without obscuringBackgrounds and surfacesProduct UI: apps, dashboards and toolsLoad for any logged-in product surface: web apps, dashboards, admin panels, internal tools, settings, editors, developer tools and data-heavy screens.1. Start from the jobProduct UI: apps, dashboards and tools2. The app shellProduct UI: apps, dashboards and tools3. Common screensProduct UI: apps, dashboards and tools4. Feedback and system statusProduct UI: apps, dashboards and tools5. Product craft checklistProduct UI: apps, dashboards and toolsForms, input and validationLoad for sign-up, checkout, settings, onboarding, search, filters, multi-step flows and any screen where people type or choose.1. FieldsForms, input and validation2. ValidationForms, input and validation3. Structure and flowForms, input and validation4. Special inputsForms, input and validation5. Forms checklistForms, input and validationData visualizationLoad for charts, KPI tiles, sparklines, maps, reports and any screen that turns numbers into a judgment.1. Choose the form from the questionData visualization2. Encoding and honestyData visualization3. Colour for dataData visualization4. Numbers and labelsData visualization5. Interaction and accessData visualization6. Data visualization checklistData visualizationComponents and interaction statesLoad when designing or reviewing individual components and their interaction states.Choose structure from the taskComponents and interaction statesState behavior is part of designComponents and interaction statesFocused patterns (adapt to actual content)Components and interaction statesUX writing and contentLoad whenever the interface has words: headlines, buttons, labels, errors, empty states, notifications, onboarding, pricing and confirmation dialogs.1. Real words firstUX writing and content2. Interface textUX writing and content3. Voice, tone and formatUX writing and content4. Internationalisation-ready copyUX writing and content5. UX writing checklistUX writing and contentFunctioning implementationLoad when building UI in code: states, data flow, persistence and project boundaries.Build the whole relevant flowFunctioning implementationKeep state and response coherentFunctioning implementationRespect provenance and project boundariesFunctioning implementationConditional stack guidanceLoad when the work touches a specific stack such as React, Next.js, Vue, Svelte, Tailwind or shadcn/ui.Use the actual projectConditional stack guidanceFramework-specific implementationConditional stack guidanceInteraction and motionLoad when adding transitions, animation, gestures or any movement.Decide whether to animateInteraction and motionHandle interruption and originsInteraction and motionGestures and reduced motionInteraction and motionMeasure animation performanceInteraction and motionResponsive behaviorLoad when making layouts work across widths, zoom levels, touch and long content.Break at content pressureResponsive behaviorOverflow deliberatelyResponsive behaviorMobile navigation and touchResponsive behaviorAccessibilityLoad for every interface: keyboard, focus, semantics, names, contrast, targets and user preferences.Concrete patternsAccessibilityAccessibility checklistAccessibilityFrontend performanceLoad when building pages that must feel fast, adding fonts, images, video, shaders or heavy client code, or when an audit reports slowness.1. TargetsFrontend performance2. Loading (LCP)Frontend performance3. Stability (CLS)Frontend performance4. Responsiveness (INP)Frontend performance5. Weight and effectsFrontend performance6. Performance checklistFrontend performanceAvoid unconsidered defaultsLoad when output risks looking generic, or when reviewing for unconsidered defaults.Question defaults, not vocabulariesAvoid unconsidered defaultsShow something trueAvoid unconsidered defaultsEarn the decorationAvoid unconsidered defaultsCommon tells of unconsidered outputAvoid unconsidered defaultsVerify rendered resultsLoad before reporting work as done: rendered checks, measurement and honest evidence.Inspect, revise, repeatVerify rendered resultsMeasure and qualifyVerify rendered resultsEvaluate the skill fairlyVerify rendered resultsAudit rubricLoad for /design-skill audit, design reviews, pre-launch checks and "why does this look off?" questions.1. How to auditAudit rubric2. What to scoreAudit rubric3. SeverityAudit rubric4. Report formatAudit rubric5. Quick triage (five-minute pass)Audit rubricstarter.cssLanding-page kit: tokens, header, hero, frames, bento, pricing, FAQ, footer and twelve direction presets.How to usestarter.cssSourcestarter.cssproduct.cssProduct kit: app shell, forms, tables, badges, alerts, tabs, dialogs, toasts, density modes and dark tokens.How to useproduct.cssSourceproduct.css
Tab to move · Enter to open · Esc to close