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

@ska-octopus-widgets/hdbpp-live-widget

v0.1.23

Published

HDBPPLive widget

Downloads

22

Readme

Fetch HDB++ History — How Data Is Served and Plotted

This document explains how fetch_hdbpp_history works end-to-end, and how the data is rendered in our line charts and heatmaps.


Line Chart

  • For each attribute, the API returns returned_points (≈ maxPoints for avg/lttb/none; ≈ maxPoints for minmax because it uses ceil(maxPoints/2) buckets × 2 points per bucket).
  • With live mode on, each series is capped to maxPoints as new packets arrive.

Heatmap

  • We render a global evenly spaced time grid of
    columns = min(maxPoints, 2000) across the whole window.
  • For each visible attribute row, we draw exactly columns z-values.
  • Total cells = (#visible attributes) × columns.

How maxPoints Is Used End-to-End

Server (fetch_hdbpp_history)

For each attribute in [start, end]:

  • downsample="avg"

    • Buckets = maxPoints
    • ~1 point per bucket (timestamp at bucket center)
    • returned_points ≤ maxPoints
  • downsample="minmax"

    • Buckets = ceil(maxPoints/2)
    • Up to 2 points (min & max) per bucket with real timestamps
    • returned_points ≤ 2 × buckets ≈ maxPoints (off by +1 if odd)
    • Empty buckets yield 0 points
  • downsample="lttb"

    • Fetch all raw
    • LTTB reduces to ≤ maxPoints (typically exactly maxPoints)
  • downsample="none" (or non-numeric fallback)

    • Raw ascending with LIMIT maxPoints

➡️ Server contract:maxPoints samples per attribute in the history payload.


Client (Our Widget)

  • Line Plot

    • Plots exactly what the server returns per attribute.
    • For minmax, compute midpoint for line/marker; min/max shown as asymmetric error bars.
    • Count of plotted x/y pairs = returned_points.
    • With live mode, append new points and cap series at maxPoints.
  • Heatmap

    • To avoid “only last ~1h shows” when unions are large, we build a uniform global timeline of
      columns = min(maxPoints, 2000) buckets over full window.
    • Each attribute row is forward-filled with its last known value at/before each grid time.
    • Per row → always columns z-values.
    • Example: maxPoints=1000, 24h selected →
      • each attribute row = 1000 cells
      • 10 visible attributes = 10,000 cells
    • Hard cap at 2000 columns for Plotly performance.

Concrete Example

  • Range: last 24h
  • Downsample: minmax
  • maxPoints: 1000

Server: returns ~1000 points per attribute (2 × 500 buckets).
Line Plot: ~1000 points per attribute (with error bars).
Heatmap: 1000 columns across full 24h; each attribute row = 1000 cells;
total cells = (#visible attributes) × 1000.