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

#1055 export selected tips #1067

Merged
merged 11 commits into from
Apr 19, 2020

Conversation

frogsquire
Copy link
Contributor

Description of proposed changes

Adds the ability to export only tips which are selected from the download data modal. Refreshes layout of download area of modal, and adds descriptions of the data available for download.

Testing

  • Make sure each old data download option still works correctly
  • Make sure the new option, selected data, correctly downloads only tips which are selected (visible and in view on tree graph)
  • Make sure each data download text block has the right description
  • Make sure numbers of authors, total strains, selected strains report correctly in the modal

Thank you for contributing to Nextstrain!

Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

This is really great, thanks! I like the new aesthetics and this feature will be widely used by researchers viewing SARS-CoV-2 right now

In addition to the in-line comments could you please:

  • Remove the package.json related changes. I'm not sure why your npm install changed them, but better to keep them out of this PR.
  • Fix linting errors introduced by this PR. You can run npm run lint to see these. (As an aside, we now have CI tests which run linting etc as part of this project 🎉 ).

(<RectangularTreeIcon width={iconWidth} selected />), () => helpers.newick(this.props.dispatch, filePrefix, this.props.nodes[0], true)],
["All Metadata (TSV)", `Per-sample metadata for all samples in the dataset (n = ${this.props.metadata.mainTreeNumTips}).`,
(<MetaIcon width={iconWidth} selected />), () => helpers.strainTSV(this.props.dispatch, filePrefix, this.props.nodes, this.props.metadata.colorings, false, null)],
["Selected Metadata (TSV)", `Per-sample metadata for strains which are currently displayed (n = ${selectedTipsCount}/${this.props.metadata.mainTreeNumTips}).`,
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a check to see if selectedTipsCount !== 0 in order to add this entry (similar to the check for areAuthorsPresent on the following line). It doesn't crash if there are no selected tips, but it'd be better to not allow the option.

Copy link
Contributor Author

@frogsquire frogsquire Apr 17, 2020

Choose a reason for hiding this comment

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

I added a check, but just to clarify - do you want the option to appear when all tips are selected? (that is, when downloading selected tip data would be the same as the total number of tips)

@frogsquire
Copy link
Contributor Author

  • Remove the package.json related changes. I'm not sure why your npm install changed them, but better to keep them out of this PR.

I'm going to assume it was something weird I did, rather than npm's fault. Reverted.

  • Fix linting errors introduced by this PR. You can run npm run lint to see these. (As an aside, we now have CI tests which run linting etc as part of this project 🎉 ).

Apologies, I wrote a note to myself to do this and forgot! Had a little trouble getting the linter to work on my system, but it is working now, and I've done this.

Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Wonderful, thanks!

@jameshadfield jameshadfield merged commit 8f63963 into nextstrain:master Apr 19, 2020
@frogsquire frogsquire changed the title 1055 export selected tips #1055 export selected tips Apr 20, 2020
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.

2 participants