-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] Pythagorean Tree: children order #3393
Conversation
Further work:
|
Codecov Report
@@ Coverage Diff @@
## master #3393 +/- ##
==========================================
- Coverage 82.29% 82.27% -0.03%
==========================================
Files 360 360
Lines 64080 64111 +31
==========================================
+ Hits 52735 52745 +10
- Misses 11345 11366 +21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well. One thing that is still an issue, which we discussed yesterday - the scene doesn't resize properly. We agreed that resizing and re-centering the view on every change was a bad idea the tree would jump around, and I still think this is important. However, one issue that does arise from not resizing the viewport is that the report image can be cut off.
For example on the housing data set, the default report looks nice (I don't show reports here because the images are huge, but it's just whatever's visible in the viewport).
while if we flip the second largest bottom node, we get this
which unfortunately cuts off the top of the tree in the report.
I suppose we'd want to make sure to properly set the sceneRect (or something related) before rendering the report.
Ideally, this would work properly when right clicking - which resets the zoom. So in that case we'd expect the entire tree to be shown, but as it is now, the top of the tree is cut off (as seen in the pictures).
Looking at the code in _update_main_area
, we'd only want to call self.scene.setSceneRect(self.view.central_widget_rect())
, and not any of the others on every change.
Updating the scene rectangle repositions the tree in the current view. If we have a horizontal layout of the tree and flip something that results in a vertical layout, we would have to add some horizontal margin to keep the tree in place besides computing the right view parameters (such that the scene/view transformation keeps the items in place). I resorted to updating the entire view with |
Issue
Fixes #3330.
Description of changes
Implemented two new features that should enable visualizations of Pythagorean trees with less overlap:
Includes