Skip to content

Conversation

@vaayne
Copy link
Collaborator

@vaayne vaayne commented Dec 31, 2025

What this PR does

Before this PR:

  • Only mermaid, plantuml, svg, and graphviz charts were supported in code blocks

After this PR:

  • Added support for rendering @antv/infographic charts in code blocks using infographic or antv-infographic syntax
image image

Why we need it and why it was done in this way

AntV Infographic is a powerful declarative infographic visualization engine that supports AI-friendly syntax for generating high-quality infographics. This complements the existing mermaid support.

The implementation follows the same patterns as mermaid:

  • Lazy loading hook (useInfographic) for the library
  • Preview component with debounced rendering
  • Theme support (dark/light)
  • Proper cleanup on unmount

The following tradeoffs were made:

  • Used any type for the module (consistent with useMermaid pattern) due to linter restrictions on typeof import()
  • Height capped at min(width * 0.6, 400px) for reasonable aspect ratio

Breaking changes

None

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)

Release note

Added support for rendering @antv/infographic charts in code blocks

@0xfullex
Copy link
Collaborator

image

@hustcc
Copy link

hustcc commented Jan 5, 2026

image

Note

This comment was translated by Claude.

  • It was open-sourced in November 2025, validated for production use in December, some articles were published, and downloads are still accumulating.
  • The NPM package size includes four directories: cjs, esm, dist, and src. The actual minified size is ~500kb, and gzipped size is ~180kb.

Original Content
  • 2025-11-22 才对外开源出来,到 12 月才业务验证,对外发了一些文章,下载量还在积累中。
  • NPM 包大小包含了 cjs、esm、dist、src 四个目录大小,实际大小 min 后 ~500kb,gzip 约 ~180kb。

@vaayne vaayne closed this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants