AntV
AntV Infographic
文档
参考
示例
AI
企业版

目录

  • Overview
  • 创建信息图实例
  • 实例方法
  • render
  • compose
  • getTypes
  • Infographic
    • API
    • 配置项
    • 类型定义
    • 导出内容
  • JSX
    • 原语节点
    • 创建布局
    • 工具函数
  • 设计资产
    • 内置结构
    • 内置数据项
    • 内置模版
    • 内置主题
    • 内置色板
    • 内置图案
    • 内置组件
API Reference
Infographic

Infographic API

AntV Infographic 的 API 由 Infographic 类统一对外暴露,用户可以通过该类创建信息图实例,并进行渲染和导出等操作。

创建信息图实例

要创建信息图实例,首先需要导入 Infographic 类,然后通过 new 关键字进行实例化,其构造函数签名为:

constructor (options: InfographicOptions): Infographic;

其中,options 即我们所指的信息图语法用于配置信息图的相关选项,具体配置项请参考配置项。

实例方法

render

根据配置信息渲染信息图。

类型签名:

render(): void

示例:

import {Infographic} from '@antv/infographic'; const infographic = new Infographic({ // 信息图配置 }); infographic.render();

compose

创建未渲染的信息图模版,以供后续渲染使用。

类型签名:

compose(): SVGSVGElement

getTypes

获取当前信息图所需数据的 TS 类型定义,便于通过大模型等工具生成符合要求的数据。

类型签名:

getTypes(): string

上一章Infographic
下一章配置项

AntV Infographic
Copyright © Ant Group Co.
文档
快速开始
核心概念
自定义设计
信息图理论
API 参考
JSX
API
设计资产
更多
更多示例
AI 在线体验
GitHub
参与贡献
友情链接
AntV
G2
G6
L7
constructor (options: InfographicOptions): Infographic;
render(): void
import {Infographic} from '@antv/infographic';

const infographic = new Infographic({
// 信息图配置
});

infographic.render();
compose(): SVGSVGElement
getTypes(): string