Published
Edited
Dec 11, 2020
Importers
Insert cell
md`# SL Trains`
Insert cell
d3 = require('d3')
Insert cell
import { renderPoints } from '@nuuuwan/open-topo-map'
Insert cell
LINE_MAP = await d3.json(
'https://raw.githubusercontent.com/nuuuwan/misc-sl-data/master/sl_trains.line_map.json'
)
Insert cell
STATION_TO_LOCATION = await d3.json(
'https://raw.githubusercontent.com/nuuuwan/misc-sl-data/master/sl_trains.station_to_location.json'
)
Insert cell
function getLineLatLngList(lineName) {
const stations = LINE_MAP[lineName];
return stations.map(name => STATION_TO_LOCATION[name]);
}
Insert cell
getLineLatLngList('Badulla')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more