algairim commented on a change in pull request #255:
URL: https://github.com/apache/brooklyn-ui/pull/255#discussion_r674661402



##########
File path: ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
##########
@@ -771,50 +774,37 @@ export function D3Blueprint(container, options) {
         return node;
     }
 
+    /**
+     * Draws new relationships as arcs and labels. Updates existing ones.
+     */
     function drawRelationships() {
+
         showRelationships();
 
-        let relationData = _relationGroup.selectAll('.relation')
-            .data(_d3DataHolder.visible.relationships, (d)=>(d.source._id + 
'_related_to_' + d.target._id));
+        const getPathId = (d) => (d.source._id + '-' + d.target._id);
+        const getRelationId = (d) => (getPathId(d) + '-' + d.pathSelector);
+
+        // ====== RELATIONSHIP ARCS ===========
 
-        let relationDataEntered = relationData.enter();
+        let arcsData = 
Object.values(_d3DataHolder.visible.relationships.reduce((accumulator, d) => {
+            accumulator[getRelationId(d)] = {
+                source: d.source,
+                target: d.target,
+                pathSelector: d.pathSelector
+            };
+            return accumulator;
+        }, {}));
 
-        // Draw the relationship path
-        relationDataEntered.insert('path')
+        let relationArcs = _relationArcs.selectAll('.relation').data(arcsData, 
(d) => getRelationId(d));
+
+        relationArcs.enter().insert('path')

Review comment:
       It's just we will need to compile angular components on a fly to inject 
them here, which is not a good idea.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to