SVG Donut as a WebComponent
See: Documentation, Demo.
npm install --save nega-donut
<html>
<head>
<script type="module">
import 'nega-donut/nega-donut.js';
</script>
</head>
<body>
<nega-donut value="200" percent="90"></nega-donut>
</body>
</html>
import {PolymerElement, html} from '@polymer/polymer';
import 'nega-donut/nega-donut.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
<nega-donut value="200" percent="90"></nega-donut>
`;
}
}
customElements.define('sample-element', SampleElement);
Feel free to fork and send over PRs. Still a lot of places this can be improved, i.e. styling, more options, or better behaviors.
git clone https://github.com/kennethklee/nega-donut
cd nega-donut
npm install
$ npm start
$ npm test