简介
该模板为包含统计数据的表格类数据提供桑基图可视化。

上图展示了到 2018 年为止,美国历届总统,姓名、出生地、上任年龄段(十年)、党派、星座间的统计关系。
安装
在 HTML 中引用文件:
<script src="https://unpkg.com/@antv/g6/build/plugin.template.tableSankey.js"></script>
或在 npm 中引用:
import '@antv/g6/build/plugin.template.tableSankey';
参数
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| table | 二维数据(必选) | array | null | |
| fields | 需显示字段 | array | null | |
| showColName | 是否显示字段名 | boolean | true | |
| align | 对齐 | string | sankeyLeft ,sankeyRight ,sankeyCenter , sankeyJustify |
|
| combine | 合并方法 | function |
使用
实例化插件对象:
const tableSankey = new G6.Plugins['template.tableSankey'](config);
在实例化 Graph 时作为插件插入:
const graph = new G6.Graph({container: 'mountNode',plugins: [ tableSankey ]});
