From cfdfcc529dedff770dc54e78d2900d9a790f5766 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Thu, 25 Oct 2018 23:28:12 +0200 Subject: convert everything to es6 classes and imports --- src/Polyline.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Polyline.js (limited to 'src/Polyline.js') 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()) + } +}) -- cgit v1.2.3