Create beautiful infographics based on provided text content. Make sure to use this skill whenever a user requests to create an infographic, chart, diagram, data visualization, or wants to transform data and information into a visual structure, even if they don't explicitly use the word 'infographic'.
An infographic transforms data, information, and knowledge into perceptible visual language. It combines visual design and data visualization, using intuitive symbols to compress complex information and help the audience quickly understand and remember the key points.
Infographic = Information Structure + Visual Expression
This task uses AntV Infographic to create visual infographics.
Before starting the task, you need to understand the AntV Infographic syntax specifications, including the template list, data structures, themes, etc.
plain code block containing the infographic syntax.palette array.
palette #4f46e5 #06b6d4 #10b981.data.
lists, sequences, compares, values, root, or nodes will cause the renderer to fail or ignore data. Stick to the single main data field matching the chosen template.The AntV Infographic syntax is a custom DSL used to describe the rendering configuration of infographics. It uses indentation to express structure, making it suitable for AI to directly generate and stream output. The core information includes:
title, desc, and the main data field.palette, fonts, stylization, etc.For example:
infographic list-row-horizontal-icon-arrow
data
title Title
desc Description
lists
- label Label
value 12.5
desc Explanation
icon document text
theme
palette #3b82f6 #8b5cf6 #f97316
infographic <template-name>.infographic prefix.data / theme blocks, with a uniform two-space indentation within the block.key space value; object arrays use - as an item prefix.icon uses icon keywords, such as star fill, mingcute/server-line.value should try to use pure numbers; numerical units are preferred to be expressed in label or desc.palette is recommended to use inline simple array syntax, such as palette #4f46e5 #06b6d4 #10b981.palette are raw values, without quotes and commas.data only contains one main data field matching the template, avoid mixing lists, sequences, compares, values, root, nodes at the same time.Main data field selection rules:
list-* → listssequence-* → sequences, optional order asc|descsequence-interaction-* → sequences + relations
sequences represents the lane listlabelchildren of each lane represent the node listchildren must be written as an object item and contain a labelid, icon, step, desc, valuestep is used to represent the time level; the same step is at the same heightcompare-* → compares
compare-binary-* / compare-hierarchy-left-right-*
compares must and can only have two root nodes, representing the two sides of the comparison respectivelychildrenchildrenchildren must be written as an object item and contain a labelchildrencompare-swot
compares can directly contain multiple root nodeschildrencompare-quadrant-*
compares directly contains 4 quadrant root nodeshierarchy-structure → itemshierarchy-* → Single root, recursively nested through childrenrelation-* → nodes + relations
chart-* → values
chart-line-plain-text / chart-bar-plain-text / chart-column-simple all use a single ordered sequence of valueslabel to represent the category, and value to represent the numerical valuevaluesitems as a fallbackTheme rules:
theme is used for custom themes, such as palette, base, stylizetheme.base.text.font-family to specify the font, such as 851tegakizatsutheme.stylize to select built-in styles and pass parameters
rough: hand-drawn effectpattern: pattern filllinear-gradient / radial-gradient: gradient styleProvide concise but complete positive examples by template category:
list-* templatesinfographic list-grid-badge-card
data
title Feature List
lists
- label Fast
icon flash fast
- label Secure
icon shield check
sequence-* templatesinfographic sequence-ascending-steps
data
title Release Process
sequences
- label Requirement Confirmation
- label Development Implementation
- label Release to Production
order asc
sequence-interaction-* templatesinfographic sequence-interaction-compact-animated-badge-card
data
title Login Verification Process
sequences
- label User
children
- label Initiate Login
id user-login
step 0
- label Receive Result
id user-result
step 2
- label Server
children
- label Verify Credentials
id server-verify
step 1
- label Return Result
id server-return
step 2
relations
user-login - Submit Account Password -> server-verify
server-verify - Generate Result -> server-return
server-return - Return Result -> user-result
hierarchy-* templatesinfographic hierarchy-tree-curved-line-rounded-rect-node
data
title Organizational Structure
root
label Company
children
- label Product Department
- label Technology Department
compare-swot templatesinfographic compare-swot
data
title Product SWOT
compares
- label Strengths
children
- label High Brand Awareness
- label Weaknesses
children
- label High Cost Pressure
compare-binary-* templatesinfographic compare-binary-horizontal-simple-fold
data
title Dining Table Price Comparison
compares
- label Original Price
children
- label Original Price
value 500
icon tag
- label Actual Payment
children
- label Actual Payment
value 450
icon check bold
compare-quadrant-* templatesinfographic compare-quadrant-quarter-simple-card
data
title Task Priority
compares
- label High Value Low Cost
- label High Value High Cost
- label Low Value Low Cost
- label Low Value High Cost
chart-line-plain-text templatesinfographic chart-line-plain-text
data
title Model A Accuracy Change
desc Most obvious improvement in week 4
values
- label Week1
value 86.5
- label Week2
value 87.3
- label Week3
value 89.1
- label Week4
value 91.2
theme
palette #4f46e5 #db2777 #14b8a6
relation-* templatesinfographic relation-dagre-flow-tb-simple-circle-node
data
title System Relationship
nodes
- label API
- id db
label DB
relations
API - Read/Write -> db
items examplesinfographic list-row-horizontal-icon-arrow
data
title Key Points Summary
items
- label Efficiency First
desc Focus on key actions
- label Results Oriented
desc Output actionable conclusions
sequence-*sequence-interaction-*list-row-* / list-column-* / list-grid-*compare-binary-*
children separately for the two sidescompare-swotcompare-quadrant-*hierarchy-tree-*chart-line-plain-textchart-bar-plain-text / chart-column-simplerelation-*chart-wordcloudhierarchy-mindmap-*infographic list-row-horizontal-icon-arrow
data
title Product Growth Key Points
desc Focus on three stages: acquisition, conversion, and repurchase
lists
- label Acquisition
desc Multi-channel delivery and content reach
icon rocket launch
- label Conversion
desc Optimize path and reduce churn
icon chart line
- label Repurchase
desc Member privileges and tiered operations
icon repeat
theme
palette #3b82f6 #8b5cf6 #f97316
Only output a single plain code block, do not add any explanatory text:
infographic list-row-horizontal-icon-arrow
data
title Title
desc Description
lists
- label Item
value 12.5
desc Explanation
icon document text
theme
palette #3b82f6 #8b5cf6 #f97316
Before outputting, check the following items:
infographic <template-name>?palette an array of raw color values without quotes and commas?sequence-interaction-* all written as children -> - label ...?compare-binary-* / compare-hierarchy-left-right-*, are there only two root nodes, and is the content of both sides placed under their respective children?children explicitly contain a label?chart-line-plain-text use a single ordered sequence of values?Before creating an infographic, first understand the user's needs and the information they want to express, in order to determine the template and data structure.
If the user provides a clear description of the content, it should be decomposed into a clear and concise structure.
Otherwise, you need to clarify with the user (e.g., "Please provide a clear and concise content description.", "Which template do you want to use?")
{syntax}.Key Note: You must respect the language input by the user. For example, if the user inputs Chinese, the text in the syntax must also be Chinese.
After obtaining the final AntV Infographic syntax, you can generate a complete HTML file according to the following steps:
{title} - Infographichttps://unpkg.com/@antv/infographic@latest/dist/infographic.min.jscontainerwidth: '100%', height: '100%'){title} with the actual title{syntax} with the actual AntV Infographic syntaxconst svgDataUrl = await infographic.toDataURL({ type: 'svg' });Reference HTML template:
<div id="container"></div>
<script src="https://unpkg.com/@antv/infographic@latest/dist/infographic.min.js"></script>
<script>
const infographic = new AntVInfographic.Infographic({
container: '#container',
width: '100%',
height: '100%',
});
infographic.render(`{syntax}`);
document.fonts?.ready.then(() => {
infographic.render(`{syntax}`);
}).catch((error) => console.error('Error waiting for fonts to load:', error));
</script>
Use the Write tool to generate an HTML file, named <title>-infographic.html
Present it to the user:
Note: The HTML file must contain:
toDataURL: This is essential because users often need to embed the resulting infographic in presentations or documents. Providing the export functionality allows them to easily download the final result as a scalable vector graphic.