API reference
components/minimap-labels
Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | MinimapLabelSide | Where a mark’s name sits, or hidden. |
| type alias | MinimapLabelInput | A caller-provided minimap label and its anchor. |
| type alias | MinimapLabelMetrics | Measured label dimensions used to place minimap labels. |
| function | layoutMinimapLabels() | The side each mark’s label takes, index for index with marks. |
MinimapLabelSidetype alias
Section titled “MinimapLabelSide”type MinimapLabelSide = | "below" | "above" | "right" | "left" | "below-right" | "below-left" | "above-right" | "above-left" | "hidden";Where a mark’s name sits, or hidden.
MinimapLabelInputtype alias
Section titled “MinimapLabelInput”type MinimapLabelInput = Readonly<{ x: number; y: number; named: boolean; solid: boolean; goal: boolean; label: string;}>;A caller-provided minimap label and its anchor.
MinimapLabelMetricstype alias
Section titled “MinimapLabelMetrics”type MinimapLabelMetrics = Readonly<{ width: number; height: number; charWidth: number; lineHeight: number; padding: number; dot: number; gap: number;}>;Measured label dimensions used to place minimap labels.
layoutMinimapLabels()function
Section titled “layoutMinimapLabels()”function layoutMinimapLabels(marks, metrics): MinimapLabelSide[];The side each mark’s label takes, index for index with marks.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
marks |
readonly Readonly<{ x: number; y: number; named: boolean; solid: boolean; goal: boolean; label: string; }>[] |
metrics |
MinimapLabelMetrics |