WebglLine
The standard Line class
Hierarchy
↳ WebglLine
Index
Constructors
Properties
Methods
Constructors
constructor
+ new WebglLine(c
: ColorRGBA, numPoints
: number): WebglLine
Overrides WebglBaseLine.constructor
Defined in src/WbglLine.ts:7
Create a new line
example
Parameters:
Name | Type | Description |
---|---|---|
c | ColorRGBA | the color of the line |
numPoints | number | number of data pints |
Returns: WebglLine
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/WbglLine.ts:85
Set a constant value for all Y values in the line
Parameters:
Name | Type | Description |
---|---|---|
c | number | constant value |
Returns: void
getX
â–¸ getX(index
: number): number
Defined in src/WbglLine.ts:50
Get an X value at a specific index
Parameters:
Name | Type | Description |
---|---|---|
index | number | the index of X |
Returns: number
getY
â–¸ getY(index
: number): number
Defined in src/WbglLine.ts:58
Get an Y value at a specific index
Parameters:
Name | Type | Description |
---|---|---|
index | number | the index of Y |
Returns: number
lineSpaceX
â–¸ lineSpaceX(start
: number, stepSize
: number): void
Defined in src/WbglLine.ts:74
Make an equally spaced array of X points
example
Parameters:
Name | Type | Description |
---|---|---|
start | number | the start of the series |
stepSize | number | step size between each data point |
Returns: void
setX
â–¸ setX(index
: number, x
: number): void
Defined in src/WbglLine.ts:33
Set the X value at a specific index
Parameters:
Name | Type | Description |
---|---|---|
index | number | the index of the data point |
x | number | the horizontal value of the data point |
Returns: void
setY
â–¸ setY(index
: number, y
: number): void
Defined in src/WbglLine.ts:42
Set the Y value at a specific index
Parameters:
Name | Type | Description |
---|---|---|
index | number | : the index of the data point |
y | number | : the vertical value of the data point |
Returns: void
shiftAdd
â–¸ shiftAdd(data
: Float32Array): void
Defined in src/WbglLine.ts:102
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
Parameters:
Name | Type | Description |
---|---|---|
data | Float32Array | the Y array |
Returns: void