-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fmt_gps_josn funs to transform df to echarts lines json data
- Loading branch information
1 parent
b2c4e78
commit 601c6b0
Showing
9 changed files
with
376 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# dataframe --------------------------------------------------------------- | ||
|
||
#' @importFrom tibble data_frame | ||
#' @export | ||
tibble::data_frame | ||
|
||
#' @importFrom tibble as_data_frame | ||
#' @export | ||
tibble::as_data_frame | ||
|
||
|
||
#' @importFrom tibble add_row | ||
#' @export | ||
tibble::add_row | ||
|
||
# glimpse ----------------------------------------------------------------- | ||
|
||
#' @importFrom tibble glimpse | ||
#' @export | ||
tibble::glimpse | ||
|
||
#' @importFrom tibble tibble | ||
#' @export | ||
tibble::tibble | ||
|
||
#' @importFrom tibble as_tibble | ||
#' @export | ||
tibble::as_tibble | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#' @importFrom magrittr %>% | ||
#' @export | ||
magrittr::`%>%` | ||
|
||
#' Get the position of x in vector y | ||
#' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
<!DOCTYPE html> | ||
<html style="height: 100%"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script type="text/javascript" src="js/jquery.min.js"></script> | ||
<script type="text/javascript" src="js/echarts-all-3.js"></script> | ||
<script type="text/javascript" src="js/ecStat.min.js"></script> | ||
<script type="text/javascript" src="js/dataTool.min.js"></script> | ||
<script type="text/javascript" src="js/china.js"></script> | ||
<script type="text/javascript" src="js/world.js"></script> | ||
<script type="text/javascript" src="http://api.map.baidu.com/getscript?v=2.0&ak=30DBi9lWqva00t5mPZyonlzpQroDtfiC"></script> | ||
<script type="text/javascript" src="js/bmap.min.js"></script> | ||
|
||
<title>上海市</title> | ||
</head> | ||
|
||
<body style="height: 100%; margin: 0"> | ||
<div id="container" style="height: 100%"></div> | ||
<script type="text/javascript"> | ||
var dom = document.getElementById("container"); | ||
var myChart = echarts.init(dom); | ||
|
||
|
||
$.getJSON('../json/<<usr_id>>.json', function(data) { | ||
var lines = data; | ||
|
||
myChart.setOption(option = { | ||
bmap: { | ||
center: [121.480524,31.23595], | ||
zoom: 12, | ||
roam: true, | ||
// mapStyle: { | ||
// styleJson: [ | ||
// { | ||
// 'featureType': 'land', //调整土地颜色 | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'color': '#081734' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'building', //调整建筑物颜色 | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'color': '#04406F' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'building', //调整建筑物标签是否可视 | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'on' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'highway', //调整高速道路颜色 | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// // 'color': '#015B99' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'highway', //调整高速名字是否可视 | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'arterial', //调整一些干道颜色 | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'color':'#003051' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'arterial', | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'green', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'water', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'color': '#044161' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'subway', //调整地铁颜色 | ||
// 'elementType': 'geometry.stroke', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// // 'color': '#003051' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'subway', | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'railway', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'railway', | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'all', //调整所有的标签的边缘颜色 | ||
// 'elementType': 'labels.text.stroke', | ||
// 'stylers': { | ||
// 'color': '#313131' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'all', //调整所有标签的填充颜色 | ||
// 'elementType': 'labels.text.fill', | ||
// 'stylers': { | ||
// 'color': '#FFFFFF' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'manmade', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'manmade', | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'on' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'local', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'local', | ||
// 'elementType': 'labels', | ||
// 'stylers': { | ||
// 'visibility': 'off' | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'subway', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'lightness': -65 | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'railway', | ||
// 'elementType': 'all', | ||
// 'stylers': { | ||
// 'lightness': -40 | ||
// } | ||
// }, | ||
// { | ||
// 'featureType': 'boundary', | ||
// 'elementType': 'geometry', | ||
// 'stylers': { | ||
// 'color': '#8b8787', | ||
// 'weight': '1', | ||
// 'lightness': 10 | ||
// } | ||
// }] | ||
// } | ||
}, | ||
title: { | ||
text: '\n 用户行程的起点终点分布情况', | ||
left: 'center', | ||
textStyle: { | ||
color: '#fff', | ||
fontWeight: 'bold', | ||
fontSize: 26 | ||
} | ||
}, | ||
series: [ { | ||
type: 'lines', | ||
coordinateSystem: 'bmap', | ||
polyline: false, | ||
data: lines, | ||
large:true, | ||
lineStyle: { | ||
normal: { | ||
color: '#66C2A5', | ||
width: 1.5, | ||
opacity: 0.5, | ||
curveness: 0.2, | ||
} | ||
}, | ||
effect: { | ||
color: { | ||
type: 'linear', | ||
x: 0, | ||
y: 0, | ||
x2: 1, | ||
y2: 1, | ||
colorStops: [{ | ||
offset: 0, color: 'red' // 0% 处的颜色 | ||
}, { | ||
offset: 1, color: 'blue' // 100% 处的颜色 | ||
}], | ||
globalCoord: true // 缺省为 false | ||
}, | ||
constantSpeed: 30, | ||
show: true, | ||
trailLength: 0, | ||
symbol: 'pin', | ||
symbolSize: 5 | ||
}, | ||
zlevel: 1 | ||
}], | ||
blendMode: 'lighter' | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.