Skip to content
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

Add tooltips to the phylo tree for both NCBI and Sample entries #1532

Merged
merged 5 commits into from Oct 1, 2018

Conversation

tfrcarvalho
Copy link
Contributor

Description

  • Add tooltips to the phylo tree for both NCBI and Sample entries
  • New DataTooltip container component for generic data tooltips
  • Links to NCBI and samples page
  • Save session state to allow refreshing same page

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Explain both the expected functionality and the edge cases.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix a feature that knowingly causes existing functionality to not work as expected)

* New DataTooltip container component for generic data tooltips
* Links to NCBI and samples page
* Save session state to allow refreshing same page
@tfrcarvalho tfrcarvalho requested review from cdebourcy and a team September 28, 2018 22:51
@codeclimate
Copy link

codeclimate bot commented Sep 28, 2018

Code Climate has analyzed commit df6cb2f and detected 0 issues on this pull request.

View more on Code Climate.

return urlParams.treeId || (phyloTrees[0] || {}).id;
return (
urlParams.treeId ||
parseInt(window.sessionStorage.getItem("treeId")) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we all agree that window.sessionStorage is OK? is it supported on all the modern browsers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage. We should do a more through css/js audit for issues in older browsers.

handleNodeClick(node) {
if (node.data.accession) {
let url = `https://www.ncbi.nlm.nih.gov/nuccore/${node.data.accession}`;
window.open(url, "_blank");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@jshoe jshoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty good

this.sampleFields = [
{ name: "project_name", label: "Project" },
{ name: "sample_location", label: "Location" },
{ name: "created_at", label: "Upload Date" },
Copy link
Contributor

@cdebourcy cdebourcy Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally this would be displayed using <Moment />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I thought of that when I was adding the field, but forgot to add. Done.

{ name: "sample_library", label: "Library" },
{ name: "sample_sequencer", label: "Sequencer" },
{ name: "sample_unique_id", label: "Unique ID" },
{ name: "sample_notes", label: "Notes" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I realized I forgot some:

    t.float "sample_input_pg", limit: 24 # RNA/DNA input (pg)
    t.integer "sample_batch" # Batch
    t.text "sample_diagnosis" # Clinical diagnosis
    t.string "sample_detection" # Detection method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Copy link
Contributor

@cdebourcy cdebourcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really great. There are some weird issues when the popup is too big for the window (it quickly jumps back and forth rather than staying in place and the window becoming scrollable). Not sure if anything can be done about that in the timeframe of the sprint.

@tfrcarvalho
Copy link
Contributor Author

@cdebourcy I think that can be addressed during stabilization. It might take me a while to figure out a good solution for that. Scrolling would not work because as you scroll, you probably lose the tooltip.

@tfrcarvalho tfrcarvalho merged commit f3d445d into master Oct 1, 2018
@tfrcarvalho tfrcarvalho deleted the tiago/sprint-phylo branch October 1, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants