3D桑基图

组件名称:3D桑基图

组件样式:

数据概览组件

组件说明: 桑基图组件返回格式。

请求方式:POST

https://doc.tingyun.com/sense/example/sankey.json

参数

字段 类型 描述 是否必选
currentTime Number 当前时间戳。
token String 盐值,校验规则为md5(timePeriod+currentTime+配置的token)。
例如:timePeriod为30,currentTime为1513137332798,token为abc,则应对301513137332798abc进行MD5运算。
timePeriod Number 时间范围分钟数。

正确响应数据

字段 类型 描述
nodes Object[] 节点数组。
id Number、String ID可以是字符串或者数字。
name String 节点的名称。
links Object[] 链接数组。
from Number 链接的起点,对应节点在数组中的下标(不是ID)。
to Number 链接的终点,对应节点在数组中的下标(不是ID)。
weight Number 链接的宽度。

说明:nodes中的id最好采用数组的下标,方便与links中对应。

示例: 示例1:

{
  "nodes": [
    { "id": 0, "name": "node0" },
    { "id": 1, "name": "node1" },
    { "id": 2, "name": "node2" },
    { "id": 3, "name": "node3" },
    { "id": 4, "name": "node4" }
  ],
  "links": [
    { "from": 0, "to": 2, "weight": 8 },
    { "from": 1, "to": 2, "weight": 2 },
    { "from": 1, "to": 3, "weight": 2 },
    { "from": 0, "to": 3, "weight": 2 },
    { "from": 2, "to": 3, "weight": 2 },
    { "from": 2, "to": 4, "weight": 2 },
    { "from": 3, "to": 4, "weight": 4 }
  ]
}

示例2:

links中字段名称也可以采用另外一种表示法:source-target-value,他们分布对应from-to-weight。

{ 
  "nodes": [
    { "node": 0, "name": "node0" },
    { "node": 1, "name": "node1" },
    { "node": 2, "name": "node2" },
    { "node": 3, "name": "node3" },
    { "node": 4, "name": "node4" },
    { "node": 5, "name": "node5" },
    { "node": 6, "name": "node6" },
    { "node": 7, "name": "node7" },
    { "node": 8, "name": "node8" },
    { "node": 9, "name": "node9" },
    { "node": 10, "name": "node10" },
  ],
  "links": [
    { "source": 0, "target": 1, "value": 1 },
    { "source": 0, "target": 2, "value": 1 },
    { "source": 0, "target": 3, "value": 2 },
    { "source": 0, "target": 4, "value": 1 },
    { "source": 0, "target": 5, "value": 1 },
    { "source": 1, "target": 6, "value": 1 },
    { "source": 2, "target": 7, "value": 1 },
    { "source": 3, "target": 7, "value": 2 },
    { "source": 4, "target": 8, "value": 1 },
    { "source": 5, "target": 9, "value": 1 },
    { "source": 7, "target": 10, "value": 3 },
    { "source": 8, "target": 10, "value": 1 },
    { "source": 6, "target": 10, "value": 1 },
  ]
}
© 2007-2023 北京基调网络股份有限公司 all right reserved,powered by Gitbook本文档更新于: 2021-11-26 14:18

results matching ""

    No results matching ""