@@ -33,18 +33,6 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
3333 ProcessColour = ColAssig [ 1 ]
3434 FilesystemValue = FilesystemAssignment ( )
3535
36- //Generate Data for process, threads and filesystem
37- let k = 0
38- for ( let i = 0 ; i < DataLength ; i ++ ) {
39- if ( ProcessColour [ i ] !== undefined )
40- {
41- BuildPanelProcess ( i , k , ProcessColour [ i ] , ColAssig [ 2 ] [ i ] )
42- k ++
43- }
44- BuildPanelThread ( i , k , ThreadColour [ i ] )
45- k ++
46- }
47-
4836 //Assign min/max values to default Options
4937 let minVal : number , maxVal : number
5038 if ( options . UseMinMaxBoolean === false ) {
@@ -57,6 +45,18 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
5745 }
5846 let minValLength = ( minVal . toString ( ) . length ) * 11
5947
48+ //Generate Data for process, threads and filesystem
49+ let k = 0
50+ for ( let i = 0 ; i < DataLength ; i ++ ) {
51+ if ( ProcessColour [ i ] !== undefined )
52+ {
53+ BuildPanelProcess ( i , k , ProcessColour [ i ] , ColAssig [ 2 ] [ i ] )
54+ k ++
55+ }
56+ BuildPanelThread ( i , k , ThreadColour [ i ] )
57+ k ++
58+ }
59+
6060 //Call Filter
6161 if ( options . UseFileSystemFinder ) {
6262 FileSystemFinder ( ) ;
@@ -153,7 +153,12 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
153153 else {
154154 for ( ; ( ( HeatValue [ j ] >= ( options . ThreadMapColor . min + test * ( ( options . ThreadMapColor . max - options . ThreadMapColor . min ) / DataLength ) ) ) || HeatValue [ j ] < options . ThreadMapColor . min ) && ( j < HeatValue . length ) ; ) {
155155 if ( ( HeatValue [ j ] <= ( options . ThreadMapColor . min + ( test + 1 ) * ( ( options . ThreadMapColor . max - options . ThreadMapColor . min ) / DataLength ) ) ) || ( HeatValue [ j ] >= options . ThreadMapColor . max ) ) {
156- ReturnColour [ j ] = Colour [ test ]
156+ if ( HeatValue [ j ] >= options . ThreadMapColor . max ) {
157+ ReturnColour [ j ] = Colour [ ( Colour . length - 1 ) ]
158+ }
159+ else {
160+ ReturnColour [ j ] = Colour [ test ]
161+ }
157162 j ++
158163 test = 0
159164 //Skip for PID
@@ -264,18 +269,21 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
264269 MapData [ i ] . stroke = 'pink' ;
265270 }
266271 }
267- console . log ( MapData )
268272 }
269273
270274 function drawThreadMap ( ) {
271- const svgTM = d3 . select ( '#ThreadMapMain' ) ;
272- const backgroundTooltip = d3
275+ //Redraw if new Min/Max Vals are specified
276+ //if (condition) {
277+ d3 . select ( '#ThreadMapMain' ) . selectAll ( '*' ) . remove ( ) ;
278+ //}
279+ const svgTM = d3 . select ( '#ThreadMapMain' ) ;
280+ const backgroundTooltip = d3
273281 . select ( '#ThreadMapMain' )
274282 . append ( 'rect' )
275283 . attr ( 'class' , 'tooltip-background-tm' )
276284 . style ( 'opacity' , 0 ) ;
277- const textTooltip = d3 . select ( '#ThreadMapMain' ) . append ( 'text' ) . attr ( 'class' , 'tooltip-text-tm' ) . style ( 'opacity' , 0 ) ;
278- const ProcessIDForceGraph = d3 . select ( '#ThreadMapMain' ) . append ( 'text' ) . attr ( 'class' , 'Forcegraph' ) . attr ( 'ProcessID' , 'select' ) . style ( 'opacity' , 0 ) ;
285+ const textTooltip = d3 . select ( '#ThreadMapMain' ) . append ( 'text' ) . attr ( 'class' , 'tooltip-text-tm' ) . style ( 'opacity' , 0 ) ;
286+ const ProcessIDForceGraph = d3 . select ( '#ThreadMapMain' ) . append ( 'text' ) . attr ( 'class' , 'Forcegraph' ) . attr ( 'ProcessID' , 'select' ) . style ( 'opacity' , 0 ) ;
279287 //Adjust width
280288 if ( DataLength * 20 + 20 < width ) {
281289 d3 . select ( '#ThreadMapMain' )
@@ -456,6 +464,7 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
456464 //remove old min max
457465 d3 . select ( '#minValueText' ) . remove ( ) ;
458466 d3 . select ( '#maxValueText' ) . remove ( ) ;
467+ d3 . select ( '#maxValueColour' ) . remove ( ) ;
459468 const svgMinMax = d3 . select ( '#ThreadMapMinMax' )
460469 const drawminVal = d3 . select ( '#ThreadMapMinMax' ) . append ( 'text' ) . attr ( 'class' , 'minValue' )
461470 const drawminValColour = d3 . select ( '#ThreadMapMinMax' ) . append ( 'circle' ) . attr ( 'class' , 'minValue' )
@@ -487,6 +496,7 @@ export const ThreadMap: React.FC<ThreadMapPanelProps> = ({ options, data, width,
487496 . attr ( 'font-weight' , 'bold' )
488497 . html ( maxVal . toString ( ) )
489498 drawmaxValColour
499+ . attr ( 'id' , 'maxValueColour' )
490500 . attr ( 'cx' , 69 + minValLength )
491501 . attr ( 'cy' , 60 )
492502 . attr ( 'r' , 10 )
0 commit comments