Class: Points

Points(data, options)

The Points visual repsents the specified data using circles, drawn based on the specified options.

Constructor

new Points(data, options)

Create a points visual.
Parameters:
Name Type Description
data Array.<Object> An array of data.
options Object Configuration options.
Author:
  • Lawrence Fyfe
Source:

Methods

addPoint(x, y, callDrawopt)

Add a new point at the specified coordinates.
Parameters:
Name Type Attributes Default Description
x number The x coordinate.
y number The y coordinate.
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

addProperty(name, value)

Add the specified property to this visual. The property is stored as [name, value].
Parameters:
Name Type Description
name string The name of the property.
value string The value of the property.
Source:

appendData(data)

Append the provided data array to the existing data array in this visual.
Parameters:
Name Type Description
data Array The data array to append.
Source:

canDeleteTime(baseTime, deltaTime)

Determines whether time in the specified time range can be deleted.
Parameters:
Name Type Description
baseTime number The start of the selection.
deltaTime number The end of the selection.
Source:

deleteSelectedPoints(callDrawopt)

Delete all selected points.
Parameters:
Name Type Attributes Default Description
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

deleteTime(baseTime, deltaTime)

Deletes time based on the specified selection range.
Parameters:
Name Type Description
baseTime number The start of the selection.
deltaTime number The end of the selection.
Source:

delineate(dx, pointerX, pointerY, callDrawopt)

Edit values for points by moving the mouse.
Parameters:
Name Type Attributes Default Description
dx number Delta x.
pointerX number Pointer x.
pointerY number Pointer y.
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

deselect(callDrawopt)

Deselect currently selected points.
Parameters:
Name Type Attributes Default Description
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

draw()

Draw this visual.
Source:

erase()

Erase this visual.
Source:

getPointsWithinRanges(t1, t2, value1, value2) → {Array}

Get any notes in the specified time and note ranges and return them in an array.
Parameters:
Name Type Description
t1 number The start of the time range.
t2 number The end of the time range.
value1 number The start of the value range.
value2 number The end of the value range.
Source:
Returns:
An array of notes in the specified ranges or an empty array.
Type
Array

includeVisual(visualType, options)

Include the visual type indicated by the type string with the specified options.
Parameters:
Name Type Description
visualType string The visual type.
options object Options for the visual type.
Source:

initialize()

Initialize this visual.
Source:

insertTime(baseTime, deltaTime)

Inserts time based on the specified selection range.
Parameters:
Name Type Description
baseTime number The start of the selection.
deltaTime number The end of the selection.
Source:

select(x1, x2, y1, y2, append, callDrawopt)

Select points within the specified x and y ranges.
Parameters:
Name Type Attributes Default Description
x1 number The start of the x range.
x2 number The end of the x range.
y1 number The start of the y range.
y2 number The end of the y range.
append boolean Append selected points to previously selected points.
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

setDataTemplate(template)

Set a data template object for adding points.
Parameters:
Name Type Description
template Object A template object.
Source:

setEditor(editor)

Set the editor for this visual and set editing callbacks.
Parameters:
Name Type Description
editor object The VisualEditor to set.
Source:

shiftPoints(dx, callDrawopt)

Shift points by the specified delta x value.
Parameters:
Name Type Attributes Default Description
dx number Delta x.
callDraw boolean <optional>
true Whether to call draw() from this method.
Source:

timeFilterData()

Filter the data using the domain values for the time scale.
Source:

valueToOpacity(value)

Convert the specified value to an opacity based on the value domain and the min and max opacity values.
Parameters:
Name Type Description
value number A number value.
Source: