1.0.1 • Published 3 years ago
lotivis-export v1.0.1
lotivis-export 
Export functionality for lotivis.js.
Functions
This package provides two functions for downloading rendered images of charts in SVG
and PNG
format.
lotivis.pngDownload(id, filename?, callback?)
Argument | Description | Default |
---|---|---|
id | The id of the chart element. Required. | - |
filename | The name of the file to be downloaded. ".png " is added automatically if not present. | "image" |
callback | An optional callback to be executed after download. | null |
Example:
lotivis.pngDownload("my-id", "my-chart{.png}", () => {
console.log("finished download");
}).
lotivis.pngDownloadRokotyan(id, filename?, callback?)
Download a PNG
image of the svg with the given id. Note that this function can only be used with SVG
s.
Argument | Description | Default |
---|---|---|
id | The id of the SVG chart element. Required. | - |
filename | The name of the file to be downloaded. ".png " is added automatically if not present. | "image" |
callback | An optional callback to be executed after download. | null |
Example:
lotivis.pngDownloadRokotyan("my-svg-id", "my-chart{.png}", () => {
console.log("finished download");
}).
Development
# build module
yarn build
# develop module
yarn build:watch