当前位置:网站首页>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;
});
四、问题反馈
如有问题可反馈至留言,欢迎指正。
边栏推荐
- Cannot start after installing MySQL 5.7.27 in CentOS 7? (Language bash)
- Anchor free detector: centernet
- Matlab-绘制叠加阶梯图和线图
- Introduction to regular expressions of shell, general matching, special characters: ^, $,., * Character range (brackets): [], special characters: \, matching mobile phone number
- 【英雄哥六月集训】第 28天: 动态规划
- WGAN、WGAN-GP、BigGAN
- 数据库性能系列之子查询
- hdu5288(OO’s Sequence)
- matlab-绘制分叉与混沌分支图
- Shell流程控制(重点)、if 判断、case 语句、let用法、for 循环中有for (( 初始值;循环控制条件;变量变化 ))和for 变量 in 值 1 值 2 值 3… 、while 循环
猜你喜欢

Pytorch installation (very detailed)

女粉想要找男朋友,竟是为了...
[email protected]、$?、env看所有的全局变量值、set看所有变量"/>Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量

Xiandai 003

StyleGAN论文笔记+修改代码尝试3D点云生成

活体检测综述

Excellent Kalman filter detailed article

PCL各模块概述(1.6)

3D修复论文:Shape Inpainting using 3D Generative Adversarial Network and Recurrent Convolutional Networks

卸载CUDA11.1
随机推荐
FSM onehot answer record
wind10配置adb命令
Word2vec principle and application and article similarity (recommended system method)
备战金九银十Android面试准备(含面试全流程,面试准备工作面试题和资料等)
Food safety | is sugar free really sugar free? These truths need to be known
hugo学习笔记
pytorch的安装(非常详细)
vs2019社区版下载教程(详细)
Open3d library installation, CONDA common instructions, importing open3d times this error solving environment: failed with initial frozen solve Retrying w
Des/3des/aes differences
Understanding of batchnorm2d() function in pytorch
【英雄哥六月集训】第 24天: 线段树
女粉想要找男朋友,竟是为了...
Overview of PCL modules (1.6)
Two architectures of ETL (ETL architecture and ELT Architecture)
open3d库的安装,conda常用指令,导入open3d时报这个错误Solving environment: failed with initial frozen solve. Retrying w
ORACLE 11g手动内存管理
After one year, the paper was finally accepted by the international summit
活体检测综述
Example of ICP registration for PCL