diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-25 23:28:12 +0200 |
commit | cfdfcc529dedff770dc54e78d2900d9a790f5766 (patch) | |
tree | 7b59c282a7823ded1d182aca95da5d55815456b2 /src/Polyline.js | |
parent | 464af8b747389b7fdb569a933591c863b9be0f6b (diff) | |
download | svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.tar.gz svg.js-cfdfcc529dedff770dc54e78d2900d9a790f5766.zip |
convert everything to es6 classes and imports
Diffstat (limited to 'src/Polyline.js')
-rw-r--r-- | src/Polyline.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Polyline.js b/src/Polyline.js new file mode 100644 index 0000000..9c28438 --- /dev/null +++ b/src/Polyline.js @@ -0,0 +1,19 @@ +import Shape from './Shape.js' +import {nodeOrNew} from './tools.js' +import PointArray from './PointArray.js' + +export default class Polyline extends Shape { + // Initialize node + constructor (node) { + super(nodeOrNew('polyline', node)) + } +} + +// Add parent method +addFactory (Parent, { + // Create a wrapped polyline element + polyline (p) { + // make sure plot is called as a setter + return this.put(new Polyline()).plot(p || new PointArray()) + } +}) |