epugh commented on code in PR #2249:
URL: https://github.com/apache/solr/pull/2249#discussion_r1480446540
##########
solr/webapp/web/js/angular/controllers/cloud.js:
##########
@@ -929,18 +929,21 @@ solrAdminApp.directive('graph', function(Constants) {
return name;
};
- scope.$watch("data", function(newValue, oldValue) {
+ var drawGraph = function(newValue, oldValue) {
if (newValue) {
- flatGraph(element, scope.data, scope.leafCount);
+ flatGraph(element, scope.data, scope.leafCount);
}
$('text').tooltip({
- content: function() {
- return $(this).attr('title');
- }
+ content: function() {
+ return $(this).attr('title');
+ }
});
- });
+ };
+
+ scope.$watch("data", drawGraph);
+ window.onresize = drawGraph;
Review Comment:
Nice! We didn't have this before!
##########
solr/webapp/web/js/angular/controllers/cloud.js:
##########
@@ -971,7 +974,10 @@ solrAdminApp.directive('graph', function(Constants) {
var w = element.width(),
h = leafCount * 20;
- var tree = d3.layout.tree().size([h, w - 400]);
+ // Calculate roughly the width of host name to align the graph
+ var hostnameWidth = graphData.children.length > 0 ?
+ graphData.children[0].children[0].children[0].name.length *
7.5 : 400;
Review Comment:
`7.5` must have been some fun trial and error!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]