Infographic Syntax Creator
Overview
Generate AntV Infographic syntax output from user content, following the rules in references/prompt.md.
Note: When generating markdown documents, infographic DSL can be embedded using fenced code blocks with the infographic language identifier:
markdown
```infographic
infographic list-row-horizontal-icon-arrow
data
title Example
lists
- label Item 1
- label Item 2
```
Workflow
- •Read
references/prompt.mdfor syntax rules, templates, and output constraints. - •Extract the user's key structure: title, desc, items, hierarchy, metrics; infer missing pieces if needed.
- •Select a template that matches the structure (sequence/list/compare/hierarchy/chart).
- •Compose the syntax using
references/prompt.mdas the formatting baseline. - •Preserve hard constraints in every output:
- •First line is
infographic <template-name>. - •Use two-space indentation; key/value pairs are
key value; arrays use-. - •Compare templates (
compare-*) must have exactly two root nodes with children.
- •First line is
When to Use Infographic vs Mermaid
| Visualization Type | Use Infographic | Use Mermaid |
|---|---|---|
| Process flows / Steps | ✅ sequence-* | ✅ flowchart |
| Timelines | ✅ sequence-timeline-* | ✅ timeline |
| Lists / Features | ✅ list-* | ❌ |
| Comparisons (SWOT, Pros/Cons) | ✅ compare-* | ❌ |
| Hierarchy / Org charts | ✅ hierarchy-* | ✅ flowchart TB |
| Mind maps | ✅ hierarchy-mindmap-* | ✅ mindmap |
| Relations / Graphs | ✅ relation-* | ✅ flowchart |
| Charts (pie, bar, line) | ✅ chart-* | ❌ |
| Class/ER diagrams | ❌ | ✅ classDiagram/erDiagram |
| Sequence diagrams | ❌ | ✅ sequenceDiagram |
Prefer Infographic when: You want visually rich, presentation-quality diagrams. Prefer Mermaid when: You need technical diagrams (class, ER, sequence) or simple flowcharts.