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 option to adjust gap between tree and first barplot layer #464

Merged
merged 9 commits into from
Jan 25, 2021

Conversation

gibsramen
Copy link
Collaborator

@gibsramen gibsramen commented Dec 11, 2020

Closes #453

Adds a new element to the side panel that allows users to manually set the distance between the tree and the first barplot layer. Currently works by specifying a percentage increase to _maxDisplacement. Default value is 10 (1 + 10% = 1.1) to keep with current default behavior. Default value changed to 5 as we decided to decrease the default gap.

OLD: var maxD = 1.1 * this._maxDisplacement;

NEW: var maxD = (1 + this._displacementFrac) * this._maxDisplacement;

A new function Empress.prototype.changeBorderGap just divides the input value by 100. This can likely be rewritten to not use a whole function - depends on what people think looks more clean.

Current Status

  • Pick a better display name than Separation length
  • Update relevant documentation in empress.js
  • Disallow negative values

gap_movie

Now checks to ensure that input value is valid. Also do the main
computation and setting in barplot-panel-handler rather than empress for
readability.
@fedarko fedarko self-requested a review December 15, 2020 17:47
@ElDeveloper ElDeveloper marked this pull request as ready for review December 15, 2020 17:51
Copy link
Member

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

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

Thanks so much @gibsramen

empress/support_files/templates/side-panel.html Outdated Show resolved Hide resolved
@@ -143,6 +144,16 @@ define([
// length divided by 10 is :)
this.borderLength = BarplotLayer.DEFAULT_LENGTH / 10;

// Initialize default spacing between tree and first barplot layer
// as well as change behavior.
this.borderGap = 10;
Copy link
Member

Choose a reason for hiding this comment

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

Per our call earlier today, the suggestion is to make this space small by default - just making a note here to have a record.

@gibsramen gibsramen changed the title [WIP] Add option to adjust gap between tree and first barplot layer Add option to adjust gap between tree and first barplot layer Dec 16, 2020
@ElDeveloper ElDeveloper reopened this Dec 16, 2020
Copy link
Collaborator

@fedarko fedarko left a comment

Choose a reason for hiding this comment

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

Thanks so much @gibsramen!!!

Per discussion with Gibs earlier today I modified this slightly in the following ways:

  1. Use the same "units" for the initial gap as for barplot lengths, making things a bit more consistent for the user. The default gap value is now 10, which matches the default barplot border length.

  2. Store the current gap value only in BarplotPanelHandler, and have Empress retrieve this value when needed rather than keeping track of it in Empress._displacementFrac. The rationale for this is that it reduces the amount of data Empress needs to keep track of, and matches some of the other ways in which the barplot functionality works (e.g. how the border color / length are also retrieved from the BarplotPanelHandler).

Provided that these changes look good, I think we can merge this in. Sorry for taking so long to get to this.

@ElDeveloper
Copy link
Member

ElDeveloper commented Jan 25, 2021 via email

@gibsramen
Copy link
Collaborator Author

LGTM :)

@ElDeveloper
Copy link
Member

Thanks so much both!

@ElDeveloper ElDeveloper merged commit 65b3f01 into biocore:master Jan 25, 2021
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.

Allow users to adjust amount of separation between first barplot layer and the farthest tip
3 participants