@@ -126,7 +126,6 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
126
126
127
127
const [ done , setDone ] = useState ( false )
128
128
const [ collapse , setCollapse ] = useState ( true )
129
- const [ infoWidth , setInfoWidth ] = useState ( document . body . offsetWidth )
130
129
const [ isFullScreen , setIsFullScreen ] = useState ( false )
131
130
const [ core , setCore ] = useState < Graph > ( )
132
131
@@ -152,7 +151,6 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
152
151
core ?. resize ( width , ( b ?. height || 585 ) + 100 )
153
152
}
154
153
}
155
- setInfoWidth ( width )
156
154
}
157
155
158
156
window . addEventListener ( 'resize' , resize )
@@ -187,14 +185,15 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
187
185
document . querySelector ( `#node-${ p [ 0 ] } ` ) ?. setAttribute ( "style" , "outline: 1px solid #85A2FE !important;" )
188
186
// Get edge size of parent ancestor to apply the right edge stroke
189
187
const edge = graph . getCellById ( `${ p [ 0 ] } -${ p [ 1 ] } ` )
188
+ const edgeColor = '#85A2FE'
190
189
edge . setAttrs ( {
191
190
line : {
192
- stroke : '#85A2FE' ,
191
+ stroke : edgeColor ,
193
192
strokeWidth : ( edge . getAttrs ( ) as any ) ?. line ?. strokeWidth ,
194
193
targetMarker : {
195
194
name : 'block' ,
196
- stroke : '#85A2FE' ,
197
- fill : '#85A2FE' ,
195
+ stroke : edgeColor ,
196
+ fill : edgeColor ,
198
197
} ,
199
198
} ,
200
199
} )
@@ -207,14 +206,15 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
207
206
ancestors . pairs . forEach ( p => {
208
207
document . querySelector ( `#node-${ p [ 0 ] } ` ) ?. setAttribute ( "style" , "" )
209
208
const edge = graph . getCellById ( `${ p [ 0 ] } -${ p [ 1 ] } ` )
209
+ const edgeColor = isDarkTheme ? '#6B6B6B' : '#8992B3'
210
210
edge . setAttrs ( {
211
211
line : {
212
- stroke : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
212
+ stroke : edgeColor ,
213
213
strokeWidth : ( edge . getAttrs ( ) as any ) ?. line ?. strokeWidth ,
214
214
targetMarker : {
215
215
name : 'block' ,
216
- fill : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
217
- stroke : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
216
+ fill : edgeColor ,
217
+ stroke : edgeColor ,
218
218
}
219
219
} ,
220
220
} )
@@ -361,7 +361,7 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
361
361
if ( data . children ) {
362
362
data . children . forEach ( ( item : any ) => {
363
363
const itemRecords = parseInt ( item . data . counter || 0 )
364
-
364
+ const edgeColor = isDarkTheme ? '#6B6B6B' : '#8992B3'
365
365
model . edges ?. push ( {
366
366
id : `${ data . id } -${ item . id } ` ,
367
367
source : {
@@ -389,12 +389,12 @@ function ExplainDraw({data, type, module, profilingTime}: {data: any, type: Core
389
389
} ,
390
390
attrs : {
391
391
line : {
392
- stroke : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
392
+ stroke : edgeColor ,
393
393
strokeWidth : getEdgeSize ( itemRecords ) ,
394
394
targetMarker : {
395
395
name : 'block' ,
396
- fill : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
397
- stroke : isDarkTheme ? '#6B6B6B' : '#8992B3' ,
396
+ fill : edgeColor ,
397
+ stroke : edgeColor ,
398
398
} ,
399
399
} ,
400
400
} ,
0 commit comments