Public
Edited
May 22, 2024
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
nextbillion.setApiKey(apiKey)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = getRandomData(city, nOrders, nVehicles, serviceTime, vehicleCapacity)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mvrpResult = (await mvrp(data)).result
Insert cell
initialRoutes = new Map(
mvrpResult.routes.map((route) => [route.vehicle, route])
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
isochrone = runIsochrone(
failureStep.location,
failedVehicle.time_window[0] + failureStep.duration
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
identity = (i) => i
Insert cell
defaultOptions = ({ columns: {}, style: "normal", paged: 25 })
Insert cell
ternaryFn = (condition, x, y) => (condition(x) ? x : y)
Insert cell
Insert cell
Insert cell
Insert cell
onlyJobs = (steps) =>
steps.length > 2
? steps[0].type === "start" && steps.at(-1).type === "end"
? steps.slice(1, -1)
: steps
: steps
Insert cell
afterFailure = (x) => x.duration > failureStep.duration
Insert cell
beforeFailure = (x) => x.duration <= failureStep.duration
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { toc } from "@nebrius/indented-toc" // This component generates the Table of Contents
Insert cell
Insert cell
html`<b>Add the stylesheet for the NB.ai SDK </b><br><code>&nbsp;&lt;link href="https://maps-gl.nextbillion.io/maps/v2/api/css" rel="stylesheet"&gt;</code>`
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