clear differential expression button interface

This commit is contained in:
Colin Megill
2018-10-15 11:20:52 -07:00
parent 9de44e6fd4
commit a42f9f83f5
@@ -20,6 +20,7 @@ class Expression extends React.Component {
computeDiffExp() { computeDiffExp() {
const { dispatch, differential } = this.props; const { dispatch, differential } = this.props;
if (differential.celllist1 && differential.celllist2) {
dispatch( dispatch(
actions.requestDifferentialExpression( actions.requestDifferentialExpression(
differential.celllist1, differential.celllist1,
@@ -27,6 +28,15 @@ class Expression extends React.Component {
) )
); );
} }
}
clearDifferentialExpression() {
const { dispatch, differential } = this.props;
dispatch({
type: "clear differential expression",
diffExp: differential.diffExp
});
}
render() { render() {
const { differential } = this.props; const { differential } = this.props;
@@ -37,6 +47,7 @@ class Expression extends React.Component {
<div style={{ marginRight: 10, marginBottom: 10 }}> <div style={{ marginRight: 10, marginBottom: 10 }}>
<CellSetButton {...this.props} eitherCellSetOneOrTwo={1} /> <CellSetButton {...this.props} eitherCellSetOneOrTwo={1} />
<CellSetButton {...this.props} eitherCellSetOneOrTwo={2} /> <CellSetButton {...this.props} eitherCellSetOneOrTwo={2} />
{!differential.diffExp ? (
<button <button
type="button" type="button"
style={{ style={{
@@ -58,8 +69,33 @@ class Expression extends React.Component {
}} }}
onClick={this.computeDiffExp.bind(this)} onClick={this.computeDiffExp.bind(this)}
> >
Compute differential expression {" "}
Compute Differential Expression{" "}
</button> </button>
) : null}
{differential.diffExp ? (
<button
type="button"
style={{
fontSize: 14,
fontWeight: 400,
color: "#FFF",
padding: "0px 10px",
height: 30,
borderRadius: 2,
backgroundColor: globals.brightBlue,
border: "none",
cursor:
differential.celllist1 && differential.celllist2
? "pointer"
: "auto"
}}
onClick={this.clearDifferentialExpression.bind(this)}
>
{" "}
Clear Differential Expression{" "}
</button>
) : null}
</div> </div>
); );
} }