Skip to content

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 the d of an arc around the center of an element, in any group: the track of a gauge around its hub.
  • createSvgArcTicksPath: Creates the d of evenly spaced graduations along an arc, around the center of an element in any group: count intervals give count + 1 ticks.
  • createSvgPiePath: Creates the d of 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

Generated from the JSDoc of the sources.