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

Automatically resize main legend when changing tree coloring #512

Merged
merged 2 commits into from
May 4, 2021

Conversation

fedarko
Copy link
Collaborator

@fedarko fedarko commented May 1, 2021

The main legend in the application is resizable, and its size will automatically change as the tree is colored by different categories. However, this behavior currently stops working after the user manually resizes the legend at all:

leg

We should keep the ability for users to manually resize the legend, IMO, since the legend can get really large and we don't want it to obstruct the user's view.

It looks like the reason for this is that, when the user manually resizes the legend, that the width / height attributes of the legend go from being unspecified to being fixed: (note the element.style text in the dev console on the right)

wh

This PR fixes this, by resetting the width/height of the main legend to their defaults right before we adjust tree coloring:

Peek 2021-04-30 20-53

It's worth noting that this PR will need to be updated once #484 is merged in so that Empress.resizeLegend() is called before creating a continuous legend.

@emperor-helper
Copy link

The following artifacts were built for this PR: empire-biplot.qzv, empire.qzv, empress-tree.qzv, just-fm.qzv, plain.qzv

@kwcantrell
Copy link
Collaborator

Thanks @fedarko, this looks good! I will go ahead and merge this and update #484.

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.

3 participants