@@ -50,21 +50,24 @@ exports.renderCell = (returnTo, cell, activation, isFailure=!activation.response
50
50
cell . className = `${ cell . className } is-failure-${ isFailure } `
51
51
container . className = `grid-cell-content latency-${ latBucket } `
52
52
53
- if ( ! isFailure && ( ! options || options . zoom > 0 ) ) {
54
- const innerLabel = document . createElement ( 'span' )
55
- innerLabel . innerText = prettyPrintDuration ( duration )
56
- container . appendChild ( innerLabel )
57
- }
58
-
59
- //label = document.createElement('div')
60
- // container.appendChild(label)
61
- // label.className = 'cell-label'
62
- // label.innerText = labelText || ''
53
+ // any extra info to display in the tooltip?
54
+ let extraTooltip = ''
63
55
64
56
if ( isFailure ) {
65
57
const fdom = document . createElement ( 'div' )
66
58
fdom . className = 'grid-oops-overlay'
67
59
container . appendChild ( fdom )
60
+
61
+ } else if ( ! options || options . zoom > 0 ) {
62
+ // for larger zoom levels, and only for successful activations,
63
+ // render the latency inside the cell
64
+ const innerLabel = document . createElement ( 'span' )
65
+ innerLabel . innerText = prettyPrintDuration ( duration )
66
+ container . appendChild ( innerLabel )
67
+
68
+ } else {
69
+ // for higher zoom levels (zoom < 0), render the latency in the tooltip
70
+ extraTooltip += `${ newline } ${ prettyPrintDuration ( duration ) } `
68
71
}
69
72
70
73
if ( activation ) {
@@ -88,7 +91,7 @@ exports.renderCell = (returnTo, cell, activation, isFailure=!activation.response
88
91
cell . isFailure = isFailure
89
92
cell . setAttribute ( 'data-action-name' , activation . name )
90
93
cell . setAttribute ( 'data-balloon-break' , 'data-balloon-break' )
91
- cell . setAttribute ( 'data-balloon' , `${ options && options . nameInTooltip ? activation . name + ' action, invoked ' : '' } ${ ui . prettyPrintTime ( activation . start , 'short' ) } ${ msg } ` )
94
+ cell . setAttribute ( 'data-balloon' , `${ options && options . nameInTooltip ? activation . name + ' action, invoked ' : '' } ${ ui . prettyPrintTime ( activation . start , 'short' ) } ${ msg } ${ extraTooltip } ` )
92
95
cell . setAttribute ( 'data-balloon-pos' , 'up' )
93
96
}
94
97
0 commit comments