Skip to main content

Type Alias: CursorShape

CursorShape = { axis: "x" | "y"; cross?: ScaleLike | D3ScaleLike; scale: BandScaleLike | D3ScaleLike; width?: number; } | { axis: "ring"; center: readonly [number, number]; x: ScaleLike | D3ScaleLike; y: ScaleLike | D3ScaleLike; }

Defined in: packages/sdvplot/src/interact/cursor.ts:30

What a figure draws for the cursor. axis: "x" | "y": a rule across the plot at the value, or with width a band width data units wide centred on it, or on a band scale (bandwidth) the band holding it. cross is the other axis' scale: the rule spans its range (default: the figure's own other scale on a Plot figure, else the svg's viewBox). axis: "ring": an ellipse around center (data coordinates) whose radii are the value mapped through the x and y scales, such as a shot distance around the hoop. Every scale is a Plot figure's (svg.scale("x")) or a d3 scale as it is (D3ScaleLike: d3.scaleLinear(), d3.scaleBand()), as brushFilter's scales are.