Plotter.js

A JavaScript helper to plot data.

View the Project on GitHub

Point class

Home

This article describes the Point class.

Constructor

Creates a new point that can be drawn on the canvas.

Syntax:

const point = new Plotter.Point([object options])

Arguments:

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 Point class has the following methods:

setPosition

Sets the point’s position.

Syntax:

Point point.setPosition(number x, number y)

Arguments:

Returns:

clone

Clones a point and sets the new point’s properties to those of the old point.

Syntax:

Point point.clone()

Arguments: none.

Returns: