plotx
v0.0.1
Published
jskit-plot is a javascript module for quickly plotting data with highcharts. When jskit-plot used with ML.js, and jskit-learn, you're left with the equialent R/Python toolset in JavaScript.
Downloads
13
Maintainers
Readme
jskit-plot
Description
JSkit-plot is a javascript module for quickly plotting data with highcharts. JSkit-plot can be used with ML.js and jskit-learn to suppliment a JavaScript data science toolchain.
Installation
$ npm i jskit-plot
Full Documentation
Usage (basic)
"jskit-plot" : {
getFileExtension: [Function: getFileExtension], //returns extension from filepath
plot: [async Function: plot], //generates svg,png,jpg and pdf image of chart
}
Quick Example
sample data plot
import * as jskp from 'jskit-plot';
const chartData = {
title: {
text: 'My Chart',
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', ],
},
series: [
{
type: 'line',
data: [1, 3, 2, 4,],
},
{
type: 'line',
data: [5, 3, 4, 2,],
},
],
};
//In JavaScript, by default most I/O Operations are asynchronous, see the notes section for more
jskp.plot({
filename:'',
chart:chartData,
})
.then(()=>{
//chart generated
})
.catch(console.error);
// or from URL
Testing
$ npm i
$ grunt test
Contributing
Fork, write tests and create a pull request!
Development
Note Make sure you have grunt installed
$ npm i -g grunt-cli jsdoc-to-markdown
For generating documentation
$ grunt doc
$ jsdoc2md src/**/*.js > docs/api.md
License
MIT