@@ -184,8 +184,6 @@ export default function AxTree(props) {
184
184
hideTooltip, // function to close a tooltip
185
185
} = useTooltip ( ) ; // returns an object with several properties that you can use to manage the tooltip state of your component
186
186
187
- // let nameVal = JSON.stringify(tooltipData)
188
- // console.log('nameVal', nameVal);
189
187
const {
190
188
containerRef, // Access to the container's bounding box. This will be empty on first render.
191
189
TooltipInPortal, // TooltipWithBounds in a Portal, outside of your component DOM tree
@@ -208,14 +206,6 @@ export default function AxTree(props) {
208
206
pointerEvents : 'all !important' ,
209
207
} ;
210
208
211
- // const formatRenderTime = (time: number): string => {
212
- // if (!time) return 'No time information';
213
- // const renderTime = time.toFixed(3);
214
- // return `${renderTime} ms `;
215
- // };
216
-
217
-
218
-
219
209
const [ layout , setLayout ] = useState ( 'cartesian' ) ;
220
210
const [ orientation , setOrientation ] = useState ( 'horizontal' ) ;
221
211
const [ linkType , setLinkType ] = useState ( 'diagonal' ) ;
@@ -256,28 +246,6 @@ export default function AxTree(props) {
256
246
// // array that holds the ax tree as a nested object and the root node initially
257
247
const nodeAxArr = [ ] ;
258
248
259
- // currNode.children = [];
260
- // // checks if there is more than 1 child
261
- // if (currNode.childIds.length > 1) {
262
- // for (let m = 0; m < currNode.childIds.length; m++) {
263
- // for (let j = 0; j < currAxSnapshot.length; j++) {
264
- // if (currNode.childIds.includes(currAxSnapshot[j].nodeId)) {
265
- // currNode.children.push(currAxSnapshot[j]);
266
- // }
267
- // }
268
- // }
269
- // } else if (currNode.childIds.length === 1) {
270
- // for (let j = 0; j < currAxSnapshot.length; j++) {
271
- // if (currNode.childIds.includes(currAxSnapshot[j].nodeId)) {
272
- // currNode.children.push(currAxSnapshot[j]);
273
- // }
274
- // }
275
- // organizeAxTree(currNode.children[0], currAxSnapshot);
276
- // }
277
- // organizeAxTree(currNode.children, currAxSnapshot);
278
- // }
279
-
280
- // organizeAxTree([rootAxNode], currAxSnapshot);
281
249
const organizeAxTree = ( currNode , currAxSnapshot ) => {
282
250
if ( currNode . childIds && currNode . childIds . length > 0 ) {
283
251
currNode . children = [ ] ;
@@ -501,13 +469,6 @@ export default function AxTree(props) {
501
469
y = { - height / 2 }
502
470
x = { - width / 2 }
503
471
fill = "url('#parent-gradient')"
504
- //color={'#ff0000'}
505
- //fill={node.children ? nodeParentFill : nodeChildFill}
506
- //stroke={
507
- // node.data.isExpanded && node.data.children.length > 0
508
- // ? nodeParentStroke
509
- // : nodeChildStroke
510
- // }
511
472
strokeWidth = { 1.5 }
512
473
strokeOpacity = '1'
513
474
rx = { node . children ? 4 : 10 }
@@ -597,17 +558,16 @@ export default function AxTree(props) {
597
558
>
598
559
< div >
599
560
< div >
561
+ { /*tooltipData['name'].value cannot be referred to using dot notation so using brackets here overrides typescript's strict data typing which was interfering with accessiccing this property */ }
600
562
< strong > { JSON . stringify ( tooltipData [ 'name' ] . value ) } </ strong >
601
563
</ div >
602
564
< div >
565
+ { /* Ax Node Info below names the tooltip title because of how its passed to the ToolTipDataDisplay container*/ }
603
566
< ToolTipDataDisplay containerName = 'Ax Node Info' dataObj = { tooltipData } />
604
- { /* <ToolTipDataDisplay containerName='State'dataObj={tooltipData}/> */ }
605
567
</ div >
606
568
</ div >
607
569
</ TooltipInPortal >
608
570
) }
609
-
610
- { /* ax Legend */ }
611
571
< div >
612
572
{ axLegendButtonClicked ?
613
573
< AxLegend /> : ''
0 commit comments