Milimetric has submitted this change and it was merged.

Change subject: Highlight greatest leaf of hierarchy by default
......................................................................


Highlight greatest leaf of hierarchy by default

Bug: T124296
Change-Id: I05d26060e88e39187d060ad84fefbbb0e8b62f3f
---
M src/components/visualizers/hierarchy/bindings.js
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Milimetric: Verified; Looks good to me, approved



diff --git a/src/components/visualizers/hierarchy/bindings.js 
b/src/components/visualizers/hierarchy/bindings.js
index b7f23bf..7df5ef1 100644
--- a/src/components/visualizers/hierarchy/bindings.js
+++ b/src/components/visualizers/hierarchy/bindings.js
@@ -52,7 +52,7 @@
         // properly. Otherwise, race conditions create an inconsistent state.
         this.container.selectAll('path').transition().duration(50)
             .style('opacity', function (node) {
-                return sequenceArray.indexOf(node) >= 0 ? 0.5 : 1;
+                return sequenceArray.indexOf(node) >= 0 ? 0.25 : 1;
             });
     }
 
@@ -288,13 +288,6 @@
                 bindingContext: bindingContext,
             };
 
-            // Bounding circle underneath the sunburst, to make it easier
-            // to detect when the mouse leaves the parent g.
-            container.append('circle')
-                .attr('r', radius + 5)
-                .style('opacity', 0)
-                .on('mouseover', hoverOut.bind(element.sunburst));
-
             var val = ko.unwrap(valueAccessor()),
                 data = ko.unwrap(val.hierarchy),
                 nodes = element.sunburst.partition.nodes(data);
@@ -316,6 +309,15 @@
 
             // Get total size of the tree = value of root node from partition.
             element.sunburst.totalSize = path.node().__data__.value;
+
+            // Highlight greatest leaf.
+            var greatestLeaf = 
element.sunburst.container.select('path').datum();
+            while (greatestLeaf.children) {
+                greatestLeaf = greatestLeaf.children[0];
+            }
+            setTimeout(function () {
+                hoverPath.bind(element.sunburst)(greatestLeaf);
+            }, 50);  // To avoid race condition that breaks zoom.
         }
     };
 });

-- 
To view, visit https://gerrit.wikimedia.org/r/277746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I05d26060e88e39187d060ad84fefbbb0e8b62f3f
Gerrit-PatchSet: 3
Gerrit-Project: analytics/dashiki
Gerrit-Branch: master
Gerrit-Owner: Mforns <[email protected]>
Gerrit-Reviewer: Milimetric <[email protected]>
Gerrit-Reviewer: Nuria <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to