class MouseTracker extends TimeLocator

Displays a vertical bar matching the time where the mouse is hovering.

Properties
data, knobColor, knobRadius, lineColor, lineDash, lineWidth, time, timeline
Methods
constructor, addMutationListener, beforeDraw, createAnimatableProperty, disconnectedCallback, drawContent, drawKnob, drawOverlay, drawUnderlay, removeMutationListener, reportMutation

Properties

data
getset

Arbitrary data. For example an identifier of a backend system.

Type:
any
knobColor
getset

Color of the top knob

Type:
string
knobRadius
getset

Radius of the top knob

Type:
number
lineColor
getset

Color of this locator

Type:
string
lineDash
getset

An array of numbers describing a dash array. For example: [4, 3] alternates between a line of 4 points and a gap of 3. Set to [] to show a solid line.

Type:
number[]
lineWidth
getset

Thickness of this locator

Type:
number
time
getset

Time for this locator.

Type:
undefined | number
timeline
get

Timeline instance that this instance is bound to.

Type:
Timeline

Methods

constructor(timeline)
Parameters:
  • Timeline timeline

    Timeline instance that this drawable is bound to.

addMutationListener(mutationListener)

Adds a listener that is notified whenever one of the properties changes.

This method is used by the Timeline instance to detect when to redraw the Canvas.

Parameters:
  • () => void mutationListener
Return type:
void
beforeDraw(g)

Gets called before any of the draw methods.

Parameters:
Return type:
void
createAnimatableProperty(value)

Creates an animatable property.

Animatable properties apply easing over time between numeric value changes.

Parameters:
  • number value –
Return type:
AnimatableProperty
disconnectedCallback()

Called when this drawable is removed from its Timeline

Return type:
void
drawContent(g)

Draw regular content.

Parameters:
Return type:
void
drawKnob(g, top, bottom)

Draw the knob shape on the locator. The default behaviour is to draw the bottom half of a circle.

Parameters:
Return type:
void
drawOverlay(g)

Gets called after regular content is drawn. Override this if you need a top layer.

Parameters:
Return type:
void
drawUnderlay(g)

Gets called before regular content is drawn. Override this if you need a bottom layer.

Parameters:
Return type:
void
removeMutationListener(mutationListener)

Remove a previously added mutation listener.

Parameters:
  • () => void mutationListener
Return type:
void
reportMutation()

Mark this Drawable as dirty. This method is intended for use in subclasses and should be called in the implementation of set accessors.

Return type:
void