Skip to content

@mk7s/holochart-traces-basic ​

Interfaces ​

InterfaceDescription
BarCalcBar calcdata. Index-aligned typed arrays, one entry per bar.
BarTraceErrorXError bars along the x axis.
BarTraceErrorYError bars along the y axis.
BarTraceInsidetextfontFont of labels inside bars. Defaults to textfont, with a color contrasting the bar fill.
BarTraceMarkerBar style.
BarTraceMarkerLineBar outline.
BarTraceMarkerPatternHatch pattern of the bar fill (drawn in screen px, for print and grayscale).
BarTraceOutsidetextfontFont of labels outside bars. Defaults to textfont.
BarTraceSelectedStyle of selected bars while a selection is active.
BarTraceSelectedMarkerMarker style of selected bars.
BarTraceSelectedTextfontText style of selected bars.
BarTraceTextfontFont of bar labels. Defaults to layout.font.
BarTraceUnselectedStyle of unselected bars while a selection is active.
BarTraceUnselectedMarkerMarker style of unselected bars.
BarTraceUnselectedTextfontText style of unselected bars.
BubbleSizerefOptionsOptions for bubbleSizeref.
ColorbarThe colorbar of this colorscale (plan E5.3).
ColorbarTickfontTick-label font. Defaults to layout.font.
ColorbarTitleColorbar title.
ColorbarTitleFontTitle font. Defaults to layout.font with the tick-label family and 1.2 × its size.
PieCalcCalcdata of a pie trace.
PieLayoutPlacement of a pie in container px (top-left origin), set by crossTraceLayout.
PieSliceOne slice: every data point with the same label (Plotly's calcdata point).
PieTraceInsidetextfontFont of labels inside slices. Defaults to textfont, with a color contrasting the slice.
PieTraceMarkerSlice style.
PieTraceMarkerLineSlice outlines.
PieTraceMarkerPatternHatch pattern of the slice fill (drawn in screen px, for print and grayscale).
PieTraceOutsidetextfontFont of labels outside slices. Defaults to textfont.
PieTraceTextfontFont of slice labels. Defaults to layout.font.
PieTraceTitleThe pie title.
PieTraceTitleFontTitle font. Defaults to layout.font.
ScatterCalcScatter calcdata: linear coordinates per point (NaN where a point cannot be placed).
ScatterLinkA trace's place among the scatter traces of its subplot (E9.4), set by crossTraceCalc.
ScatterStackA stacked trace's cross-trace calc (E9.4), written by crossTraceCalc: the x / y of the calc then hold each point's stacked position.
ScatterTraceErrorXError bars along the x axis.
ScatterTraceErrorYError bars along the y axis.
ScatterTraceFillgradientA color gradient drawn instead of fillcolor (which still colors hover labels).
ScatterTraceFillpatternHatch pattern of the area fill (drawn in screen px, for print and grayscale).
ScatterTraceLineLine style (mode lines). shape and smoothing also shape fills.
ScatterTraceMarkerMarker style (mode markers).
ScatterTraceMarkerLineMarker outline.
ScatterTraceSelectedStyle of selected points while a selection is active (box/lasso select, selectedpoints).
ScatterTraceSelectedMarkerMarker style of selected points.
ScatterTraceSelectedTextfontText style of selected points.
ScatterTraceTextfontFont of the text labels (mode text). Defaults to layout.font.
ScatterTraceUnselectedStyle of unselected points while a selection is active (box/lasso select, selectedpoints).
ScatterTraceUnselectedMarkerMarker style of unselected points.
ScatterTraceUnselectedTextfontText style of unselected points.
StackOutputWhat layoutBars computes for one input. Arrays are index-aligned with the input.
TableCalcCalcdata of a table.
TableColumnOne column, in data order.
TableTraceCellsThe cells, scrolled with the wheel, by dragging, or with the scrollbar.
TableTraceCellsFillCell background.
TableTraceCellsFontFont of the cells text. Defaults to layout.font.
TableTraceCellsLineCell outlines.
TableTraceHeaderThe header: fixed above the scrolling cells; drag a header cell to reorder columns.
TableTraceHeaderFillCell background.
TableTraceHeaderFontFont of the header text. Defaults to layout.font.
TableTraceHeaderLineCell outlines.
TimelineFigureThe figure built by timeline: pass it to createChart or adjust it first.
TimelineFigureOptionsOptions of timeline: the camelCase counterparts of px.timeline's parameters.

Type Aliases ​

Type AliasDescription
BarExtruderDraws a bar trace with depth extruded (render's extrudeRects; see the module comment).
BaseBarTraceBar: rectangles from a base to a value, vertical or horizontal.
BasePieTracePie or donut: slices of a circle proportional to their values.
BaseScatterTraceScatter: markers, lines, text labels and filled or stacked areas at x/y positions.
TableTraceTable: a grid of formatted values with a fixed header, placed by domain. Only the visible rows are laid out and drawn, so large tables scroll smoothly.
TimelineDataRows ([{ task, start, end }, …]) or columns ({ task: [...], start: [...], end: [...] }).
TracesBasicAny trace of @mk7s/holochart-traces-basic, discriminated on type. Type a partial bundle's figures with it: FigureInput<TracesBasic>.

Variables ​

VariableDescription
bar-
barAttributesThe bar schema. Common trace attributes (name, opacity, xaxis, …) come from core.
basicTracesEvery trace module in this package, in registration order (the full bundle registers these).
colorbarAttributesThe colorbar container of a colorscaled container with showscale (marker.colorbar, layout.coloraxisN.colorbar), following Plotly's colorbar attributes: size and placement, outline, border and background, the axis tick API (the colorbar is a linear axis over [cmin, cmax]) and a title.
pie-
pieAttributesThe pie schema.
scatter-
scatterAttributesThe scatter schema. Common trace attributes (name, opacity, xaxis, …) come from core.
table-
tableAttributesThe table schema.

Functions ​

FunctionDescription
bubbleSizerefThe marker.sizeref that draws the largest of sizes as a bubble maxPx CSS px across, so data of any magnitude maps to a readable range of marker sizes. For sizemode: 'area' (the usual bubble setting) this is Plotly's documented 2 · max(size) / maxPx²; for 'diameter' it is max(size) / maxPx.
setBarExtruderInstall (or remove) the extruder of bars with depth (plan E9.10). The full bundle (@mk7s/holochart) installs render's extrudeRects and registers bar with the depth, bevel and material attributes (core withExtrusion); partial bundles opt in the same way.
timelineBuild a Gantt chart figure from a table, like plotly.py's px.timeline: one horizontal bar trace per color group, base = the start dates (as given), x = durations in ms, barmode: 'overlay' and a date x axis. Rows whose start or end is not a valid date are skipped. Differences from px: rows read top-down by default (reverseY), colors come from the template's colorway unless colorDiscreteMap / colorDiscreteSequence is given, and hover dates show the time of day only when some start or end has one.

Released under the MIT License.