Infographic
infographic fence and an AntV template.An infographic turns a short list into a picture of its structure: three
steps in a row, five years on a timeline, stages that narrow like a funnel, a
two-level hierarchy. You write the title and the items as plain data in an
infographic fence, name one of the AntV templates on the first line, and the
browser draws it; on GitHub the fence stays readable as text.
Reach for an infographic when the shape of the information is the message. When readers need axes and exact numbers, use ECharts; for a flow with conditions and branches, use Mermaid.
Shortest form
The first line is infographic <template>, followed by a data block with a
title and an items list in which every item has at least a label.
Indentation defines the structure, two spaces per level. Keep labels to a word
or two and put the explanation in desc, because long labels get squeezed or
cut off on a phone.
Timelines
The sequence-timeline-* templates place items along a time axis: label is
the point in time and desc the event.
Funnels
sequence-funnel-simple draws stages that narrow, such as the path from a
first visit to production use.
Grid cards
When the items have no order, list-grid-* lays them out as a grid of cards
instead of a sequence. A desc under data adds a subtitle.
Items with values
Templates that show proportions, such as pies, doughnuts and progress
displays, read a value on each item.
Hierarchy and hand-drawn style
Nest items with children, and a hierarchy-mindmap-* template draws two
levels of structure. A top-level theme block changes the look of the whole
graphic; its type is light, dark or hand-drawn.
Each graphic sits on its own canvas, which does not follow the site’s light or
dark mode. The default and hand-drawn styles use a white canvas, a background
you set in the DSL wins, and a type dark graphic stays dark even on a light
page. Switching the site’s mode leaves the graphic exactly as drawn, so if you
set a transparent background or your own text colors, check the contrast in
both modes.
Picking a template
Template names read structure-variant, and each structure comes in 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 |
Pick the simplest form that shows the relationship. The AntV Infographic gallery shows every template; the names match the version bundled with the theme.
Output
On the web the theme’s bundled AntV runtime draws the graphic as SVG when the
reader scrolls near it, so a page with several graphics stays fast. Print and
RSS draw nothing and show the DSL source in a <pre> block instead, so state
the conclusion in the surrounding prose; the page’s Markdown output keeps the
fence as written.
Parameter reference
The fence attribute line (```infographic {…}):
Unknown attributes warn and are ignored; Hugo takes style as a highlighting
option and strips on*, so both are ignored without a warning. An empty fence
warns and renders nothing.
The top-level DSL keys, defined by AntV:
Each entry under items accepts label, desc, value, icon, children,
group and id. The AntV Infographic documentation
defines the full DSL; the theme’s VENDOR.json records the bundled version and
its checksum.
Limits
- A misspelled template name does not fail the build, because Hugo checks only the fence attributes and the DSL is parsed in the browser. The graphic area shows an error line instead, so look at the page after changing a template.
- SVG carries no semantic structure, and screen readers may not read the items in visual order. When a heading, a list or a table can say the same thing, prefer it.
- Long labels are squeezed or cut off on narrow screens; check the page 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