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

// inherit from SVG.Shape
SVG.Path.prototype = new SVG.Shape();

// Add path-specific functions
SVG.extend(SVG.Path, {
  
  // set path data
  plot: function(d) {
    return this.attr('d', d);
  },
  
  // move path using translate
  move: function(x, y) {
    return this.transform('translate(' + x + ',' + y + ')');
  }
  
});