Skip to content

@mk7s/holochart-traces-hier ​

Interfaces ​

InterfaceDescription
HierarchyA built hierarchy.
HierarchyInputWhat buildHierarchy reads (a defaulted trace's attributes).
HierNodeOne node of a hierarchy: Plotly's calcdata item (cdi) and its d3 node in one object.
IcicleTraceInsidetextfontFont of labels inside nodes. Defaults to textfont, with a color contrasting the node.
IcicleTraceLeafLeaf style.
IcicleTraceMarkerCell style.
IcicleTraceMarkerLineCell outlines.
IcicleTraceMarkerPatternHatch pattern of the cell fill (drawn in screen px, for print and grayscale).
IcicleTraceOutsidetextfontFont of the root's label when the root is transparent (it sits on the background; not with a colorscale or several roots). Defaults to textfont.
IcicleTracePathbarThe path bar: where the current root sits in the hierarchy.
IcicleTracePathbarTextfontFont of path bar labels. Defaults to textfont, with a color contrasting the segment.
IcicleTraceRootRoot style.
IcicleTraceTextfontFont of node labels. Defaults to layout.font.
IcicleTraceTilingHow cells are laid out.
PartitionCellA node placed by partition: x along the partitioned axis, y across levels.
RectCalcCalcdata of a treemap or icicle trace.
RectLayoutPlacement of a treemap or icicle in container px (top-left origin), set by crossTraceLayout.
SankeyCalcCalcdata of a sankey trace.
SankeyGraph-
SankeyLayoutOptions-
SankeyTraceLinkThe links.
SankeyTraceLinkConcentrationscalesOne item of colorscales.
SankeyTraceLinkFlowFlow particles (a Holochart extension): dots streaming along every link from its source to its target, spread across its width, as many as its size and density call for. Off unless link.flow is set (flow: {} turns them on). They dim with links outside a hover highlight, and hold still under prefers-reduced-motion: reduce.
SankeyTraceLinkLineOutlines of the links.
SankeyTraceNodeThe nodes.
SankeyTraceNodeLineOutlines of the nodes.
SankeyTraceTextfontFont of the node labels. Default: layout.font, with the automatic halo (shadow: auto).
SunburstCalcCalcdata of a sunburst trace.
SunburstLayoutPlacement of a sunburst in container px (top-left origin), set by crossTraceLayout.
SunburstTraceInsidetextfontFont of labels inside nodes. Defaults to textfont, with a color contrasting the node.
SunburstTraceLeafLeaf style.
SunburstTraceMarkerSector style.
SunburstTraceMarkerLineSector outlines.
SunburstTraceMarkerPatternHatch pattern of the sector fill (drawn in screen px, for print and grayscale).
SunburstTraceOutsidetextfontFont of the root's label when the root is transparent (it sits on the background; not with a colorscale or several roots). Defaults to textfont.
SunburstTraceRootRoot style.
SunburstTraceTextfontFont of node labels. Defaults to layout.font.
TreemapTraceInsidetextfontFont of labels inside nodes. Defaults to textfont, with a color contrasting the node.
TreemapTraceMarkerTile style.
TreemapTraceMarkerLineTile outlines.
TreemapTraceMarkerPadPadding inside branch tiles around their children, px. Defaults to twice textfont.size on the header's side (the top, the bottom with bottom text positions) and half of textfont.size elsewhere.
TreemapTraceMarkerPatternHatch pattern of the tile fill (drawn in screen px, for print and grayscale).
TreemapTraceOutsidetextfontFont of the root's label when the root is transparent (it sits on the background; not with a colorscale or several roots). Defaults to textfont.
TreemapTracePathbarThe path bar: where the current root sits in the hierarchy.
TreemapTracePathbarTextfontFont of path bar labels. Defaults to textfont, with a color contrasting the segment.
TreemapTraceRootRoot style.
TreemapTraceTextfontFont of node labels. Defaults to layout.font.
TreemapTraceTilingHow tiles are laid out.

Type Aliases ​

Type AliasDescription
BaseIcicleTraceIcicle: a hierarchy as rows (or columns) of cells, children next to their parents, with a path bar and drill-down.
BaseTreemapTraceTreemap: a hierarchy as nested rectangles sized by value, with a path bar and drill-down.
HierarchyResultA hierarchy, or Plotly's warning when the rows do not make one.
SankeyTraceSankey diagram: nodes in columns sized by their flow and links between them as wide as their value; cycles are drawn as loops; drag nodes to rearrange.
SunburstTraceSunburst: a hierarchy as rings of sectors, children outside their parents, with drill-down.
TracesHierAny trace of @mk7s/holochart-traces-hier, discriminated on type. Type a partial bundle's figures with it: FigureInput<TracesHier>.

Variables ​

VariableDescription
hierTracesEvery hierarchical and flow trace module, for register(...hierTraces).
icicle-
icicleAttributesThe icicle schema.
sankey-
sankeyAttributesThe sankey schema.
sunburst-
sunburstAttributesThe sunburst schema.
treemap-
treemapAttributesThe treemap schema.

Functions ​

FunctionDescription
buildHierarchyBuild the hierarchy of a trace's rows (see the module comment). warnings holds Plotly's messages, also when a tree was built (none today: every warning is fatal, as in Plotly).
nodePathThe labels from the root down to the node's parent, each followed by / (Plotly's getPath): '/' for the root, 'Eve/Seth/' for a grandchild of Eve.
partitiond3's partition of the subtree at entry over [0, dx] × [0, dy]: each level is dy / (entry.height + 1) tall, and children split their parent's x span by value (d3's treemapDice; a remainder or total above the children's sum leaves a gap at the end). Cells come breadth first (d3 descendants), so parents precede their children. With padding (icicle's tiling.pad), every cell then gives up padding px at its far x and y ends, and the entry starts padding px in, as in d3.
sankeyLayoutLay out a sankey (see the module comment). links refer to node indices 0 … nodeCount − 1; links whose value is not positive, or whose ends are not nodes, must be filtered by the caller.

Released under the MIT License.