From b87c0940a473e7d61058620997194e1f0cddbe6e Mon Sep 17 00:00:00 2001 From: hausman-gdit Date: Tue, 26 Mar 2024 15:25:30 -0400 Subject: [PATCH] modal first pass --- .../IndividualModel/ModelDetailModal.js | 150 +++++++++++++++++- .../components/Output/Multitumor/ModalBody.js | 79 --------- .../Output/NestedDichotomous/ModalBody.js | 65 -------- 3 files changed, 145 insertions(+), 149 deletions(-) delete mode 100644 frontend/src/components/Output/Multitumor/ModalBody.js delete mode 100644 frontend/src/components/Output/NestedDichotomous/ModalBody.js diff --git a/frontend/src/components/IndividualModel/ModelDetailModal.js b/frontend/src/components/IndividualModel/ModelDetailModal.js index e58e2e78..855adc72 100644 --- a/frontend/src/components/IndividualModel/ModelDetailModal.js +++ b/frontend/src/components/IndividualModel/ModelDetailModal.js @@ -7,8 +7,18 @@ import * as dc from "@/constants/dataConstants"; import Button from "../common/Button"; import DoseResponsePlot from "../common/DoseResponsePlot"; -import MultitumorModalBody from "../Output/Multitumor/ModalBody"; -import NestedDichotomousModalBody from "../Output/NestedDichotomous/ModalBody"; +import AnalysisOfDeviance from "../Output/Multitumor/AnalysisOfDeviance"; +import ModelOptions from "../Output/Multitumor/ModelOptions"; +import {MsComboInfo, MsComboSummary} from "../Output/Multitumor/MsCombo"; +import MultitumorPlot from "../Output/Multitumor/MultitumorPlot"; +import ParameterSettings from "../Output/Multitumor/ParameterSettings"; +import Summary from "../Output/Multitumor/Summary"; +import BootstrapResults from "../Output/NestedDichotomous/BootstrapResults"; +import BootstrapRuns from "../Output/NestedDichotomous/BootstrapRuns"; +import LitterData from "../Output/NestedDichotomous/LitterData"; +import {ModelParameters as NdModelParameters} from "../Output/NestedDichotomous/ModelParameters"; +import ScaledResidual from "../Output/NestedDichotomous/ScaledResidual"; +import {Summary as NdSummary} from "../Output/NestedDichotomous/Summary"; import CDFPlot from "./CDFPlot"; import CDFTable from "./CDFTable"; import ContinuousDeviance from "./ContinuousDeviance"; @@ -23,7 +33,6 @@ import MaIndividualModels from "./MaIndividualModels"; import ModelOptionsTable from "./ModelOptionsTable"; import ModelParameters from "./ModelParameters"; import ParameterPriorTable from "./ParameterPriorTable"; - @observer class ModelBody extends Component { render() { @@ -145,6 +154,137 @@ ModelAverageBody.propTypes = { outputStore: PropTypes.object, }; +@observer +class MtModalBody extends Component { + render() { + const {outputStore} = this.props, + model = outputStore.modalModel, + isSummary = outputStore.drModelModalIsMA; + + if (isSummary) { + return ( + + + + + + + + + + + + + + ); + } + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); + } +} +MtModalBody.propTypes = { + outputStore: PropTypes.object, +}; + +class NdModalBody extends Component { + render() { + const {outputStore} = this.props, + dataset = outputStore.selectedDataset, + dtype = dataset.dtype, + model = outputStore.modalModel, + isSummary = outputStore.drModelModalIsMA; + + if (isSummary) { + return ( + + + + + + + + + + + + + + ); + } + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); + } +} +NdModalBody.propTypes = { + outputStore: PropTypes.object, +}; + @inject("outputStore") @observer class ModelDetailModal extends Component { @@ -155,11 +295,11 @@ class ModelDetailModal extends Component { getBody() { const {outputStore} = this.props; if (outputStore.isMultiTumor) { - return MultitumorModalBody; + return MtModalBody; } else if (outputStore.drModelModalIsMA) { return ModelAverageBody; } else if (outputStore.isNestedDichotomous) { - return NestedDichotomousModalBody; + return NdModalBody; } else { return ModelBody; } diff --git a/frontend/src/components/Output/Multitumor/ModalBody.js b/frontend/src/components/Output/Multitumor/ModalBody.js deleted file mode 100644 index a09db52f..00000000 --- a/frontend/src/components/Output/Multitumor/ModalBody.js +++ /dev/null @@ -1,79 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; -import {Col, Modal, Row} from "react-bootstrap"; - -import DoseResponsePlot from "../../common/DoseResponsePlot"; -import GoodnessFit from "../../IndividualModel/GoodnessFit"; -import InfoTable from "../../IndividualModel/InfoTable"; -import ModelParameters from "../../IndividualModel/ModelParameters"; -import AnalysisOfDeviance from "./AnalysisOfDeviance"; -import ModelOptions from "./ModelOptions"; -import {MsComboInfo, MsComboSummary} from "./MsCombo"; -import MultitumorPlot from "./MultitumorPlot"; -import ParameterSettings from "./ParameterSettings"; -import Summary from "./Summary"; - -@observer -class ModalBody extends Component { - render() { - const {outputStore} = this.props, - model = outputStore.modalModel, - isSummary = outputStore.drModelModalIsMA; - - if (isSummary) { - return ( - - - - - - - - - - - - - - ); - } - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - } -} -ModalBody.propTypes = { - outputStore: PropTypes.object, -}; -export default ModalBody; diff --git a/frontend/src/components/Output/NestedDichotomous/ModalBody.js b/frontend/src/components/Output/NestedDichotomous/ModalBody.js deleted file mode 100644 index d778150b..00000000 --- a/frontend/src/components/Output/NestedDichotomous/ModalBody.js +++ /dev/null @@ -1,65 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; -import {Col, Modal, Row} from "react-bootstrap"; - -import DoseResponsePlot from "../../common/DoseResponsePlot"; -import InfoTable from "../../IndividualModel/InfoTable"; -import ModelOptionsTable from "../../IndividualModel/ModelOptionsTable"; -import BootstrapResults from "./BootstrapResults"; -import BootstrapRuns from "./BootstrapRuns"; -import LitterData from "./LitterData"; -import ModelParameters from "./ModelParameters"; -import ScaledResidual from "./ScaledResidual"; -import Summary from "./Summary"; - -@observer -class ModalBody extends Component { - render() { - const {outputStore} = this.props, - dataset = outputStore.selectedDataset, - dtype = dataset.dtype, - model = outputStore.modalModel; - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - } -} -ModalBody.propTypes = { - outputStore: PropTypes.object, -}; -export default ModalBody;