This is the multi-page printable view of this section. .
Infographics with AntV
The infographic shortcode renders the AntV Infographic DSL with the versioned
runtime bundled by Oink. Use it for processes, timelines, cycles, funnels,
roadmaps, and compact visual summaries where a statistical chart would be too
literal.
The DSL is serialized as data, not inserted as arbitrary HTML or executable code. The browser runtime turns it into SVG and loads only on pages that use the shortcode.
Quick start
The same three steps appear below. Drafting creates the first version, review checks facts and language, and publication builds and verifies the site.
Syntax anatomy
An infographic normally contains:
infographic TEMPLATE, which selects a built-in AntV template;- a
datablock with an optionaltitleanddesc; - an
itemslist withlabel,desc, optionalvalue, and optional nestedchildrenfields; - an optional
themeblock for a built-in theme or explicit colors.
Indentation defines structure. Keep labels short, use descriptions for context, and choose a template whose visual relationship matches the prose. A decorative sequence is not a substitute for an actual hierarchy or comparison.
Shortcode parameters
| Parameter | Default | Behavior |
|---|---|---|
height |
auto |
Accepts auto or a nonnegative number with px, rem, em, vh, vw, or % |
full |
false |
Set to true to remove Oink’s normal content-width clamp |
Invalid height values and an empty DSL body fail the Hugo build. DSL schema or template errors are reported by the browser runtime in the infographic container.
AntV themes belong to the DSL rather than the shortcode parameters. They do not automatically follow Oink’s site color mode, so verify foreground, background, and surrounding-page contrast in both modes.
Choose a guide
- Processes, timelines, and cycles demonstrates three common ways to explain a sequence.
- Layouts, funnels, and themes demonstrates grids, narrowing stages, template selection, and a built-in hand-drawn theme.
The AntV package contains many templates. Start with the smallest visual form that clarifies the relationship, not the most decorative form available.
Authoring and accessibility
- Summarize the same conclusion in ordinary text before or after the graphic.
- Keep the reading order meaningful and labels concise.
- Do not use color or shape as the only carrier of status.
- Check long translated labels, narrow screens, printing, and both site color modes.
- Avoid remote image or icon identifiers in a local-first page unless their network and license boundary has been reviewed explicitly.
- Record the source and date when values are not illustrative.
SVG improves visual fidelity, but it does not guarantee that every template exposes the same semantic structure as native headings, lists, and tables. Essential instructions must remain available in adjacent prose.
Further reference
OINK documents its shortcode and delivery boundary. For the full DSL, template
gallery, and theme model, use the
AntV Infographic documentation,
gallery, and
source repository. The Oink theme’s
VENDOR.json records the exact bundled version, checksum, and MIT license file.
1 - Processes, timelines, and cycles
Sequence templates answer different questions. A horizontal process emphasizes ordered handoffs, a timeline emphasizes chronology, and a cycle emphasizes that the last stage feeds the first again. The surrounding prose must state which relationship matters.
Horizontal process
Use list-row-simple-horizontal-arrow for a short left-to-right sequence. On
narrow screens, keep labels brief and verify that the rendered order remains
clear.
The process moves from planning through writing and review to a separately verified hosted result.
Chronological timeline
Use sequence-timeline-simple when time or release order is the primary
relationship.
The timeline separates four evidence points; a passing test does not skip the public-tag or deployment stages.
Continuous cycle
Use sequence-circular-simple only when the final item genuinely returns work
to the first. Do not use a cycle for a process that has a terminal state.
Verification produces new observations, so the maintenance loop returns to its first stage.
Selection rule
If removing the arrows or time axis would not change the meaning, use a native list or cards instead. Infographics should reveal a relationship, not decorate an otherwise unrelated set of statements.
2 - Infographic layouts, funnels, and themes
AntV templates combine a structure with item and title treatments. Changing the
template changes the implied relationship, so review meaning before appearance.
The examples below use flat items data and no remote icons.
Grid of grouped facts
Use list-grid-badge-card for peer facts that share one topic but have no
required order.
The four gates are peers. None should be drawn as a prerequisite for another.
Narrowing funnel
Use sequence-funnel-simple when each stage intentionally reduces a population.
Include value fields and repeat the numbers in prose.
Forty drafted pages become 34 fact-checked pages, 31 language-reviewed pages, and 28 verified published pages.
Built-in hand-drawn theme
Themes change styling, not data meaning. The hand-drawn theme is useful for
informal planning material; a custom primary color can still align it with the
site.
Choose a template family
| Relationship | Useful starting templates |
|---|---|
| Ordered handoff | list-row-simple-horizontal-arrow, sequence-steps-simple |
| Chronology or roadmap | sequence-timeline-simple, sequence-roadmap-vertical-simple |
| Repeating loop | sequence-circular-simple, sequence-circle-arrows-indexed-card |
| Peer facts | list-grid-badge-card, list-grid-compact-card |
| Progressive reduction | sequence-funnel-simple, sequence-pyramid-simple |
| Hierarchy | hierarchy-tree-*, hierarchy-mindmap-* |
Template availability belongs to the bundled AntV version. Before adopting a
less common template, render it with realistic English and Chinese content and
pin the Oink release whose VENDOR.json provides it.
Layout checklist
- Keep peer labels grammatically parallel.
- Use
valueonly when it has a defined unit or meaning. - Avoid a fixed height that clips translated text.
- Use
full=trueonly when the surrounding page and print layout need it. - Verify template meaning, contrast, overflow, and reading order separately.
- Keep remote icon and image references out of network-isolated documentation.