-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
484 additions
and
57,442 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ yarn.lock | |
|
||
# Folder | ||
coverage | ||
|
||
# Other | ||
*.map |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,126 +1,136 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<head> | ||
<title>netjsongraph.js: Dark Colors</title> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" | ||
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" | ||
crossorigin=""/> | ||
<meta charset="utf-8" /> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" | ||
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==" | ||
crossorigin="" | ||
/> | ||
<!-- theme can be easily customized via css --> | ||
<link href="../src/css/netjsongraph-theme.css" rel="stylesheet"> | ||
<link href="../src/css/netjsongraph.css" rel="stylesheet"> | ||
<link href="../src/css/netjsongraph-theme.css" rel="stylesheet" /> | ||
<link href="../src/css/netjsongraph.css" rel="stylesheet" /> | ||
<style type="text/css"> | ||
.njg-metadata{ | ||
left: 50px; | ||
} | ||
.njg-metadata { | ||
left: 50px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="../dist/netjsongraph.min.js"></script> | ||
<script> | ||
/* | ||
/* | ||
The demo is used to show hwo to set path animation. | ||
See `mapLinkConfig` below for details. | ||
*/ | ||
const graph = new NetJSONGraph("./data/airplaneRouteMap.json", { | ||
render: "map", | ||
echartsOption: { | ||
title: { | ||
text: "Airplane route map", | ||
subtext: "Develop By WanderGIS", | ||
left: "center", | ||
textStyle: { | ||
color: "#fff" | ||
} | ||
}, | ||
const graph = new NetJSONGraph("./data/airplaneRouteMap.json", { | ||
render: "map", | ||
echartsOption: { | ||
title: { | ||
text: "Airplane route map", | ||
subtext: "Develop By WanderGIS", | ||
left: "center", | ||
textStyle: { | ||
color: "#fff", | ||
}, | ||
// set map initial state. | ||
mapOptions: { | ||
center: [34.86, 112.5], | ||
zoom: 6, | ||
}, | ||
}, | ||
// set map initial state. | ||
mapOptions: { | ||
center: [34.86, 112.5], | ||
zoom: 6, | ||
}, | ||
// set map tiles config, can set multiple values. | ||
mapTileConfig: [ | ||
{ | ||
label: "Blue Street", | ||
urlTemplate: | ||
"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}", | ||
options: { | ||
minZoom: 0.25, | ||
maxZoom: 18, | ||
}, | ||
// set map tiles config, can set multiple values. | ||
mapTileConfig: [{ | ||
label: "Blue Street", | ||
urlTemplate: "http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}", | ||
options: { | ||
minZoom: 0.25, | ||
maxZoom: 18, | ||
} | ||
}], | ||
}, | ||
], | ||
|
||
// Convert to internal json format | ||
prepareData: data => { | ||
data.nodes.map(node => { | ||
node.label = node.name; | ||
node.properties = Object.assign(node.properties || {}, { | ||
location: node.location, | ||
}) | ||
}) | ||
// Convert to internal json format | ||
prepareData: (data) => { | ||
data.nodes.map((node) => { | ||
node.label = node.name; | ||
node.properties = Object.assign(node.properties || {}, { | ||
location: node.location, | ||
}); | ||
}); | ||
}, | ||
|
||
// Map lines configuration | ||
mapLinkConfig: [ | ||
{ | ||
type: "lines", | ||
zlevel: 1, | ||
// Define track point effects | ||
effect: { | ||
show: true, | ||
// Define special effects time | ||
period: 6, | ||
// Define the length of the effect | ||
trailLength: 0.7, | ||
// color of the track points | ||
color: "#fff", | ||
symbolSize: 3, | ||
}, | ||
lineStyle: { | ||
normal: { | ||
color: "#a6c84c", | ||
width: 0, | ||
curveness: 0.2, | ||
}, | ||
}, | ||
}, | ||
{ | ||
// set two level lines. | ||
zlevel: 2, | ||
effect: { | ||
show: true, | ||
period: 6, | ||
trailLength: 0, | ||
// Custom effects images(Svg format,scale to fit size automatically.) | ||
symbol: | ||
"path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z", | ||
symbolSize: 15, | ||
}, | ||
lineStyle: { | ||
normal: { | ||
color: "#a6c84c", | ||
width: 1, | ||
opacity: 0.4, | ||
curveness: 0.2, | ||
}, | ||
}, | ||
|
||
// Map lines configuration | ||
mapLinkConfig: [{ | ||
type: "lines", | ||
zlevel: 1, | ||
// Define track point effects | ||
effect: { | ||
show: true, | ||
// Define special effects time | ||
period: 6, | ||
// Define the length of the effect | ||
trailLength: 0.7, | ||
// color of the track points | ||
color: "#fff", | ||
symbolSize: 3 | ||
}, | ||
lineStyle: { | ||
normal: { | ||
color: "#a6c84c", | ||
width: 0, | ||
curveness: 0.2 | ||
} | ||
}, | ||
}, { | ||
// set two level lines. | ||
zlevel: 2, | ||
effect: { | ||
show: true, | ||
period: 6, | ||
trailLength: 0, | ||
// Custom effects images(Svg format,scale to fit size automatically.) | ||
symbol: "path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z", | ||
symbolSize: 15 | ||
}, | ||
lineStyle: { | ||
normal: { | ||
color: "#a6c84c", | ||
width: 1, | ||
opacity: 0.4, | ||
curveness: 0.2 | ||
} | ||
}, | ||
}], | ||
mapNodeConfig: { | ||
zlevel: 2, | ||
rippleEffect: { | ||
brushType: "stroke" | ||
}, | ||
label: { | ||
color: "#a6c84c", | ||
}, | ||
itemStyle: { | ||
normal: { | ||
color: "#a6c84c" | ||
} | ||
}, | ||
}, | ||
], | ||
mapNodeConfig: { | ||
zlevel: 2, | ||
rippleEffect: { | ||
brushType: "stroke", | ||
}, | ||
label: { | ||
color: "#a6c84c", | ||
}, | ||
itemStyle: { | ||
normal: { | ||
color: "#a6c84c", | ||
}, | ||
nodeSize: 20, | ||
nodeStyleProperty: {}, | ||
linkStyleProperty: {}, | ||
}) | ||
}, | ||
}, | ||
nodeSize: 20, | ||
nodeStyleProperty: {}, | ||
linkStyleProperty: {}, | ||
}); | ||
|
||
graph.render(); | ||
graph.render(); | ||
</script> | ||
</body> | ||
</body> | ||
</html> |
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
Oops, something went wrong.