Dependencies

Add support for dependency links between tasks using jsPlumb.

Dependency

jsPlumb

Usage

angular.module('myApp', ['gantt', 'gantt.dependencies']);
<div gantt>
    <gantt-dependencies enabled="true"
                        read-only="false"
                        js-plumb-defaults="{
                                         Endpoint: ['Dot', {radius: 7}],
                                         Connector: 'Flowchart'
                                         }"
                        endpoints="[...]"
                        fallback-endpoints="[...]">
    </gantt-dependencies>
</div>

Attributes

Model

Task can specify a dependencies field containing a single or a list of objects.

Each object defines the opposite side or the dependency, using either from or to property. connectParameters field can optionnaly be set to an object that will be used for each related jsPlumb.connect(...) function call.

{
  ...
  // Inside Task object
  'dependencies': [{
    'from': <taskId>,
    'connectParameters': {...} // Parameters given to jsPlumb.connect() function call.
  }]
}

{
  ...
  // Inside Task object
  'dependencies': [{
    'to': <taskId>,
    'connectParameters': {...} // Parameters given to jsPlumb.connect() function call.
  }]
}

{
  ...
  // Inside Task object or Row object
  'dependencies': false // Disable dependencies support for this task or row
}

API

Methods

Refresh the view with dependencies data from the model. tasks is an array of Task objects to refresh, or undefined to refresh the whole chart.

Events

A dependency was created, removed or changed.

Tips

data-fromId and data-toId attributes are added to svg canvas used to display dependency links.

So it's possible with CSS to hide all dependencies but thoses related to a given task id.

.jtk-connector {
    display: none;
}

.jtk-connector.jtk-dragging {
    display: inherit;
}

.jtk-connector[data-fromId='Product list view'] {
    display: inherit;
}

.jtk-connector[data-toId='Product list view'] {
    display: inherit;
}

For more information, see Styling via css from jsPlumb documentation.