Infographic
infographic fence picks an AntV template and renders a title plus a list of items as a flow, timeline, funnel, grid or hierarchy.An infographic fence picks an AntV template and renders “a title plus a list
of items” as an infographic. Use it for structure: order, hierarchy, comparison.
When you need axes and numeric precision use
ECharts; when you need a flow with conditional
branches use Mermaid. The fence body is data, and
it stays readable text on GitHub.
Shortest form
The first line is infographic <template>, followed by a data block: title
is the title and every entry under items needs at least a label.
Indentation decides the structure, two spaces per level. Keep labels short and
put the explanation in desc.
Timelines
The sequence-timeline-* family lays the items out on a time axis, with label
as the point in time and desc as the event.
Funnels
sequence-funnel-simple draws stages that narrow. Below are the theme’s five
release states: they are not interchangeable, and only the last one is live.
Grid cards
When items have no order between them, list-grid-* arranges them in a grid
rather than a queue.
Items with values
Add value to an item and templates that express proportion — pies, doughnuts,
progress — will use it.
Hierarchy and hand-drawn style
Items can nest through children, and hierarchy-mindmap-* draws two levels of
structure. A top-level theme block changes the whole look; type takes
light, dark or hand-drawn.
theme belongs to the DSL, not to the fence attributes, and it does not follow
the site’s colour scheme: a diagram with type dark stays dark on a light page.
Check contrast in both modes.
Picking a template
Template names are structure-variant, and one structure has several visual
variants. The common families:
| Structure prefix | What it expresses | Example |
|---|---|---|
list-row-* list-column-* |
Items in a row or a column | list-row-simple-horizontal-arrow |
list-grid-* |
A grid, no order between items | list-grid-compact-card list-grid-badge-card |
list-pyramid-* sequence-funnel-* |
Narrowing stages | sequence-funnel-simple |
sequence-timeline-* sequence-roadmap-vertical-* |
Timelines and roadmaps | sequence-timeline-simple |
sequence-steps-* sequence-snake-steps-* |
Ordered steps | sequence-steps-simple |
compare-binary-horizontal-* compare-quadrant-* |
Binary comparison and quadrants | compare-binary-horizontal-simple-vs |
hierarchy-mindmap-* hierarchy-structure-* |
Hierarchy, with children |
hierarchy-mindmap-level-gradient-compact-card |
chart-pie-* chart-bar-* chart-column-* |
Illustrative charts, with value |
chart-pie-donut-plain-text |
relation-network-* relation-dagre-flow |
Networks and flows, with relations |
relation-dagre-flow |
Choose the smallest form that makes the relationship clear. The full gallery is at AntV Infographic, and the template names match the version shipped with the theme.
Output
| Output | Shape |
|---|---|
| HTML | A canvas container inside <div class="td-infographic"> plus the DSL; the local AntV runtime draws the SVG |
No diagram; the DSL source inside <pre class="td-infographic-source"> |
|
| Markdown | The infographic fence and its DSL, kept as written |
| RSS | Same as print — source only |
Whatever the diagram says, say it in the prose too: print and RSS carry the DSL and nothing else.
Parameter reference
The fence attribute line (```infographic {…}):
style, on*, and unknown attributes warn and are ignored. An empty DSL body
warns and renders nothing. Strict publishing rejects all these warnings.
The DSL’s top-level keys (AntV’s, not the theme’s):
Each entry under items accepts label, desc, value, icon, children,
group and id. The DSL is defined by the
AntV Infographic documentation; the
version shipped with the theme and its checksum are recorded in the theme’s
VENDOR.json.
Limits
- A wrong template name does not fail the build: Hugo checks the fence attributes only, the DSL is parsed by the browser runtime, and a missing template shows a line of error text in the container. Check the page after changing a template name.
- No colour-scheme awareness:
themelives in the DSL, so check contrast in both modes. - Print and RSS carry the DSL only, so the conclusion belongs in the prose.
- SVG is not a semantic structure: the order a screen reader gets is not necessarily the visual order. Prefer headings, lists and tables when they can say it.
- Keep labels short: long text is truncated or squeezed on a narrow screen, so check at phone width after editing.
Related
- ECharts — when you need axes and exact numbers
- Steps — when the reader has to follow the procedure
- Cards — a grid of clickable entry points
- Mermaid — flows with branches and conditions