/diagram-studio:d3from diagram-studio
Creates, animates, inspects, recomposes, and validates D3-powered HTML and SVG visuals. Use for custom charts, simulations, linked views, visual audits, parametric logos, textures, and portable SVG that need data-driven geometry, joins, layouts, or transitions.
Ships in diagram-studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
For a complete interactive logo studio or a browsable logo catalog, first run
python "<d3-skill>/scripts/build_logo_studio.py" --help. Build with that script,
passing the requested output, brand, tagline, colorset, and optional pattern
flags. Read logo-studio.md for the complete build,
static validation and native compact-preview commands, and
references/compact-composition.md for page sizing. Run the browser verifier as
uv run --script "<d3-skill>/scripts/verify_logo_gallery.py", including its
--help call. For the requested 96×64 Type Orbit check, pass --small-only,
--json-report <report.json> and --small-logo-screenshot <image.png>.
Validate the
HTML with validate_logo_artifact.py and check_self_contained_html.py; inspect
the live preview in a browser. Check extended colors against an exported
settled SVG: the studio HTML creates its colored marks at runtime, so its
static source cannot satisfy --require-extended. Do not assemble the studio by reading and
substituting its large engine or catalogs. A single standalone logo follows
the contract-builder route below.
For a non-logo catalogue or grid of equal-size directly labeled category tiles,
first run uv run --script "<d3-skill>/scripts/build_category_grid.py" --help,
then read references/category-grid.md and references/palette-contract.md.
Pass the caller's ordered labels or category records as JSON. Use --output,
--svg-output, and optional --allocation-output for the exact requested paths.
This builder supplies genuine bundled D3, title/desc, responsive columns, complete
solid and overflow styles, and export from the actual rendered SVG. Correct data
or flags and rerun for supported grids; keep the skill directory read-only.
For a bar chart, horizontal lollipop, node-link network, flow spine, orbit logo, or radial-wedge logo, your first command after reading this file MUST be:
python "<d3-skill>/scripts/build_contract_artifact.py" --help
Replace <d3-skill> with the exact directory containing this SKILL.md; do not guess .agents or probe alternate paths. Use python when available; on command not found, immediately rerun the same command with python3. Do not plan, inspect the runtime, or write a deliverable before this command succeeds. A missing interpreter alias never permits hand-authoring: use the builder for the final files, and never replace or post-edit a supported form. Correct flags and rerun. The wedge builder already satisfies colorset2 accent, warning/orange, success/green, and special/purple groups.
For an ordered line chart with missing observations or directly labeled series, first run uv run --script "<d3-skill>/scripts/build_direct_line.py" --help. Use the offline builder with ordered data, then export and verify the SVG at its intended size. Follow rendered readability for the input contract.
For an evaluation or composition audit, your first command after reading this file MUST instead be python "<d3-skill>/scripts/build_evaluation_report.py" --help with the same exact-directory rule. Use its outputs without post-editing.
For an editable KPI/service dashboard, first run python "<d3-skill>/scripts/create_d3_svg_starter.py" --help, then read references/user-artifact-workflow.md. Generate the operational-dashboard starter and edit its output data. This route already provides compact neutral panels, active-colorset metadata, local runtime files, and the KPI/table layout.
For a standalone two-level treemap, first run python "<d3-skill>/scripts/build_treemap.py" --help, then read references/patterns/treemap.md. Supply the requested hierarchy as JSON and build with that script; it computes D3 area geometry and finalizes solid tones, exact black/white text and palette metadata automatically. Correct the data or flags and rerun instead of hand-authoring or post-editing a supported treemap. Export its settled SVG with render_d3_svg.py.
For dense task overlap with nine scope regions and 100 tasks, first run python "<d3-skill>/scripts/build_dense_task_overlap.py" --help, then read references/patterns/task-overlap-dense.md. Generate the layout with its documented command and pass that file to the builder. It sets portable final geometry, semantic region transparency, compact captions and palette finalization automatically. Correct flags and rerun the builder for supported output; export its SVG with render_d3_svg.py.
Run dependency-declaring helpers such as verify_logo_gallery.py,
verify_logo_texture_gallery.py, render_d3_svg.py and dither_d3_output.py
with uv run --script, including their --help calls.
Their uv metadata provides Pillow and Playwright in a clean isolated workspace.
Use the dependency-free Python first commands above for their named routes.
colorset1 by default. Use colorset2 only for an explicit extended, expanded, multicolor, or full-color request.references/compact-composition.md when sizing nodes, panels, or controls; preserve readable text and data geometry.#9e1b32, the bundled dark/middle interleave of grays including black, white, then the remaining colors. Exclude only the actual canvas token. Keep sequential value ramps and named semantic ink/status roles separate. Pink is a last-resort category after the preceding usable colors are exhausted, never an automatic secondary color, selection fill, or focus ring.assets/palettes/colorsets.json; use exact lowercase six-digit tokens and opacity, never arbitrary colors, functional color syntax, or raw D3 chromatic scales.--colorset and default to colorset1 through the bundled colorset_adapter.py; use the flag for colorset2. Validate their generated HTML and settled SVG against the selected contract. Immutable source image bytes may retain source colors; every authored overlay and control must follow the active contract.viewBox, <title>, <desc>, semantic groups, readable labels, stable IDs, and active-colorset metadata.Map every public acceptance literal to a flag. Use --kind flow with --svg-pattern-id when the decision variant differs from SVG pattern metadata, and repeat --attribute, --flow-node, --link, and --link-value in contract order. Keep titles generic or include only a leading prefix of ordered data labels; never mention a later label before intervening labels. Use --kind logo --logo-mode wedges for radial wedges; its colorset2 sequence already covers visible accent, warning/orange, success/green, and special/purple groups.
For check_visual_contract.py, express exact cardinality as --require-class CLASS:COUNT. For ordered data labels, repeat --ordered-text TOKEN or --require-ordered-text TOKEN; the latter also accepts a quoted sequence such as --require-ordered-text "First|Second|Third". A literal label containing | uses --ordered-text so that character stays part of the token. Both forms apply the same ordered-content gate. Quote every complete CLI value that contains whitespace, such as --require-attribute "viewBox=0 0 960 540"; never issue a known-invalid command as a probe. For logos emitted by build_contract_artifact.py, use the self-contained, palette, render, and visual-contract checks; validate_logo_artifact.py is only for full logo-studio outputs.
Use --require-id ID without a count suffix. --require-class takes a class name, never a CSS selector: for a default four-node flow use --require-class flow-node:4 --require-class node:4 --require-class link:3. Only use another class when you supplied its builder flag; do not guess a flow-link alias.
During skill maintenance, extend and test the builder when a required supported contract cannot be expressed.
For build_evaluation_report.py, pass each requiredTerms value unchanged with repeated --required-term; keep composition, implementation-contract, and validation findings separate. Do not post-edit supported reports. The visual checker uses --require-text instead.
Math.hypot and d3.easeCubicOut.references/visualization-type-index.md, references/layout-patterns.md, and references/pattern-selection-contracts.md.references/pattern-routing.md when the family is unclear, or references/pattern-index.md when a canonical ID or legacy alias needs lookup. For exact counts, also read references/cardinality-generalization.md.scripts/build_treemap.py and references/patterns/treemap.md for stepped family tones, neutral gutters, separate parent headers, and contrast-aware labels. Preserve existing weighted cell geometry when maintaining a supplied renderer.references/patterns/speculative-decoding.md and use scripts/build_speculative_decoding.py for a draft sequence, accepted prefix, rejected tail and target continuation; it supports changed tokens, counts, dimensions and optional alternates. Use its bundled verify_speculative_decoding.py browser command for Replay, SVG parity, reduced motion and the inspection PNG. Check HTML controls against HTML and SVG geometry against SVG.references/patterns/kinetic-glyph-mosaic.md; use scripts/build_kinetic_type.py for ordinary-looking text that reveals moving tile, line, dot, or hybrid glyph components. Follow that route's HTML-specific validation commands; do not substitute the generic settled-SVG contract check or look for acceptance fixtures in a runtime bundle.references/self-contained-output.md and references/animation-patterns.md.references/evaluation-rubric.md and references/recomposition-recipes.md.references/pattern-catalog.md, references/mathematical-patterns.md, and references/palette-contract.md; add references/texture-catalog.md only for texture selection.references/svg-replication.md.references/patterns/surface-stable-dither.md.references/user-artifact-workflow.md and references/maintenance-validation.md.colorset1 standard roles: background #f7f7f7, surface #ffffff, ink #333e48, dark ink #1c1c1c, primary #9e1b32, dark primary #6d1222, accent #e8002a, muted #828282, line #cfcfcf, quiet #e7e7e7. The legacy accentSoft token #ffccd5 is available only for a justified last-resort category or an explicit pink request; use quiet for subtle fills.colorset2 extended adds blue #007298, dark blue #004d66, orange #e77204, green #45842a, purple #652f6c, and yellow #f1c319. Use additions for meaningful categories or states.assets/vendor/d3.v7.9.0.min.js inside <script id="d3-runtime"> and use its real D3 joins. Follow references/palette-contract.md for the complete category allocator, including overflow styles and metadata. Create each SVG's title and desc before running the first self-contained check. Never substitute a partial D3-compatible stub or reveal an author-CSS-hidden mark solely through a presentation attribute.The commands below apply to single-file HTML with static SVG marks. For a logo
studio, use its route above and check the palette on the rendered SVG. For an editable starter directory,
follow the render/paint checks in references/user-artifact-workflow.md; its
local data.js, stylesheet, and vendor script are part of the offline output.
For speculative decoding, follow the direct recipe's validation commands; its
bundled browser verifier supplies the settled PNG, Replay and reduced-motion
checks without a separate custom replay harness.
python <d3-skill>/scripts/check_self_contained_html.py <artifact.html>
python <d3-skill>/scripts/check_palette_contract.py <artifact.html> --colorset colorset1
python <d3-skill>/scripts/check_palette_contract.py <artifact.html> --colorset colorset2 --require-extended
uv run --script <d3-skill>/scripts/render_d3_svg.py <artifact.html> --output <scratch/settled.svg> --screenshot <scratch/preview.png> --wait-ms <final-frame-ms> --viewport <WIDTHxHEIGHT>
python <d3-skill>/scripts/check_visual_contract.py <settled.svg> <exact-contract-flags>
Run only the palette command matching the active colorset. Choose a wait beyond the last animation; the renderer writes both the captured SVG and inspection PNG in one call. It has declared Playwright dependencies: always invoke it with uv run --script, never bare python or a new Playwright import probe. It can reuse installed Edge/Chrome on Windows when managed Chromium is absent. Put every scratch output inside an owned directory in the writable task workspace, outside deliverables; do not use host /tmp paths or guess an image-conversion executable. A missing tool is not a pass; use an equivalent available browser/parser check. Use route-specific validators for logos, recompositions, galleries, or replication.
Complete the rendered visual review before reporting success: open the inspection PNG or browser preview at the requested size and check every title, caption, token and branch label against the SVG boundary. A parser or render-success result cannot establish readability. Correct overflow in the authored layout, render again, and rerun affected validators. Once those required checks and the visual review pass, stop issuing verification commands and report the result. Avoid duplicate ad hoc parsers for conditions already covered by the bundled validators; raw first-occurrence logic can disagree with rendered accessibility text.
For small or densely labeled artifacts, follow rendered readability. Use the renderer's --layout-report and --strict-layout at the requested display size. Mark presentation-only controls with data-d3-export-ignore so the browser interaction remains available and the exported SVG and preview focus on the visual.
Before changing bundled patterns, scripts, examples, galleries, palettes, or composition sheets, read references/maintenance-validation.md and preserve published IDs.
Read only the resource matching the task.
Select the matching recipe and read it in full.
Use opaque, single-token filled marks without decorative borders first. Read
solidSequence and textOnFill from assets/palettes/colorsets.json. Reuse a
fill for the same semantic role; when roles must be distinct, exhaust every
usable distinct token in the preferred sequence, excluding the actual canvas,
before creating outline or tint combinations. Soft tokens occur late. For text
on a fill, use exactly black or white with the larger WCAG contrast computed
from the actual background; composite opacity before evaluating translucent
backgrounds. Do not infer text color from a hue name.
Named builders and the editable starter finalize this styling automatically.
The finalizer makes ordinary static filled marks opaque. Declare
data-opacity-role="semantic" on only the shapes or groups whose alpha
communicates overlap, density, a numeric value, or a named selection state;
document that meaning in the visual's description. Use
data-opacity-role="reveal" for programmatic reveal animation. CSS and SVG
opacity animations remain supported. Do not use low alpha as a routine
category tint or decorative background treatment.
Preserve zero-opacity hidden states until their visibility or reveal changes.
For custom HTML, run uv run --script <d3-skill>/scripts/colorset_adapter.py <authored.html> <final.html> --colorset <colorset1|colorset2>, then capture the
settled SVG from the finalized HTML. The runtime exposes
D3SolidStyle.categoryStyle(index, colorset, actualCanvas) for categorical
allocation; use its complete solid tier before its overflow tier.
Keep connectors, axes, signal traces, open line art, physical geometry and
explicit source-fidelity modes. A stroke that depicts a relationship or is the
geometry itself is meaningful. Reserve decorative outlines for a documented
palette overflow or an explicit requested style; mark SVG overflow treatments
with data-outline-tier="overflow". A transient keyboard focus ring remains an
interaction affordance. Use position, whitespace and direct labels for ordinary
selection and grouping.
agents/openai.yaml (opens in a new tab)assets/catalog/logo-manifest.json (opens in a new tab)assets/examples/d3-animated-svg-colorset2/colorset2-config.js (opens in a new tab)assets/examples/d3-animated-svg-colorset2/index.html (opens in a new tab)assets/examples/d3-animated-svg-colorset2/scripts/verify_colorset2_gallery.py (opens in a new tab)assets/examples/d3-animated-svg-cs1/cs1-config.js (opens in a new tab)assets/examples/d3-animated-svg-cs1/index.html (opens in a new tab)assets/examples/d3-animated-svg-cs1/scripts/verify_style_gallery.py (opens in a new tab)assets/examples/d3-animated-svg/assets/agent-loop-reference.png (opens in a new tab)assets/examples/d3-animated-svg/composition-sheets.html (opens in a new tab)assets/examples/d3-animated-svg/composition-sheets.js (opens in a new tab)assets/examples/d3-animated-svg/force-beeswarm.html (opens in a new tab)assets/examples/d3-animated-svg/gallery-page.css (opens in a new tab)assets/examples/d3-animated-svg/gallery.js (opens in a new tab)assets/examples/d3-animated-svg/index.html (opens in a new tab)assets/examples/d3-animated-svg/package-lock.json (opens in a new tab)assets/examples/d3-animated-svg/package.json (opens in a new tab)assets/examples/d3-animated-svg/scripts/audit_d3_gallery_visuals.py (opens in a new tab)assets/examples/d3-animated-svg/scripts/audit_saturated_task_overlap.py (opens in a new tab)assets/examples/d3-animated-svg/scripts/export_d3_gallery_svgs.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gvillarroel/plugins --plugin diagram-studio11 skills in this plugin
/compose-synchronized-svgDesigns, builds, synchronizes, and validates giant standalone SVG compositions made from many related diagrams, charts, maps, schematics, illustrations, and explanatory assets. Use when Codex must turn one idea into a coherent 6–16-module megacanvas or a 12–48-module navigable world such as a Path of Exile-style skill tree, giant genealogy, causal atlas, or linked-diagram map; keep recurring concepts visually consistent; propagate canonical values through every relevant view; coordinate focus, time, world-to-district-to-module semantic zoom, or a deterministic camera route for video; and deliver one self-contained interactive SVG with meaningful static and reduced-motion fallbacks./diagram-compositionDecomposes a complex idea into related subdiagrams, chooses suitable visual forms, and composes a compact page with explicit grid spans, consistent semantic colors, readable text, shared SVG icons, and meaningful cross-panel connections. Use for dense explanatory figures, architecture plates, visual comparisons, and multi-panel diagrams that need semantic planning before layout; coordinate available diagram and icon skills without requiring them./echarts-animated-svgAnimates already-rendered Apache ECharts SVG output and builds replayable SVG galleries. Use when Codex needs to render ECharts charts with SVGRenderer or SSR, post-process the resulting SVG instead of rebuilding chart geometry, choose chart-type-specific SVG animation profiles for ECharts chart types, or create an HTML index with controls to replay or restore chart animations./hierarchy-lensBuilds offline interactive hierarchies with decision-driven pixel composition, compact organic cells, radial heatmaps, or labeled charts. Use for organizational maps, portfolios, or taxonomies needing explicit placement priorities, proximity rules, step-by-step growth, switchable color lenses, and exact record lookup./lucidchart-svgExports Lucidchart diagrams to SVG, inserts SVG artwork into Lucidchart, and reconstructs SVG diagrams as editable Lucid shapes and connectors. Use for Lucidchart SVG downloads, uploads, conversions, and fidelity checks./mermaidCreates, selects, styles, renders, validates, and animates Mermaid diagrams from prose or structured data, including verified accessible title and description metadata for newly authored work. Use when Codex must honor or infer an appropriate Mermaid family; preserve workflows, schedules, schemas, hierarchies, interactions, behavioral contracts, tabular data, or quantitative facts; simplify or audience-adapt an existing diagram with an explicit fidelity ledger; apply colorset1 as the standard palette or colorset2 only when extended/full-color styling is explicitly requested; restyle Mermaid files or Markdown fences; render static SVG; or produce faithful animated SVG.