@@ -278,7 +278,7 @@ <h3>Dynamic Optimization</h3>
278
278
</ div >
279
279
280
280
< script type ="text/ng-template " id ="icycle_graph_callee_renderer.html ">
281
- < a href = "#" class = "call" style = "background-color: {{backgroundColor()}}; " ng-click = "toCallee(callee)" > { { callee . name} } </ a >
281
+ < a href = "#" class = "call" style = "background-color:{{backgroundColor(callee )}}" ng-click = "toCallee(callee)" > { { callee . name} } </ a >
282
282
< div class = "child" style = "width: {{callee.inclusive_time * 100 / Current.inclusive_time}}%;" ng - repeat = "callee in callee.callees" title = "{{callee.name}}" ng - include = "'icycle_graph_callee_renderer.html'" > < / div >
283
283
</ script >
284
284
@@ -708,7 +708,7 @@ <h3>Global Deoptimization</h3>
708
708
709
709
< script src ="https://code.jquery.com/jquery-1.11.1.min.js "> </ script >
710
710
< script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js "> </ script >
711
- < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21 /angular.min.js "> </ script >
711
+ < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2 /angular.min.js "> </ script >
712
712
< script >
713
713
var rawData = JSON . parse ( '{{{PROFIELR_OUTPUT}}}' ) ;
714
714
@@ -729,8 +729,10 @@ <h3>Global Deoptimization</h3>
729
729
walkCallGraphNode ( rawData [ 0 ] . call_graph ) ;
730
730
} ( ) ) ;
731
731
732
- // Register application and add controllers.
733
- var moarProfApp = angular . module ( 'moarProfApp' , [ ] ) ;
732
+ // Register application and add controllers, increase recursion depth for callGraphController
733
+ var moarProfApp = angular . module ( 'moarProfApp' , [ ] ) . config ( function ( $rootScopeProvider ) {
734
+ $rootScopeProvider . digestTtl ( 100 ) ;
735
+ } ) ;
734
736
735
737
moarProfApp . controller ( 'NavigationController' , function ( $scope ) {
736
738
$scope . Tab = 'Overview' ;
@@ -924,11 +926,15 @@ <h3>Global Deoptimization</h3>
924
926
updateCurrentData ( ) ;
925
927
}
926
928
927
- $scope . backgroundColor = function ( ) {
928
- var component = Math . floor ( 128 + Math . random ( ) * 127 ) . toString ( 16 ) ;
929
- if ( component . length == 1 )
930
- component = '0' + component ;
931
- return '#' + component + component + 'ff' ;
929
+ /*
930
+ * Given a callee, create a unique, repeatable color;
931
+ * h/t https://stackoverflow.com/questions/3426404
932
+ */
933
+ $scope . backgroundColor = function ( callee ) {
934
+ var str = callee . $$hashKey + callee . file + callee . name ;
935
+ for ( var i = 0 , hash = 0 ; i < str . length ; hash = str . charCodeAt ( i ++ ) + ( ( hash << 5 ) - hash ) ) ;
936
+ for ( var i = 0 , colour = "#" ; i < 3 ; colour += ( "00" + ( ( hash >> i ++ * 8 ) & 0xFF ) . toString ( 16 ) ) . slice ( - 2 ) ) ;
937
+ return colour ;
932
938
}
933
939
934
940
function updateCurrentData ( ) {
0 commit comments