@@ -82,6 +82,7 @@ export default function Explain(props: IExplain): JSX.Element {
82
82
let [ cluster , entityInfo ] = ParseProfileCluster ( info )
83
83
cluster [ 'Coordinator' ] . forEach ( ( kv : [ string , string ] ) => profilingTime [ kv [ 0 ] ] = kv [ 1 ] )
84
84
data = entityInfo
85
+ return < div className = "responseFail" > Visualization of FT.PROFILE on cluster is not yet supported.</ div >
85
86
} else if ( typeof info [ 0 ] === 'string' && info [ 0 ] . toLowerCase ( ) . startsWith ( 'coordinator' ) ) {
86
87
const resultsProfile = info [ 2 ]
87
88
data = ParseProfile ( resultsProfile )
@@ -91,6 +92,7 @@ export default function Explain(props: IExplain): JSX.Element {
91
92
'Parsing time' : resultsProfile [ 1 ] [ 1 ] ,
92
93
'Pipeline creation time' : resultsProfile [ 2 ] [ 1 ] ,
93
94
}
95
+ return < div className = "responseFail" > Visualization of FT.PROFILE on cluster is not yet supported.</ div >
94
96
} else {
95
97
data = ParseProfile ( info )
96
98
profilingTime = {
@@ -213,11 +215,6 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
213
215
line : {
214
216
stroke : edgeColor ,
215
217
strokeWidth : ( edge . getAttrs ( ) as any ) ?. line ?. strokeWidth ,
216
- targetMarker : {
217
- name : 'block' ,
218
- stroke : edgeColor ,
219
- fill : edgeColor ,
220
- } ,
221
218
} ,
222
219
} )
223
220
} )
@@ -234,11 +231,6 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
234
231
line : {
235
232
stroke : edgeColor ,
236
233
strokeWidth : ( edge . getAttrs ( ) as any ) ?. line ?. strokeWidth ,
237
- targetMarker : {
238
- name : 'block' ,
239
- fill : edgeColor ,
240
- stroke : edgeColor ,
241
- }
242
234
} ,
243
235
} )
244
236
} )
@@ -270,8 +262,14 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
270
262
if ( data ) {
271
263
const info = data . data as EntityInfo
272
264
273
- if ( ! info . snippet && info . parentSnippet && info . data ?. startsWith ( info . parentSnippet ) ) {
274
- info . data = info . data . substr ( info . parentSnippet . length )
265
+ // snippet if prefix with parent suffix will always be followed by ':'.
266
+ //
267
+ // Currently snippets are passed to child only for TAG
268
+ // expressions which has ':' at the center.
269
+ //
270
+ // Example child data with parent snippet: <PARENT_SNIPPET>:<DATA>
271
+ if ( ! info . snippet && info . parentSnippet && info . data ?. startsWith ( `${ info . parentSnippet } :` ) ) {
272
+ info . data = info . data . substr ( info . parentSnippet . length + 1 )
275
273
info . snippet = info . parentSnippet
276
274
}
277
275
@@ -375,11 +373,7 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
375
373
line : {
376
374
stroke : edgeColor ,
377
375
strokeWidth : getEdgeSize ( itemRecords ) ,
378
- targetMarker : {
379
- name : 'block' ,
380
- fill : edgeColor ,
381
- stroke : edgeColor ,
382
- } ,
376
+ targetMarker : null ,
383
377
} ,
384
378
} ,
385
379
} )
@@ -462,7 +456,7 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
462
456
name : 'Zoom In' ,
463
457
onClick : ( ) => {
464
458
setTimeout ( ( ) => document . addEventListener ( 'mouseup' , mouseUpHandler ) , 100 )
465
- core ?. zoom ( 0.5 )
459
+ core && Math . floor ( core . zoom ( ) ) <= 3 && core ?. zoom ( 0.5 )
466
460
core ?. resize ( undefined , core ?. getContentBBox ( ) . height + 50 )
467
461
} ,
468
462
icon : 'magnifyWithPlus'
@@ -471,7 +465,11 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
471
465
name : 'Zoom Out' ,
472
466
onClick : ( ) => {
473
467
setTimeout ( ( ) => document . addEventListener ( 'mouseup' , mouseUpHandler ) , 100 )
474
- core && Math . floor ( core . zoom ( ) ) <= 0.5 ? core ?. zoom ( 0 ) : core ?. zoom ( - 0.5 )
468
+ if ( Math . floor ( core ?. zoom ( ) || 0 ) <= 0.5 ) {
469
+ core ?. centerContent ( )
470
+ } else {
471
+ core ?. zoom ( - 0.5 )
472
+ }
475
473
core ?. resize ( undefined , core ?. getContentBBox ( ) . height + 50 )
476
474
} ,
477
475
icon : 'magnifyWithMinus'
0 commit comments