jqSimpleConnect - API Documentation

Requirements

In order to use jqSimpleConnect, the only thing that you have to do is to include the JavaScript files of jqSimpleConnect and jQuery into your page's <head> tag:

<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jqSimpleConnect.min.js"></script>
            

Methods description

jqSimpleConnect.connect

jqSimpleConnect.connect = function(elementA, elementB, options)
Draws a connection between the elements "A" and "B".
Parameters
elementA A CSS selector or a jQuery's object for select the first element.
elementB A CSS selector or a jQuery's object for select the second element.
options
(optional) An associative array with the properties (all of them optionals):
  • color: which defines the color of the connection.
  • radius: which defines the width of the connection's lines.
  • roundedCorners: a boolean indicating if the corners must be round (only available in brownsers which supports the CSS property 'border-radius').
  • anchorA: which defines the anchor type of the first element ('horizontal' or 'vertical').
  • anchorB: which defines the anchor type of the second element ('horizontal' or 'vertical').
Returns
An string which identifies uniquely the connection.

jqSimpleConnect.repaintConnection

jqSimpleConnect.repaintConnection = function(connectionId)
Repaints an specific connection from the page.
Parameters
connectionId The connection's unique identifier.
Returns
true if the connection was repainted or false if none connection with that identifier was found.

jqSimpleConnect.repaintAll

jqSimpleConnect.repaintAll = function()
Repaints all the connections in the page.

jqSimpleConnect.removeConnection

jqSimpleConnect.removeConnection = function(connectionId)
Removes an specific connection from the page.
Parameters
connectionId The connection's unique identifier.
Returns
true if the connection was removed or false if none connection with that identifier was found.

jqSimpleConnect.removeAll

jqSimpleConnect.removeAll = function()
Removes all the connections in the page.