Skip to content

Class: SparklineOverlay

Defined in: src/temporal/SparklineOverlay.ts:19

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: src/temporal/SparklineOverlay.ts:31

Parameters

container

HTMLElement

options?

SparklineOptions

Returns

SparklineOverlay

Methods

show()

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

Defined in: src/temporal/SparklineOverlay.ts:54

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: src/temporal/SparklineOverlay.ts:75

Hide the sparkline.

Returns

void


updateTimeMarker()

ts
updateTimeMarker(currentTime): void;

Defined in: src/temporal/SparklineOverlay.ts:84

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

Parameters

currentTime

number

Returns

void


dispose()

ts
dispose(): void;

Defined in: src/temporal/SparklineOverlay.ts:90

Returns

void

Released under the MIT License.