当前位置:网站首页>Datagear uses coordinate mapping table to make geographic coordinate data visualization Kanban
Datagear uses coordinate mapping table to make geographic coordinate data visualization Kanban
2022-06-21 19:53:00 【DataGear】
DataGear The data set structure of is composed of Dataset properties It means , Data set attributes are not required to be consistent with the actual data structure , Can be added freely 、 edit 、 Delete . Take advantage of this feature , You can add placeholder attributes to the dataset ( There is no corresponding actual data ), Then when the Kanban shows its associated charts , adopt dg-chart-listener Of onUpdate The function completes the data , So as to realize the data expansion function .
This paper takes the flying line map as an example , Describes how to take advantage of these features , Is a dataset that contains only region name information , Make data visualization kanban .
Suppose you have the following region name data set :
name :
Source region name / Destination area name
data :
Source region name , Destination area name
xinjiang , Beijing
sichuan , Beijing
guangdong , Beijing
Zhejiang , Beijing
After preview , Its attribute list is :
name type
Source region name character string
Destination area name character string
The map Flyline map requires the data set to have the following attributes : Source longitude 、 Source latitude 、 End longitude 、 Latitude of destination , therefore , These four placeholder attributes are manually added here for the above data set :
name type
Source region name character string
Destination area name character string
Longitude of source region The number
Source latitude The number
Terminal longitude The number
Latitude of the final region The number
then , New map Flyline map , As shown below :
name : Map Flyline map
Chart type : Map Flyline map
Data sets :
Longitude of source region -> Source longitude
Source latitude -> Source latitude
Terminal longitude -> End longitude
Latitude of the final region -> Latitude of destination
At this point, the display chart will be a blank Flyline chart , Because there is no actual geographic coordinate data .
then , New Kanban , Add the above chart , To add dg-chart-listener Chart listener , And through its onUpdate Function to complete geographic coordinate data , As shown below :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css"> .chart{
display: inline-block; width: 100%; height: 500px; } </style>
<script> // Region name -> Geographic coordinate mapping table var coordMap= {
" xinjiang ": [85.523256,41.094106], " sichuan ": [103.037483,30.450264], " guangdong ": [113.560737,23.669933], " Zhejiang ": [119.962996,29.037435], " Beijing ": [116.651482,40.253657], }; var chartListener= {
onUpdate: function(chart, results) {
var result = chart.resultFirst(results); var datas = chart.resultDatas(result); for(var i=0; i<datas.length; i++) {
var di = datas[i]; var srcCoord = (coordMap[di[' Source region name ']] || {
}); var targetCoord = (coordMap[di[' Destination area name ']] || {
}); di[' Longitude of source region '] = srcCoord[0]; di[' Source latitude '] = srcCoord[1]; di[' Terminal longitude '] = targetCoord[0]; di[' Latitude of the final region '] = targetCoord[1]; } chart.resultData(result, datas); } }; </script>
</head>
<body>
<div class="chart" dg-chart-listener="chartListener" dg-chart-widget=" Above chart ID"></div>
</body>
</html>
Click on [ Save and show ] Button , Open the Kanban display page , complete !!!
The effect is shown below :

Official website address :http://www.datagear.tech
Source code address :
Gitee:https://gitee.com/datagear/datagear
Github:https://github.com/datageartech/datagear
Big screen template address :https://gitee.com/datagear/DataGearDashboardTemplate
边栏推荐
- 论文解读(USIB)《Towards Explanation for Unsupervised Graph-Level Representation Learning》
- jvm造轮子
- Write down some pat topics (I)
- 机器学习之贝叶斯分类与集成学习
- Sword finger offer II 029 Sorted circular linked list
- Qt Creator 7.0常见问题和常见用法
- 2022年6月25日PMP考试通关宝典-4
- Nebula Graph入驻阿里云计算巢,助力企业打造云上超大规模图数据库
- Experience sharing of Sanye's friends: Qianqiu Shu (general manager of Qianqiu)
- Jupyter Notebook启动方式及相关问题
猜你喜欢

Shang Silicon Valley Shang Silicon Valley | what is Clickhouse table engine memory and merge

基于ASP.NET开发的企信通源码 短信管理平台源码

MFC界面库BCGControlBar v33.0 - 桌面警报窗口、网格控件升级

508. Most Frequent Subtree Sum
![[pwn基础]Pwntools学习](/img/72/0f80d2f91d772e361b6d23a67e2ca3.png)
[pwn基础]Pwntools学习

SQL operation: with expression and its application

After the 80 version of Google browser, how to deal with the problem samesite cross domain problem

TensorFlow 2:使用神经网络对Fashion MNIST分类并进行比较分析

Nacos configuration center source code

CPDA|数据分析师需要具备哪些基本功?
随机推荐
yolov5训练自己的数据集报错记录
6月25日PMP考前指南,你需要做好这些
Startup mode of Jupiter notebook and related problems
在Qt中设置程序图标的方法介绍
The R language uses rbind The fill function vertically merges dataframe data of two different data columns
理财产品到期当日能赎回吗?
How to create network redundancy for network managed national production reinforced switch
R语言使用neuralnet包构建神经网络回归模型(前馈神经网络回归模型),可视化测试集中实际目标值与预测值之间的散点图并分析模型预测的可靠性
基于ASP.NET开发的企信通源码 短信管理平台源码
How to use devaxpress WPF to create the first MVVM application in winui?
【综合笔试题】难度 2.5/5 :「树状数组」与「双树状数组优化」
508. Most Frequent Subtree Sum
Forwarding to remind metamask how to deal with the potential private key disclosure of the expansion program
[high frequency interview questions] difficulty 1/5, popular enumeration simulation questions
Dynamic programming [1] (knapsack problem)
Security框架中使用FastJson反序列化SimpleGrantedAuthority
Sword finger offer II 029 Sorted circular linked list
GetEmptyBlcoksPre Info
pnpm 中无法使用 patch-package 打补丁
LeetCode个人题解(剑指offer 21-25)21. 调整数组顺序使奇数位于偶数前面,22. 链表中倒数第k个节点,24. 反转链表,25. 合并两个排序的链表