Fork me on GitHub

Example: Basic bidirectional arrow wire creation

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

HTML

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

JavaScript

Implementation

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

    var mygraphic = new Y.Graphic({render: "#layer"});
    
    var wire = mygraphic.addShape({
       type: Y.BidirectionalArrowWire,
       stroke: {
           weight: 4,
           color: "rgb(173,216,230)" 
       },
       src: {
         getXY: function() {
           return [50,50];
         }
       },
       tgt: {
         getXY: function() {
           return [400,150];
         }
       }
    });
    
});