datagovsg-plottable-charts
Reusable Plottable chart components
Using the chart components
npm install --save datagovsg-plottable-charts
import {
SimplePie,
SimpleBar,
GroupedBar,
StackedBar,
SimpleLine,
MultipleLine
} from 'datagovsg-plottable-charts'
var pie = new SimplePie(props)
pie.mount(document.getElementById('ctn'))
pie.update(newProps)
Using plugins
import {
highlightOnHover,
setupOuterLabel
} from 'datagovsg-plottable-charts/dist/plugins'
highlightOnHover(pie)
setupOuterLabel(pie)
Debugging guide
- Clone the datagovsg/datagovsg-plottable-charts repo
cd
to the cloned repo- Run
npm install
- Change main field in the package.json to
"main": "src/index.js"
- Set up a symlink
sudo npm link
cd
to your working directory- Run
npm link datagovsg-plottable-charts