Horseshoe tick marks and labels¶
Tick marks and labels add readable scale information around a Horseshoe. Ticks divide the scale into visible positions. Labels show the values or named states that belong to those positions.
This page shows how to add major and minor ticks, choose which values receive labels, move ticks and labels relative to the path, change label direction and spacing, and add label backgrounds or badges.
Add major tick marks¶
Major ticks provide the main readable scale intervals, for example every 10 units on a 0–100 gauge.
ticksize: 10 creates a major tick every 10 units on this scale. Add minor tick marks¶
Minor ticks add intermediate scale positions when the major intervals alone are too coarse.
Move the tick marks¶
Use the tick offset when the ticks should move inward or outward relative to their normal radius. Use tickmarks_radius on the Horseshoe when the complete tick-mark layer needs another base radius.
Add labels¶
Choose which values should receive labels with show.labels_at:
Choose which values get labels¶
Labels do not have to be shown at every possible value; choose the set that makes the scale readable without crowding it.
labels_at | Labels shown |
|---|---|
none | No labels |
minmax | Minimum and maximum |
minmax0 | Minimum, zero, and maximum |
colorstop / colorstops | Color-stop/scale boundaries |
ticks_major | Major tick values |
both | Color-stop and major-tick labels |
segment / stringstate | Labels from mapped states |
Move the labels¶
Use horseshoe_labels.offset to move the label layer inward or outward:
Change the label direction¶
Use horseshoe_labels.orientation to choose the label direction. arc follows the Horseshoe path and is the default. horizontal keeps every label level on the card instead of following the curve.
Keep enough space between labels¶
Use distance_min when labels would otherwise appear too close together:
Add a label background or badge¶
Use show.label_background for a band behind the label layer. none hides the band, fixed uses the configured background color, colorstopsegments divides the band into hard color-stop sections, lineargradient spreads the configured colors evenly across the path, and colorstopgradient places the gradient colors at their configured scale values. Configure the band under horseshoe_labels.background.
Set show.label_badges: true to draw a badge behind every individual label; false leaves the text without badges. Horizontal labels use circular badges, while labels that follow the path use capsule-shaped badges. Configure their size and appearance under horseshoe_labels.badges.
Configuration options¶
Major or minor tick layer¶
When you define ticks_major or ticks_minor yourself, the interval, length, and thickness are the three values that define that visible tick layer.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
ticksize | number | Yes | — | Value interval between neighboring ticks; for example 10 places ticks at 0, 10, 20, and so on. |
width | number | Yes | — | Length of each tick away from its base radius. |
thickness | number | Yes | — | Thickness of each tick along the path. |
offset | number | No | 0 | Moves the complete tick layer relative to tickmarks_radius: positive outward, negative inward. |
shape | line, circle | No | line | line draws a short tick across the path; circle draws a circular point. |
radius | number | No | width / 2 for circles | Radius of a circular tick when shape: circle is used. |
color | color | No | Tick style color | Fixed tick color. |
color_mode | fixed, colorstop, colorstopinterpolated | No | fixed | fixed uses color/styles; colorstop uses the discrete color-stop color for that tick value; colorstopinterpolated blends between neighboring color stops. |
styles | mapping | No | Not set | Adds SVG/CSS appearance overrides to the tick layer. |
Label visibility and background¶
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
show.labels_at | none, minmax, minmax0, colorstop, colorstops, ticks_major, both, segment, stringstate | No | none | Chooses the label source; the visible result of each value is listed above. |
show.label_background | none, fixed, colorstopsegments, lineargradient, colorstopgradient | No | none | Chooses whether the label band is hidden, fixed-color, divided into hard color-stop sections, or shown as an even/value-positioned gradient. |
show.label_badges | boolean | No | false | true draws a badge behind every label; false shows only the text. |
Labels¶
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
offset | number | No | 12 | Moves labels relative to the Horseshoe path: positive outward, negative inward. |
distance_min | number | No | 0 | Hides labels that would represent values closer together than this minimum difference. |
orientation | arc, horizontal | No | arc | arc follows the Horseshoe path; horizontal keeps every label level on the card. |
arc_size | number | No | Calculated | Amount of path space available to each label. |
ellipsis | number | No | 0 / no truncation | Shortens a label after the configured character limit. |
stringstate_mode | mapping | No | Not set | Appearance used for labels generated by stringstate_mode. |
stringstate_level | mapping | No | Not set | Appearance used for labels generated by stringstate_level. |
color_filter | mapping | No | Not set | Transforms the label color without changing the label value. |
styles | mapping | No | Default label style | Sets font, color, alignment, and other label appearance. |