1.0.1 • Published 3 years ago

lotivis-export v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

lotivis-export Node.js CI Build

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?)

ArgumentDescriptionDefault
idThe id of the chart element. Required.-
filenameThe name of the file to be downloaded. ".png" is added automatically if not present."image"
callbackAn 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 SVGs.

ArgumentDescriptionDefault
idThe id of the SVG chart element. Required.-
filenameThe name of the file to be downloaded. ".png" is added automatically if not present."image"
callbackAn 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