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

@bicharts/shape-core

v0.5.19

Published

Host-agnostic data-shape profiler: ingest a dataset's rows through IValueCollection.addRow and read back the measured shape as an LLMColumnWithValue[] payload — types, cardinality, temporal/ordinal detection, geographic region and point resolution, cross-

Readme

@bicharts/shape-core

A host-agnostic data-shape profiler. Feed it a dataset's rows through the IValueCollection.addRow seam; read back the measured shape as an LLMColumnWithValue[] payload — the exact contract the Business Intelligence Champions (BIC) backend consumes to select and generate a chart.

The Power BI visual and the MCP client both feed this same engine through their own thin adapters, so the server receives an identical shape payload regardless of which front-end produced it — it cannot tell them apart.

npm install @bicharts/shape-core

What's in scope

This package is measurement only:

  • IndexedText — the engine. Ingests rows, computes per-column primitives (distinct/blank counts, ranges, median, top-N categories, format) and full-dataset derived signals (association η², shared-value ratios, nesting ratios, categorical pair stats, leaf cardinality) — the signals that require a pass over every row, which the server never gets.
  • Pure classifiers — classifyNumericValueNature, classifyTemporal, classifyAdditivity, hostAggHint, isIdentifierName.
  • Column-detail helpers — ordinal-domain / format detection, localized month names.
  • The wire types — LLMColumnWithValue and friends.

What's deliberately NOT here

The policy that decides what a measured shape means for chart selection — eligibility gates, weighting, prompt assembly, the guardrail corpus — lives server-side and is not in this package. Profiling is commodity; the policy is the moat, which is exactly why the profiler can be open source and the policy cannot.

Consuming it

import { IndexedText, IValueCollection, LLMColumnWithValue } from "@bicharts/shape-core";
// An adapter registers columns, pushes rows via addRow(values, originalIdx),
// then reads the enriched LLMColumnWithValue[] back out as the shape payload.

An adapter is whatever turns your source of rows into addRow calls. Two exist today and they share this engine exactly:

  • the Power BI visual, whose adapter walks a dataView;
  • the MCP client, whose adapter reads a CSV, DataFrame or Arrow table.

Because the measurement is identical, the server cannot tell which front-end produced a payload — which is the property that makes a chart behave the same in both.

Determinism

The emitted shape statistics are deterministic across runs and across hosts — that's what lets the two front-ends agree. Only the optional obfuscated sample text uses GET_RANDOM and therefore varies; stat derivation never does. A byte-identity test (same rows through both adapters → identical shape JSON) is the intended guard once the MCP adapter exists.

Tests

shape-core/tests/ is included in the repo's root vitest run. The engine's behavioral coverage currently lives in ../tests/indexedText.test.ts and ../tests/ordinalDetector.test.ts (they import from this package); they can move here over time.