@@ -63,7 +63,7 @@ function hideBootstrapTooltip(node) {
6363 * @param maxY the max value of Y axis
6464 * @param unitY the unit of Y axis
6565 */
66- function drawTimeline ( id , data , minX , maxX , minY , maxY , unitY ) {
66+ function drawTimeline ( id , data , minX , maxX , minY , maxY , unitY , batchTime ) {
6767 d3 . select ( d3 . select ( id ) . node ( ) . parentNode ) . style ( "padding" , "8px 0 8px 8px" ) . style ( "border-right" , "0px solid white" ) ;
6868 var margin = { top : 20 , right : 27 , bottom : 30 , left : timelineMarginLeft } ;
6969 var width = 500 - margin . left - margin . right ;
@@ -101,6 +101,26 @@ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY) {
101101 . attr ( "transform" , "translate(0," + ( - 3 ) + ")" )
102102 . text ( unitY ) ;
103103
104+
105+ if ( batchTime ) {
106+ var batchTimeline = d3 . svg . line ( )
107+ . x ( function ( d ) { return x ( d . x ) ; } )
108+ . y ( function ( d ) { return y ( d . y ) ; } ) ;
109+
110+ console . log ( batchTime ) ;
111+ var batchTimeData = [
112+ { x : minX , y : batchTime } , { x : maxX , y : batchTime }
113+ ] ;
114+ console . log ( batchTimeData ) ;
115+
116+ svg . append ( "path" )
117+ . datum ( batchTimeData )
118+ . style ( "stroke-dasharray" , ( "6, 6" ) )
119+ . style ( "stroke" , "lightblue" )
120+ . attr ( "class" , "line" )
121+ . attr ( "d" , batchTimeline ) ;
122+ }
123+
104124 svg . append ( "path" )
105125 . datum ( data )
106126 . attr ( "class" , "line" )
@@ -136,6 +156,7 @@ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY) {
136156 . attr ( "fill" , "white" )
137157 . attr ( "opacity" , "0" ) ;
138158 } ) ;
159+
139160}
140161
141162/**
@@ -145,7 +166,7 @@ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY) {
145166 * @param maxY the max value of Y axis
146167 * @param unitY the unit of Y axis
147168 */
148- function drawDistribution ( id , values , minY , maxY , unitY ) {
169+ function drawDistribution ( id , values , minY , maxY , unitY , batchTime ) {
149170 d3 . select ( d3 . select ( id ) . node ( ) . parentNode ) . style ( "padding" , "8px 8px 8px 0" ) . style ( "border-left" , "0px solid white" ) ;
150171 var margin = { top : 20 , right : 30 , bottom : 30 , left : 10 } ;
151172 var width = 300 - margin . left - margin . right ;
@@ -169,6 +190,25 @@ function drawDistribution(id, values, minY, maxY, unitY) {
169190 . append ( "g" )
170191 . attr ( "transform" , "translate(" + margin . left + "," + margin . top + ")" ) ;
171192
193+ if ( batchTime ) {
194+ var batchTimeline = d3 . svg . line ( )
195+ . x ( function ( d ) { return x ( d . x ) ; } )
196+ . y ( function ( d ) { return y ( d . y ) ; } ) ;
197+
198+ console . log ( batchTime ) ;
199+ var batchTimeData = [
200+ { x : distributionMinX , y : batchTime } , { x : distributionMaxX , y : batchTime }
201+ ] ;
202+ console . log ( batchTimeData ) ;
203+
204+ svg . append ( "path" )
205+ . datum ( batchTimeData )
206+ . style ( "stroke-dasharray" , ( "6, 6" ) )
207+ . style ( "stroke" , "lightblue" )
208+ . attr ( "class" , "line" )
209+ . attr ( "d" , batchTimeline ) ;
210+ }
211+
172212 svg . append ( "g" )
173213 . attr ( "class" , "x axis" )
174214 . attr ( "transform" , "translate(0," + 0 + ")" )
@@ -208,6 +248,22 @@ function drawDistribution(id, values, minY, maxY, unitY) {
208248 hideBootstrapTooltip ( d3 . select ( this ) . node ( ) ) ;
209249 //hideGraphTooltip();
210250 } ) ;
251+
252+ if ( batchTime && batchTime <= maxY ) {
253+ svg . append ( "text" )
254+ . style ( "fill" , "lightblue" )
255+ . attr ( "class" , "stable-text" )
256+ . attr ( "text-anchor" , "middle" )
257+ . attr ( "transform" , "translate(" + ( x ( distributionMaxX ) - 20 ) + "," + ( y ( batchTime ) + 15 ) + ")" )
258+ . text ( "stable" )
259+ . on ( 'mouseover' , function ( d ) {
260+ var tip = "Processing Time <= Batch Interval (" + formatBinValue ( batchTime ) + " " + unitY + ")" ;
261+ showBootstrapTooltip ( d3 . select ( this ) . node ( ) , tip ) ;
262+ } )
263+ . on ( 'mouseout' , function ( ) {
264+ hideBootstrapTooltip ( d3 . select ( this ) . node ( ) ) ;
265+ } ) ;
266+ }
211267}
212268
213269function prepareTimeline ( minY , maxY ) {
0 commit comments