Describe your systems as a typed object. Get back indexes, routes and orbital positions over time — then draw the whole thing as SVG. Two libraries, and neither one of them wants to be your game engine.
import { createGalaxy, findRoute } from '@industrieh/starmap'
import { renderGalaxy } from '@industrieh/starmap-render'
const galaxy = createGalaxy({
systems: [
{ id: 'sol', name: 'Sol', x: 0, y: 0, star: { class: 'G', radius: 18 } },
{ id: 'alpha', name: 'Alpha', x: 400, y: 300, star: { radius: 14 } },
],
lanes: [{ from: 'sol', to: 'alpha' }],
})
findRoute(galaxy, 'sol', 'alpha') // ['sol', 'alpha']
renderGalaxy(galaxy) // '<svg …>'Neither library pulls anything in. Read the lockfile.
The renderer returns a string. Where it goes is yours.
Every export carries an explicit signature, checked in CI.
They ship separately on purpose. Take the model alone if you draw your own; take both if you want pixels without writing an SVG by hand.