A trip flies up out of the map as a 3D model: real streets, glowing driven road, stop beams, vehicle token. Three themes.
Part of High Command Pro. The preview and props are open to everyone; installing it needs your license key. Set up your key · Pricing
$ npx shadcn@latest add @highcommand/trip-hologramCopies the source into your project and pulls in what it needs (4 other items). First time? Add the registry to components.json.
The trip as a 3D hologram that flies up out of its spot on the map: glass plate, real streets, the road driven as a glowing tube and the road ahead dashed, stops as beams with badges, the vehicle as a token.
triprequiredTripFocus—The trip to draw: road driven, road ahead, the vehicle now and the stops; a new object updates the open hologram in place.
onCloserequired() => void—Called when the person asks to leave (Escape or the close button); set `closing` to fly back, then `onClosed` fires.
onClosedrequired() => void—Called once the hologram has flown back into the map (immediately if no 3D view was running); unmount it here.
themeHologramTheme | keyof typeof HOLOGRAM_THEMES—A built-in theme name or your own HologramTheme (default `blueprint`); read once on mount, so change `key` to switch themes.
closingboolean—Fly back into the map, then call onClosed.
detail(bbox: [number, number, number, number]) => Detail | null—City detail for the plate (e.g. streets from road-router `linesIn`), given the plate's [w, s, e, n].
cardReactNode—Side card (driver, ETA...), shown on the right; the model frames itself beside it.
nearboolean—Close in on the vehicle and follow it.
onFail() => void—Called if WebGL2 is missing or the first frames are too slow: show a flat view instead.
classNamestring—Extra classes for the full-bleed overlay root (`absolute inset-0 z-30`).
<TripHologramView />11 propsTripHologram for any MapLibre map (High Command's CommandMap, your own): pass the map it flies out of, or null to open in place.triprequiredTripFocus—The trip to draw: road driven, road ahead, the vehicle now and the stops; a new object updates the open hologram in place.
onCloserequired() => void—Called when the person asks to leave (Escape or the close button); set `closing` to fly back, then `onClosed` fires.
onClosedrequired() => void—Called once the hologram has flown back into the map (immediately if no 3D view was running); unmount it here.
maprequiredMlMap | null—The MapLibre map the hologram flies out of and back into; null opens it in place with no flight.
themeHologramTheme | keyof typeof HOLOGRAM_THEMES"blueprint"A built-in theme name or your own HologramTheme (default `blueprint`); read once on mount, so change `key` to switch themes.
closingbooleanfalseFly back into the map, then call onClosed.
detail(bbox: [number, number, number, number]) => Detail | null—City detail for the plate (e.g. streets from road-router `linesIn`), given the plate's [w, s, e, n].
cardReactNode—Side card (driver, ETA...), shown on the right; the model frames itself beside it.
nearbooleanfalseClose in on the vehicle and follow it.
onFail() => void—Called if WebGL2 is missing or the first frames are too slow: show a flat view instead.
classNamestring—Extra classes for the full-bleed overlay root (`absolute inset-0 z-30`).
clipSegment(a: [number, number], b: [number, number], x0: number, y0: number, x1: number, y1: number): [[number, number], [number, number]] | nullA segment clipped to the box [x0, x1] × [y0, y1] (Liang–Barsky), or null when it lies outside.
createViewer(canvas: HTMLCanvasElement, opts: ViewerOpts): { resize(w: number, h: number): void; setRoom(r: Room): void; open(): Promise<void>; ... 11 more ...; dispose(): void; }Builds the WebGL viewer on `canvas` and returns its controls (resize, setRoom, open, close, setFocus, ... dispose); throws if the setup fails, after releasing the GL context.
flyEase(t: number): numberEase out with a slight overshoot (about 8 % past the end, back by the end).
niceMetres(m: number): numberA scale bar's length: the longest round distance (m) not over `m`.
layoutLabels(items: LabelIn[], obstacles: Box[], bounds: Box, placed?: Box[]): LabelOut[]Place the badges (in `items` order of no importance: they are taken by priority, then by their order). `placed` receives every box taken.
tryPlace(b: Box, placed: Box[], bounds: Box): booleanTake `b` if it is inside the bounds and clear of everything placed (a street's name, after the badges).
tripFocusFrom(input: TripFocusInput): TripFocusMaps stop status and window risk onto the hologram's shapes: done, next, ahead, at risk, late, skipped.
aheadThrough(router: RoadRouter, from: LngLat, stops: { position: LngLat; }[]): LngLat[]The road ahead: from the vehicle through each open stop, along the router's roads.
roadDetail(router: RoadRouter, bbox: [number, number, number, number]): DetailStreets for the hologram's plate from the offline road router (no tiles needed).