v7.3.0

Dependencies
Feature

Feature that draws dependencies between events. Uses a DependencyStore to determine which dependencies to draw, if none is defined one will be created automatically. Dependencies can also be specified as scheduler.dependencies, see example below:

Dependencies also work in vertical mode:

To customize the dependency tooltip, you can use the tooltipTemplate. For example:

const scheduler = new Scheduler({
    features : {
        dependencies : {
            tooltipTemplate(dependencyModel) {
                const { fromEvent, toEvent } = dependencyModel;

return `${fromEvent.name} (${fromEvent.id}) -> ${toEvent.name} (${toEvent.id})`; } } } }

Styling dependency lines

You can easily customize the arrows drawn between events. To change all arrows, apply the following basic SVG CSS:

.b-sch-dependency {
   stroke-width: 2;
   stroke : red;
}

.b-sch-dependency-arrow { fill: red; }

To style an individual dependency line, you can provide a cls in your data:

{
    "id"   : 9,
    "from" : 7,
    "to"   : 8,
    "cls"  : "special-dependency"
}
// Make line dashed
.b-sch-dependency.special-dependency {
   stroke-dasharray: 5, 5;
}

To customize the marker used for the lines (the arrow header), you can supply a SVG path definition to the markerDef config:

You can also specify a radius to get lines with rounded "corners", for a less boxy look:

For advanced use cases, you can also manipulate the DomConfig used to create a dependency line in a renderer function.

Adjusting terminals

When hovering an event bar, terminals (connection points) for creating new dependencies are shown. By default, they have a diameter of 12px and are positioned at the edge of the event bar. You can customize this by setting terminalSize and terminalOffset. The example below uses larger terminals offset to outside the event bar:

This feature is disabled by default. For info on enabling it, see GridFeatures.

Useful configs and functions

Member Description
dependencyClick Fires when a dependency line is clicked
dependencyDblClick Fires on dependency double-click
dependencyContextMenu Fires on dependency right-click
dependenciesDrawn Fires after all dependency lines are drawn
dependencyMouseOver Fires when pointer enters a dependency

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • baseCls : Stringb-sch-dependency
    private

    The CSS class applied to dependency lines

  • The clickable/touchable width of the dependency line in pixels. Draws an invisible but wider line along the same path as each dependency, making lines much easier to click and tap on touch devices. The tradeoff is that twice as many SVG lines will be drawn, which can affect performance with many visible dependencies. Set to null to disable the wider hit area and only use the visible line width.

    Has a corresponding runtime clickWidth property.

  • Specify false to prevent dependencies from being redrawn during event interaction, such as dragging, resizing or rescheduling through other means, including when events animate into place. This makes interaction smoother, but dependency lines will not be updated until the interaction is finished.

    Has a corresponding runtime drawOnEventInteraction property.

  • Specify false to prevent dependencies from being drawn during scroll, for smoother scrolling in schedules with lots of dependencies. Dependencies will be drawn when scrolling stops instead.

    Has a corresponding runtime drawOnScroll property.

  • Specify false to not enable simple deletion of dependencies by clicking on them.

    Has a corresponding runtime enableDelete property.

  • Specify true to highlight incoming and outgoing dependencies when hovering an event.

    Has a corresponding runtime highlightDependenciesOnEventHover property.

  • noMarkerCls : Stringb-sch-dependency-markerless
    private

    The CSS class applied to a too narrow dependency line (to hide markers)

  • overCls : Stringb-sch-dependency-over
    private

    The CSS class to add to a dependency line when hovering over it

  • removeIconCls : Stringb-icon b-icon-remove-circle

    The CSS class representing a delete icon shown when clicking a dependency line

Properties

Properties are getters/setters or publicly accessible variables on this class
  • The clickable/touchable width of the dependency line in pixels. Draws an invisible but wider line along the same path as each dependency, making lines much easier to click and tap on touch devices. The tradeoff is that twice as many SVG lines will be drawn, which can affect performance with many visible dependencies. Set to null to disable the wider hit area and only use the visible line width.

    Has a corresponding clickWidth config.

  • Specify false to prevent dependencies from being redrawn during event interaction, such as dragging, resizing or rescheduling through other means, including when events animate into place. This makes interaction smoother, but dependency lines will not be updated until the interaction is finished.

    Has a corresponding drawOnEventInteraction config.

  • Specify false to prevent dependencies from being drawn during scroll, for smoother scrolling in schedules with lots of dependencies. Dependencies will be drawn when scrolling stops instead.

    Has a corresponding drawOnScroll config.

  • Specify false to not enable simple deletion of dependencies by clicking on them.

    Has a corresponding enableDelete config.

  • Specify true to highlight incoming and outgoing dependencies when hovering an event.

    Has a corresponding highlightDependenciesOnEventHover config.

  • isDependencies : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of Dependencies class, or subclass thereof.

Functions

Functions are methods available for calling on the class

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code
    • Fired when dependencies are rendered

      Note that this event is triggered on the owning widget:

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class
    • Called when dependencies are rendered

      Note that this handler is called on the owning widget:

    CSS variables

    CSS variables that can be set to adjust appearance
    Name Description
    --b-dependency-color Dependency line color (SVG stroke, also used as fill for markers)
    --b-dependency-hover-stroke-width Dependency hover stroke width (SVG)
    --b-dependency-stroke-width Dependency stroke width (SVG)
    --b-dependency-tooltip-event-background Background of the illustrational events in the dependency tooltip
    --b-dependency-tooltip-terminal-color Color of illustrational terminals in the dependency tooltip
    --b-dependency-tooltip-terminal-size Size of the illustrational terminals in the dependency tooltip
    --b-dependency-zindex Dependencies z-index
    Selected
    --b-dependency-selected-color Dependency line color for selected dependencies (SVG stroke, also used as fill for markers)
    id: dependencies

    Source path

    Scheduler/feature/Dependencies.js

    Demo

    examples/dependencies

    Contents