环形拓扑
组件名称: 环形拓扑
组件样式:
组件说明: 环形拓扑图,需要指定层级。
请求方式:POST
https://doc.tingyun.com/sense/example/ringtopology.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 | 节点的名称。 | |
zIndex | Number | 节点的层级。 | |
links | Object[] | 链接数组。 | |
source | Number | 链接的起点,对应节点在数组中的下标(不是ID)。 | |
target | Number | 链接的终点,对应节点在数组中的下标(不是ID)。 | |
value | Number | 链接的值。 |
说明:nodes中的id最好采用数组的下标,方便与links中对应。
示例: 示例1:
{
"nodes": [
{
"id": 0,
"zIndex": 1,
"name": "节点0",
"value": 22
},
{
"id": 1,
"zIndex": 1,
"name": "节点1",
"value": 87
},
{
"id": 2,
"zIndex": 1,
"name": "节点2",
"value": 49
},
{
"id": 3,
"zIndex": 1,
"name": "节点3",
"value": 22
},
{
"id": 4,
"zIndex": 1,
"name": "节点4",
"value": 50
},
{
"id": 5,
"zIndex": 1,
"name": "节点5",
"value": 82
},
{
"id": 6,
"zIndex": 1,
"name": "节点6",
"value": 49
},
{
"id": 7,
"zIndex": 1,
"name": "节点7",
"value": 40
},
{
"id": 8,
"zIndex": 1,
"name": "节点8",
"value": 86
},
{
"id": 9,
"zIndex": 1,
"name": "节点9",
"value": 57
},
{
"id": 10,
"zIndex": 1,
"name": "节点10",
"value": 55
},
{
"id": 11,
"zIndex": 1,
"name": "节点11",
"value": 91
},
{
"id": 12,
"zIndex": 1,
"name": "节点12",
"value": 28
},
{
"id": 13,
"zIndex": 1,
"name": "节点13",
"value": 73
},
{
"id": 14,
"zIndex": 1,
"name": "节点14",
"value": 73
},
{
"id": 15,
"zIndex": 1,
"name": "节点15",
"value": 76
},
{
"id": 16,
"zIndex": 1,
"name": "节点16",
"value": 96
},
{
"id": 17,
"zIndex": 1,
"name": "节点17",
"value": 64
},
{
"id": 18,
"zIndex": 1,
"name": "节点18",
"value": 55
},
{
"id": 19,
"zIndex": 1,
"name": "节点19",
"value": 19
}
],
"links": [
{
"source": 0,
"target": 0,
"value": 66
},
{
"source": 1,
"target": 0,
"value": 53
},
{
"source": 2,
"target": 0,
"value": 63
},
{
"source": 3,
"target": 1,
"value": 16
},
{
"source": 4,
"target": 2,
"value": 32
},
{
"source": 5,
"target": 1,
"value": 80
},
{
"source": 6,
"target": 2,
"value": 23
},
{
"source": 7,
"target": 2,
"value": 12
},
{
"source": 8,
"target": 6,
"value": 80
},
{
"source": 9,
"target": 3,
"value": 61
},
{
"source": 10,
"target": 1,
"value": 99
},
{
"source": 11,
"target": 0,
"value": 13
},
{
"source": 12,
"target": 0,
"value": 33
},
{
"source": 13,
"target": 11,
"value": 38
},
{
"source": 14,
"target": 13,
"value": 17
},
{
"source": 15,
"target": 9,
"value": 86
},
{
"source": 16,
"target": 0,
"value": 84
},
{
"source": 17,
"target": 11,
"value": 43
},
{
"source": 18,
"target": 5,
"value": 13
},
{
"source": 19,
"target": 8,
"value": 99
}
]
}
示例2:
zIndex分两层
{
"nodes": [
{
"id": 0,
"zIndex": 1,
"name": "节点0",
"value": 98
},
{
"id": 1,
"zIndex": 1,
"name": "节点1",
"value": 57
},
{
"id": 2,
"zIndex": 1,
"name": "节点2",
"value": 26
},
{
"id": 3,
"zIndex": 1,
"name": "节点3",
"value": 95
},
{
"id": 4,
"zIndex": 1,
"name": "节点4",
"value": 58
},
{
"id": 5,
"zIndex": 1,
"name": "节点5",
"value": 53
},
{
"id": 6,
"zIndex": 1,
"name": "节点6",
"value": 22
},
{
"id": 7,
"zIndex": 1,
"name": "节点7",
"value": 55
},
{
"id": 8,
"zIndex": 1,
"name": "节点8",
"value": 93
},
{
"id": 9,
"zIndex": 1,
"name": "节点9",
"value": 72
},
{
"id": 10,
"zIndex": 1,
"name": "节点10",
"value": 53
},
{
"id": 11,
"zIndex": 1,
"name": "节点11",
"value": 81
},
{
"id": 12,
"zIndex": 1,
"name": "节点12",
"value": 70
},
{
"id": 13,
"zIndex": 1,
"name": "节点13",
"value": 84
},
{
"id": 14,
"zIndex": 1,
"name": "节点14",
"value": 26
},
{
"id": 15,
"zIndex": 1,
"name": "节点15",
"value": 20
},
{
"id": 16,
"zIndex": 1,
"name": "节点16",
"value": 50
},
{
"id": 17,
"zIndex": 1,
"name": "节点17",
"value": 91
},
{
"id": 18,
"zIndex": 1,
"name": "节点18",
"value": 18
},
{
"id": 19,
"zIndex": 1,
"name": "节点19",
"value": 40
},
{
"id": 20,
"zIndex": 1,
"name": "节点20",
"value": 63
},
{
"id": 21,
"zIndex": 1,
"name": "节点21",
"value": 21
},
{
"id": 22,
"zIndex": 1,
"name": "节点22",
"value": 71
},
{
"id": 23,
"zIndex": 1,
"name": "节点23",
"value": 92
},
{
"id": 24,
"zIndex": 1,
"name": "节点24",
"value": 11
},
{
"id": 25,
"zIndex": 1,
"name": "节点25",
"value": 16
},
{
"id": 26,
"zIndex": 1,
"name": "节点26",
"value": 99
},
{
"id": 27,
"zIndex": 1,
"name": "节点27",
"value": 94
},
{
"id": 28,
"zIndex": 1,
"name": "节点28",
"value": 88
},
{
"id": 29,
"zIndex": 1,
"name": "节点29",
"value": 86
},
{
"id": 30,
"zIndex": 1,
"name": "节点30",
"value": 71
},
{
"id": 31,
"zIndex": 1,
"name": "节点31",
"value": 20
},
{
"id": 32,
"zIndex": 2,
"name": "节点32",
"value": 66
},
{
"id": 33,
"zIndex": 2,
"name": "节点33",
"value": 56
},
{
"id": 34,
"zIndex": 2,
"name": "节点34",
"value": 57
},
{
"id": 35,
"zIndex": 2,
"name": "节点35",
"value": 24
}
],
"links": [
{
"source": 34,
"target": 22,
"value": 75
},
{
"source": 33,
"target": 10,
"value": 86
},
{
"source": 32,
"target": 27,
"value": 10
},
{
"source": 33,
"target": 11,
"value": 72
},
{
"source": 33,
"target": 10,
"value": 68
},
{
"source": 32,
"target": 27,
"value": 16
},
{
"source": 33,
"target": 8,
"value": 60
},
{
"source": 35,
"target": 8,
"value": 31
},
{
"source": 34,
"target": 13,
"value": 67
},
{
"source": 35,
"target": 8,
"value": 28
},
{
"source": 35,
"target": 1,
"value": 78
},
{
"source": 35,
"target": 4,
"value": 40
},
{
"source": 33,
"target": 27,
"value": 58
},
{
"source": 34,
"target": 13,
"value": 90
},
{
"source": 32,
"target": 11,
"value": 64
},
{
"source": 32,
"target": 26,
"value": 64
},
{
"source": 33,
"target": 6,
"value": 18
},
{
"source": 35,
"target": 4,
"value": 30
},
{
"source": 35,
"target": 1,
"value": 39
},
{
"source": 33,
"target": 11,
"value": 70
},
{
"source": 32,
"target": 12,
"value": 90
},
{
"source": 35,
"target": 11,
"value": 29
},
{
"source": 35,
"target": 3,
"value": 85
},
{
"source": 35,
"target": 7,
"value": 49
},
{
"source": 34,
"target": 27,
"value": 79
},
{
"source": 35,
"target": 23,
"value": 97
},
{
"source": 33,
"target": 28,
"value": 40
},
{
"source": 34,
"target": 28,
"value": 64
},
{
"source": 32,
"target": 26,
"value": 19
},
{
"source": 32,
"target": 16,
"value": 65
},
{
"source": 32,
"target": 8,
"value": 40
},
{
"source": 32,
"target": 10,
"value": 46
}
]
}