-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
3c4e160
commit 2081ce4
Showing
47 changed files
with
11,035 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
[ | ||
"@babel/plugin-transform-runtime" | ||
] | ||
] | ||
} |
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 @@ | ||
node_modules |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="theme-color" content="#000000"/><link href="https://rsuitejs.com/css/theme-default.css?v4.8.0" rel="stylesheet"/><link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.css" rel="stylesheet"/><title>ERA — Route Compatibility</title><link rel="icon" href="favicon.png"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="main.js"></script></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
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,63 @@ | ||
{ | ||
"name": "era-ui", | ||
"version": "1.0.0", | ||
"description": "ERA's routable tiles UI ", | ||
"scripts": { | ||
"start": "webpack-dev-server --open --mode development", | ||
"build": "webpack --mode production" | ||
}, | ||
"author": "Julian Rojas", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://gitlab.ilabt.imec.be/era/era-ui.git" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.10.3", | ||
"@babel/plugin-proposal-class-properties": "^7.10.1", | ||
"@babel/plugin-transform-runtime": "^7.10.4", | ||
"@babel/preset-env": "^7.10.3", | ||
"@babel/preset-react": "^7.10.1", | ||
"babel-loader": "^8.1.0", | ||
"css-loader": "^3.6.0", | ||
"file-loader": "^6.1.0", | ||
"html-loader": "^1.1.0", | ||
"html-webpack-plugin": "^4.3.0", | ||
"style-loader": "^1.2.1", | ||
"webpack": "^4.43.0", | ||
"webpack-cli": "^3.3.12", | ||
"webpack-dev-server": "^3.11.0", | ||
"worker-loader": "^2.0.0" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.10.4", | ||
"@graphy/memory.dataset.fast": "^4.2.1", | ||
"@rdfjs/data-model": "^1.1.2", | ||
"@turf/distance": "^6.0.1", | ||
"@turf/helpers": "^6.1.4", | ||
"jsonld-streaming-parser": "^2.0.2", | ||
"mapbox-gl": "^1.11.0", | ||
"n3": "^1.5.0", | ||
"rdf-string": "^1.4.2", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-mapbox-gl": "^4.8.6", | ||
"rsuite": "^4.8.0", | ||
"styled-components": "^5.1.1", | ||
"tinyqueue": "^2.0.3", | ||
"url-loader": "^4.1.0", | ||
"wellknown": "^0.5.0" | ||
} | ||
} |
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,12 @@ | ||
import MainLayout from "./components/MainLayout"; | ||
import React from "react"; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<MainLayout></MainLayout> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
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,68 @@ | ||
export class NetworkGraph { | ||
constructor() { | ||
this._nodes = new Map(); | ||
this._edges = new Map(); | ||
} | ||
|
||
addNode(node) { | ||
let n = null; | ||
if (this.nodes.has(node.id)) { | ||
n = this.nodes.get(node.id); | ||
} else { | ||
n = { edges: new Set(), lngLat: null, microNode: null }; | ||
} | ||
|
||
if (node.edge) n.edges.add(node.edge); | ||
if (node.lngLat) n.lngLat = node.lngLat; | ||
if (node.microNode) n.microNode = node.microNode; | ||
this.nodes.set(node.id, n); | ||
} | ||
|
||
addEdge(edge) { | ||
if (this.edges.has(edge.id)) { | ||
if (edge.from) this.edges.get(edge.id).from = edge.from; | ||
if (edge.to) this.edges.get(edge.id).to = edge.to; | ||
// Check if edge has been set as bidirectional | ||
if (this.edges.get(edge.id).bidirectional && this.edges.get(edge.id).to) { | ||
this.addNode({ | ||
id: this.edges.get(edge.id).to, | ||
edge: edge.id | ||
}); | ||
} | ||
} else { | ||
if (edge.from) this.edges.set(edge.id, { from: edge.from }); | ||
if (edge.to) this.edges.set(edge.id, { to: edge.to }); | ||
} | ||
} | ||
|
||
setBidirectional(edge) { | ||
if (this.edges.has(edge)) { | ||
this.edges.get(edge).bidirectional = true; | ||
// Add edge to node if already defined | ||
if (this.edges.get(edge).to) { | ||
this.addNode({ | ||
id: this.edges.get(edge).to, | ||
edge: edge | ||
}); | ||
} | ||
} else { | ||
this.edges.set(edge, { bidirectional: true }); | ||
} | ||
} | ||
|
||
get nodes() { | ||
return this._nodes; | ||
} | ||
|
||
set nodes(n) { | ||
this._nodes = n; | ||
} | ||
|
||
get edges() { | ||
return this._edges; | ||
} | ||
|
||
set edges(e) { | ||
this._edges = e; | ||
} | ||
} |
Oops, something went wrong.