Methods
(static) copyCanvasToClipboard() → {void}
- Description:
Copies the canvas content to the clipboard as an image. This function uses the Clipboard API to create a blob from the canvas and then writes this blob to the clipboard as an image in PNG format. It handles different scenarios including API unavailability and operational failures by displaying appropriate toast notifications.
- Source:
Throws:
-
Throws an error and warns the user if the image could not be copied to the clipboard.
- Type
- Error
Returns:
- Type
- void
(static) downloadCanvasAsImage(imageType) → {void}
- Description:
Downloads the current canvas content as an image file.
This function creates a temporary canvas element, draws the current content of the global CANVAS onto it, and then converts it to a specified image format (PNG or JPEG). The resulting image is then downloaded to the user's device with a predefined filename based on the image type.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
imageType |
string | The type of the image to download. Accepted values are "png" or "jpeg". |
Throws:
Will throw an error if there is an issue with the canvas conversion or download process.
Returns:
- Type
- void
(static) downloadDataToCsv() → {void}
- Description:
Takes every single point from every single channel currently on screen and maps it to a csv file.
Within the csv file, every column is a channel and every line is a point N from said channel.
We also create a pseudo/temp link element to click it and start the download as soon as possible.
- Source:
Throws:
-
Throws an error if the function fails and warns the user something went wrong.
- Type
- Error
Returns:
- Type
- void