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



##########
File path: ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
##########
@@ -837,45 +850,50 @@ export function D3Blueprint(container, options) {
 
         _relationLabels.selectAll('.relation-label').remove(); // Re-draw 
labels every time, required to refresh changes.
 
-        // Group unique labels per path.
-        let labelsPerPath = {};
+        // Group unique relationships per path.
+        let relationshipsPerPath = {};
         _d3DataHolder.visible.relationships.forEach(d => {
             const key = getPathId(d);
-            if (!labelsPerPath[key]) {
-                labelsPerPath[key] = new Set();
+            if (!relationshipsPerPath[key]) {
+                relationshipsPerPath[key] = new Set();
             }
-            labelsPerPath[key].add(d.label);
+            relationshipsPerPath[key].add(getRelationId(d));
         });
 
+        const OFFSET_RATIO_PX = -12;
         const getLabelOffset = (d) => {
-            let labelIndex = 
Array.from(labelsPerPath[getPathId(d)]).indexOf(d.label);
-            return labelIndex > 0 ? labelIndex * -12 : 0;
+            let labelIndex = 
Array.from(relationshipsPerPath[getPathId(d)]).indexOf(getRelationId(d));
+            return labelIndex > 0 ? labelIndex * OFFSET_RATIO_PX : 0;

Review comment:
       Good point, I can't read.




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