diff --git a/web/src/Components/Bridging/BridgeContainer.tsx b/web/src/Components/Bridging/BridgeContainer.tsx index b9f3cc6..276c405 100644 --- a/web/src/Components/Bridging/BridgeContainer.tsx +++ b/web/src/Components/Bridging/BridgeContainer.tsx @@ -5,9 +5,9 @@ import { AuthContext } from 'react-oauth2-code-pkce' import { ErrorToast } from '../Common/Toast' import InputContainer from './InputContainer' import { findGraphData } from '../../Utils' -import CumulativeGraph from './Graphs/CumulativeGraph' -import DistributionGraph from './Graphs/DistributionGraph' import { Bridge } from '../../Types' +import BridgeGraph from './Graphs/BridgeGraph' +import { differentiateArrayObjects } from './utils' type BridgeContainerProps = { bridges: Bridge @@ -96,8 +96,18 @@ export default ({ bridges, mode, setMode, bridgeValue, setValue }: BridgeContain borderRadius: '0.5rem', }} > - - + + { - const newGraphData = findGraphData(sizeFractions, bridges) - setGraphData(newGraphData) - }, [bridges, sizeFractions]) - - return ( - - ) -} - -export default CumulativeGraph diff --git a/web/src/Components/Bridging/Graphs/DistributionGraph.tsx b/web/src/Components/Bridging/Graphs/DistributionGraph.tsx deleted file mode 100644 index 6109d77..0000000 --- a/web/src/Components/Bridging/Graphs/DistributionGraph.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { useEffect, useState } from 'react' -import { findGraphData } from '../../../Utils' -import { differentiateArrayObjects } from '../utils' -import BridgeGraph from './BridgeGraph' - -export function ParticleSizeDistributionGraph({ bridges, sizeFractions }) { - const [graphData, setGraphData] = useState([]) - - useEffect(() => { - const newGraphData = findGraphData(sizeFractions, bridges) - const diffentiated = differentiateArrayObjects(newGraphData) - setGraphData(diffentiated) - }, [bridges, sizeFractions]) - - return -} - -export default ParticleSizeDistributionGraph