@@ -72,6 +72,17 @@ $(document).ready(function(){
7272 } ) ( )
7373
7474
75+ Trace . instrumentedPackages = { }
76+ Trace . isInstrumentedNode = function isInstrumented ( node ) {
77+ if ( ! node ) return false
78+
79+ if ( Trace . instrumentedPackages . hasOwnProperty ( node . id ) ) {
80+ return ! ! Trace . instrumentedPackages [ node . id ]
81+ }
82+
83+ return isInstrumented ( node . parent )
84+ }
85+
7586 // When the `treemapColoringStateChanges` fires, use the current `legendData`
7687 // to generate a new treemap coloring function, and update the treemap's colors
7788 // with that.
@@ -105,10 +116,10 @@ $(document).ready(function(){
105116 var activeRecordingIds = Trace . getActiveRecordingIds ( ) ,
106117 allActivityId = Trace . allActivityRecordingId ,
107118 allActivityColor = colorLegend [ allActivityId ] ,
108- allActivityColorFaded = d3 . interpolate ( 'lightgray' , allActivityColor ) ( .2 )
119+ allActivityColorFaded = d3 . interpolate ( 'lightgray' , allActivityColor ) ( .2 ) ,
120+ instrumentedPackages = Trace . instrumentedPackages
109121
110122 function countActiveCoverings ( coverage ) {
111- // if(!coverage) return 0
112123 var count = 0
113124 coverage . forEach ( function ( id ) {
114125 if ( activeRecordingIds . has ( id ) ) {
@@ -118,9 +129,10 @@ $(document).ready(function(){
118129 return count
119130 }
120131
121- return function ( node ) {
132+ var base = function ( node ) {
122133 if ( ignoredKinds . has ( node . kind ) ) return 'grey'
123134
135+
124136 var coverage = Trace . coverageSets [ node . id ] ,
125137 numCovered = countActiveCoverings ( coverage )
126138
@@ -140,6 +152,12 @@ $(document).ready(function(){
140152
141153 return entry ? entry : 'yellow'
142154 }
155+
156+ return function ( node ) {
157+ var baseColor = base ( node )
158+ if ( Trace . isInstrumentedNode ( node ) ) return baseColor
159+ else return d3 . interpolate ( 'darkgray' , baseColor ) ( .2 )
160+ }
143161 }
144162
145163 treemapColoring . latest = coloringFunc
@@ -168,6 +186,11 @@ $(document).ready(function(){
168186
169187 var controller = new PackageController ( Trace . fullTree , $ ( '#packages' ) , $ ( '#totals' ) , $ ( '#clear-selections-button' ) )
170188
189+ controller . instrumentedWidgets . onValue ( function ( map ) {
190+ Trace . instrumentedPackages = map
191+ Trace . treemapColoringStateChanges . push ( 'Instrumented Packages Changed' )
192+ } )
193+
171194 /**
172195 * An Rx Property that represents the treemap's TreeData as it
173196 * changes due to the PackageWidgets' selection state.
@@ -353,7 +376,21 @@ $(document).ready(function(){
353376 return container
354377 }
355378
356- return padDiv . append ( recurse ( 0 ) )
379+ var result = $ ( '<div>' )
380+
381+ // added the padded div that holds the ancestors list
382+ result . append ( padDiv . append ( recurse ( 0 ) ) )
383+
384+ // if the node isn't "instrumented", add a div that says so
385+ if ( ! Trace . isInstrumentedNode ( node ) ) {
386+ var noTraceBadge = $ ( '<div>' )
387+ . addClass ( 'notrace-badge' )
388+ . text ( 'This method is not marked for tracing' )
389+ . prepend ( '<i class="fa fa-times">' )
390+ result . append ( noTraceBadge )
391+ }
392+
393+ return result
357394 }
358395 }
359396 } ) ( )
0 commit comments