SvgArc interface
An arc around the center of an element, for createSvgArcPath and its siblings (0° up, clockwise).
ts
import type { SvgArc } from 'utils';Signature
ts
export interface SvgArc {
/** The element whose visible center is the center of the arc, such as the hub of a gauge. */
readonly center: SVGGraphicsElement;
/** In the coordinates of the drawn path. */
readonly radius: number;
/** In degrees. */
readonly startAngle: number;
/** The opening in degrees: positive clockwise, 360 for a full circle. */
readonly sweepAngle: number;Tests
Line coverage: 0 %.
Source
src/svg-shape/svg-arc.ts (on GitHub)
Used by
createSvgArcPath: Creates thedof an arc around the center of an element, in any group: the track of a gauge around its hub.createSvgArcTicksPath: Creates thedof evenly spaced graduations along an arc, around the center of an element in any group:countintervals givecount + 1ticks.createSvgPiePath: Creates thedof a pie slice joined to the center of an element, in any group: a radar sector, a remaining-time disk, to fill.getSvgArcPoint: Finds a point along an arc, in the coordinates of an element of any group: where to put the label of a graduation or a marker.
Source code
ts
/** An arc around the center of an element, for `createSvgArcPath` and its siblings (0° up, clockwise). */
export interface SvgArc {
/** The element whose visible center is the center of the arc, such as the hub of a gauge. */
readonly center: SVGGraphicsElement;
/** In the coordinates of the drawn path. */
readonly radius: number;
/** In degrees. */
readonly startAngle: number;
/** The opening in degrees: positive clockwise, 360 for a full circle. */
readonly sweepAngle: number;
}Keywords: svg, arc, svg shapes, interface