Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
An indented tree layout for D3, commonly used for hierarchical lists, e.g. file directories.
On top of D3's usual hierarchical layout methods sort()
, children()
, and value()
(see D3 API documentation), d3.layout.indent implements dx()
and dy()
which are used to specify the x and y increment between nodes.
Per default, both x and y increment by 1:
var indent = d3.layout.indent();
var tree = {id: "root", children: [{id: "child1"}, {id: "child2"}]};
var nodes = indent.nodes(tree); // -> [{id:"root", x: 0, y: 0}, {id: "child1", x: 1, y: 1}, {id: "child2", x: 1, y: 2}]
With .nodeSize()
the x and y increment can be defined. .separation()
additionally defines by how much the x increment will be multiplied between the current and the previous node:
var indent = d3.layout.indent()
.nodeSize([10, 10])
.separation(function(a, b) { return a.children ? 2 : 1; });
var tree = {id: "root", children: [{id: "child1"}, {id: "child2", children: [{id: "child21"}]}]};
var nodes = indent.nodes(tree); // -> [{id:"root", x: 0, y: 0}, {id: "child1", x: 10, y: 10}, {id: "child2", x: 10, y: 30}, {id: "child21", x: 20, y: 40}]
Jeremy Stucki, Interactive Things
BSD, see LICENSE.txt
FAQs
Indented tree layout for D3
The npm package d3-indent receives a total of 9 weekly downloads. As such, d3-indent popularity was classified as not popular.
We found that d3-indent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.