HelixOverviewComponentsMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingCortexDocsEngramActiveTraceActiveRecallActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
Spatial TreemapView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA treemap drawn in three dimensions, each item a block whose area is its size and whose height is a second measure.Also called 3D treemap, Isometric treemap, Treemap in 3D, and City map chart.ExperimentalSince 0.199.0ChartsImportimport'@fusion.dev/helix/spatial-treemap'import'@fusion.dev/helix-headless/spatial-treemap'Preview
GuidelinesWhen to use
Items sized by one measure and raised by a second, such as services by requests and latency.Spatial TreemapThis page
1::part(grid)The box's edges and its grid, in the chart's own drawing.
2::part(block)One block, its faces in its group's color.
3::part(tick)A height at a tick, along its edge of the box, in the chart's own drawing.
API referenceRoothelix-spatial-treemapA treemap drawn in three dimensions, each item a block whose area is its size and whose height is a second measure.
PropTypeDescriptiondataChartDataThe readings as data, in the shape of a table, where the page has no
table to point for at. for wins where both are set.emphasis"outlined"|"solid"|"subtle"How strongly the blocks are drawn, as on every chart.emptyTextstringDefault"No readings"The words shown in place of the drawing when the table has no readings,
and the fallback of the empty slot.errorTextstringDefault""The words shown in place of the drawing when the readings did not load,
such as "The visits did not load". Empty, the default, shows nothing.forstringDefault""The id of the table to read.groupBystringDefault""The column of text that gathers the rows into groups, by its heading. None by default.growbooleanDefaultfalseGrows the blocks in from the floor the first time the chart comes
into view with readings, one after another in the order of the table, so the drawing arrives the way a
page's own picture does. The growth is fast at first, slows to rest,
and never passes a reading.growAgainbooleanDefaultfalseGrows the blocks in again each time the chart comes back into view
after it left it, as a pane does when it is opened again, where grow
alone grows them the first time only. Only a chart that grows takes it.labelstringDefault""The chart's name, which starts the chart's text summary.loadingbooleanDefaultfalseWhether the readings are still on their way. The chart shows
loading-text in place of an empty drawing until it has readings.loadingTextstringDefault"Loading readings"The words shown in place of the drawing while loading is set and
there are no readings yet, and the fallback of the loading slot.localestringDefault""The locale the chart's own numbers are written in: its axis, its
percentages and its totals, such as de for 1.240 and 32 %.material"frosted"|"glass"How much of each mark comes through, as on every chart: glass admits the
most of what is behind it, frosted less, and absent is opaque. The
strength is the theme's, scaled by --helix-material-opacity.nextReadingsLabelstringDefault"Next readings"The name of the button that shows the next page of readings in the
table drawn from data, which holds a page at a time past
READINGS_PAGE.noBoxbooleanDefaultfalseDraws no box: no edges, grid, numbers, or names, so the readings stand
alone and fill the plot, as a picture on a product's own page does. The
table, the summary, the tooltip, and the keys still carry every value,
and a renderer draws no box either.plotLabelstringDefault"3D treemap"The plot's name where the chart has none: no aria-label, label, or table caption.positionLabelstringDefault"{position} of {count}"Where a reading the keys moved to stands among the readings, said after
it. {position} and {count} are replaced with the numbers, written in
locale.previousReadingsLabelstringDefault"Previous readings"The name of the button that shows the previous page of readings in the
table drawn from data.readingsLabelstringDefault"Readings {first} to {last} of {count}"Which readings the page of the table drawn from data holds, said
beside its buttons and as each page arrives. {first}, {last} and
{count} are replaced with the numbers, written in locale.separation"filled"|"plain"What the plot stands on. plain, the default, draws nothing behind it, as a
flat chart does, so a Card or the page is its ground. filled draws the
surface-filled ground every family takes. no-box is a separate choice:
it removes the box, grid, numbers, and names.sonifybooleanDefaultfalseDraws a Listen button that plays the chart as sound: each series in
turn, its readings from left to right and from the left ear to the
right, the value as pitch over two octaves, a soft tick at each
gridline, and one timbre a series. With it, each reading the arrow keys
step to plays its tone beside what the readout says, and L plays the
whole chart while it has focus. Escape stops it. Nothing plays without a
press, and the sound is made only then.sonifyDurationnumberDefault3000How long each series takes to play, in milliseconds or as 3s.sonifyLabelstringDefault"Listen"The Listen button's words.sonifyStopLabelstringDefault"Stop"The Listen button's words while the chart plays.summary"hidden"|"visible"visible draws the chart's text summary under it, as one line.
hidden, or absent, says the summary to a screen reader and draws it
for no one else. Reflected, because the stylesheet draws it by the
attribute, and a page that sets the property, as React does, writes none.summaryLabelstringDefault"{count, plural, one {# item} other {# items}} in {groups, plural, one {# group} other {# groups}}, sized from {low} to {high}."The summary part's sentence. {count} and {groups} are the number
of items and groups, written in the locale, and {low} and {high} the
smallest and the largest size.
ReadTypeDescriptionactivenumberThe block the keys or the pointer rest on, as its place in field.blocks, or -1.fieldTreemapFieldThe table read as blocks. The first numeric column is each block's
size, and the second its height. A renderer reads it.namedstringThe chart's name: an aria-label written on the chart, then label,
then the table's caption.plottedColumnsnumber[]The positions of the cells in a row that hold numbers, in table order.readingsnumberThe number of readings, which the pointer position maps onto.seriesSeries[]The table's columns, one series each. Empty when there is no table.shownTreemapFieldThe blocks as drawn this frame, which a renderer draws: field at rest,
and while the readings move, every block between its last place and its
new one, in field's order, then each block the last table had and the
new one does not, shrinking away.soundingbooleanWhether the chart is playing as sound now.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The renderer's box, which the 3D drawing is made in.emptyContent shown when the table has no readings. Falls back to empty-text.errorContent shown after error-text while it is set and there are no readings, such as a button that tries again.loadingContent shown while loading is set and there are no readings yet. Falls back to loading-text.
EventTypeDescriptionhelix-plot-changeHelixPlotChangeEventThe blocks or the block the keys rest on changed, or a frame of a move drew the blocks on their way, which the renderer is told. It stays on the chart.helix-plot-turnHelixPlotTurnEventShift with an arrow asked the view to turn, by a step across or up.helix-reading-changeHelixReadingChangeEventThe reading moved, or was put away: index is the row, or -1 for none, with its label and the pointerType that moved it.helix-reading-pressHelixReadingPressEventA block was clicked or pressed with Enter or Space, with the same detail as helix-reading-change.
MethodTypeDescriptioncolumnName(cell: number) => stringThe heading of the column at this place in a row: a cell's name is its
column's heading, read from the first row that has a cell there, so a
short first row does not lose the heading. '' where no row has one.placeReading(at: { x: number; y: number } | undefined) => voidSays where the renderer draws the reading, as fractions of the plot from
its top left, or undefined while it draws none. The tooltip points
there. Called by the connector.playReadings() => Promise<void>Plays every shown series as sound, one after another, and resolves when it ends or is stopped.rendererDrawn(on: unknown) => voidSays whether a renderer has drawn the blocks, which hides the chart's own
drawing or shows it again. Called by the connector.requestActive(at: number, kind: "mouse" | "pen" | "touch") => voidPuts the reading on the block at index, or lets it go with -1, as a
pointer resting on it in the renderer's drawing or a press there does.
A touch keeps it until a tap lands elsewhere, and a mouse leaving a
reading the keys moved to leaves it. Called by the connector.seriesOf(cell: number) => number | undefinedThe palette slot for the cell at this position in a row.showsColumn(cell: number) => booleanWhether the series read from the cell at this place in a row is drawn,
by its column's heading. The keys and the readout pass over one a
legend hid.showsSeries(name: string) => booleanWhether the series of this name is drawn, which it is unless a legend
reading the same table hid it.stopReadings() => voidStops the sound.
PartDescriptionaxis-nameThe height's name, along its edge of the box, in the chart's own drawing.blockOne block, its faces in its group's color.block-activeThe block the pointer or the keys rest on. Set alongside block.drawingThe chart's own drawing in SVG: the box, its grid and numbers, and the blocks.emptyThe words when the table has no readings: the empty slot, falling back to empty-text.errorThe words while error-text is set and there are no readings, followed by the error slot. Announced as it appears.faceOne face of a block the view shows, shaded by which way it faces.fallbackThe box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.gridThe box's edges and its grid, in the chart's own drawing.liveThe readout: a polite live region that says the item the keys moved to. Hide it visually.loadingThe words while loading is set and there are no readings.markThe invisible point the tooltip is anchored to, where the renderer draws the reading.plotThe box the drawing fills, which takes focus to be read by key. It is named by the host's aria-labelledby or aria-label, then by label, then by the caption of the table.ringThe outline around the block the pointer or the keys rest on, painted after it, so the blocks in front of it cover it.ring-behindThe same outline, faint and dashed, drawn over every block, so the part of the block the pointer or the keys rest on that others hide still shows.sonifyThe button that plays the chart as sound, under sonify.summaryThe number of items and groups and the range of their sizes, written as a sentence for screen readers, which describes the plot. Hide it visually.tableThe readings as a table, for a screen reader, rendered only where they were drawn from data, a page of them at a time past a few hundred. Hide it visually.table-pagesWhich readings a page of the table holds, and the buttons that show the previous and the next page, rendered only while it holds a page. Hide it visually.tickA height at a tick, along its edge of the box, in the chart's own drawing.tooltip-anchorThe Tooltip element itself.tooltip-arrowThe bubble's point, forwarded from Tooltip.tooltip-arrow-bottomThe point while the bubble is below the reading, on its top edge. Set alongside tooltip-arrow.tooltip-arrow-leftThe point while the bubble is left of the reading, on its right edge. Set alongside tooltip-arrow.tooltip-arrow-rightThe point while the bubble is right of the reading, on its left edge. Set alongside tooltip-arrow.tooltip-arrow-topThe point while the bubble is above the reading, on its bottom edge. Set alongside tooltip-arrow.tooltip-cellOne column's name and value inside the tooltip.tooltip-cell-currentThe cell a chart's series keys rest on, which every chart's tooltip can mark. This chart marks none, since its readout says the measure. Set alongside tooltip-cell.tooltip-labelThe row's own name inside the tooltip.tooltip-nameA column's name inside the tooltip.tooltip-surfaceThe bubble, forwarded from Tooltip.tooltip-surface-bottomThe bubble while it is below the reading. Set alongside tooltip-surface.tooltip-surface-leftThe bubble while it is left of the reading. Set alongside tooltip-surface.tooltip-surface-rightThe bubble while it is right of the reading. Set alongside tooltip-surface.tooltip-surface-topThe bubble while it is above the reading. Set alongside tooltip-surface.tooltip-valueA column's value inside the tooltip.
CSS PropertyDescription--spatial-treemap-block-sizeHow tall the plot is. By default, as tall as it is wide and 26em at most.--spatial-treemap-move-durationHow long the blocks take to move to a new table's readings. Defaults to --helix-duration-normal. 0ms draws a new table at once.--spatial-treemap-move-easingThe curve the blocks move to new readings along. Defaults to --helix-easing-decelerate, so a block slows as it arrives and never passes its reading.--spatial-treemap-shadeHow far a block's face turns from the light, from 0 for its top. The component writes it on each face, and the stylesheet that shades the face reads it.
Custom stateDescriptionactiveWhile a block is shown, under the pointer or the keys.drawnWhile a renderer has drawn the blocks, and the chart's own drawing is hidden.emptyWhile the empty part stands in place of the readings.errorWhile the error part stands in place of the readings.loadingWhile the loading part stands in place of the readings.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-headless-spatial-treemapA treemap drawn in three dimensions, each item a block whose area is its size and whose height is a second measure.
PropTypeDescriptiondataChartDataThe readings as data, in the shape of a table, where the page has no
table to point for at. for wins where both are set.emptyTextstringDefault"No readings"The words shown in place of the drawing when the table has no readings,
and the fallback of the empty slot.errorTextstringDefault""The words shown in place of the drawing when the readings did not load,
such as "The visits did not load". Empty, the default, shows nothing.forstringDefault""The id of the table to read.groupBystringDefault""The column of text that gathers the rows into groups, by its heading. None by default.growbooleanDefaultfalseGrows the blocks in from the floor the first time the chart comes
into view with readings, one after another in the order of the table, so the drawing arrives the way a
page's own picture does. The growth is fast at first, slows to rest,
and never passes a reading.growAgainbooleanDefaultfalseGrows the blocks in again each time the chart comes back into view
after it left it, as a pane does when it is opened again, where grow
alone grows them the first time only. Only a chart that grows takes it.labelstringDefault""The chart's name, which starts the chart's text summary.loadingbooleanDefaultfalseWhether the readings are still on their way. The chart shows
loading-text in place of an empty drawing until it has readings.loadingTextstringDefault"Loading readings"The words shown in place of the drawing while loading is set and
there are no readings yet, and the fallback of the loading slot.localestringDefault""The locale the chart's own numbers are written in: its axis, its
percentages and its totals, such as de for 1.240 and 32 %.nextReadingsLabelstringDefault"Next readings"The name of the button that shows the next page of readings in the
table drawn from data, which holds a page at a time past
READINGS_PAGE.noBoxbooleanDefaultfalseDraws no box: no edges, grid, numbers, or names, so the readings stand
alone and fill the plot, as a picture on a product's own page does. The
table, the summary, the tooltip, and the keys still carry every value,
and a renderer draws no box either.plotLabelstringDefault"3D treemap"The plot's name where the chart has none: no aria-label, label, or table caption.positionLabelstringDefault"{position} of {count}"Where a reading the keys moved to stands among the readings, said after
it. {position} and {count} are replaced with the numbers, written in
locale.previousReadingsLabelstringDefault"Previous readings"The name of the button that shows the previous page of readings in the
table drawn from data.readingsLabelstringDefault"Readings {first} to {last} of {count}"Which readings the page of the table drawn from data holds, said
beside its buttons and as each page arrives. {first}, {last} and
{count} are replaced with the numbers, written in locale.sonifybooleanDefaultfalseDraws a Listen button that plays the chart as sound: each series in
turn, its readings from left to right and from the left ear to the
right, the value as pitch over two octaves, a soft tick at each
gridline, and one timbre a series. With it, each reading the arrow keys
step to plays its tone beside what the readout says, and L plays the
whole chart while it has focus. Escape stops it. Nothing plays without a
press, and the sound is made only then.sonifyDurationnumberDefault3000How long each series takes to play, in milliseconds or as 3s.sonifyLabelstringDefault"Listen"The Listen button's words.sonifyStopLabelstringDefault"Stop"The Listen button's words while the chart plays.summary"hidden"|"visible"visible draws the chart's text summary under it, as one line.
hidden, or absent, says the summary to a screen reader and draws it
for no one else. Reflected, because the stylesheet draws it by the
attribute, and a page that sets the property, as React does, writes none.summaryLabelstringDefault"{count, plural, one {# item} other {# items}} in {groups, plural, one {# group} other {# groups}}, sized from {low} to {high}."The summary part's sentence. {count} and {groups} are the number
of items and groups, written in the locale, and {low} and {high} the
smallest and the largest size.
ReadTypeDescriptionactivenumberThe block the keys or the pointer rest on, as its place in field.blocks, or -1.fieldTreemapFieldThe table read as blocks. The first numeric column is each block's
size, and the second its height. A renderer reads it.namedstringThe chart's name: an aria-label written on the chart, then label,
then the table's caption.plottedColumnsnumber[]The positions of the cells in a row that hold numbers, in table order.readingsnumberThe number of blocks, which the keys walk.seriesSeries[]The table's columns, one series each. Empty when there is no table.shownTreemapFieldThe blocks as drawn this frame, which a renderer draws: field at rest,
and while the readings move, every block between its last place and its
new one, in field's order, then each block the last table had and the
new one does not, shrinking away.soundingbooleanWhether the chart is playing as sound now.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The renderer's box, which the 3D drawing is made in.emptyContent shown when the table has no readings. Falls back to empty-text.errorContent shown after error-text while it is set and there are no readings, such as a button that tries again.loadingContent shown while loading is set and there are no readings yet. Falls back to loading-text.
EventTypeDescriptionhelix-plot-changeHelixPlotChangeEventThe blocks or the block the keys rest on changed, or a frame of a move drew the blocks on their way, which the renderer is told. It stays on the chart.helix-plot-turnHelixPlotTurnEventShift with an arrow asked the view to turn, by a step across or up.helix-reading-changeHelixReadingChangeEventThe reading moved, or was put away: index is the row, or -1 for none, with its label and the pointerType that moved it.helix-reading-pressHelixReadingPressEventA block was clicked or pressed with Enter or Space, with the same detail as helix-reading-change.
MethodTypeDescriptioncolumnName(cell: number) => stringThe heading of the column at this place in a row: a cell's name is its
column's heading, read from the first row that has a cell there, so a
short first row does not lose the heading. '' where no row has one.placeReading(at: { x: number; y: number } | undefined) => voidSays where the renderer draws the reading, as fractions of the plot from
its top left, or undefined while it draws none. The tooltip points
there. Called by the connector.playReadings() => Promise<void>Plays every shown series as sound, one after another, and resolves when it ends or is stopped.rendererDrawn(on: unknown) => voidSays whether a renderer has drawn the blocks, which hides the chart's own
drawing or shows it again. Called by the connector.requestActive(at: number, kind: "mouse" | "pen" | "touch") => voidPuts the reading on the block at index, or lets it go with -1, as a
pointer resting on it in the renderer's drawing or a press there does.
A touch keeps it until a tap lands elsewhere, and a mouse leaving a
reading the keys moved to leaves it. Called by the connector.seriesOf(cell: number) => number | undefinedThe palette slot for the cell at this position in a row.showsColumn(cell: number) => booleanWhether the series read from the cell at this place in a row is drawn,
by its column's heading. The keys and the readout pass over one a
legend hid.showsSeries(name: string) => booleanWhether the series of this name is drawn, which it is unless a legend
reading the same table hid it.stopReadings() => voidStops the sound.
PartDescriptionaxis-nameThe height's name, along its edge of the box, in the chart's own drawing.blockOne block, its faces in its group's color.block-activeThe block the pointer or the keys rest on. Set alongside block.drawingThe chart's own drawing in SVG: the box, its grid and numbers, and the blocks.emptyThe words when the table has no readings: the empty slot, falling back to empty-text.errorThe words while error-text is set and there are no readings, followed by the error slot. Announced as it appears.faceOne face of a block the view shows, shaded by which way it faces.fallbackThe box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.gridThe box's edges and its grid, in the chart's own drawing.liveThe readout: a polite live region that says the item the keys moved to. Hide it visually.loadingThe words while loading is set and there are no readings.markThe invisible point the tooltip is anchored to, where the renderer draws the reading.plotThe box the drawing fills, which takes focus to be read by key. It is named by the host's aria-labelledby or aria-label, then by label, then by the caption of the table.ringThe outline around the block the pointer or the keys rest on, painted after it, so the blocks in front of it cover it.ring-behindThe same outline, faint and dashed, drawn over every block, so the part of the block the pointer or the keys rest on that others hide still shows.sonifyThe button that plays the chart as sound, under sonify.summaryThe number of items and groups and the range of their sizes, written as a sentence for screen readers, which describes the plot. Hide it visually.tableThe readings as a table, for a screen reader, rendered only where they were drawn from data, a page of them at a time past a few hundred. Hide it visually.table-pagesWhich readings a page of the table holds, and the buttons that show the previous and the next page, rendered only while it holds a page. Hide it visually.tickA height at a tick, along its edge of the box, in the chart's own drawing.tooltip-anchorThe Tooltip element itself.tooltip-arrowThe bubble's point, forwarded from Tooltip.tooltip-arrow-bottomThe point while the bubble is below the reading, on its top edge. Set alongside tooltip-arrow.tooltip-arrow-leftThe point while the bubble is left of the reading, on its right edge. Set alongside tooltip-arrow.tooltip-arrow-rightThe point while the bubble is right of the reading, on its left edge. Set alongside tooltip-arrow.tooltip-arrow-topThe point while the bubble is above the reading, on its bottom edge. Set alongside tooltip-arrow.tooltip-cellOne column's name and value inside the tooltip.tooltip-cell-currentThe cell a chart's series keys rest on, which every chart's tooltip can mark. This chart marks none, since its readout says the measure. Set alongside tooltip-cell.tooltip-labelThe row's own name inside the tooltip.tooltip-nameA column's name inside the tooltip.tooltip-surfaceThe bubble, forwarded from Tooltip.tooltip-surface-bottomThe bubble while it is below the reading. Set alongside tooltip-surface.tooltip-surface-leftThe bubble while it is left of the reading. Set alongside tooltip-surface.tooltip-surface-rightThe bubble while it is right of the reading. Set alongside tooltip-surface.tooltip-surface-topThe bubble while it is above the reading. Set alongside tooltip-surface.tooltip-valueA column's value inside the tooltip.
CSS PropertyDescription--spatial-treemap-move-durationHow long the blocks take to move to a new table's readings: a block the table keeps moves to its new part of the floor and its new height, a block it adds grows from the middle of its part, and a block it drops shrinks away. Unset, a new table is drawn at once. The growth under grow keeps its own timing.--spatial-treemap-move-easingThe curve the blocks move to new readings along.--spatial-treemap-shadeHow far a block's face turns from the light, from 0 for its top. The component writes it on each face, and the stylesheet that shades the face reads it.
Custom stateDescriptionactiveWhile a block is shown, under the pointer or the keys.drawnWhile a renderer has drawn the blocks, and the chart's own drawing is hidden.emptyWhile the empty part stands in place of the readings.errorWhile the error part stands in place of the readings.loadingWhile the loading part stands in place of the readings.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Examples
NameDescriptionEmphasisSix services in two teams at each emphasis: solid blocks, outlined blocks, and a subtle wash.MaterialSix services in two teams at each material: opaque, frosted, and glass, over a panel.PreviewRequests a minute and response time for fifteen services in four teams, drawn in 3D in SVG: each block as large as its requests and as tall as its response time, in its team's color. Drag to turn the blocks, or press Shift with an arrow.PreviewRequests a minute and response time for fifteen services in four teams, drawn in 3D in SVG: each block as large as its requests and as tall as its response time, in its team's color. Drag to turn the blocks, or press Shift with an arrow.SeparationSix services in two teams with the plain separation and on the filled ground.StatesA chart while its table loads, and a chart whose table has no readings.Taking new dataBlocks that rise from the floor the first time they are seen, and take their new sizes and heights when the table changes.ThreeThe same services drawn in 3D by three.js. Drag to turn the blocks, or press Shift with an arrow.Without a boxThe same services as glass blocks with no box, grid, or names around them, for a landing page. The tooltip and the table still carry every value.Without heightsThe same services by requests alone. With no second numeric column, the blocks stand as one slab, a treemap seen in 3D.