Skip to content
API reference

components/minimap-labels

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”
Signature
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”
Signature
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”
Signature
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()”
Signature
function layoutMinimapLabels(marks, metrics): MinimapLabelSide[];

The side each mark’s label takes, index for index with marks.

Parameter Type
marks readonly Readonly<{ x: number; y: number; named: boolean; solid: boolean; goal: boolean; label: string; }>[]
metrics MinimapLabelMetrics

MinimapLabelSide[]