Skip to content

Class: SparklineOverlay ​

Defined in: temporal/SparklineOverlay.ts:23

Lightweight hover tooltip that draws a vertex's time-series sparkline on a floating <canvas> element.

Canvas 2D is chosen over SVG for performance on the ~80 ms hover throttle. A single canvas is reused (show/hide) rather than created/destroyed per hover.

Constructors ​

Constructor ​

ts
new SparklineOverlay(container, options?): SparklineOverlay;

Defined in: temporal/SparklineOverlay.ts:35

Parameters ​

container ​

HTMLElement

options? ​

SparklineOptions

Returns ​

SparklineOverlay

Methods ​

show() ​

ts
show(
   timeSeries, 
   times, 
   currentTime, 
   screenX, 
   screenY, 
   factor?
): void;

Defined in: temporal/SparklineOverlay.ts:69

Show the sparkline at the given screen position.

Parameters ​

timeSeries ​

Float32Array

times ​

number[]

currentTime ​

number

screenX ​

number

screenY ​

number

factor? ​

FactorDescriptor

Returns ​

void


hide() ​

ts
hide(): void;

Defined in: temporal/SparklineOverlay.ts:118

Hide the sparkline.

Returns ​

void


updateTimeMarker() ​

ts
updateTimeMarker(currentTime): void;

Defined in: temporal/SparklineOverlay.ts:127

Efficient redraw: update only the time marker without a full repaint.

Parameters ​

currentTime ​

number

Returns ​

void


dispose() ​

ts
dispose(): void;

Defined in: temporal/SparklineOverlay.ts:134

Returns ​

void

Released under the MIT License.