How antvis/infographic works
AntV Infographic is a declarative infographic-generation and SVG-rendering framework, with an editor and browser-based demos. Its main user flow is to supply infographic syntax and options to the runtime, which parses and resolves templates, themes, and designs before rendering SVG; users can then edit or export the result. The README documents streaming rendering, built-in templates, theming, and editing. Some runtime wiring was not sampled, so uncertain relationships are shown as unverified or omitted.
Main entry points: src/index.ts Public API · syntax/index.ts Syntax parser · Infographic.tsx Infographic runtime · parser.ts Option resolver
Components 28
Generation and rendering
- Public API
src/index.ts - Infographic runtime
src/runtime/Infographic.tsx - Syntax parser
src/syntax/index.ts - Syntax AST parser
src/syntax/parser.ts - Schema mapper
src/syntax/mapper.ts - Relation parser
src/syntax/relations.ts - Option resolver
src/options/parser.ts - SVG renderer
src/renderer/renderer.ts - SVG element runtime
src/jsx/jsx-runtime.ts - Element bounds
src/jsx/utils/bounds.ts - Resource loaders
src/resource
Design system
- Template registry
src/templates/registry.ts - Built-in templates
src/templates/built-in.ts - Design catalog
src/designs - Theme system
src/themes
Editing and output
- Interactive editor
src/editor/interactions/base.ts - SVG export
src/exporter/svg.ts
User experiences
- AI playground
site/src/components/AIPlayground/Service.ts - Live editor
site/src/components/LiveEditor - Template preview
dev/src/Preview.tsx - Streaming preview
dev/src/StreamPreview.tsx - Composite preview
dev/src/Composite.tsx - Preview settings
dev/src/hooks/usePreviewSettings.ts - Preview data
dev/src/hooks/usePreviewData.ts - Preview interactions
dev/src/hooks/usePreviewInteractions.ts - Preview datasets
shared/datasets.ts - Local storage
dev/src/utils/storage.ts
Other components
- Application developer
Connections 38
- Application developer → Public API: uses
README.md - Public API → Infographic runtime: exports
src/index.ts - Public API → Syntax parser: exports
src/index.ts - Public API → Template registry: exports
src/index.ts - Syntax parser → Syntax AST parser: parses AST
src/syntax/index.ts - Syntax parser → Schema mapper: maps schemas
src/syntax/index.ts - Syntax parser → Relation parser: parses relations
src/syntax/index.ts - Option resolver → Template registry: resolves templates
src/options/parser.ts - Option resolver → Design catalog: resolves designs
src/options/parser.ts - Option resolver → Theme system: resolves themes
src/options/parser.ts - Template registry → Built-in templates: loads built-ins
src/templates/index.ts - Public API → Design catalog: exports
src/index.ts - Public API → Theme system: exports
src/index.ts - Public API → SVG renderer: exports
src/index.ts - Public API → SVG element runtime: exports
src/index.ts - Public API → Resource loaders: exports
src/index.ts - Public API → Interactive editor: exports
src/index.ts - Public API → SVG export: exports
src/index.ts - Infographic runtime → Syntax parser: parses input
- Infographic runtime → Option resolver: resolves options
- Infographic runtime → SVG renderer: renders graphic
- SVG renderer → SVG element runtime: creates SVG
- SVG element runtime → Element bounds: measures elements
- Public API → Interactive editor: enables editing
README.md - Public API → SVG export: exports SVG
src/index.ts - Application developer → AI playground: generates content
README.md - Application developer → Live editor: edits infographic
README.md - Application developer → Template preview: previews templates
- Application developer → Streaming preview: views streaming
README.md - Template preview → Composite preview: composes preview
dev/src/App.tsx - Streaming preview → Composite preview: shares preview
- Composite preview → Preview settings: uses settings
- Composite preview → Preview data: uses data
- Preview interactions → Preview settings: coordinates
dev/src/hooks/usePreviewInteractions.ts - Preview interactions → Preview data: updates data
dev/src/hooks/usePreviewInteractions.ts - Preview interactions → Preview datasets: selects dataset
dev/src/hooks/usePreviewInteractions.ts - Preview settings → Local storage: persists settings
dev/src/hooks/usePreviewSettings.ts - Preview data → Local storage: persists data
dev/src/hooks/usePreviewData.ts