Fork me on GitHub

Example: Basic BezierWire usage

This example demonstrates how to create an Basic BezierWire usage.

HTML

<div style="position: relative; width: 500px; height: 277px;" id="layer"></div>

JavaScript

Implementation

YUI().use('bezier-wire', function(Y) {

    var mygraphic = new Y.Graphic({render: "#layer"}); 

    var wire = mygraphic.addShape({
      type: Y.BezierWire,
      stroke: {
        weight: 4,
        color: "rgb(173,216,230)" 
      },
      src: {
        getXY: function() {
          return [300,50];
        }
      },
      tgt: {
        getXY: function() {
          return [700,250];
        }
      },
      bezierTangentNorm:300
    });
        
});