summaryrefslogtreecommitdiffstats
path: root/src/path.js
blob: ef6ab03f2170ec9c410bbf5024a5f5290054f422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
SVG.Path = function(unbiased) {
  this.constructor.call(this, SVG.create('path'))
  
  this.unbiased = unbiased
}

// Inherit from SVG.Shape
SVG.Path.prototype = new SVG.Shape

SVG.extend(SVG.Path, {
  // Private: Native plot
  _plot: function(data) {
    return this.attr('d', data || 'M0,0')
  }
  
})

//
SVG.extend(SVG.Container, {
  // Create a wrapped path element
  path: function(data, unbiased) {
    return this.put(new SVG.Path(unbiased)).plot(data)
  }

})