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

@uptimizr/heatmap

v1.0.3

Published

Framework-agnostic 3D heatmap overlay core + Babylon adapter. Draws a world-space (voxel) heatmap into the developer's own scene (Tier 0 overlay, ADR 0010).

Readme

@uptimizr/heatmap

Draw a world-space heatmap overlay into the developer's own 3D scene — the Tier 0 "dev-integrated overlay" approach. It re-uses the same GET /api/v1/heatmaps/world voxel data the dashboard renders, but paints the heat directly onto the live scene you already ship.

The core is framework-agnostic (it turns voxel counts into normalized, positioned, colored instances); engine adapters live behind subpaths. The Babylon adapter renders the voxels as a single thin-instanced box, so thousands of cells stay one draw call.

Install

npm install @uptimizr/heatmap @babylonjs/core

The engine (@babylonjs/core or @babylonjs/lite) is an optional peer dependency — install the one your scene already uses. The overlay reads the collector's GET /api/v1/heatmaps/world voxel data and draws into your own scene.

Usage

import { showWorldHeatmap } from "@uptimizr/heatmap/babylon";

// One call: fetch + render into your existing Babylon scene.
const overlay = await showWorldHeatmap({
  scene, // your host scene
  endpoint: "https://collect.example.com",
  apiKey: "utk_…",
  sceneId: "lobby", // optional sceneId filter
  cellSize: 0.5, // must match how you want the grid binned
  style: { opacity: 0.85, maxVoxels: 2000 },
});

overlay.setVisible(false); // toggle
overlay.dispose(); // remove from the scene

Lower-level, if you manage fetching yourself or want to re-render on a control:

import { HeatmapOverlay } from "@uptimizr/heatmap";
import { createBabylonHeatmapDriver } from "@uptimizr/heatmap/babylon";

const overlay = new HeatmapOverlay(createBabylonHeatmapDriver({ scene }), {
  opacity: 0.85,
});
overlay.render({ voxels, cellSize: 0.5 }); // call again whenever data changes

Gaze (view-direction) dome

Alongside the world voxel heatmap, the package can draw a gaze dome — the camera view-direction distribution (GET /api/v1/heatmaps/camera) reconstructed as markers on a sphere. Center it on the live camera and the developer literally stands inside the distribution of where visitors looked. This is the in-scene (Tier 0) counterpart of the dashboard's CameraDome3D viewer.

import { showGazeDome } from "@uptimizr/heatmap/babylon";

const gaze = await showGazeDome({
  scene,
  endpoint: "https://collect.example.com",
  apiKey: "utk_…",
  sceneId: "lobby", // optional scene filter
  sessionId, // optional: one session instead of the aggregate
  bins: 36, // grid resolution per axis (must match the dashboard)
  followCamera: scene.activeCamera ?? undefined, // dome tracks the viewer
  style: { radius: 8, opacity: 0.9 }, // radius is in the host scene's units
});

gaze.setVisible(false); // toggle
gaze.dispose(); // remove from the scene (also detaches the camera follower)

Like the world heatmap, the core is engine-free: buildGazeInstances(data, style) turns { azimuthBin, elevationBin, count } bins into dome HeatmapInstances, so a non-Babylon host can render gaze with any HeatmapDriver.

Gaze skydome

For a continuous view-direction field instead of discrete markers, the Babylon adapter can draw the same camera heatmap as an inward-facing equirectangular skydome:

import { showGazeSkydome } from "@uptimizr/heatmap/babylon";

const sky = await showGazeSkydome({
  scene,
  endpoint: "https://collect.example.com",
  apiKey: "utk_…",
  sceneId: "lobby",
  followCamera: scene.activeCamera ?? undefined,
  texture: { width: 512, blurBins: 1.5, opacity: 0.9 },
});

sky.setVisible(false);
sky.dispose();

The engine-free buildGazeEquirect(data, options?) helper returns raw RGBA pixels for hosts that want to upload the texture themselves.

Design

  • buildHeatmapInstances(data, style) is pure and engine-free: it normalizes counts against the busiest voxel, places each at its world center ((v + 0.5) * cellSize), sizes it by intensity, and colors it via the ramp.
  • buildGazeInstances(data, style) mirrors it for gaze: it inverts the server's spherical binning back to a unit direction and drops a marker at center + direction * radius, normalized against the busiest bin.
  • HeatmapDriver is the engine extension point — implement { render, clear, setVisible, dispose } for another engine and pass it to HeatmapOverlay (or GazeOverlay).
  • The default cold→hot ramp runs blue → cyan → green → yellow → red → white-hot.
  • There is no scene registry at this tier: cellSize and the gaze radius have no inherent units, so the host supplies them (or exposes them as controls).

@babylonjs/core and @babylonjs/lite are optional peer dependencies — only needed for the Babylon adapter you import.

Develop

pnpm --filter @uptimizr/heatmap build
pnpm --filter @uptimizr/heatmap typecheck
pnpm --filter @uptimizr/heatmap test

License

Apache-2.0 © Uptimizr.