Fork me on GitHub

Example: Basic arrow wire creation

This example demonstrates how to create an Basic arrow wire creation.

HTML

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

JavaScript

Implementation

YUI().use('arrow-wire', function(Y) {
  
  var mygraphic = new Y.Graphic({render: "#layer"});

  var wire = mygraphic.addShape({
    type: Y.ArrowWire,
    stroke: {
      weight: 4,
      color: "rgb(173,216,230)" 
    },
    src: {
      getXY: function() {
        return [30,60];
      }
    },
    tgt: {
      getXY: function() {
        return [250,150];
      }
    }
  });

});