WebglStep

The step based line plot

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new WebglStep(c: ColorRGBA, num: number): WebglStep

Overrides WebglBaseLine.constructor

Defined in src/WbglStep.ts:7

Create a new step line

example

x = [0, 1];
y = [1, 2];
line = new WebglStep(new ColorRGBA(0.1, 0.1, 0.1, 1), 2);

Parameters:

NameTypeDescription
cColorRGBAthe color of the line
numnumber-

Returns: WebglStep

Properties

color

• color: ColorRGBA

Inherited from WebglBaseLine.color

Defined in src/WebglBaseLine.ts:24

The Color of the line


intensity

• intensity: number

Inherited from WebglBaseLine.intensity

Defined in src/WebglBaseLine.ts:7


loop

• loop: boolean

Inherited from WebglBaseLine.loop

Defined in src/WebglBaseLine.ts:54

if this is a close loop line or not

default = false


numPoints

• numPoints: number

Inherited from WebglBaseLine.numPoints

Defined in src/WebglBaseLine.ts:13

The number of data point pairs in the line


offsetX

• offsetX: number

Inherited from WebglBaseLine.offsetX

Defined in src/WebglBaseLine.ts:42

The horixontal offset of the line

default = 0


offsetY

• offsetY: number

Inherited from WebglBaseLine.offsetY

Defined in src/WebglBaseLine.ts:48

the vertical offset of the line

default = 0


scaleX

• scaleX: number

Inherited from WebglBaseLine.scaleX

Defined in src/WebglBaseLine.ts:30

The horizontal scale of the line

default = 1


scaleY

• scaleY: number

Inherited from WebglBaseLine.scaleY

Defined in src/WebglBaseLine.ts:36

The vertical sclae of the line

default = 1


visible

• visible: boolean

Inherited from WebglBaseLine.visible

Defined in src/WebglBaseLine.ts:8


webglNumPoints

• webglNumPoints: number

Inherited from WebglBaseLine.webglNumPoints

Defined in src/WebglBaseLine.ts:60

total webgl number of points

internal


xy

• xy: Float32Array

Inherited from WebglBaseLine.xy

Defined in src/WebglBaseLine.ts:19

The data ponits for webgl array

internal

Methods

constY

â–¸ constY(c: number): void

Defined in src/WbglStep.ts:74

Set a constant value for all Y values in the line

Parameters:

NameTypeDescription
cnumberconstant value

Returns: void


getX

â–¸ getX(index: number): number

Defined in src/WbglStep.ts:38

Parameters:

NameType
indexnumber

Returns: number


getY

â–¸ getY(index: number): number

Defined in src/WbglStep.ts:46

Get an X value at a specific index

Parameters:

NameTypeDescription
indexnumberthe index of X

Returns: number


lineSpaceX

â–¸ lineSpaceX(start: number, stepsize: number): void

Defined in src/WbglStep.ts:62

Make an equally spaced array of X points

example

//x = [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8]
const numX = 10;
line.lineSpaceX(-1, 2 / numX);

Parameters:

NameTypeDescription
startnumberthe start of the series
stepsizenumber-

Returns: void


setY

â–¸ setY(index: number, y: number): void

Defined in src/WbglStep.ts:33

Set the Y value at a specific index

Parameters:

NameTypeDescription
indexnumberthe index of the data point
ynumberthe vertical value of the data point

Returns: void


shiftAdd

â–¸ shiftAdd(data: Float32Array): void

Defined in src/WbglStep.ts:91

Add a new Y values to the end of current array and shift it, so that the total number of the pair remains the same

example

yArray = new Float32Array([3, 4, 5]);
line.shiftAdd(yArray);

Parameters:

NameTypeDescription
dataFloat32Arraythe Y array

Returns: void