Drawings

Methods

(static) clearCanvas() → {void}

Description:
  • Completely clears the canvas' content.

Source:
Returns:
Type
void

(static) drawCursors() → {void}

Description:
  • This function is here to draw the vertical and horizontal measure cursors on screen. It also draws the lines going to and from the cursors and also the text displaying the position of each line.

Source:
Returns:
Type
void

(static) drawFFT(channelKey) → {void}

Description:
  • This function is fairly similar to 'drawSignal' but is specific to FFT signals to draw. The main reason for it being a separate function is that we add text along the signal. We also need to filter out empty values caused by fft.js. This is due to the fact that fft.js requires arrays with a size of a power of 2, so we fill the array with zeroes until the next power of two.

Source:
Parameters:
Name Type Description
channelKey string

Object key corresponding to a certain signal saved within 'channelData'.

Returns:
Type
void

(static) drawGrid(gridColor, thickerLineWidth) → {void}

Description:
  • This function draws the grid on the screen of the canvas. Users can modify its opacity.

Source:
Parameters:
Name Type Description
gridColor string

Color assigned to the lines of the grid.

thickerLineWidth number

Thickness of the central lines (horizontal & vertical).

Returns:
Type
void

(static) drawSignal(channelKey) → {void}

Description:
  • This function draws a signal onto the canvas' screen using the points from a channel.

Source:
Parameters:
Name Type Description
channelKey string

Object key corresponding to a certain signal saved within 'channelData'.

Returns:
Type
void

(static) drawTriggerCursor() → {void}

Description:
  • This function draws the trigger cursor when the user activates the trigger options.

Source:
Returns:
Type
void

(static) drawZoomRectangle() → {void}

Description:
  • This function draws the rectangle the user sees when dragging their mouse onto the canvas to zoom-in.

Source:
Returns:
Type
void

(static) removeSpikes(points, thresholdRatio) → {Array.<number>}

Description:
  • This function is used when gathering raw data. It filters out big spikes within the signal that are the result of a trigger point in the data. We check for high and low spikes and remove them from the signal to keep only the valid data points.

Source:
Parameters:
Name Type Description
points Array.<number>

Points from a channel.

thresholdRatio number

Arbitrary number corresponding to the acceptable limit at which we consider a point a spike. The smaller the number the more the signal will be streamlined. 3 is a good baseline.

Returns:

The points array 'cleaned out'.

Type
Array.<number>

(static) resetZoom() → {void}

Description:
  • This function resets the zoom setup by a user on the canvas' screen. N.B: It can be called via a button in the sub-menu DISPLAY, or by pressing 'Shift+X'.

Source:
Returns:
Type
void