-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Node Sequences Option #414
Conversation
…issues in tubemap rendering
I think the test is failing because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should work, but there are some places where I would like the code cleaned up before merging it.
Also, for PRs that add new UI like this, it would be good to have a screenshot included to show how it looks.
src/components/HeaderForm.js
Outdated
@@ -825,6 +832,19 @@ class HeaderForm extends Component { | |||
this.setState({ simplify: !this.state.simplify }); | |||
}; | |||
|
|||
/* Function for toggling nodeSequences button, enabling client to make request for node sequences to be displayed or note */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think nodeSequences
is a variable or function name, and note
is a typo. We could simplify the sentence to something like:
/* Function for toggling nodeSequences button, enabling client to make request for node sequences to be displayed or note */ | |
/* Function for toggling display of node sequences */ |
src/components/HeaderForm.js
Outdated
openPopup = () => { | ||
this.setState({ popupOpen: !this.state.popupOpen }); | ||
}; | ||
|
||
closePopup = () => { | ||
this.setState({ popupOpen: !this.state.popupOpen }); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are called openPopup
and closePopup
but really they are two copies of a toggle-the-popup function. Either they should always do what their names say, or there should just be one togglePopup
.
@@ -49,6 +49,7 @@ | |||
"react-scripts": "5.0.1", | |||
"react-select": "^5.7.3", | |||
"react-select-event": "^5.5.1", | |||
"react-switch": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually the switch component documented at https://mui.com/material-ui/react-switch/ that I thought we were using. This is a completely different package documented at https://www.npmjs.com/package/react-switch#usage which has about the same API.
This one might be a little better, so maybe we should keep it?
src/end-to-end.test.js
Outdated
@@ -339,7 +339,7 @@ describe("When we wait for it to load", () => { | |||
it("produces correct link for view before & after go is pressed", async () => { | |||
// First test that after pressing go, the link reflects the dat form | |||
const expectedLinkBRCA1 = | |||
"http://localhost?name=snp1kg-BRCA1&tracks[0][trackFile]=exampleData%2Finternal%2Fsnp1kg-BRCA1.vg.xg&tracks[0][trackType]=graph&tracks[0][trackColorSettings][mainPalette]=greys&tracks[0][trackColorSettings][auxPalette]=ygreys&tracks[1][trackFile]=exampleData%2Finternal%2FNA12878-BRCA1.sorted.gam&tracks[1][trackType]=read®ion=17%3A1-100&bedFile=exampleData%2Finternal%2Fsnp1kg-BRCA1.bed&dataType=built-in&simplify=false"; | |||
"http://localhost?name=snp1kg-BRCA1&tracks[0][trackFile]=exampleData%2Finternal%2Fsnp1kg-BRCA1.vg.xg&tracks[0][trackType]=graph&tracks[0][trackColorSettings][mainPalette]=greys&tracks[0][trackColorSettings][auxPalette]=ygreys&tracks[1][trackFile]=exampleData%2Finternal%2FNA12878-BRCA1.sorted.gam&tracks[1][trackType]=read&dataPath=default®ion=17%3A1-100&bedFile=exampleData%2Finternal%2Fsnp1kg-BRCA1.bed&dataType=built-in&simplify=false&removeSequences=false"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't mean to add back dataPath
.
"http://localhost?name=snp1kg-BRCA1&tracks[0][trackFile]=exampleData%2Finternal%2Fsnp1kg-BRCA1.vg.xg&tracks[0][trackType]=graph&tracks[0][trackColorSettings][mainPalette]=greys&tracks[0][trackColorSettings][auxPalette]=ygreys&tracks[1][trackFile]=exampleData%2Finternal%2FNA12878-BRCA1.sorted.gam&tracks[1][trackType]=read&dataPath=default®ion=17%3A1-100&bedFile=exampleData%2Finternal%2Fsnp1kg-BRCA1.bed&dataType=built-in&simplify=false&removeSequences=false"; | |
"http://localhost?name=snp1kg-BRCA1&tracks[0][trackFile]=exampleData%2Finternal%2Fsnp1kg-BRCA1.vg.xg&tracks[0][trackType]=graph&tracks[0][trackColorSettings][mainPalette]=greys&tracks[0][trackColorSettings][auxPalette]=ygreys&tracks[1][trackFile]=exampleData%2Finternal%2FNA12878-BRCA1.sorted.gam&tracks[1][trackType]=read®ion=17%3A1-100&bedFile=exampleData%2Finternal%2Fsnp1kg-BRCA1.bed&dataType=built-in&simplify=false&removeSequences=false"; |
src/server.mjs
Outdated
{ | ||
sequence: "AGCT" | ||
id: "1" | ||
, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, | |
}, |
src/server.mjs
Outdated
node: [ | ||
{ | ||
id: "1" | ||
, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, | |
}, |
src/server.mjs
Outdated
] | ||
edge: [] | ||
path: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
] | |
edge: [] | |
path: [] | |
], | |
edge: [], | |
path: [] |
src/server.mjs
Outdated
] | ||
edge: [] | ||
path: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
] | |
edge: [] | |
path: [] | |
], | |
edge: [], | |
path: [] |
src/server.mjs
Outdated
return; | ||
} | ||
graph.node.forEach(function(node) { | ||
console.log("node sequence to delete:", node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should cut this; people are going to remove sequence because there's a lot of it, and we don't want a lot of sequence going to the logs.
console.log("node sequence to delete:", node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think trying to use !this.openPopup
as a close event handler is going to work. I think if you take the suggestions here the dialog will actually work when you go to open and close it manually; it looks like it is probably broken right now.
src/components/HeaderForm.js
Outdated
> | ||
<FontAwesomeIcon icon={faGear} /> Simplify | ||
</Button> | ||
<PopupDialog open={this.state.popupOpen} close={!this.openPopup} width="400px"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think openPopup()
maybe needs to be renamed to togglePopup()
? And you would just pass it here? It looks like you are trying to negate the function and I don't think this will actually work if you run it and try and open the dialog (so maybe that warrants a test?).
<PopupDialog open={this.state.popupOpen} close={!this.openPopup} width="400px"> | |
<PopupDialog open={this.state.popupOpen} close={this.togglePopup} width="400px"> |
src/components/HeaderForm.js
Outdated
this.setState({ removeSequences: !this.state.removeSequences }); | ||
}; | ||
|
||
openPopup = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really toggles it.
openPopup = () => { | |
togglePopup = () => { |
src/components/HeaderForm.js
Outdated
{!readsExist(this.state.tracks) && ( | ||
<> | ||
<Button | ||
onClick={this.openPopup} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we rename the function we'd change it here too.
onClick={this.openPopup} | |
onClick={this.togglePopup} |
Fixes #349