Arcs

<o-arc> draws a piece of a lane, with text along it if you want. Sibling arcs split their ring between them, or stack one after another by value.

A label that fits its text, eight equal segments (hover them), and a donut of 45, 30 and 25.

Arcs go straight into a ring, next to satellites or vectors if you like. They are drawn by the runtime, so they need the Orbit script.

Reference

AttributeDefaultWhat it does
valueShare of the ring's range, out of max. Without it, arcs split the range equally. See Split or stack.
max100The value that fills the whole range. Without it, --o-max of the ring or system.
startWhere the arc begins, on the same scale as value. A placed arc takes no slot and moves no other arc. See Placed arcs.
rangeauto makes the arc as long as its text. See Arcs that fit their text.
shapenoneThe ending. See Endings.
text-anchormiddleText along the arc: start, middle or end. On a range="auto" arc, where the arc sits around its angle.
flipRuns the text the other way, so it reads upright at the bottom. Also works as a class. flip="auto" (or the class flip-auto) does it only for an arc whose middle sits on the lower half of the ring.
fit-rangeStretches or squeezes the text to the whole arc. Also works as a class.
interactiveMakes the whole band clickable, even where it is transparent. See Pointer interaction.
hit-width0Extra touch area, in px, on each side of an interactive band.
Property or classDefaultWhat it does
--o-fillvar(--o-gray-light)Band color. transparent for text only.
--o-strokevar(--o-fill)Outline color.
--o-stroke-width1Outline width, in px.
color or --o-colorcurrentcolorText color. Other font properties apply too.
--o-gap, .gap-0 … .gap-301Space at each end of the arc. Cascades from the ring and the system.
--o-max100The scale: the value that fills the range when there is no max attribute. Cascades from the ring and the system.
.rippleWaves grow out of the band, to call for attention. See Ripple.
--o-ripple-color, --o-ripple-duration, --o-ripple-scale--o-fill, 1.6s, 1.14The color of a wave, how long it takes and how far it grows.
--o-size-ratio1Thickness, in lanes. .grow-* and .shrink-* work as on satellites.
.inner-orbit, .outer-orbit, .quarter-*-orbitMoves the band in or out from its lane.
.angle-0 … .angle-360Starts the arc at that angle.

Split or stack

Without value, sibling arcs share the ring equally: a segmented ring, or a pie when they are thick. With value, each takes its share of the range and starts where the previous one ended: a donut chart. Values are not normalized, so make them add up to max for a full ring. With max="24", or --o-max: 24 on the ring, value="6" is a quarter. An explicit value="0" draws nothing and takes no room.

Five arcs with values 50, 25, 15, 5 and 5, and three satellites at the middle angle of the big ones.

Color

--o-fill colors the band, and --o-stroke and --o-stroke-width its outline. They change with a short transition, so a hover state is one rule. Hover needs interactive: arcs ignore the pointer until you ask.

Hover the segments.

Endings

shape sets how each end looks: circle (or circle-a), circle-b, bullet, arrow, slash, backslash, rounded and zigzag. Endings are sized from the band, so they look the same on every ring and at every size.

Thickness, position and gaps

An arc is one lane thick. Set --o-size-ratio in lanes on the arc, its ring or the .gravity-spot, or use the .grow-* and .shrink-* classes on the arc. .inner-orbit and .outer-orbit move the band in or out so one of its edges sits on the lane, and the .quarter- versions go part of the way.

--o-gap is the space left at each end of an arc. It cascades, so one value on the ring spaces all its arcs; .gap-0 to .gap-30 set it on one arc. A ring of 3 to 6 thick segments usually wants --o-gap between 24 and 60 to read as separate pieces.

Outer ring, clockwise from the top: outer-orbit, quarter-outer-orbit, default, quarter-inner-orbit, inner-orbit. Inner ring: --o-gap.

Arcs follow the ring's --o-range, --o-from and .ccw (see Orbits). .angle-N on an arc starts it at that angle instead of its turn on the ring.

Curved text

Text inside an <o-arc> is drawn along it. Style it like any text: color, font-size, font-weight, text-transform. The font size is the same in px on every ring. Set --o-fill: transparent for text with no band.

text-anchor places the text at the start, middle (default) or end of its arc.

Text runs clockwise, so on the lower half of a ring it reads upside down. flip runs it the other way:

April to September, in amber, have flip.

When the arcs come from data, or the ring turns, working out which ones land on the lower half is Orbit's job: flip="auto" flips an arc only while its middle sits there, and decides again when the arc moves (a new --o-from, a sibling added, a different value).

Every month has flip="auto". Turn the ring: each one flips as it crosses the sides.

flip="auto" reads the arc's own place on its ring. It does not see a rotation applied to an ancestor with rotate or transform; there, set flip yourself.

Text longer than its arc is cut off, and the console says so with an [orbit] message. Shorten it, widen the range, let the arc fit the text with range="auto", or add fit-range to squeeze or stretch the text to the arc:

Change the range: the text stretches or squeezes to fill it.

Arcs that fit their text

With range="auto" an arc is as long as its text, with half a letter of room at each end. Consecutive auto arcs follow each other, which makes curved menus easy:

Three auto arcs, one after another. Click one, or tab to it and press Enter.

An auto arc starts at its angle. text-anchor="middle" centers it there instead, and text-anchor="end" ends it there. Both labels here are anchored at the top:

The amber line points at 0°.

Placed arcs

start puts an arc at a point of its ring, on the same scale as value: 0 is the start of the range and max its end. A placed arc takes no slot and moves no other arc, so it can go over a ring that already has arcs: a name on a ring of segments, or a segment on a timeline.

--o-max sets the scale for every arc and progress below it that has no max attribute, so values stay in their own units. Here a whole system counts hours: 12 of them fill 320°, from 12 hours ago to now.

Two rings of history. Every segment says when it started and how long it lasted, in hours. The labels sit on the same rings as the arcs.

With range="auto", a placed arc is a label. With text-anchor it is anchored at its point, as above: start begins there, middle centers on it and end ends there. A segment stays inside a partial range; on a full ring it wraps around, so with --o-max: 24, start="22" value="4" runs from 22:00 to 2:00.

Ripple

.ripple sends waves out of an arc: a copy of the band grows from the center of the ring and fades, over and over, while the band itself stays. Use it for the one thing that needs attention now. --o-ripple-color sets its color (the band's fill by default), --o-ripple-duration how long a wave takes, and --o-ripple-scale how far it grows. With reduced motion, there are no waves.

Six segments, two of them calling: amber every 1.6 seconds, coral every 0.9.

To make a whole dial call, place a transparent arc over it and give it the color of the wave: <o-arc class="ripple" start="0" value="100" style="--o-fill: transparent; --o-ripple-color: var(--coral)">.

Pointer interaction

Arcs are decorative by default, so they never steal clicks from controls nearby. interactive makes the whole band clickable, even where its fill is transparent, and hit-width adds touch area in px on each side, which helps with thin arcs on touch screens.

Only the outline is drawn, yet a click anywhere on the band, or up to 12px around it, toggles the color.

When an arc acts as a control, you bring the keyboard behavior and the accessible name. Arcs are placed with the rotate property, so your own transform or scale (on hover, say) adds to it instead of replacing it.

After drawing

Each <o-arc> fires a bubbling o-rendered event after it redraws. To wait for every arc on the page, for example before measuring, use await Orbit.ready(). See Runtime and resizing.