example/js/svg.js
function(element) {
    // use given clip or create a new one
    this.clipper = element instanceof SVG.ClipPath ? element : this.parent().clip().add(element)

    // store reverence on self in mask
    this.clipper.targets.push(this)

    // apply mask
    return this.attr('clip-path', 'url("#' + this.clipper.attr('id') + '")')
  }
function(element) {
    // use given clip or create a new one
    this.clipper = element instanceof SVG.ClipPath ? element : this.parent().clip().add(element)

    // store reverence on self in mask
    this.clipper.targets.push(this)

    // apply mask
    return this.attr('clip-path', 'url("#' + this.clipper.attr('id') + '")')
  }
function ( element ) { // use given clip or create a new one this . clipper = element instanceof SVG . ClipPath ? element : this . parent ( ) . clip ( ) . add ( element ) // store reverence on self in mask this . clipper . targets . push ( this ) // apply mask return this . attr ( 'clip-path' , 'url("#' + this . clipper . attr ( 'id' ) + '")' ) }
Distribute clipPath to svg element
Distribute clipPath to svg element