Get started
Installation
One package, one dependency — the core. It produces SVG strings, so there is no stylesheet to load and no component to mount.
Install it
bun add @industrieh/starmap-renderIt needs the core
The renderer draws a Galaxy, and only @industrieh/starmap produces one. So the two are installed together:
bun add @industrieh/starmap @industrieh/starmap-renderThat is the whole dependency tree — the core has none of its own. Two packages in your lockfile, and nothing else added on their behalf.
Why two packages and not one
What it needs from you
- Any JavaScript runtime. The package never touches the DOM, so it runs on a server, in a worker, or in a build script just as well as in a browser.
- ES modules. ESM only, with type declarations alongside. No CommonJS build.
- Somewhere to put a string. That is genuinely all. A file, an
innerHTML, an<img src>, adata:URI — see Framing & embedding.
No React, no Vue, no anything
dangerouslySetInnerHTML or an <img> — and that is a feature, not a workaround.Importing
Everything comes from the package root. The two functions at the top are what most projects ever use; the rest is there for when you want to build your own drawing on the same primitives.
import {
renderSystem, // one system → a complete <svg> string
renderGalaxy, // the whole map → a complete <svg> string
renderSystemContent, // the layers alone, for when you own the <svg>
renderGalaxyContent,
systemViewBox, // the framing those two would have used
galaxyViewBox,
viewBoxAttr,
DEFAULT_THEME, // the colours, and how to change them
resolveTheme,
el, group, text, // the string primitives, for your own overlays
type Theme,
type RenderSystemOptions,
} from '@industrieh/starmap-render'Next step
The Quickstart takes a galaxy to a picture on screen, then makes it move — ten minutes, and every output on it was produced by running the code.