You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo demonstrates how you can use dygraphs with the webpack or rollup module bundlers.
To get going, clone this repo and run:
npm install
./node_modules/.bin/webpack
Then open index.html in a browser. You should see a chart.
Alternatively, you can use rollup to generate the bundle:
./node_modules/.bin/rollup -c
And modify index.html to source main.rollup.js.
How this works
The entry point is index.js:
importDygraphfrom'dygraphs';// or, if you don't want to use ES6 imports:// const Dygraph = require('dygraphs');constg=newDygraph('graph',`Date,A,B2016/01/01,10,202016/07/01,20,102016/12/31,40,30`,{fillGraph: true});
Running rollup or webpack generates a bundle which includes the full dygraphs source:
The version of dygraphs that gets built this way is a development version. It includes
checks which help you catch errors but which will slow you down in production.
To get the production version, make sure you set NODE_ENV=production and minify your code.