Gathering detailed insights and metrics for @antv/hierarchy
Gathering detailed insights and metrics for @antv/hierarchy
Gathering detailed insights and metrics for @antv/hierarchy
Gathering detailed insights and metrics for @antv/hierarchy
npm install @antv/hierarchy
Typescript
Module System
Node Version
NPM Version
99.4
Supply Chain
99.6
Quality
85
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
272 Stars
77 Commits
33 Forks
15 Watchers
1 Branches
52 Contributors
Updated on Jul 12, 2025
Latest Version
0.6.14
Package Id
@antv/hierarchy@0.6.14
Unpacked Size
1.14 MB
Size
935.94 kB
File Count
67
NPM Version
10.8.2
Node Version
20.17.0
Published on
Sep 20, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
26
Layout algorithms for visualizing hierarchical data.
1const Hierarchy = require('@antv/hierarchy'); 2 3// your tree data 4const root = { 5 isRoot: true, 6 id: 'Root', 7 children: [ 8 { 9 id: 'SubTreeNode1', 10 children: [ 11 { 12 id: 'SubTreeNode1.1' 13 }, 14 { 15 id: 'SubTreeNode1.2' 16 } 17 ] 18 }, 19 { 20 id: 'SubTreeNode2' 21 } 22 ] 23}; 24 25// apply layout 26const NODE_SIZE = 16; 27const PEM = 5; 28const ctx = document.getElementById('id-of-canvas-element').getContext('2d'); 29const rootNode = Hierarchy.compactBox(root, { 30 direction: 'H', // H / V / LR / RL / TB / BT 31 getId(d) { 32 return d.id; 33 }, 34 getHeight(d) { 35 if (d.isRoot) { 36 return NODE_SIZE * 2; 37 } 38 return NODE_SIZE; 39 }, 40 getWidth(d) { 41 if (d.isRoot) { 42 return ctx.measureText(d.id).width * 2 + PEM * 1.6; 43 } 44 return ctx.measureText(d.id).width + PEM * 1.6; 45 }, 46 getHGap(d) { 47 if (d.isRoot) { 48 return PEM * 2; 49 } 50 return PEM; 51 }, 52 getVGap(d) { 53 if (d.isRoot) { 54 return PEM * 2; 55 } 56 return PEM; 57 }, 58 getSubTreeSep(d) { 59 if (!d.children || !d.children.length) { 60 return 0; 61 } 62 return PEM; 63 } 64});
Hierarchy[type]
this layout differs from d3-hierarcy.tree
, it is a compact box tidy layout that is tidy in both horizontal and vertical directions.
demos
LR | RL | H |
---|---|---|
![]() | ![]() | ![]() |
TB | BT | V |
---|---|---|
![]() | ![]() | ![]() |
demos
LR | RL | H |
---|---|---|
![]() | ![]() | ![]() |
TB | BT | V |
---|---|---|
![]() | ![]() | ![]() |
demos
LR | RL | H |
---|---|---|
![]() | ![]() | ![]() |
this layout is inspired by XMind.
demos
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/18 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More