Skip to content

Bidirectional Relations

asgdf edited this page Feb 14, 2024 · 2 revisions

Showcase

Recursive bidirectional relations

Functional Description

This feature allows displaying the "outgoing" relations of an object (uses, calls) and the "incoming" relations (usedBy, calledBy) as part of the same model. Both relations can be displayed recursively, so that they also include the relations of related objects. Recursive relations do not mix the directions of the relation. For either direction, whether to display relations of that direction and, if so, which color to use, can be configured separately.

The highlighting behavior does not distinguish between the two directions.

Technical Description

The core of the implementation is in the file ui/scripts/Relation/RelationController.js, whose already existing functions to handle relations were expanded to manage both possible directions. The connector helper files were slightly modified to handle the new options.

Configuration

The dedicated setup ui/setups/relations-bidire.js was created to showcase the feature.

The connectors for relations of either direction can be enabled/disabled separately with the options enableOutgoingConnectors and enableIncomingConnectors (both Boolean). The color for the connectors can be set separately with the options outgoingConnectorColor and incomingConnectorColor (both {r: 0-1, g: 0-1, b: 0-1}). The option connectorColor is made obsolete and no longer used.

Clone this wiki locally