summaryrefslogtreecommitdiffstats
path: root/src/Polyline.js
blob: 9c28438773c50549884e10d8e676d777222e4c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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())
  }
})