Class: Boundary

Boundary(time, strength, label, options, properties, active, firstCreated)

A boundary annotation.

Constructor

new Boundary(time, strength, label, options, properties, active, firstCreated)

Create a boundary annotation.
Parameters:
Name Type Description
time number The time.
strength number The strength.
label string A label.
options Object Configuration options.
properties Object Properties.
active boolean Whether this boundary should be active when created.
firstCreated boolean Whether this boundary has just been created.
Author:
  • Lawrence Fyfe
Source:

Methods

draw(parentElement, parentWidth, parentHeight, timeScale)

Draw this boundary with the specified parameters from the containing pane.
Parameters:
Name Type Description
parentElement d3.selection The parent element.
parentWidth number The width.
parentHeight number The height.
timeScale d3.scaleLinear The time scale.
Source:

drawHandle(parentElement, parentWidth, parentHeight, timeScale, direction)

Draw the triangular handles for this boundary with the specified parameters.
Parameters:
Name Type Description
parentElement d3.selection The parent element.
parentWidth number The width.
parentHeight number The height.
timeScale d3.scaleLinear The time scale.
direction number The RIGHT or the LEFT handle.
Source:

drawLabel(parentElement, parentWidth, parentHeight, timeScale, x)

Draw the triangular handles for this boundary with the specified parameters.
Parameters:
Name Type Description
parentElement d3.selection The parent element.
parentWidth number The width.
parentHeight number The height.
timeScale d3.scaleLinear The time scale.
x number The x location of this boundary.
Source:

erase()

Erase this boundary.
Source:

eraseLabel()

Erase the label.
Source:

getLeftHandlePoints() → {points}

Get the points for creating the left triangular handle.
Source:
Returns:
Three points.
Type
points

getRightHandlePoints() → {points}

Get the points for creating the right triangular handle.
Source:
Returns:
Three points.
Type
points

getStrengthClickWidth() → {string}

Get the click width based on the strength value. The click width is always larger than the line width.
Source:
Returns:
The width as a string.
Type
string

getStrengthOpacity() → {string}

Get the line opacity based on the strength value.
Source:
Returns:
The opacity as a string.
Type
string

getStrengthWidth() → {string}

Get the line width based on the strength value.
Source:
Returns:
The width as a string.
Type
string

getTime() → {number}

Get the time.
Source:
Returns:
The time.
Type
number

hideHandles()

Hide handles.
Source:

move(parentWidth, parentHeight, moveX)

Move this boundary to the specified x location.
Parameters:
Name Type Description
parentWidth number The parent width.
parentHeight number The parent height.
moveX number The x location.
Source:

select(select)

Select or deselect this boundary.
Parameters:
Name Type Description
select boolean If true, select; otherwise deselect.
Source:

setLabel(label)

Set the label string.
Parameters:
Name Type Description
label string The label.
Source:

setStrength(strength)

Set the strength.
Parameters:
Name Type Description
strength number The strength value.
Source:

showHandles()

Show handles.
Source: