Horseshoe scale and state¶
The scale defines the value range and base geometry of the horseshoe. The state layer shows the current value within that range. Styling them separately makes it possible to keep the scale subtle while giving the active value more visual emphasis.
Scale configuration¶
Use horseshoe_scale to define the value range and appearance of the base arc.
| Field | Default | Description |
|---|---|---|
min | Color-stop scale or 0 | Defines the lowest value on the scale. |
max | Color-stop scale or 100 | Defines the highest value on the scale. |
type | linear | Chooses how values are mapped to angles. |
spline | Provides the spline definition required by spline scale types. | |
width | 6 | Controls the width of the scale arc. |
color | var(--primary-background-color) | Applies the base scale color. |
linecap | round | Chooses the shape of the scale ends. |
color_filter | Applies an optional shared color filter. | |
styles | Applies SVG styles to the scale layer. |
1 2 3 4 5 6 7 8 9 | |
When color_stops.scales.default defines a minimum and maximum, the horseshoe uses that range automatically. Explicit horseshoe_scale.min or horseshoe_scale.max values override the corresponding color-stop values. If neither is configured, the range falls back to 0 through 100.
A linear scale is the best choice for most gauges. Use a spline scale only when the spacing needs to follow a verified spline definition. Tick marks, labels, and the state arc all use the same mapping, so they remain aligned.
State configuration¶
Use horseshoe_state to control the active value layer.
| Field | Default | Description |
|---|---|---|
width | 12 | Controls the width of the active state arc. |
color | var(--primary-color) | Applies a fixed state color. |
linecap | round | Chooses the shape of the state ends. |
mode | value | Chooses how the state is rendered. |
segment_gap | 2 | Defines the space between applicable state segments. |
inactive_opacity | Controls the opacity of inactive segments in segmented modes. | |
state_map | Maps non-numeric states to numeric render values. | |
animation | Controls the transition between state values. | |
color_filter | Applies an optional shared color filter. | |
styles | Applies SVG styles to the state layer. |
1 2 3 4 5 6 | |
State modes¶
The selected mode determines whether the current state appears as one continuous arc or as a set of discrete segments.
| Mode | Use |
|---|---|
value | Displays a continuous active arc from the scale minimum to the current value. |
segment | Displays the state as discrete mapped segments. |
stringstate_mode | Maps string states to mutually exclusive segments. |
stringstate_level | Maps string states to ordered levels. |
String-state modes require a state map. Labels can use the same mapping, which keeps the visible text synchronized with the active segment.
1 2 3 4 5 6 7 8 9 10 | |
Normal and bidirectional bars¶
Configure bar_mode on the horseshoe item itself because it affects the geometry shared by both the scale and the state.
| Mode | Behavior |
|---|---|
normal | Grows from the scale minimum toward the current value. |
bidirectional | Grows away from the calculated or configured zero position. |
bidirectional_symmetrical | Uses the center of the scale as the zero position. |
bidirectional_linear | Displays the bidirectional value with linear segment geometry. |
absolute | Grows from the arc start using the active signed branch's magnitude. |
When the scale range crosses zero, the default zero_ratio is calculated from horseshoe_scale.min and horseshoe_scale.max. Set zero_ratio manually only when the visual zero position should differ from the numeric ratio.
Absolute bars¶
bar_mode: absolute keeps the entity value signed for state text and color-stop selection, but draws its magnitude from the physical start of the horseshoe. Do not configure zero_ratio for this mode.
A 0..max scale shares one magnitude range between both signs. With min: 0 and max: 15, both -5 and +5 fill one third of the arc. Signed color stops remain independent, so those values can still use different colors.
A scale that crosses zero gives each sign its own complete arc. With min: -10 and max: 40, -5 fills half of the negative branch while +5 fills one eighth of the positive branch. The active branch also supplies scale/background colors, ticks, and magnitude labels. At exactly zero, the positive branch is active.
absolute uses the configured linear, spline, or splineorg mapping independently for each branch and supports every continuous horseshoe color style.
1 2 3 4 5 6 7 8 9 10 11 12 | |
Background layer¶
horseshoe_background adds an optional arc behind the full gauge. Enable it with show.horseshoe_background, then configure its geometry and appearance separately.
| Field | Description |
|---|---|
width | Controls the width of the background arc. |
offset | Moves the background inward or outward relative to the horseshoe radius. |
gap | Adds space between segmented color-stop background parts. |
color_filter | Applies an optional shared color filter. |
styles | Applies SVG styles to the background layer. |
1 2 3 4 5 6 7 8 9 | |
State colors¶
Use show.horseshoe_style to control how the horseshoe is colored.
Style names changed in v5.4.7-dev.22
Existing cards may require updated color-style names. See Migrating from v5.4.7 for the complete old-to-new table.
| Style | What it does |
|---|---|
fixed | Uses a single fixed color. |
autominmax | Changes the horseshoe color as the value moves through the scale. |
colorstop | Uses the color that matches the current value range. |
colorstopinterpolated | Interpolates the current state color between adjacent color stops. |
colorstopsegments | Displays each color range as a separate solid segment. |
minmaxgradient | Creates a continuous minimum/zero/maximum gradient over the active horseshoe. |
colorstopgradient | Creates a smooth gradient from all configured color stops. |
lineargradient | Distributes all configured colors evenly over the rendered range. |
colorstopgradient uses every configured color stop. For example, with blue at 0, yellow at 50, and red at 100, the gradient runs from blue through yellow to red. The horseshoe reveals that gradient up to the current value.
For a normal bar, lineargradient distributes every configured color evenly over the active horseshoe. The numeric distance between color-stop values does not affect their visual spacing.
For a bidirectional bar, lineargradient creates separate gradients for negative and positive values. Each side distributes its applicable colors evenly between the outer scale value and zero. Add a color stop at 0 to control the center color, or let FHS calculate it from the surrounding stops.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
In this example, negative values use a gray-to-red gradient, while positive values use a gray-to-green gradient. When the scale extends below or above zero, define at least one color stop on each side that should display a gradient.
The same color stops can also be reused by backgrounds and tick marks. See Color Stops for the complete syntax.
Animation¶
State changes can animate from the previous value to the new one. Configure this behavior under horseshoe_state.animation. General animation concepts and reusable definitions are covered in Animations.
Animation affects only the transition between valid states. The scale range, state map, and color-stop settings still determine the final geometry and color.