diff --git a/src/app/FrontendTypes.ts b/src/app/FrontendTypes.ts index b32f0d068..91bbb5389 100644 --- a/src/app/FrontendTypes.ts +++ b/src/app/FrontendTypes.ts @@ -297,12 +297,10 @@ export interface StepsObj { } export interface LinkControlProps { - layout: string; orientation: string; linkType: string; stepPercent: number; selectedNode: string; - setLayout: (layout: string) => void; setOrientation: (orientation: string) => void; setLinkType: (linkType: string) => void; setStepPercent: (percent: number) => void; @@ -333,7 +331,6 @@ export interface Node { } export interface LinkComponent { - layout: string; linkType: string; orientation: string; } diff --git a/src/app/components/StateRoute/AxMap/Ax.tsx b/src/app/components/StateRoute/AxMap/Ax.tsx index 6093e8293..4d5fa499d 100644 --- a/src/app/components/StateRoute/AxMap/Ax.tsx +++ b/src/app/components/StateRoute/AxMap/Ax.tsx @@ -52,7 +52,7 @@ export default function AxTree(props) { showTooltip, // function to set tooltip state hideTooltip, // function to close a tooltip } = useTooltip(); // returns an object with several properties that you can use to manage the tooltip state of your component - + const { containerRef, // Access to the container's bounding box. This will be empty on first render. TooltipInPortal, // TooltipWithBounds in a Portal, outside of your component DOM tree @@ -75,7 +75,6 @@ export default function AxTree(props) { pointerEvents: 'all !important', }; - const [layout, setLayout] = useState('cartesian'); const [orientation, setOrientation] = useState('horizontal'); const [linkType, setLinkType] = useState('diagonal'); const [stepPercent, setStepPercent] = useState(0.5); @@ -87,32 +86,23 @@ export default function AxTree(props) { let sizeWidth: number; let sizeHeight: number; - if (layout === 'polar') { - origin = { - x: innerWidth / 2, - y: innerHeight / 2, - }; - sizeWidth = 2 * Math.PI; - sizeHeight = Math.min(innerWidth, innerHeight) / 2; + origin = { x: 0, y: 0 }; + if (orientation === 'vertical') { + sizeWidth = innerWidth; + sizeHeight = innerHeight; } else { - origin = { x: 0, y: 0 }; - if (orientation === 'vertical') { - sizeWidth = innerWidth; - sizeHeight = innerHeight; - } else { - sizeWidth = innerHeight; - sizeHeight = innerWidth; - } + sizeWidth = innerHeight; + sizeHeight = innerWidth; } - const LinkComponent = getLinkComponent({ layout, linkType, orientation }); + const LinkComponent = getLinkComponent({ linkType, orientation }); const currAxSnapshot = JSON.parse(JSON.stringify(axSnapshots[currLocation.index])); // root node of currAxSnapshot const rootAxNode = JSON.parse(JSON.stringify(currAxSnapshot[0])); - // array that holds each ax tree node with children property + // array that holds each ax tree node with children property const nodeAxArr = []; // populates ax nodes with children property; visx recognizes 'children' in order to properly render a nested tree @@ -164,11 +154,9 @@ export default function AxTree(props) {