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.
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
| Attribute | Default | What it does |
|---|---|---|
value | Share of the ring's range, out of max. Without it, arcs split the range equally. See Split or stack. | |
max | 100 | The value that fills the whole range. Without it, --o-max of the ring or system. |
start | Where the arc begins, on the same scale as value. A placed arc takes no slot and moves no other arc. See Placed arcs. | |
range | auto makes the arc as long as its text. See Arcs that fit their text. | |
shape | none | The ending. See Endings. |
text-anchor | middle | Text along the arc: start, middle or end. On a range="auto" arc, where the arc sits around its angle. |
flip | Runs 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-range | Stretches or squeezes the text to the whole arc. Also works as a class. | |
interactive | Makes the whole band clickable, even where it is transparent. See Pointer interaction. | |
hit-width | 0 | Extra touch area, in px, on each side of an interactive band. |
| Property or class | Default | What it does |
|---|---|---|
--o-fill | var(--o-gray-light) | Band color. transparent for text only. |
--o-stroke | var(--o-fill) | Outline color. |
--o-stroke-width | 1 | Outline width, in px. |
color or --o-color | currentcolor | Text color. Other font properties apply too. |
--o-gap, .gap-0 … .gap-30 | 1 | Space at each end of the arc. Cascades from the ring and the system. |
--o-max | 100 | The scale: the value that fills the range when there is no max attribute. Cascades from the ring and the system. |
.ripple | Waves 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.14 | The color of a wave, how long it takes and how far it grows. |
--o-size-ratio | 1 | Thickness, in lanes. .grow-* and .shrink-* work as on satellites. |
.inner-orbit, .outer-orbit, .quarter-*-orbit | Moves the band in or out from its lane. | |
.angle-0 … .angle-360 | Starts 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.
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.
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-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:
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).
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:
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:
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:
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.
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.
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.
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.