-
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.
- Loading branch information
Showing
17 changed files
with
525 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Serbia" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [20.906982421875, 44.36313311380771] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Austria" | ||
}, | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[13.5791015625, 47.45037978769006], | ||
[13.743896484375, 46.31658418182218], | ||
[15.875244140625, 46.79253827035982], | ||
[17.1826171875, 48.151428143221224], | ||
[16.677246093749996, 48.828565527993234], | ||
[13.5791015625, 47.45037978769006] | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Bulgaria" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [25.1806640625, 42.97250158602597] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Romania" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [24.949951171875, 45.920587344733654] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Greece" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [22.8955078125, 38.71980474264237] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Switzerland" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [8.1298828125, 47.12995075666307] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Hungary" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [19.51171875, 47.42808726171425] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Poland" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [19.423828125, 52.29504228453735] | ||
} | ||
} | ||
] | ||
} |
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,27 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<head> | ||
<title>netjsongraph.js: basic example</title> | ||
<meta charset="utf-8"> | ||
<meta charset="utf-8" /> | ||
<!-- theme can be easily customized via css --> | ||
<link href="../src/css/netjsongraph-theme.css" rel="stylesheet"> | ||
<link href="../src/css/netjsongraph.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<link href="../src/css/netjsongraph-theme.css" rel="stylesheet" /> | ||
<link href="../src/css/netjsongraph.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="../dist/netjsongraph.min.js"></script> | ||
<script type="text/javascript"> | ||
/* | ||
/* | ||
The demo is used to show how to deal with the `multiple interfaces` in the NetJSON data. | ||
We provide a work file to process the data before rendering. | ||
This file provides functions to remove dirty data, deduplicate, handle multiple interfaces, add node links, add flatNodes and so on. | ||
You can also define related files yourself. | ||
*/ | ||
// `graph` render defaultly. | ||
const graph = new NetJSONGraph("./data/netjson-multipleInterfaces.json", { | ||
// Asynchronous processing of incoming data formats using WebWorker file. | ||
dealDataByWorker: "../src/js/netjsonWorker.js", | ||
}); | ||
graph.render(); | ||
// `graph` render defaultly. | ||
const graph = new NetJSONGraph("./data/netjson-multipleInterfaces.json", { | ||
// Asynchronous processing of incoming data formats using WebWorker file. | ||
dealDataByWorker: "../src/js/netjsonWorker.js", | ||
}); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>GeoJSON Example</title> | ||
<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" /> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="../dist/netjsongraph.min.js"></script> | ||
<script type="text/javascript"> | ||
const map = new NetJSONGraph("./data/geojson-sample.json", { | ||
render: "map", | ||
// set map initial state. | ||
mapOptions: { | ||
center: [46.86764405052012, 19.675998687744144], | ||
zoom: 5, | ||
}, | ||
onReady: function () { | ||
this.gui.sideBar.classList.add("hidden"); | ||
}, | ||
}); | ||
|
||
map.render(); | ||
</script> | ||
</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
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
Oops, something went wrong.