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



##########
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) => {

Review comment:
       There is a need to reduce, not to map. See code comments.




-- 
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