AntV Infographic
Home
Learn
Reference
Gallery
Icon
Editor
AI
Enterprise
  • Infographic
    • API
    • 配置项
    • 类型定义
    • 导出内容
  • JSX
    • 原语节点
    • 创建布局
    • 工具函数
  • 设计资产
    • 内置结构
    • 内置数据项
    • 内置模版
    • 内置主题
    • 内置色板
    • 内置图案
    • 内置组件
API Reference
Infographic

配置

实例化 Infographic 类时所需传入的InfographicOptions配置项,详见信息图语法。

此处提供 InfographicOptions 的详细类型定义。

TYPESCRIPT
interface InfographicOptions { /** 容器,可以是选择器或者 HTMLElement */ container?: string | HTMLElement; /** 宽度 */ width?: number | string; /** 高度 */ height?: number | string; /** 容器内边距 */ padding?: Padding; /** 模板 */ template?: string; /** 设计 */ design?: DesignOptions; /** 数据 */ data: Data; /** 主题 */ theme?: string; /** 额外主题配置 */ themeConfig?: ThemeConfig; /** svg 容器上的配置 */ svg?: SVGOptions; /** 启用编辑 */ editable?: boolean; /** 启用插件 */ plugins?: IPlugin[]; /** 启用交互 */ interactions?: IInteraction[]; /** 用于向画布添加图形 */ elements?: ElementProps[]; }

引用类型:Padding、Data、DesignOptions、ThemeConfig、SVGOptions、IPlugin、IInteraction、ElementProps

编辑相关:

  • 将 editable 设为 true 后会创建内置编辑器。默认插件与交互包括 EditBar、ResizeElement、DblClickEditText、ClickSelect、SelectHighlight,可通过 plugins 与 interactions 覆盖或扩展。
  • elements 用于向画布追加初始图形,类型为 ElementProps(编辑器图形定义)。
PreviousAPI
Next类型定义

AntV Infographic
Copyright © Ant Group Co.
Docs
Quick Start
Core Concepts
Custom Design
Infographic Theory
API Reference
JSX
API
Design Assets
More
More Examples
AI Generated Infographics
GitHub
Contribute
Friendly Links
AntV
G2
G6
L7
TYPESCRIPT
interface InfographicOptions {
/** 容器,可以是选择器或者 HTMLElement */
container?: string | HTMLElement;
/** 宽度 */
width?: number | string;
/** 高度 */
height?: number | string;
/** 容器内边距 */
padding?: Padding;
/** 模板 */
template?: string;
/** 设计 */
design?: DesignOptions;
/** 数据 */
data: Data;
/** 主题 */
theme?: string;
/** 额外主题配置 */
themeConfig?: ThemeConfig;
/** svg 容器上的配置 */
svg?: SVGOptions;

/** 启用编辑 */
editable?: boolean;
/** 启用插件 */
plugins?: IPlugin[];
/** 启用交互 */
interactions?: IInteraction[];
/** 用于向画布添加图形 */
elements?: ElementProps[];
}