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:
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)
This PR fixes this, by resetting the width/height of the main legend to their defaults right before we adjust tree coloring:
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.
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:
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 theelement.style
text in the dev console on the right)This PR fixes this, by resetting the width/height of the main legend to their defaults right before we adjust tree coloring:
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.