Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrojas87 committed Sep 23, 2020
1 parent 3c4e160 commit 2081ce4
Show file tree
Hide file tree
Showing 47 changed files with 11,035 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .babelrc
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"
]
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added dist/51a078f9aef9949a4f1d32a5f70a3420.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions dist/8b1061d20ad0635c1567.worker.js

Large diffs are not rendered by default.

Binary file added dist/8b4a042982a066d1922de60e43fcbf87.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/ce675874480c4a7e4da08649aa4da364.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/index.html
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>
54 changes: 54 additions & 0 deletions dist/main.js

Large diffs are not rendered by default.

8,195 changes: 8,195 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions package.json
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"
}
}
12 changes: 12 additions & 0 deletions src/App.js
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;
68 changes: 68 additions & 0 deletions src/algorithm/NetworkGraph.js
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;
}
}
Loading

0 comments on commit 2081ce4

Please sign in to comment.