Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

d3-stalactite

Latest version: v0.1.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: ant0sch
2 Versions

Scan summary

d3-stalactite was last scanned on 29 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 29 Nov 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 29 Nov 2026 No rules fired
0.0.0-stage 29 Nov 2026 Not shown

No rules fired in 0.1.0

Findings

Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

d3-stalactite

Stalactite plots for D3: hierarchical data with two quantities per node — an additive one (e.g. sales; a parent is the sum of its children) and a proportional one (e.g. profit margin; a parent is the average of its children, weighted by the additive quantity). Width encodes the additive quantity, height the proportional one, children hang below their parent, and an average line mirrors each parent's height onto its children.

Interactive demo

The layout has no dependencies. The renderer draws into a d3 selection you pass in, so d3 (v6 or later) is only needed by your page.

Behaviour is defined by the language-independent specification and tested against its fixtures.

Data

Nested JSON, as in portfolio.json:

{ "name": "Portfolio", "children": [
  { "name": "Financials", "children": [
    { "name": "BAC", "add_val": 960.66, "ratio_val": 28.243 },
    { "name": "JPM", "add_val": 1667.75, "ratio_val": 35.06 } ] } ] }

Only leaves carry values; inner nodes are aggregated. Leaves with add_val = 0 are dropped with a warning. Missing, non-numeric or negative values are errors naming the node by its path (e.g. Portfolio / Financials / BAC). Other field names can be read with accessors (see below).

Ready-made plot

import { stalactitePlot } from "d3-stalactite";

d3.select("svg").call(stalactitePlot, {
  data,
  width: 960,
  height: 500,
  valueNames: ["Sales", "Profit margin"],
});

Calling it again on the same selection updates the plot in place.

option default
data — the tree (required)
width, height 960, 500 plot size in px
gap 1 horizontal gap between siblings in px
lineWidth 3 thickness of the average lines in px
sort "none" "none" (data order) or "descending" (by additive value)
k null height scale in px per unit of the proportional value; set the same k to make several plots comparable
colors defaultColors one color per depth, repeating when the tree is deeper
labels true draw names inside boxes where they fit (never truncated)
valueNames ["Additive", "Proportional"] names of the two quantities in tooltips
tooltip true false, or a function (node, valueNames) => html
labelFontSize, labelFontFamily, labelPadding 12, "sans-serif", 4 label font and padding
name, children, n, v d.name, d.children, d.add_val, d.ratio_val accessors

Every box shows a tooltip with its name and both values on hover, labelled or not. Tooltip content from a custom function is inserted as HTML: escape user-provided text yourself.

Layout only

In the style of d3.treemap():

import { stalactite } from "d3-stalactite";

const layout = stalactite()
  .size([960, 500])
  .sort("descending")
  .n((d) => d.sales)
  .v((d) => d.margin);

const { nodes, lines, k } = layout(data);

Methods (each a getter without argument, a chaining setter with one): width, height, size([width, height]), gap, lineWidth, sort, k, and the accessors name, children, n, v. The same is available as a plain function: stalactiteLayout(data, options).

  • nodes: one object per node, in preorder — {id, name, depth, parent_id, n, v, x0, x1, y0, y1, data} (data is your original object).
  • lines: one average line per inner node, in drawing order (deepest first) — {node_id, depth, x0, x1, y}.
  • k: the height scale used.

Draw each node as a rectangle [x0, x1] × [y0, y1] and each line from (x0, y) to (x1, y) with butt caps, both colored by depth.

Long tables

One row per leaf, e.g. from d3.csv:

import { fromTable } from "d3-stalactite";

const rows = await d3.csv("portfolio.csv", d3.autoType);
const data = fromTable(rows, {
  levels: ["sector", "industry", "company"],
  n: "sales",
  v: "profit_margin",
  rootName: "Portfolio",
});

The result is in the nested JSON format above. Empty level values and duplicate rows are errors.

Development

npm install            # dev dependency d3, for the demo and browser tests
npm test               # spec fixtures and unit tests (Node's built-in runner)
npm run test:browser   # renderer tests in headless Chrome/Edge
npm run demo           # demo page at localhost:8080/docs/
npm run render-review  # writes ../docs/review/js.png

Set CHROME to the browser executable if Chrome or Edge is not found.

Citation

A. Schlieder, J. Rummel, F. Sadlo, "Proportional Aggregation in Hierarchical Data Visualization", IEEE TVCG (VIS 2026). DOI: 10.1109/TVCG.2026.3664464

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm d3-stalactite

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229