ProtocolDatum

ProtocolDatum

Class representing a datum for a protocol

Constructor

new ProtocolDatum(value, name, line_colournullable, colour_abovenullable, colour_belownullable, colour_leftnullable, colour_rightnullable)

Source:
Example
// Constant value datum
let pd = new ProtocolDatum(10.0, "My Datum", Colour.GREEN, Colour.RED, Colour.GREEN);

// Variable value datum
let pd = new ProtocolDatum([0.0, 10.0, 0.5, 20.0, 1.0, 30.0],
                           "My Datum",
                           Colour.GREEN,
                           Colour.RED,
                           Colour.GREEN);
Parameters:
Name Type Attributes Description
value number | Array.<number> Datum value or array of X, Y pairs
name string Datum name
line_colour number <nullable>
Line colour
colour_above number <nullable>
Colour to fill above datum
colour_below number <nullable>
Colour to fill below datum
colour_left number <nullable>
Colour to fill to the left of the datum
colour_right number <nullable>
Colour to fill to the right of the datum

Members

(nullable) colour_above :number

Description:
  • Colour to fill above datum
Source:
Colour to fill above datum
Type:
  • number

(nullable) colour_below :number

Description:
  • Colour to fill below datum
Source:
Colour to fill below datum
Type:
  • number

(nullable) colour_left :number

Description:
  • Colour to fill to left of datum
Source:
Colour to fill to left of datum
Type:
  • number

(nullable) colour_right :number

Description:
  • Colour to fill to right of datum
Source:
Colour to fill to right of datum
Type:
  • number

(nullable) line_colour :number

Description:
  • Line colour
Source:
Line colour
Type:
  • number

name :string

Description:
  • Datum name
Source:
Datum name
Type:
  • string

value :number|Array.<number>

Description:
  • Datum value or array of X, Y pairs
Source:
Datum value or array of X, Y pairs
Type:
  • number | Array.<number>

Methods

ExtendLastYValueToX(x)

Description:
  • Extends the last point on the datum to the specified X value
Source:
Parameters:
Name Type Description
x number X value to extend the datum to

MaxX() → {number}

Description:
  • Returns the maximum X value of the datum If it's a constant value datum, returns -Numer.MAX_VALUE
Source:
Example
let max_x = pd.MaxX();
Returns:
Type
number

MaxY() → {number}

Description:
  • Returns the maximum Y value of the datum
Source:
Example
let max_y = pd.MaxY();
Returns:
Type
number

MinX() → {number}

Description:
  • Returns the minimum X value of the datum If it's a constant value datum, returns Number.MAX_VALUE
Source:
Example
let min_x = pd.MinX();
Returns:
Type
number

MinY() → {number}

Description:
  • Returns the minimum Y value of the datum
Source:
Example
let min_y = pd.MinY();
Returns:
Type
number

Plot(graphopt)

Description:
  • Plot a datum
Source:
Example
pd.Plot();
Parameters:
Name Type Attributes Description
graph number <optional>
Index of graph to plot on. If not specified, it's plotted on all graphs