Plotter.js

A JavaScript helper to plot data.

View the Project on GitHub

PointList class

Home

This article describes the PointList class.

Constructor

Creates a new point list that contains the points that are drawn on the canvas.

Syntax:

const pointList = new Plotter.PointList()

Arguments: none.

Returns:

Instance properties

All properties have corresponding getters and setters which you can use to read or write the properties’ values. The setters return the instance of the point itself.

Instance methods

Along with the getters and setters, the PointList class has the following methods:

addPoint

Adds a point to the point list.

Syntax:

PointList pointList.addPoint(Point point)

Arguments:

Returns:

addPoints

Adds points to the point list.

Syntax:

PointList pointList.addPoints(Point... points)

Arguments:

Returns:

sort

Bring the points in the list into a special order.

Syntax:

PointList pointList.sort(((Point a, Point b) => number) sortingFunction = PointList.prototype.defaultSortingFunction)

Arguments:

Returns:

defaultSortingFunction

Compares two points.

Syntax:

number pointList.defaultSortingFunction(Point a, Point b)

Arguments:

Returns:

getMinimumX, getMaximumX, getMinimumY, getMaximumY

Returns the minimum or maximum extent of the points in the list in x or y direction.

Syntax:

number pointList.getMinimumX()
number pointList.getMaximumX()
number pointList.getMinimumY()
number pointList.getMaximumY()

Arguments: none.

Returns: