ChartHoneycomb
Hexagonal tile-map chart. Renders a grid of SVG <polygon> hexagons positioned by (x=col, y=row) indices. Supports pointy-top and flat-top orientations, categorical and heatmap colour modes.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-chart-honeycomb> — 5 internal parts. Hexagon points computed in JavaScript from tileSize and orientation.- 1.origam-chart-honeycomb
- Root element. CSS grid with areas: header / body / legend. role="figure" + aria-label from title.
- 2.origam-chart__honeycomb-tile
- SVG
for each tile. Points computed from tileSize, col/row index and orientation. tabindex="0" + role="button". - 3.origam-chart__honeycomb-label
- Text centred at the tile's (cx, cy). Shows name or formatted value. Hidden when showLabel=false.
- 4.origam-chart__honeycomb-tile--active
- BEM modifier applied on hover/focus — adds brightness filter.
- 5.origam-chart-honeycomb__header
- Title and subtitle block. Rendered only when title or subtitle is provided.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- orientationTChartHoneycombOrientation'pointy-top'
- Hex vertex orientation. 'pointy-top' = vertex at top (default). 'flat-top' = flat edge at top.
- colorModeTChartHoneycombColorMode'categorical'
- Colour strategy. 'categorical' cycles the colorScheme palette; 'heatmap' interpolates value between heatmapColorRange endpoints.
- heatmapColorRange[TIntent | string, TIntent | string]['info', 'danger']
- Two-stop colour range for colorMode="heatmap". First = min value colour; second = max value colour.
- tileSizenumber30
- Hex side-length in SVG user units. Controls how large each tile is.
- tileGapnumber2
- Gap between adjacent tiles in SVG user units.
- showLabelbooleantrue
- Renders the tile's name (or value when name is absent) centred in the tile.
- xAxisFormat(value: number | string) => string
- Column index formatter used in tooltips.
- yAxisFormat(value: number) => string
- Row index formatter used in labels and tooltips.
- seriesrequisArray<IChartSeries>—
- Data series — only series[0] is consumed. Each datum must supply x (col), y (row) and optionally name, value, color.
- categoriesArray<string>
- titlestring
- Optional title rendered above the plotting area.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendbooleantrue
- Renders the ChartLegend block.
- legendPositionTChartLegendPosition'bottom'
- Position of the legend: 'top' | 'bottom' | 'left' | 'right'.
- showTooltipbooleantrue
- Shows a tooltip on hover/focus with the tile name and value.
- animatedbooleantrue
- Fades tiles in on first paint. Respects prefers-reduced-motion.
- animationDurationnumber600
- Entry animation duration in ms.
- colorSchemeArray<TIntent | string>[]
- Palette cycled in categorical mode. Defaults to the 8 origam intent colours when empty.
- aspectRatiostring
- CSS aspect-ratio shortcut. When set, overrides height.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string400
- Component height. Accepts a CSS length or a number (converted to px).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColor
- Background colour applied to the chart root.
- fontSizeTFontSize
- fontWeightTFontWeight
API
Slots
Emplacements de contenu exposés par ce composant.
- #tile-label
- #tooltip
- Replaces the default tooltip body for a hovered tile.
- #legend-item
- Replaces one legend entry with custom markup.
- #title
- Replaces the default title/subtitle block.
- #empty
- Shown when series is empty or every tile is hidden.
API
Emits
Événements émis par ce composant.
- @point-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired when the user clicks or keyboard-activates a tile.
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, boolean
- Fired after a legend click with the intended next visibility value.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Gap between header, body and legend areas.
- Internal padding of the chart root.
- Entry animation duration. Driven by animationDuration prop.
- Stroke colour applied to each tile polygon (creates gap between tiles).
- Stroke width of tile polygons.
- Font size of the centred tile label.
- Font weight of the centred tile label.
- Fill colour of the centred tile label.
- Font size of the chart title.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | Action |
|---|---|
| Tab | Moves focus through each hex tile (tabindex="0") and legend items. |
| Enter / Space | Activates the focused tile, firing the point-click emit. |
Notes
- Root has role="figure" with aria-label from the title prop (falls back to "honeycomb chart").
- The SVG carries role="img" with a <title> and <desc> listing the tile count.
- Each tile has aria-label derived from its name and value (e.g. "A: 42").
- Entry animations are disabled via @media (prefers-reduced-motion: reduce).
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Categorical honeycomb
Heatmap colour mode
Flat-top orientation
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
Chart
Universal chart component supporting bar, line, area, pie, donut, scatter and more.
ChartBullet
Bullet chart — compact KPI display with range bands, actual-value bar and target tick.
ChartHeatmap
Rectangular heatmap chart with colour-mix gradient cells.
ChartLegend
Standalone series-legend component shared by all chart families.
ChartMap
Choropleth and flight-route world map chart.