Skip to content

Commit

Permalink
gof tweak, infotable merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hausman-gdit committed Mar 26, 2024
1 parent 4d88387 commit ffce056
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
7 changes: 3 additions & 4 deletions frontend/src/components/IndividualModel/GoodnessFit.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,11 @@ class GoodnessFit extends Component {
render() {
const {store} = this.props,
settings = store.modalModel.settings,
// if modalDataset, means MT then do other table?
// is there a better way to detect MT?
dataset = store.modalDataset ? store.modalDataset : store.selectedDataset,
// MT has a different Dataset & dtype
dataset = store.isMultiTumor ? store.modalDataset : store.selectedDataset,
{dtype} = dataset;
let data;
if (store.modalDataset) {
if (store.isMultiTumor) {
data = this.getMultitumorData(dtype, settings);
} else {
if (dtype == Dtype.DICHOTOMOUS) {
Expand Down
16 changes: 14 additions & 2 deletions frontend/src/components/IndividualModel/InfoTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@ import PropTypes from "prop-types";
import React, {Component} from "react";

import TwoColumnTable from "@/components/common/TwoColumnTable";

import {getNameFromDegrees} from "@/constants/modelConstants";
@inject("outputStore")
@observer
class InfoTable extends Component {
render() {
const {outputStore} = this.props,
model = outputStore.modalModel,
dataset = outputStore.selectedDataset,
// MT has a different Dataset
dataset = outputStore.isMultitumor
? outputStore.modalDataset
: outputStore.selectedDataset;
let data;
if (outputStore.isMultitumor) {
data = [
["Dataset", dataset.metadata.name],
["Model", getNameFromDegrees(model)],
["Equation", "P[dose] = g + (1 - g) * (1 - exp(-b1 * dose^1 - b2 * dose^2 - ...))"],
];
} else {
data = [
["Dataset", dataset.metadata.name],
["Model", model.name],
["Equation", model.model_class.model_form_str],
];
}
return <TwoColumnTable id="info-table" data={data} label="Info" />;
}
}
Expand Down
26 changes: 0 additions & 26 deletions frontend/src/components/Output/Multitumor/InfoTable.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/Output/Multitumor/ModalBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 InfoTable from "./InfoTable";
import ModelOptions from "./ModelOptions";
import {MsComboInfo, MsComboSummary} from "./MsCombo";
import MultitumorPlot from "./MultitumorPlot";
Expand Down

0 comments on commit ffce056

Please sign in to comment.