@mk7s/holochart-traces-hier
v0.1.0-alpha.0
Published
Hierarchical and flow trace types: sunburst, treemap, icicle, sankey.
Maintainers
Readme
@mk7s/holochart-traces-hier
The hierarchical and flow trace types of Holochart: sunburst, treemap, icicle and sankey.
Part of Holochart, declarative GPU charts on three.js.
Alpha. Released as
0.1.0-alphaon the npmalphatag; APIs can change between 0.x releases. Most apps should install the full bundle,@mk7s/holochart, which includes this package.
Install
pnpm add @mk7s/holochart-traces-hier@alpha threethree is a peer dependency, so your app and Holochart share one copy. ESM-only; Node 22 and
newer can also require() it.
What it exports
hierTraces: every trace module below, to register at once- Trace modules:
sunburst,treemap,icicle,sankey - Attribute schemas (experimental):
sunburstAttributes,treemapAttributes,icicleAttributes,sankeyAttributes - Hierarchy helpers (experimental):
buildHierarchy,partition,nodePath(for preparing data or reading click payloads), andsankeyLayout
Usage
import { createChart, register } from '@mk7s/holochart-runtime';
import { builtinComponents } from '@mk7s/holochart-components';
import { hierTraces } from '@mk7s/holochart-traces-hier';
register(...hierTraces, ...builtinComponents);
createChart(el, {
data: [
{
type: 'sunburst',
labels: ['root', 'a', 'b'],
parents: ['', 'root', 'root'],
values: [0, 2, 3],
},
],
});Docs
- Chart types: sunburst, treemap, sankey
- Attribute reference: sunburst, treemap, sankey
- API reference
License
MIT (see LICENSE).
