当前位置:网站首页>Echats关系图les-miserables的图表详细解析(和弦图)
Echats关系图les-miserables的图表详细解析(和弦图)
2022-07-27 10:02:00 【骑上我心爱的小摩托】
echats关系图之les-miserables的图表解析(和弦图)
一、图表展示分析
- 当前遇到的图表为关系图官网连接les-miserables图形编辑,它的数据结构连接为:
https://www.echartsjs.comdata/asset/data/les-miserables.gexf在浏览器内打开后即可下载当前gexf文件。
二、字段含义解释
1.JSON数据字段信息
- 图表内是对gexf格式文件进行了解析。解析出的JSON格式如下(截取部分代码),此处代码命名为graph:
var graph = {
"nodes": [{
"id": "0",
"name": "Myriel",
"itemStyle": {
"normal": {
"color": "rgb(235,81,72)"
}
},
"symbolSize": 28.685715,
"x": -266.82776,
"y": 299.6904,
"attributes": {
"modularity_class": 0
}
}, {
"id": "1",
"name": "Napoleon",
"itemStyle": {
"normal": {
"color": "rgb(236,81,72)"
}
},
"symbolSize": 4,
"x": -418.08344,
"y": 446.8853,
"attributes": {
"modularity_class": 0
}
}, {
"id": "2",
"name": "MlleBaptistine",
"itemStyle": {
"normal": {
"color": "rgb(236,81,72)"
}
},
"symbolSize": 9.485714,
"x": -212.76357,
"y": 245.29176,
"attributes": {
"modularity_class": 1
}
}],
"links": [{
"id": "0",
"name": null,
"source": "1",
"target": "0",
"lineStyle": {
"normal": {}
}
}, {
"id": "1",
"name": null,
"source": "2",
"target": "0",
"lineStyle": {
"normal": {}
}
}, {
"id": "2",
"name": null,
"source": "3",
"target": "0",
"lineStyle": {
"normal": {}
}
}]
2.字段解析
在JSON中信息可以看出来,nodes数组内所包含的为各个点。
而"attributes": { "modularity_class": 0 }中的modularity_class展示的是相同类别的点。
从图中以及官网提供代码可以看出当前为9种品类,分别用不同的颜色代表,即 “modularity_class” 的值为 “0-8” 的整数范围。symbolSize为当前点的值数值大小。modularity_class 值相同的 nodes 点,即为同一类别且同一颜色。每个nodes数组内的点,分别用id该字段作为唯一标志信息。links数组字段代表着连线,其中的
"source": "3", "target": "0",代表含义为:源id 点 (source)连线至目的id点(target),id点值即为上面提到的nodes内的标志信息。links内的每一个数据均代表一根连线。我有尝试用这个关系图来作为城轨交通内的列车运行OD图,但最终失败了。原因在于OD图为双向OD,但该图的双向线会重叠,不太理想的效果。
三、代码解析
官网提供的对于节点代码解析如下:遍历nodes点,根据节点数值symbolSize设置处理为大于10后进行当前节点名称显示,重组node节点字段数据
graph.nodes.forEach(function (node) {
node.itemStyle = null;
node.value = node.symbolSize;
node.symbolSize /= 1.5;
node.label = {
normal: {
show: node.symbolSize > 10
}
};
node.category = node.attributes.modularity_class;
});
四、问题反馈
如有问题可反馈至留言,欢迎指正。
边栏推荐
- Oracle RAC 19C PDB instance is down
- Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk
- QT learning (II) -.Pro file explanation
- How does data analysis solve business problems? Here is a super detailed introduction
- Mysql database experiment training 5, data query YGGL database query (detailed)
- Oracle 11g manual memory management
- Metaspolit
- Color segmentation using kmeans clustering
- 语音识别的一些开源项目整理
- Anaconda installation (very detailed)
猜你喜欢

Understanding and code implementation of Se (sequence and exception) module

Oracle调整数据文件大小杂谈
[email protected], "/>Shell variables, system predefined variables $home, $pwd, $shell, $user, custom variables, special variables $n, $, $*, [email protected],

线代003

Food safety | is sugar free really sugar free? These truths need to be known

Failure of CUDA installation nsight visual studio edition failed

Concurrent Park and unpark description

视觉SLAM十四讲笔记(一):第一讲+第二讲

window平台下本地连接远程服务器数据库(一)
![[scm] source code management - lock of perforce branch](/img/c6/daead474a64a9a3c86dd140c097be0.jpg)
[scm] source code management - lock of perforce branch
随机推荐
Ant高级-task
mount.nfs: access denied by server while mounting解决
3D restoration paper: shape painting using 3D generative advantageous networks and recurrent revolutionary networks
Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk
【英雄哥六月集训】第 24天: 线段树
SE(Squeeze and Excitation)模块的理解以及代码实现
Cannot start after installing MySQL 5.7.27 in CentOS 7? (Language bash)
Configuration of pytorch deep learning environment based on cuda10.0
Matlab-创建 MATLAB的logo
Metasploit-永恒之蓝攻击
Xiandai 004
Concurrent thread state transition
Stylegan paper notes + modify code to try 3D point cloud generation
安装CUDA失败的情况nsight visual studio edition失败
matlab-绘制分叉与混沌分支图
Leetcode.814. binary tree pruning____ DFS
语音数据采集-实时语音数据可视化
3D face reconstruction and dense alignment with position map progression network
Data visualization
Failure of CUDA installation nsight visual studio edition failed