@@ -184,8 +184,6 @@ export default function AxTree(props) {
184184 hideTooltip, // function to close a tooltip
185185 } = useTooltip ( ) ; // returns an object with several properties that you can use to manage the tooltip state of your component
186186
187- // let nameVal = JSON.stringify(tooltipData)
188- // console.log('nameVal', nameVal);
189187 const {
190188 containerRef, // Access to the container's bounding box. This will be empty on first render.
191189 TooltipInPortal, // TooltipWithBounds in a Portal, outside of your component DOM tree
@@ -208,14 +206,6 @@ export default function AxTree(props) {
208206 pointerEvents : 'all !important' ,
209207 } ;
210208
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-
219209 const [ layout , setLayout ] = useState ( 'cartesian' ) ;
220210 const [ orientation , setOrientation ] = useState ( 'horizontal' ) ;
221211 const [ linkType , setLinkType ] = useState ( 'diagonal' ) ;
@@ -256,28 +246,6 @@ export default function AxTree(props) {
256246 // // array that holds the ax tree as a nested object and the root node initially
257247 const nodeAxArr = [ ] ;
258248
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);
281249 const organizeAxTree = ( currNode , currAxSnapshot ) => {
282250 if ( currNode . childIds && currNode . childIds . length > 0 ) {
283251 currNode . children = [ ] ;
@@ -501,13 +469,6 @@ export default function AxTree(props) {
501469 y = { - height / 2 }
502470 x = { - width / 2 }
503471 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- // }
511472 strokeWidth = { 1.5 }
512473 strokeOpacity = '1'
513474 rx = { node . children ? 4 : 10 }
@@ -597,17 +558,16 @@ export default function AxTree(props) {
597558 >
598559 < div >
599560 < 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 */ }
600562 < strong > { JSON . stringify ( tooltipData [ 'name' ] . value ) } </ strong >
601563 </ div >
602564 < div >
565+ { /* Ax Node Info below names the tooltip title because of how its passed to the ToolTipDataDisplay container*/ }
603566 < ToolTipDataDisplay containerName = 'Ax Node Info' dataObj = { tooltipData } />
604- { /* <ToolTipDataDisplay containerName='State'dataObj={tooltipData}/> */ }
605567 </ div >
606568 </ div >
607569 </ TooltipInPortal >
608570 ) }
609-
610- { /* ax Legend */ }
611571 < div >
612572 { axLegendButtonClicked ?
613573 < AxLegend /> : ''
0 commit comments