#!/usr/bin/env -S node --experimental-json-modules import network from "../src/tam/network.json"; console.log("digraph {"); 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}", shape=box]`); } const junctions = new Set(); for (const [beginId, begin] of Object.entries(network.navigation)) { if (!(beginId in network.stops)) { junctions.add(beginId); } for (const endId in begin) { if (!(endId in network.stops)) { junctions.add(endId); } } } for (const junction of junctions) { console.log(`${junction}[label="", shape=point]`); } for (const [beginId, begin] of Object.entries(network.navigation)) { for (const endId in begin) { console.log(`${beginId} -> ${endId}`); } } console.log("}");