npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@found-in-space/star-map-canvas

v0.2.0

Published

2D canvas star map adapter for Found in Space star cells

Readme

@found-in-space/star-map-canvas

Status: alpha package.

Reusable Canvas2D star-map adapter for spatial star cells.

This package consumes StarCellStore data from @found-in-space/star-trees and draws observer-relative 2D sky maps. It does not create octree sessions, load catalogs, own sidecars, import anchored-image, or render Three.js objects.

Provider strategy semantics are outside this package. The examples use observer-shell only as a convenient source of streamed star cells; strategy composition and planning are defined by @found-in-space/star-octree-provider.

The intended package path is:

star-octree-provider -> star-trees cell store -> star-map-canvas

The built-in RA/Dec all-sky and FoV projections use sky-chart orientation: increasing RA/east runs toward the left side of the map.

Minimal Shape

import {
  createStarOctreeProviderService,
} from '@found-in-space/star-octree-provider';
import {
  consumeStarCellDeltas,
  createObserverShellStrategy,
  createStarCellStore,
} from '@found-in-space/star-trees';
import { createCanvasStarMap } from '@found-in-space/star-map-canvas';

const provider = createStarOctreeProviderService({ url });
const store = createStarCellStore();
const map = createCanvasStarMap(canvas, { store });

const session = provider.createSession({
  strategy: createObserverShellStrategy(),
  attributes: ['position', 'magAbs', 'teffLog8', 'objectRef', 'pickMeta'],
});

void consumeStarCellDeltas(session.deltas(), store, { throwOnError: false });

store.subscribe(() => {
  map.render({ observerPc, limitingMagnitude: 6.5 });
});

session.updateView({ observerPc, limitingMagnitude: 6.5 });

Projection And Drawing

The high-level API is backed by lower-level steps:

import {
  drawProjectedStarMap,
  projectStarMap,
} from '@found-in-space/star-map-canvas';

const projected = projectStarMap(rect, {
  store,
  observerPc,
  limitingMagnitude: 6.5,
});

drawProjectedStarMap(ctx, projected);

ProjectedStarMap is a plain draw list. PDF, SVG, print, test, or export code can consume it without depending on Canvas2D.

Custom Projection

Use RA/Dec primitives for compact custom projections:

import { createRaDecProjection } from '@found-in-space/star-map-canvas';

const sinusoidal = createRaDecProjection((sky, context) => {
  const ra = sky.raDeg * Math.PI / 180;
  const dec = sky.decDeg * Math.PI / 180;
  return {
    x: context.width * (0.5 + (ra - Math.PI) * Math.cos(dec) / (2 * Math.PI)),
    y: context.height * (0.5 - dec / Math.PI),
  };
}, { id: 'sinusoidal' });

map.render({ projection: sinusoidal });

Use createGnomonicProjection() for horizontal FoV star charts.

Layers And Hooks

Use layers for Canvas components such as grids, labels, and externally projected images. Use mapPoint to transform final projected points, and drawPoint to replace the default star glyph.

Layer phases are Canvas draw order: background renders before stars and foreground renders after stars.

For warped image overlays, use the layer context's projectRaDecUnclipped helper so FoV charts can clip the final image draw instead of dropping boundary triangles before they reach Canvas.

map.render({
  timeMs: performance.now(),
  layers: [gridLayer],
  mapPoint(point, context) {
    return {
      ...point,
      alpha: point.alpha * (0.7 + 0.3 * Math.sin(context.timeMs * 0.004)),
    };
  },
});

Guide-star catalogs and directional sky catalogs are a future source lane. This package's v1 input is spatial star cells with parsec positions, so applications can render the sky from arbitrary observerPc positions.