From 452c7b9586eaa2dd048d29519ff325c6988512b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Sat, 22 May 2021 00:21:26 +0200 Subject: [PATCH] Improve navigation graph rendering --- script/output-graph.js | 9 ++-- src/tam/network.json | 99 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 5 deletions(-) diff --git a/script/output-graph.js b/script/output-graph.js index d749c66..aeabdff 100755 --- a/script/output-graph.js +++ b/script/output-graph.js @@ -3,10 +3,10 @@ import network from "../src/tam/network.json"; console.log("digraph {"); -console.log("graph[layout=fdp, outputorder=nodesfirst]"); +console.log("graph[layout=neato, overlap=scalexy, splines=true, outputorder=nodesfirst]"); for (const [stopId, stop] of Object.entries(network.stops)) { - console.log(`${stopId}[label="${stop.properties.name}"]`); + console.log(`${stopId}[label="${stop.properties.name}", shape=box]`); } const junctions = new Set(); @@ -28,9 +28,8 @@ for (const junction of junctions) { } for (const [beginId, begin] of Object.entries(network.navigation)) { - for (const [endId, end] of Object.entries(begin)) { - const len = end.properties.length; - console.log(`${beginId} -> ${endId}[len=${len}]`); + for (const endId in begin) { + console.log(`${beginId} -> ${endId}`); } } diff --git a/src/tam/network.json b/src/tam/network.json index d7e9497..2c3f547 100644 --- a/src/tam/network.json +++ b/src/tam/network.json @@ -30302,6 +30302,43 @@ ] ] } + }, + "2577354951": { + "type": "Feature", + "properties": { + "begin": "1540234613", + "end": "2577354951", + "length": 60.443359137445206 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 3.8228084, + 43.630625 + ], + [ + 3.8227325, + 43.6306264 + ], + [ + 3.8223147, + 43.6306342 + ], + [ + 3.8221605, + 43.6306371 + ], + [ + 3.8220931, + 43.6306383 + ], + [ + 3.8220578, + 43.6306408 + ] + ] + } } }, "1540234616": { @@ -38509,6 +38546,68 @@ } }, "2577354951": { + "1540234613": { + "type": "Feature", + "properties": { + "begin": "2577354951", + "end": "1540234613", + "length": 60.443359137445206 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 3.8220578, + 43.6306408 + ], + [ + 3.8220931, + 43.6306383 + ], + [ + 3.8221605, + 43.6306371 + ], + [ + 3.8223147, + 43.6306342 + ], + [ + 3.8227325, + 43.6306264 + ], + [ + 3.8228084, + 43.630625 + ] + ] + } + }, + "3123039805": { + "type": "Feature", + "properties": { + "begin": "2577354951", + "end": "3123039805", + "length": 20.081156918367746 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 3.8220578, + 43.6306408 + ], + [ + 3.8219998, + 43.63064 + ], + [ + 3.8218084, + 43.6306444 + ] + ] + } + }, "3123039810": { "type": "Feature", "properties": {