@thanhnguyxn/pixelcraft 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +22 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/LICENSE +21 -0
- package/README.md +264 -2
- package/SECURITY.md +28 -0
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +852 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/DESIGN-RATIONALE.md +191 -0
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +37 -0
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +74 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +76 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +77 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +73 -0
- package/evals/pixelcraft-plan.md +127 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +86 -0
- package/evals/pixelcraft-web.md +89 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +6 -0
- package/install.ps1 +341 -0
- package/install.sh +512 -0
- package/package.json +91 -4
- package/plugin.json +29 -0
- package/scripts/build-adapters.mjs +288 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +61 -0
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +203 -0
- package/scripts/test-export-tokens.mjs +361 -0
- package/scripts/test-finish-gate.mjs +271 -0
- package/scripts/test-installers.mjs +216 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +87 -0
- package/scripts/test-slop-scan.mjs +416 -0
- package/scripts/test-style-inventory.mjs +234 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +195 -0
- package/scripts/validate-skills.mjs +658 -0
- package/skills/pixelcraft/SKILL.md +155 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +90 -0
- package/skills/pixelcraft/references/report-template.md +49 -0
- package/skills/pixelcraft/references/stack-detection.md +226 -0
- package/skills/pixelcraft/references/surface-acceptance.md +52 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
- package/skills/pixelcraft-accessibility/SKILL.md +54 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
- package/skills/pixelcraft-accessibility/references/verification.md +64 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
- package/skills/pixelcraft-brandkit/SKILL.md +127 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
- package/skills/pixelcraft-constrained/SKILL.md +52 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
- package/skills/pixelcraft-craft/SKILL.md +58 -0
- package/skills/pixelcraft-craft/references/color.md +125 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +73 -0
- package/skills/pixelcraft-craft/references/motion.md +163 -0
- package/skills/pixelcraft-craft/references/typography.md +110 -0
- package/skills/pixelcraft-data-apps/SKILL.md +86 -0
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +109 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
- package/skills/pixelcraft-data-apps/references/panel.md +99 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
- package/skills/pixelcraft-dataviz/SKILL.md +60 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
- package/skills/pixelcraft-desktop/SKILL.md +93 -0
- package/skills/pixelcraft-desktop/references/appkit.md +92 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
- package/skills/pixelcraft-desktop/references/electron.md +96 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/gtk.md +97 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/tauri.md +110 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
- package/skills/pixelcraft-desktop/references/working-context.md +84 -0
- package/skills/pixelcraft-direction/SKILL.md +120 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +64 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +71 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +58 -0
- package/skills/pixelcraft-document/references/archetypes.md +106 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +187 -0
- package/skills/pixelcraft-document/references/slides.md +198 -0
- package/skills/pixelcraft-email/SKILL.md +80 -0
- package/skills/pixelcraft-email/references/client-quirks.md +113 -0
- package/skills/pixelcraft-email/references/html-tables.md +114 -0
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +54 -0
- package/skills/pixelcraft-email/references/react-email.md +95 -0
- package/skills/pixelcraft-extensions/SKILL.md +56 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +98 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
- package/skills/pixelcraft-game-ui/SKILL.md +80 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
- package/skills/pixelcraft-game-ui/references/godot.md +130 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +50 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +49 -0
- package/skills/pixelcraft-media/references/banners-video.md +130 -0
- package/skills/pixelcraft-media/references/og-generation.md +154 -0
- package/skills/pixelcraft-media/references/social-cards.md +71 -0
- package/skills/pixelcraft-mobile/SKILL.md +86 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
- package/skills/pixelcraft-mobile/references/flet.md +80 -0
- package/skills/pixelcraft-mobile/references/flutter.md +113 -0
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
- package/skills/pixelcraft-mobile/references/kivy.md +82 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
- package/skills/pixelcraft-mobile/references/uikit.md +92 -0
- package/skills/pixelcraft-patterns/SKILL.md +75 -0
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +47 -0
- package/skills/pixelcraft-patterns/references/communication.md +45 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +44 -0
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +51 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +103 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +134 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
- package/skills/pixelcraft-review/SKILL.md +86 -0
- package/skills/pixelcraft-review/references/audit-report.md +69 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +63 -0
- package/skills/pixelcraft-review/references/personas.md +53 -0
- package/skills/pixelcraft-review/references/polish.md +78 -0
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
- package/skills/pixelcraft-spatial/SKILL.md +51 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
- package/skills/pixelcraft-spatial/references/platforms.md +147 -0
- package/skills/pixelcraft-tokens/SKILL.md +60 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +84 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
- package/skills/pixelcraft-tui/SKILL.md +76 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +109 -0
- package/skills/pixelcraft-tui/references/ratatui.md +102 -0
- package/skills/pixelcraft-tui/references/rich.md +82 -0
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +108 -0
- package/skills/pixelcraft-ux/SKILL.md +56 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +151 -0
- package/skills/pixelcraft-ux/references/i18n.md +221 -0
- package/skills/pixelcraft-ux/references/laws.md +39 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
- package/skills/pixelcraft-web/SKILL.md +132 -0
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
- package/skills/pixelcraft-web/references/angular.md +108 -0
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +113 -0
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +88 -0
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +220 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +61 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +230 -0
- package/skills/pixelcraft-web/references/qwik.md +94 -0
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +168 -0
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +114 -0
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +111 -0
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +111 -0
- package/skills/pixelcraft-web/references/tailwind.md +99 -0
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-dataviz
|
|
3
|
+
description: Designs and verifies truthful, legible, accessible data visualization across any stack. Use for charts, plots, dashboards, analytics, scientific visualization, tables as visualization, streaming data, node graphs, maps/geospatial UI, rendering scale, and chart accessibility across D3, Observable Plot, Vega/Vega-Lite, ECharts, Chart.js, Highcharts, Recharts, Nivo, Tremor, visx, uPlot, Lightweight Charts, AntV, Plotly, MapLibre, Mapbox, Leaflet, deck.gl, Cesium, PMTiles, Turf, Cytoscape, Sigma.js, Cosmograph, Bokeh, Seaborn, matplotlib, Altair, Datashader, Perspective, Mosaic, ggplot2, Makie, Swift Charts, or Vico.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft dataviz
|
|
10
|
+
|
|
11
|
+
Data visualization is evidence communication, not dashboard decoration. Start with the analytical question and the decision it informs; choose the simplest encoding that preserves magnitude, uncertainty, freshness, and missingness. A technically impressive chart that misreads the data is a failed chart.
|
|
12
|
+
|
|
13
|
+
## Surface craft
|
|
14
|
+
|
|
15
|
+
Start with the judgment the reader must make and expose its comparison baseline, units, uncertainty, and missing values. Use annotations and ordered or small-multiple views when they remove comparison work. Verify the meaning survives monochrome, resizing, and keyboard access; provide a data or text alternative for canvas or hover-only details.
|
|
16
|
+
|
|
17
|
+
## References
|
|
18
|
+
|
|
19
|
+
- Read [references/chart-choice.md](references/chart-choice.md) when choosing among comparison, distribution, composition, relationship, time, flow, hierarchy, and geographic representations.
|
|
20
|
+
- Read [references/encoding-tables-dashboards.md](references/encoding-tables-dashboards.md) when designing encoding hierarchy, axes, units, direct labeling, annotations, tables as visualization, and analytical dashboard layout/density.
|
|
21
|
+
- Read [references/color-accessibility.md](references/color-accessibility.md) when selecting colorblind-safe palettes, redundant encodings, contrast, text alternatives, keyboard navigation, sonification boundaries, and reduced motion.
|
|
22
|
+
- Read [references/realtime-graphs-maps-scale.md](references/realtime-graphs-maps-scale.md) when implementing streaming updates, node graphs (`@xyflow/react`, Cytoscape, Sigma.js, Cosmograph, AntV G6), and SVG/Canvas/WebGL/WASM scale tiers (Perspective, Mosaic/DuckDB-Wasm, Datashader).
|
|
23
|
+
- Read [references/maps-geospatial.md](references/maps-geospatial.md) when selecting or implementing mapping and geospatial engines (MapLibre GL JS, Mapbox GL JS, Leaflet, OpenLayers, CesiumJS, deck.gl, kepler.gl), Protomaps/PMTiles, Turf.js spatial ops, choropleth pitfalls, or accessible map alternatives.
|
|
24
|
+
- Read [references/libraries.md](references/libraries.md) when implementing in a specific charting library or language ecosystem.
|
|
25
|
+
|
|
26
|
+
## Required workflow
|
|
27
|
+
|
|
28
|
+
1. **Question first.** Write the exact question in words: compare what, over what period, filtered how, measured in which unit, and what decision follows. Reject chart requests that have no readable question.
|
|
29
|
+
2. **Audit the data.** Inspect cardinality, type, units, timezone/calendar, nulls, zeros versus missing values, outliers, sampling rate, update latency, duplicate keys, precision, and whether values are counts/rates/estimates/cumulative totals.
|
|
30
|
+
3. **Choose the representation.** Use the chart-choice table; prefer small multiples or tables over overplotted multi-series charts. Do not let library defaults choose the chart.
|
|
31
|
+
4. **Encode explicitly.** Map columns to position/length/color/shape/facet intentionally. State what is quantitative, categorical, temporal, spatial, uncertainty, and metadata.
|
|
32
|
+
5. **Label for reading.** Prefer direct labels and concise annotations; show units, source scope, freshness, and baseline. Legends are fallback navigation, not the primary reading path.
|
|
33
|
+
6. **Implement idiomatically.** Use the platform/library reference without forcing browser assumptions into native, document, terminal, or notebook surfaces.
|
|
34
|
+
7. **Verify with real cardinality.** Test empty/one/few/many series, extreme values, long labels, null gaps, negative values, locale formatting, dark/high-contrast themes, keyboard/screen-reader path, resize/reflow, and update bursts.
|
|
35
|
+
|
|
36
|
+
## Non-negotiable rules
|
|
37
|
+
|
|
38
|
+
| Concern | Rule |
|
|
39
|
+
|---|---|
|
|
40
|
+
| truthfulness & downsampling | Never fabricate data, truncate magnitude bars, or downsample `10k–1M+` time-series with naive `every-Nth` slicing that erases incident spikes—use **`LTTB` (Largest-Triangle-Three-Buckets)** or **`Min-Max` pixel envelopes**, re-querying raw detail on zoom. |
|
|
41
|
+
| latency & query resilience | Render the **primary chart shell in `< 1–2 s`**, keep **filter, hover, cross-filter, and brush responses within `100–200 ms`**, and handle **concurrent multi-user load + explicit query timeouts/cancellation** cleanly without frozen spinners. |
|
|
42
|
+
| numeric semantics & `0` vs `null` | Enforce `font-variant-numeric: tabular-nums`, **True Minus `U+2212` (`−`)** on negative values, right-aligned numeric columns, explicit unit headers (`$ USD`, `ms`, `%`), and **strict visual separation between measured `0` and missing `null / — / N/A`** (break lines or render muted `—`; never coerce `null` to `0`). |
|
|
43
|
+
| provenance, definitions & SLA freshness | Display **visible data source attribution**, **metric definitions** (formula, scope, exclusions), explicit timezone (`UTC` vs local IANA zone), and a **Data Freshness / SLA Staleness badge** (`Updated 12s ago` escalating to warning/stale state when ingestion lags SLA). |
|
|
44
|
+
| baseline & monochrome | Bar/area magnitude charts include zero unless an explicit indexed/delta baseline is labeled; color never carries meaning alone—pair Okabe–Ito / Viridis palettes with direct labels, dash style, shape, or pattern so charts survive grayscale/CVD. |
|
|
45
|
+
| PII redaction & export safety | Hover/tooltips are progressive enhancement. **Mask/redact PII on chart tooltips, QA screenshots, and downloadable CSV/XLSX exports**, and neutralize **OWASP CSV/XLSX formula injection** (`=`, `+`, `-`, `@`, `\t`, `\r` prefixes). |
|
|
46
|
+
| accessibility | Every chart ships a **screen-reader accessible data-table / text summary fallback** plus **composite keyboard data-point navigation** (`<= 1` `Tab` stop + arrow keys across series/points). |
|
|
47
|
+
|
|
48
|
+
## Anti-slop warnings
|
|
49
|
+
|
|
50
|
+
Avoid the default analytics collage: four KPI cards with invented deltas, unattributed metrics without definitions or source provenance, a gradient area chart, a donut with unreadable slices, a purple-blue palette, unexplained "live" badges without SLA timestamps, naive `every-Nth` downsampled lines hiding outages, `null` plotted as `0`, and legends forcing constant eye travel. Distinctiveness belongs in editorial judgment, annotation quality, composition, and domain-specific emphasis—not in distorting evidence.
|
|
51
|
+
|
|
52
|
+
## Pre-submit checklist
|
|
53
|
+
|
|
54
|
+
- [ ] analytical question, unit (`$ USD`, `ms`, `%`), **visible data source attribution**, **metric definitions**, explicit timezone (`UTC` vs local), and **Data Freshness / SLA Staleness badge** are visible;
|
|
55
|
+
- [ ] **primary chart shell `< 1–2 s`**, **filter/hover/brush response `100–200 ms`**, **concurrent multi-user load + query timeout recovery**, and **`LTTB` / `Min-Max`** dense downsampling verified;
|
|
56
|
+
- [ ] numeric columns/labels enforce `tabular-nums`, right alignment, **True Minus `U+2212` (`−`)**, and strict **`0` vs `null / — / N/A`** distinction;
|
|
57
|
+
- [ ] direct labels or annotations carry the primary reading path; palette is CVD/grayscale-safe with redundant non-color encoding;
|
|
58
|
+
- [ ] **PII masking/redaction** enforced on screenshots and exports, and CSV/XLSX exports escape leading `=`, `+`, `-`, `@`, `\t`, `\r` against formula injection;
|
|
59
|
+
- [ ] **screen-reader accessible data-table / text summary fallback + keyboard data-point navigation** verified;
|
|
60
|
+
- [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, and `check-acceptance.mjs .pixelcraft/acceptance.json` (`pixelcraft-review`) in a `Fix → Re-verify` loop until passing (`0` `fail`/`pending` rows, `rendered` evidence at real cardinality per `Rule #0.3`).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Choosing a chart by analytical question
|
|
2
|
+
|
|
3
|
+
Choose the question before the geometry. Several correct charts can answer one question; choose the one with the least decoding work for the intended audience and data shape.
|
|
4
|
+
|
|
5
|
+
## Core choice table
|
|
6
|
+
|
|
7
|
+
| Analytical question | First candidates | Use when | Avoid / correct common misuse |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| Compare categories | horizontal/vertical bar, dot plot, lollipop, grouped bar | discrete categories or ranked values; horizontal bars for long labels | Don't use a line for unordered categories; don't sort alphabetically when magnitude/rank matters. |
|
|
10
|
+
| Change over time | line, slope, step line, column, small-multiple lines | continuous time or ordered periods; line for trend, columns for discrete period totals | Don't connect missing observations across gaps silently; don't use dual y-axes merely to fit two scales. |
|
|
11
|
+
| Distribution | histogram, density strip, box plot, violin, empirical cumulative distribution | spread, skew, outliers, quantiles matter | Don't average away distribution; don't use bins that hide multimodality—test several bin widths. |
|
|
12
|
+
| Composition of a total | stacked bar, 100% stacked bar, treemap, pie only for 2–5 familiar parts | part-to-whole at one or a few times | Don't use many-slice pies/donuts; angles/areas are weak for comparison. Use ranked bars for exact comparison. |
|
|
13
|
+
| Relationship/correlation | scatterplot, bubble only for a third quantitative variable, hexbin/2D density for overplotting | two numeric variables per observation | Don't imply causation; don't use bubbles when area differences are not meaningful. |
|
|
14
|
+
| Flow between stages/entities | funnel for ordered conversion stages; Sankey for conserved flow; waterfall for additive change | quantities move through stages or split/recombine | Don't force cyclic/non-conserved networks into funnels; label leakage/dropoff honestly. |
|
|
15
|
+
| Geographic pattern | point/symbol map, choropleth for normalized regional rates, cartogram, hex/tile grid map | location itself is the comparison key | Don't choropleth raw counts where population drives values; don't use color-filled regions for sparse point events. |
|
|
16
|
+
| Hierarchy/partition | tree, icicle, sunburst, treemap | structure and containment matter more than exact comparison | Don't use deep circular layouts when labels cannot fit; provide breadcrumb/table fallback. |
|
|
17
|
+
| Rank/order | ordered bar, dot plot, slope chart | position/rank or change in rank matters | Don't hide ties or unstable confidence intervals. |
|
|
18
|
+
| Uncertainty/estimate | point + interval, fan chart, error bars, quantile bands | confidence/credible/prediction interval matters | Never present forecast/estimate as observed fact; label interval definition. |
|
|
19
|
+
|
|
20
|
+
## Match geometry to data type
|
|
21
|
+
|
|
22
|
+
- **Nominal categories:** position on a shared baseline is strongest. Sort intentionally: magnitude, semantic order, or alphabetically only for lookup.
|
|
23
|
+
- **Ordinal categories:** preserve intrinsic order before magnitude sorting.
|
|
24
|
+
- **Time:** check missing intervals, irregular sampling, timezone boundaries, daylight-saving transitions, fiscal versus calendar periods, and whether trailing periods are complete.
|
|
25
|
+
- **Quantitative values:** distinguish absolute values, rates, ratios, percentages, cumulative quantities, indexes, and uncertainty. Their axis labels must not be interchangeable.
|
|
26
|
+
- **Multiple series:** more than roughly 4–6 visually overlapping lines usually needs small multiples, filtering, aggregation, direct highlighting, or an interactive focus+context design. Measure actual legibility rather than obeying the number blindly.
|
|
27
|
+
- **High cardinality:** rank/aggregate the tail only when the remaining group is honestly labeled (“other”, “47 remaining suppliers”), and preserve expansion/drill-down.
|
|
28
|
+
|
|
29
|
+
## Composition traps
|
|
30
|
+
|
|
31
|
+
- Pie/donut charts are acceptable only when the number of parts is small, the whole is meaningful, and exact comparison is not required. Direct-label values and percentages; never rely on a detached legend.
|
|
32
|
+
- Stacked bars compare the first segment and total well, but middle segments poorly. Use small multiples or grouped bars when every segment matters.
|
|
33
|
+
- Treemap area is weak for precise comparison; use it for overview + drill-down, not exact ranking.
|
|
34
|
+
- Waterfall charts require unambiguous positive/negative color semantics and connector labels; do not use red/green as the only sign encoding.
|
|
35
|
+
|
|
36
|
+
## Time and comparison traps
|
|
37
|
+
|
|
38
|
+
- Dual-axis plots often manufacture correlation. Prefer indexed values, panels, ratio/difference plots, or a clear annotation of why shared scale is impossible.
|
|
39
|
+
- Smoothed lines must identify the smoothing window/method. Keep raw observations available when noise is meaningful.
|
|
40
|
+
- Slope charts work for two time points/conditions and few entities. They are not a substitute for a full time series.
|
|
41
|
+
- Area charts emphasize magnitude and accumulation; overlapping translucent areas become unreadable quickly. Stack only when the sum itself means something.
|
|
42
|
+
|
|
43
|
+
## Small multiples and tables
|
|
44
|
+
|
|
45
|
+
Use small multiples when group comparison matters more than cross-group overlay. Keep shared scales when magnitude comparison matters; use independent scales only for shape comparison and label that choice prominently.
|
|
46
|
+
|
|
47
|
+
Use a table when the user needs exact lookup, sorting, copying, row-level action, or comparison of a handful of values. “Chart or table?” is not a taste decision; it follows the task.
|
|
48
|
+
|
|
49
|
+
## Anti-slop checks
|
|
50
|
+
|
|
51
|
+
- A dashboard demo dataset (`sales`, `users`, `revenue`) is not evidence that the chart fits the user's domain.
|
|
52
|
+
- Gradients, glow, rounded bars, and dark-mode neon do not compensate for missing labels or meaningless metrics.
|
|
53
|
+
- Do not include a donut merely because the layout has an empty corner.
|
|
54
|
+
- Do not animate every number counting up unless the count-up explains temporal accumulation.
|
|
55
|
+
- Do not normalize away absolute magnitude without saying so.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Color and accessibility for data visualization
|
|
2
|
+
|
|
3
|
+
## Palette selection
|
|
4
|
+
|
|
5
|
+
Color supports decoding; it cannot be the only channel. Choose categorical, sequential, or diverging behavior intentionally—do not interpolate a categorical palette merely because it looks attractive.
|
|
6
|
+
|
|
7
|
+
### Categorical palettes
|
|
8
|
+
|
|
9
|
+
Use a palette tested against common color-vision deficiency. Okabe–Ito is a strong default for up to eight categories:
|
|
10
|
+
|
|
11
|
+
| Name | Hex |
|
|
12
|
+
|---|---|
|
|
13
|
+
| black | `#000000` |
|
|
14
|
+
| orange | `#E69F00` |
|
|
15
|
+
| sky blue | `#56B4E9` |
|
|
16
|
+
| bluish green | `#009E73` |
|
|
17
|
+
| yellow | `#F0E442` |
|
|
18
|
+
| blue | `#0072B2` |
|
|
19
|
+
| vermillion | `#D55E00` |
|
|
20
|
+
| reddish purple | `#CC79A7` |
|
|
21
|
+
|
|
22
|
+
Tableau 10 is another common tested set: `#4E79A7`, `#F28E2B`, `#E15759`, `#76B7B2`, `#59A14F`, `#EDC948`, `#B07AA1`, `#FF9DA7`, `#9C755F`, `#BAB0AC`.
|
|
23
|
+
|
|
24
|
+
Do not solve more than ~8–10 categories by inventing more hues. Use grouping, small multiples, direct highlighting, shapes, labels, filtering, or aggregation. Avoid red/green-only semantics even in these palettes; pair with shape/text.
|
|
25
|
+
|
|
26
|
+
### Sequential palettes
|
|
27
|
+
|
|
28
|
+
Use monotonic luminance for ordered magnitude. Viridis-family palettes are widely tested and print reasonably; example anchor colors include `#440154`, `#3B528B`, `#21918C`, `#5EC962`, and `#FDE725`. For a single-hue operational dashboard, use a controlled light-to-dark scale rather than rainbow interpolation. Do not use rainbow/jet: uneven luminance creates artificial bands and is difficult for color-vision deficiency.
|
|
29
|
+
|
|
30
|
+
### Diverging palettes
|
|
31
|
+
|
|
32
|
+
Use only when there is a meaningful midpoint (zero, target, neutral, parity). Anchor examples:
|
|
33
|
+
|
|
34
|
+
- blue–orange/red: `#2166AC` → `#F7F7F7` → `#B2182B`;
|
|
35
|
+
- purple–green: `#762A83` → `#F7F7F7` → `#1B7837`.
|
|
36
|
+
|
|
37
|
+
Make the endpoint meaning explicit and keep the center neutral. Positive/negative meaning also needs sign, position, icon, or line direction.
|
|
38
|
+
|
|
39
|
+
## Contrast and theme
|
|
40
|
+
|
|
41
|
+
- WCAG non-text contrast requires at least 3:1 for meaningful graphical objects and focus indicators.
|
|
42
|
+
- Normal text requires at least 4.5:1; large text at least 3:1 under WCAG 2.2 AA.
|
|
43
|
+
- Gridlines should be subordinate but still visible; never sacrifice data/background separation for aesthetic faintness.
|
|
44
|
+
- Test light, dark, forced-colors/high-contrast, grayscale/print, and projector conditions. Dark mode is not inverted saturation; re-balance luminance.
|
|
45
|
+
- Use patterns/hatching in monochrome print or SVG export where supported.
|
|
46
|
+
|
|
47
|
+
## Redundant encoding
|
|
48
|
+
|
|
49
|
+
Every categorical color used for meaning needs a redundant channel where practical:
|
|
50
|
+
|
|
51
|
+
- direct text label;
|
|
52
|
+
- line dash/width;
|
|
53
|
+
- point shape;
|
|
54
|
+
- icon/marker;
|
|
55
|
+
- pattern/texture;
|
|
56
|
+
- position/facet;
|
|
57
|
+
- annotation.
|
|
58
|
+
|
|
59
|
+
Redundant encoding is not clutter when sparse and systematic. Do not use random shape variety; map shapes consistently across the product.
|
|
60
|
+
|
|
61
|
+
## Text alternatives
|
|
62
|
+
|
|
63
|
+
Every chart needs a textual route to the information. Choose depth based on complexity:
|
|
64
|
+
|
|
65
|
+
1. concise chart summary: question, main pattern, magnitude/rank, uncertainty/freshness;
|
|
66
|
+
2. accessible data table/list with the underlying rows or aggregated equivalent;
|
|
67
|
+
3. structured point/series navigation for interactive charts;
|
|
68
|
+
4. downloadable CSV/JSON where users need independent analysis.
|
|
69
|
+
|
|
70
|
+
A bare `role="img"` or `aria-label="chart"` is not access. Describe the message (“Revenue rose 18% after March, driven by…”) and provide the data. Do not expose thousands of rows directly to a screen reader without pagination/filtering/aggregation.
|
|
71
|
+
|
|
72
|
+
## Keyboard and focus interaction
|
|
73
|
+
|
|
74
|
+
Interactive visualization must define:
|
|
75
|
+
|
|
76
|
+
- entry into the chart region versus ordinary Tab flow;
|
|
77
|
+
- arrow-key movement across points/bars/cells where point navigation matters;
|
|
78
|
+
- Home/End/PageUp/PageDown semantics for large series;
|
|
79
|
+
- visible focus indicator and synchronized tooltip/crosshair;
|
|
80
|
+
- Escape behavior for popovers/modes;
|
|
81
|
+
- legend/filter/keyboard equivalent;
|
|
82
|
+
- focus restoration after zoom/filter/data refresh.
|
|
83
|
+
|
|
84
|
+
Do not construct hundreds of Tab stops. Prefer one composite widget with roving focus/internal arrow keys when point-by-point exploration is required. **Highcharts' `accessibility` module** is a useful benchmark pattern for this interaction model: it provides composite roving keyboard navigation across series and points, auto-generated screen-reader descriptions, an optional synchronized data table, and high-contrast pattern fills.
|
|
85
|
+
|
|
86
|
+
## Screen readers and live data
|
|
87
|
+
|
|
88
|
+
- Do not announce every streaming tick. Summarize meaningful state changes at a controlled cadence and provide a pause control.
|
|
89
|
+
- Use polite live regions only for consequential alerts; assertive announcements are for urgent failures.
|
|
90
|
+
- Keep chart summaries synchronized with filtered/visible data.
|
|
91
|
+
- Ensure auto-generated SVG `<title>`/ARIA labels do not contradict custom descriptions.
|
|
92
|
+
|
|
93
|
+
## Sonification boundary
|
|
94
|
+
|
|
95
|
+
Sonification can help users perceive trend, rhythm, and outliers, but support varies widely and it is never a WCAG substitute for textual/tabular access. **Highcharts' `sonification` module** illustrates the right boundary: opt-in audio playback, explicit play/pause and speed controls, configurable pitch/instrument mapping, and spoken context cues, always paired with primary visual, keyboard, and tabular equivalents. Never autoplay sound.
|
|
96
|
+
|
|
97
|
+
## Motion and cognitive load
|
|
98
|
+
|
|
99
|
+
- Animate only meaningful object constancy, filtering, zoom context, or incoming data.
|
|
100
|
+
- Respect reduced-motion settings; replace interpolation with instant/static updates.
|
|
101
|
+
- Avoid looping pulses except for genuinely time-critical live state; provide pause/stop.
|
|
102
|
+
- Keep transition durations short enough not to block scanning; long animation is not a loading state replacement.
|
|
103
|
+
|
|
104
|
+
## Verification checklist
|
|
105
|
+
|
|
106
|
+
- [ ] palette tested with color-vision-deficiency simulation or a tested palette/redundant encoding;
|
|
107
|
+
- [ ] text/non-text contrast measured in the actual theme;
|
|
108
|
+
- [ ] chart summary and data table reflect current filters;
|
|
109
|
+
- [ ] keyboard-only user can reach equivalent insight;
|
|
110
|
+
- [ ] screen-reader output reviewed or explicitly labeled `not-checked`;
|
|
111
|
+
- [ ] forced-colors/print/grayscale behavior inspected;
|
|
112
|
+
- [ ] sonification, if present, is optional and never the only access path.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Encoding, labeling, tables, and dashboards
|
|
2
|
+
|
|
3
|
+
## Encoding hierarchy
|
|
4
|
+
|
|
5
|
+
Approximate perceptual effectiveness for quantitative reading, strongest first:
|
|
6
|
+
|
|
7
|
+
1. position on a common scale;
|
|
8
|
+
2. position on aligned but noncommon scales;
|
|
9
|
+
3. length/height;
|
|
10
|
+
4. angle/slope;
|
|
11
|
+
5. area;
|
|
12
|
+
6. volume/3D depth;
|
|
13
|
+
7. color saturation/luminance;
|
|
14
|
+
8. hue alone.
|
|
15
|
+
|
|
16
|
+
Choose the strongest available channel for the most important variable. Do not encode the primary magnitude with hue while using x/y position for a less important dimension. Never use 3D perspective in ordinary statistical charts: depth distorts length and area.
|
|
17
|
+
|
|
18
|
+
Reserve channels deliberately:
|
|
19
|
+
|
|
20
|
+
| Channel | Good use | Misuse |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| x/y position | primary quantitative or ordered variable | jitter/random placement without explanation |
|
|
23
|
+
| length | magnitudes with shared baseline | truncated bars |
|
|
24
|
+
| hue | limited categories/series identity | continuous quantity or dozens of categories |
|
|
25
|
+
| luminance/saturation | ordered intensity/density | unrelated categories |
|
|
26
|
+
| shape/line style | redundant category encoding | decorative variety |
|
|
27
|
+
| size/area | true third quantitative variable | emphasis without scale legend |
|
|
28
|
+
| motion | object constancy during meaningful transitions | looping decoration |
|
|
29
|
+
|
|
30
|
+
## Axes, scales, and baselines
|
|
31
|
+
|
|
32
|
+
- Bar/column/area charts require a zero baseline because length/area encodes magnitude. If a nonzero baseline is semantically required, transform the value explicitly (for example “change since baseline”) and label it.
|
|
33
|
+
- Line charts need not start at zero when the question is local variation, but the axis range must not exaggerate noise. State units and relevant baseline/reference lines.
|
|
34
|
+
- Use logarithmic scales only when ratios/orders of magnitude are the question. Label the log scale and never silently mix log/linear panels.
|
|
35
|
+
- Use consistent scale domains in small multiples when comparing magnitude. Independent scales are for shape comparison only and must say so.
|
|
36
|
+
- Show uncertainty intervals with the same visual priority as estimates when decisions depend on them.
|
|
37
|
+
- Do not drop outliers silently. Clamp only with visible broken-axis/overflow notation or provide a scale toggle.
|
|
38
|
+
|
|
39
|
+
## Direct labels before legends
|
|
40
|
+
|
|
41
|
+
Prefer in order:
|
|
42
|
+
|
|
43
|
+
1. direct series/end-point labels;
|
|
44
|
+
2. labels in a consistent side rail aligned by position;
|
|
45
|
+
3. annotated representative values;
|
|
46
|
+
4. interactive tooltip as supplemental detail;
|
|
47
|
+
5. separate legend.
|
|
48
|
+
|
|
49
|
+
Legends force eye travel and color-memory lookup. When one is unavoidable, make it keyboard/touch operable, use the same ordering as visual end positions where practical, and pair color with line style/shape/text. Do not let legend toggling be the only way to understand series identity.
|
|
50
|
+
|
|
51
|
+
Annotation should answer “what should I notice?” Use sparse domain-specific callouts: threshold crossed, abnormal event, missing feed, target/benchmark, confidence boundary. Remove annotations that merely restate axis values.
|
|
52
|
+
|
|
53
|
+
When two percentage series answer related but different questions, repeat their denominators in local labels rather than writing only “share” or distinguishing them by hue. If a comparison becomes a stack on phones, keep the order, date range, denominator and common domain close to each value. Verify that a reader can explain which group each percentage describes without hover or looking back to the desktop legend.
|
|
54
|
+
|
|
55
|
+
## Honest numeric semantics, timezone, and SLA freshness
|
|
56
|
+
|
|
57
|
+
- **Explicit unit headers & axis labels**: put exact units and currency codes in column headers or axis titles (`Revenue ($ USD)`, `P99 Latency (ms)`, `Error Rate (%)`), never hidden exclusively inside hover tooltips.
|
|
58
|
+
- **`tabular-nums` + True Minus `U+2212` (`−`)**: apply `font-variant-numeric: tabular-nums lining-nums` on every numeric column, KPI, tick, and live counter, and render negative numbers with **True Minus `U+2212` (`−`)** rather than ASCII hyphen-minus `U+002D` (`-`) so `−` matches `+` glyph width and optical crossbar height:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
export function formatMetric(value: number | null | undefined, unit = ''): string {
|
|
62
|
+
if (value === null || value === undefined || Number.isNaN(value)) return '—'; // never coerce null to 0
|
|
63
|
+
const formatted = new Intl.NumberFormat('en-US', { maximumFractionDigits: 2 }).format(Math.abs(value));
|
|
64
|
+
const sign = value < 0 ? '\u2212' : '';
|
|
65
|
+
return `${sign}${formatted}${unit ? `\u00A0${unit}` : ''}`;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- **Strict separation between `0` (measured zero) and `null / — / N/A` (missing/uncollected)**:
|
|
70
|
+
- **In tables/KPIs**: render measured zero as `0` / `0.00` in standard foreground ink; render missing/uncollected values as muted `—` or `N/A` (`aria-label="No data collected"`) with an explanatory tooltip (`Sensor offline 02:10–02:25 UTC`).
|
|
71
|
+
- **In line/area charts**: break the path across `null` intervals (`defined(d => d.value !== null)` in D3/Plot, `connectNulls: false` in ECharts/Recharts) or bridge only with an explicit dashed "missing interval" style—never drop `null` to the `0` baseline!
|
|
72
|
+
- **Explicit display timezone (`UTC` vs local) & Data Freshness / SLA Staleness badge**:
|
|
73
|
+
- Label the active timezone visibly (`2026-11-25 14:00 UTC` or `Local · America/New_York`) and provide a `UTC <-> Local` switch on operational incidents/logs.
|
|
74
|
+
- Pair every live or warehouse-backed region with a **Data Freshness / SLA Staleness badge** (`Updated 12s ago · SLA 60s` -> transitions to high-contrast warning `Stale · 14m behind SLA` when `now - max(event_ts) > sla_ms`).
|
|
75
|
+
|
|
76
|
+
## Tables as visualization & safe exports
|
|
77
|
+
|
|
78
|
+
Tables are often the sharpest visual representation. Design them as high-precision scanning instruments:
|
|
79
|
+
|
|
80
|
+
| Rule | Application |
|
|
81
|
+
|---|---|
|
|
82
|
+
| alignment | right-align numeric/timestamp columns (`text-align: right; font-variant-numeric: tabular-nums`); left-align text/IDs |
|
|
83
|
+
| units | put shared units in column headers (`Latency (ms)`, `Cost ($ USD)`); repeat inline only when rows mix currencies/units |
|
|
84
|
+
| `0` vs `null` | `0.0` = observed zero; muted `—` / `N/A` = null/unreported (sort `null` consistently last regardless of `ASC`/`DESC`) |
|
|
85
|
+
| comparison | use inline bars/sparklines only when scale + zero/baseline are consistent and labeled across rows |
|
|
86
|
+
| state | pair text + icon/shape + color for status; never rely on red/green fill alone |
|
|
87
|
+
| overflow | never truncate the distinguishing suffix of IDs/hashes (`…9f4a` or middle-ellipsis + one-click copy) |
|
|
88
|
+
| CSV/XLSX export safety | neutralize **OWASP Formula Injection**: prefix string cells starting with `=`, `+`, `-`, `@`, `\t`, or `\r` with `'` before CSV/XLSX export (while exporting true numeric negatives as native numbers in XLSX) so opening exports in Excel/Sheets cannot trigger `DDE` or formula execution |
|
|
89
|
+
|
|
90
|
+
> **Cross-skill boundary:** `pixelcraft-dataviz` governs analytical tables, numeric alignment, visual encodings, inline sparklines, and dashboard information density. Operational table CRUD (row selection, bulk actions, inline editing, keyset pagination, saved URL filters) coordinates with `pixelcraft-data-apps` and `pixelcraft-patterns`.
|
|
91
|
+
|
|
92
|
+
## Dashboard layout and density
|
|
93
|
+
|
|
94
|
+
Start from decisions, not chart inventory.
|
|
95
|
+
|
|
96
|
+
1. Put system health/outliers/actions and **Data Freshness / SLA status** first; contextual trends second; exploratory detail later.
|
|
97
|
+
2. Group by operational object or decision, not by chart type.
|
|
98
|
+
3. State time range, explicit timezone (`UTC` vs local), freshness SLA, source scope, and URL-serialized filters once per coherent region.
|
|
99
|
+
4. Preserve drill-down context: selection, filter, sort, time range, timezone, scroll, and deep-link URL state.
|
|
100
|
+
5. Use unequal emphasis. Every metric in the same card size teaches users that nothing matters.
|
|
101
|
+
6. High-frequency operations favor dense `tabular-nums` tables and exception queues; infrequent executive overview favors fewer, larger comparisons.
|
|
102
|
+
|
|
103
|
+
Required dashboard states: no data yet, partial ingestion, **SLA stale/offline**, source error, permission-limited, empty after filter, extreme cardinality, long entity names, and degraded real-time connection. Never fabricate sparklines or placeholder deltas.
|
|
104
|
+
|
|
105
|
+
## Anti-slop dashboard pattern
|
|
106
|
+
|
|
107
|
+
Reject the generic grid of four KPI cards, purple gradient area chart, donut, leaderboard table, and “AI insights” box unless each element answers a real question. Replace decorative KPI deltas with explicit comparison periods, True Minus `−` formatting, and SLA freshness provenance.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Library and ecosystem notes
|
|
2
|
+
|
|
3
|
+
Library defaults are starting points, not design decisions. Verify current documentation for the exact version in the repository; APIs and accessibility support evolve.
|
|
4
|
+
|
|
5
|
+
## Web and cross-platform charting libraries
|
|
6
|
+
|
|
7
|
+
| Library / ecosystem | Best use | Rendering / model | Practical notes |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **D3.js (v7+)** | Custom, unconventional, tightly controlled browser visualization | ESM-only modular packages (`d3-scale`, `d3-shape`, `d3-array`) | Prefer **"D3 for math, framework for DOM"** in React/Svelte/Vue/Solid instead of mixing `d3.select()` DOM mutations with framework reconciliation. Own axes, transitions, keyboard focus, and text alternatives. |
|
|
10
|
+
| **Observable Plot** | Concise exploratory and production statistical graphics | Declarative marks over D3 scales (SVG) | Supports `ariaLabel`/`ariaDescription` and facets. Pair with `resize()` or ResizeObserver plus an explicit summary/table. |
|
|
11
|
+
| **Vega (standalone)** | Custom interactive visualization grammars beyond Vega-Lite | Full JSON dataflow grammar (SVG / Canvas) | Supports force, Voronoi, tree, and streaming signals/transforms that Vega-Lite omits. Keep dataflow specs validated and provide external keyboard/table access. |
|
|
12
|
+
| **Vega-Lite** | Portable declarative statistical chart specs | JSON grammar compiled to Vega (SVG / Canvas) | Excellent for cross-language reproducibility. Set explicit domains, titles, descriptions, and external focus/table equivalents. |
|
|
13
|
+
| **Apache ECharts** | Feature-complete product dashboards and large series | Canvas default; SVG renderer available | Enable `aria: { enabled: true, decal: { show: true } }` for descriptions and colorblind-safe patterns, then inspect actual DOM/Canvas output and external keyboard access. |
|
|
14
|
+
| **Chart.js** | Lightweight standard web charts (bar, line, radar, scatter) | Canvas 2D with tree-shakeable controllers/scales | Fast and small bundle, but Canvas content is opaque to screen readers—add explicit summary/table fallbacks and configure `responsive: true` inside a sized wrapper. |
|
|
15
|
+
| **Highcharts** | Enterprise/editorial charts requiring strong built-in accessibility | SVG + WebGL `boost` module | Commercial license for for-profit use. Its **`accessibility`** module (roving keyboard focus, screen-reader series descriptions, auto data tables, pattern fills) and **`sonification`** module are industry benchmarks. |
|
|
16
|
+
| **Recharts** | Conventional React charts | Declarative React SVG components | `ResponsiveContainer` requires an explicit parent height/width. Label collisions, tooltips, and keyboard accessibility require explicit implementation. |
|
|
17
|
+
| **Nivo** | Rich themed React charts (heatmaps, Sankey, Bump, Calendar) | React SVG / Canvas / HTML over D3 | Great aesthetic variety out of the box, but watch bundle size, responsive margin clipping, and missing keyboard navigation on Canvas variants. |
|
|
18
|
+
| **Tremor** | Rapid Tailwind/React operational KPIs and SaaS charts | React primitives over Recharts / Radix | Speeds up standard product analytics, but override default card/palette templates so dashboards do not collapse into generic SaaS slop. |
|
|
19
|
+
| **visx** | Custom React visualization primitives | Low-level SVG primitives, scales, shapes | D3-level control in idiomatic React without DOM conflicts. You own labels, responsive measurement, transitions, and ARIA semantics. |
|
|
20
|
+
| **uPlot** | High-frequency observability, metrics, and telemetry time series | Ultra-fast Canvas 2D (~50 KB) | Renders 100k+ points at 60 fps with minimal memory. Requires explicit container resize wiring, legend formatting, and external text/table access. |
|
|
21
|
+
| **TradingView Lightweight Charts** | Financial OHLC/candlestick, volume, and live price streams | Canvas 2D (Apache-2.0 with attribution) | Built for crosshair sync, time-scale zoom, and streaming ticks. Not for general categorical charts; pair with accessible price summary readouts. |
|
|
22
|
+
| **AntV (`G2 v5`, `G6 v5`, `X6`, `L7`)** | Unified grammar-of-graphics (`G2`), graphs (`G6`), editors (`X6`), geo (`L7`) | Canvas / SVG / WebGL | Strong enterprise coverage across charts, networks, and maps. Verify English/localized docs, bundle splitting, and accessibility wrappers. |
|
|
23
|
+
| **Plotly.js** | Scientific/engineering charts, 3D, WebGL scatter/heatmaps | Mixed SVG + WebGL (`scattergl`, `heatmapgl`) | Heavy full bundle—use partial bundles (`plotly.js-basic-dist-min`) when possible. Modebar and WebGL canvases require external keyboard and tabular access. |
|
|
24
|
+
|
|
25
|
+
## Python, R, Julia, native, and WASM-scale ecosystems
|
|
26
|
+
|
|
27
|
+
| Library / ecosystem | Best use | Rendering / model | Practical notes |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| **matplotlib** | Publication and static scientific graphics in Python | Raster / vector (`SVG`, `PDF`, `PNG`) | Set explicit `figsize`, DPI, `layout="constrained"`, units, and colorblind-safe colormaps. Static images always need alt text and underlying data access. |
|
|
30
|
+
| **Seaborn (`seaborn.objects`)** | Declarative statistical graphics in Python | Layered grammar (`so.Plot`) or statistical wrappers over matplotlib | Prefer `seaborn.objects` for composable multi-layer plots with explicit scales and themes instead of ad hoc axes mutation. |
|
|
31
|
+
| **Altair** | Declarative Python statistical visualization | Emits Vega-Lite JSON | Use vegafusion or URL/Parquet data transformers for large datasets instead of embedding 50 MB JSON inline in HTML/notebooks. |
|
|
32
|
+
| **Bokeh** | Interactive Python browser plots with linked brushing | Canvas / WebGL via `ColumnDataSource` + `CustomJS` | Powers Panel and standalone HTML exports; pair with external data summaries and keep light/dark themes synced with host pages. |
|
|
33
|
+
| **HoloViews / hvPlot / Datashader** | Declarative Python plots + million-to-billion-point rasterization | Multi-backend (Bokeh, Matplotlib, Plotly) + CPU/GPU Datashader rasterizer | Use **Datashader** (`rasterize=True` / `datashade=True`) whenever scatter or trajectory density causes overplotting or browser crashes; publish aggregation method and colorbar units. |
|
|
34
|
+
| **ggplot2 (R)** | Layered grammar of graphics and statistical figures | Static vector/grid graphics (`thematic` for Shiny) | Direct annotations and facets outperform detached legends. Interactive `girafe`/`plotly` conversions require separate focus and keyboard verification. |
|
|
35
|
+
| **Makie (Julia)** | High-performance scientific and publication visualization | `CairoMakie` (vector/static), `GLMakie` (GPU), `WGLMakie` (WebGL) | Pick backend by output: `CairoMakie` for PDF/SVG papers, `GLMakie`/`WGLMakie` for interactive exploration. Set explicit limits and colorbars. |
|
|
36
|
+
| **Swift Charts** | Native Apple-platform charts (iOS, macOS, watchOS, visionOS) | Declarative SwiftUI marks | Generates VoiceOver elements automatically; refine with `.accessibilityLabel` / `.accessibilityValue`, Dynamic Type, and chart scrolling. |
|
|
37
|
+
| **Vico (Compose)** | Jetpack Compose Android/KMP cartesian charts | Compose-native canvas/model | Add explicit `contentDescription` / semantics and an adjacent tabular readout; verify with TalkBack. |
|
|
38
|
+
| **FINOS Perspective** | Real-time streaming pivot tables and analytical charts | C++/Rust WebAssembly engine + virtualized grid & D3FC/canvas | Handles high-frequency streaming updates (financial blotters, logs) directly in browser workers; pair with keyboard-accessible view presets and CSV export. |
|
|
39
|
+
| **UW IDL Mosaic / DuckDB-Wasm** | Multi-million-row interactive cross-filtering in the browser or server | `vgplot` / `MosaicClient` SQL coordinator + materialized pre-aggregates | Eliminates browser lag on millions of rows by pushing brush/filter selections into DuckDB pre-aggregated data cubes. Verify Parquet/WASM load progress and empty-brush states. |
|
|
40
|
+
|
|
41
|
+
## D3 v7 modular idiom ("D3 for math, framework for DOM")
|
|
42
|
+
|
|
43
|
+
Import only the ESM submodules needed (`d3-scale`, `d3-array`, `d3-shape`) and let the host UI framework (React, Svelte, Vue, Solid, Lit) own DOM reconciliation, reactive updates, and ARIA attributes:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { scaleLinear, scaleBand } from 'd3-scale';
|
|
47
|
+
import { max } from 'd3-array';
|
|
48
|
+
|
|
49
|
+
// Pure layout computation reusable in React, Svelte, Vue, or server SVG rendering:
|
|
50
|
+
export function computeBarLayout(
|
|
51
|
+
data: { label: string; value: number }[],
|
|
52
|
+
width: number,
|
|
53
|
+
height: number,
|
|
54
|
+
) {
|
|
55
|
+
const x = scaleBand(data.map((d) => d.label), [48, width - 16]).padding(0.2);
|
|
56
|
+
const y = scaleLinear([0, max(data, (d) => d.value) ?? 0], [height - 28, 16]).nice();
|
|
57
|
+
return data.map((d) => ({
|
|
58
|
+
...d,
|
|
59
|
+
x: x(d.label) ?? 0,
|
|
60
|
+
y: y(d.value),
|
|
61
|
+
w: x.bandwidth(),
|
|
62
|
+
h: y(0) - y(d.value),
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Apache ECharts, Observable Plot, & Vega-Lite idioms
|
|
68
|
+
|
|
69
|
+
### Apache ECharts (`echarts/core` tree-shaking + `ResizeObserver` + `aria.decal`)
|
|
70
|
+
|
|
71
|
+
Never import the full `echarts` barrel (~1 MB+) in app bundles. Register only used charts/components from `echarts/core`, enable `aria: { enabled: true, decal: { show: true } }` for descriptions and colorblind-safe patterns, observe container resizes, and **always call `chart.dispose()` on unmount**:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import * as echarts from 'echarts/core';
|
|
75
|
+
import { BarChart } from 'echarts/charts';
|
|
76
|
+
import { AriaComponent, GridComponent, TooltipComponent } from 'echarts/components';
|
|
77
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
78
|
+
|
|
79
|
+
echarts.use([BarChart, AriaComponent, GridComponent, TooltipComponent, CanvasRenderer]);
|
|
80
|
+
|
|
81
|
+
export function mountRevenueChart(el: HTMLElement, labels: string[], values: number[]) {
|
|
82
|
+
const chart = echarts.init(el);
|
|
83
|
+
chart.setOption({
|
|
84
|
+
aria: { enabled: true, decal: { show: true } },
|
|
85
|
+
tooltip: { trigger: 'axis' },
|
|
86
|
+
xAxis: { type: 'category', data: labels },
|
|
87
|
+
yAxis: { type: 'value' },
|
|
88
|
+
series: [{ name: 'Revenue (EUR)', type: 'bar', data: values }],
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const ro = new ResizeObserver(() => chart.resize());
|
|
92
|
+
ro.observe(el);
|
|
93
|
+
return () => {
|
|
94
|
+
ro.disconnect();
|
|
95
|
+
chart.dispose();
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Observable Plot (declarative marks, facets, `ariaLabel`, & resize)
|
|
101
|
+
|
|
102
|
+
Set `ariaLabel` / `ariaDescription` directly on `Plot.plot(...)`, use `fx`/`fy` facets for small multiples instead of spaghetti overlays, measure container width with `ResizeObserver` (or Observable Framework's `resize()`), and remove previous SVG elements before re-appending:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import * as Plot from '@observablehq/plot';
|
|
106
|
+
|
|
107
|
+
export function mountFacetPlot(el: HTMLElement, rows: { region: string; month: string; latencyMs: number }[]) {
|
|
108
|
+
const render = () => {
|
|
109
|
+
const chart = Plot.plot({
|
|
110
|
+
width: Math.max(320, el.clientWidth),
|
|
111
|
+
height: 260,
|
|
112
|
+
ariaLabel: 'Median latency by month faceted by region',
|
|
113
|
+
fx: { label: null },
|
|
114
|
+
y: { label: 'Latency (ms)', grid: true },
|
|
115
|
+
marks: [Plot.lineY(rows, { x: 'month', y: 'latencyMs', fx: 'region', tip: true }), Plot.ruleY([0])],
|
|
116
|
+
});
|
|
117
|
+
el.replaceChildren(chart);
|
|
118
|
+
};
|
|
119
|
+
render();
|
|
120
|
+
const ro = new ResizeObserver(render);
|
|
121
|
+
ro.observe(el);
|
|
122
|
+
return () => {
|
|
123
|
+
ro.disconnect();
|
|
124
|
+
el.replaceChildren();
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Vega-Lite (`vega-embed`, `"width": "container"`, signals, & fallback)
|
|
130
|
+
|
|
131
|
+
- Set `"width": "container"` inside single-view specs backed by a sized parent container; **trap**: Vega-Lite's `"width": "container"` does **not** apply to faceted/concatenated multi-view specs—compute explicit child widths on resize instead.
|
|
132
|
+
- Use `params` (interactive signals/selections) for brushing/filtering, call `result.finalize()` on unmount to clean up listeners/Canvas contexts, and pair with a collapsible summary table + keyboard filter controls because Vega canvases are not keyboard-navigable by default.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import embed from 'vega-embed';
|
|
136
|
+
|
|
137
|
+
const res = await embed(el, {
|
|
138
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
139
|
+
description: 'Monthly error rate with interactive threshold slider',
|
|
140
|
+
width: 'container',
|
|
141
|
+
height: 240,
|
|
142
|
+
params: [{ name: 'maxErr', value: 5, bind: { input: 'range', min: 1, max: 10, step: 0.5, name: 'Threshold % ' } }],
|
|
143
|
+
data: { values: rows },
|
|
144
|
+
mark: 'bar',
|
|
145
|
+
encoding: {
|
|
146
|
+
x: { field: 'month', type: 'ordinal' },
|
|
147
|
+
y: { field: 'errorPct', type: 'quantitative', title: 'Error rate (%)' },
|
|
148
|
+
color: { condition: { test: 'datum.errorPct > maxErr', value: '#c92a2a' }, value: '#1971c2' },
|
|
149
|
+
},
|
|
150
|
+
}, { actions: { export: true, source: false, editor: false } });
|
|
151
|
+
// On unmount: res.finalize();
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## BI & observability plugin UI
|
|
155
|
+
|
|
156
|
+
- **Grafana Plugin UI (`@grafana/ui`, `@grafana/data`, & Grafana Scenes)**: read live host light/dark/high-contrast tokens through **`useTheme2()`** (`theme.colors.background.primary`, `theme.colors.text.primary`, `theme.spacing(2)`)—never hardcode colors that break when users toggle Grafana themes. Compose native panel/app UIs with `@grafana/ui` (`PanelChrome`, `Table`, `TimeSeries`) and build multi-panel dynamic observability apps using **Grafana Scenes** (`EmbeddedScene`, `SceneFlexLayout`, `SceneQueryRunner`, `SceneVariableSet`) so time ranges, template variables, query cancellation, and error/no-data states stay synchronized with Grafana.
|
|
157
|
+
- **Apache Superset & Metabase embedding boundaries**:
|
|
158
|
+
- Use official SDKs (**`@superset-ui/embedded-sdk`** with short-lived server-issued guest tokens, or **Metabase Embedding SDK** `@metabase/embedding-sdk-react` / signed JWT embeds) instead of fragile session-cookie `<iframe>` hacks.
|
|
159
|
+
- Enforce server-side **row-level security (RLS)** predicates inside the guest/JWT token so tenants can never tamper with client filter URLs; lock CSP `frame-ancestors`, handle token refresh/expiry cleanly, align theme tokens where supported, and never expose unauthenticated BI admin chrome inside customer products.
|
|
160
|
+
|
|
161
|
+
## Cross-ecosystem implementation rules
|
|
162
|
+
|
|
163
|
+
- **Data contract**: Keep parsing, unit conversion, timezone normalization, null policy, and aggregation outside chart render components. Never let missing fields silently coerce to zero.
|
|
164
|
+
- **Themes and tokens**: Map semantic tokens explicitly (`surface`, `text`, `grid`, `categorical`, `positive/negative`, `missing`). Dark mode requires luminance rebalancing, not blind inversion.
|
|
165
|
+
- **Resize and reflow**: Measure containers with `ResizeObserver` (or native layout bounds). On narrow screens, switch to horizontal bars, fewer ticks, or small multiples rather than shrinking labels below readability.
|
|
166
|
+
- **Export and print**: Test PNG/SVG/PDF/CSV export—WebGL canvases can serialize blank unless `preserveDrawingBuffer` or vector export is handled. Static exports require titles, units, direct labels, and freshness timestamps.
|
|
167
|
+
- **Notebook and native embedding**: Notebook rendering is not product accessibility. Native apps should prefer Swift Charts/Vico over WebViews unless cross-platform sharing justifies the bridge and accessibility cost.
|
|
168
|
+
|
|
169
|
+
## Selection guidance
|
|
170
|
+
|
|
171
|
+
- Choose **D3 v7 (modular) / visx / standalone Vega** for bespoke interactive encodings when the team can own accessibility and layout.
|
|
172
|
+
- Choose **Observable Plot / Vega-Lite / Altair / Seaborn (`seaborn.objects`) / ggplot2** for reproducible statistical grammar.
|
|
173
|
+
- Choose **Highcharts / ECharts (`echarts/core`) / Chart.js / Recharts / Nivo / Tremor** for standard product dashboards (prefer Highcharts when turnkey chart accessibility and sonification are priorities and licensing fits).
|
|
174
|
+
- Choose **uPlot / TradingView Lightweight Charts** for high-frequency telemetry or financial time series, and **Grafana Scenes / `@grafana/ui`** for observability plugins inside Grafana.
|
|
175
|
+
- Choose **Datashader / FINOS Perspective / UW IDL Mosaic (DuckDB-Wasm)** when raw point counts or streaming rates exceed ordinary DOM/Canvas limits.
|
|
176
|
+
- Choose **matplotlib / CairoMakie** for print/publication vector precision, and **Swift Charts / Vico** for native mobile craft.
|