-
Notifications
You must be signed in to change notification settings - Fork 441
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
Support vtkLegendScaleActor with add_legend_scale #3716
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3716 +/- ##
=======================================
Coverage 94.18% 94.19%
=======================================
Files 91 91
Lines 19586 19631 +45
=======================================
+ Hits 18448 18492 +44
- Misses 1138 1139 +1 |
See #2531 which implements the ability to add the rulers using vtkAxisActor2D. vtkLegendScaleActor uses vtkAxisActor2D under the hood with some defaults, but it also has the ability to add that black and white thingy. I am pointing this out so the documentation can link from one to the other (See Also section) and that we should try to keep the API consistent (maybe necessitating changes to the code from the prior PR). |
Ah, I missed that PR and that feature - thank you for linking! |
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.
Mostly docstring suggestions
pyvista/plotting/renderer.py
Outdated
The corner offset value. | ||
|
||
bottom_border_offset : int, default: 30 | ||
Bottom border offset. Recommended value ``50`` |
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.
Why are the defaults not the same as recommended for all of these?
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.
The defaults match what's set as default in VTK and make the actors visible in testing. The recommended values make them look quite a bit nicer for PyVista's default window_size or bigger
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.
This is a hard choice then. I don't have a strong opinion, so leave it up to you and or other reviewers.
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
Thanks @MatthewFlamm! |
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.
LGTM
Overview
Adds support for
vtkLegendScaleActor
which is a widget style actor for adding a sense of scale to the scene. This has tons of potential configurations options and I tried to expose what I could and make it similar toadd_ruler()
.Also cleans up the related
add_ruler()
method by moving it to the `Renderer`` class and adding color setters to resolve #3888Details
To do
*_axis_visibility
should be on or off by defaultadd_ruler
to make sure APIs are similaradd_ruler
- e.g., text colorKnown Issues
The label colors are either white or black. This seems to be an upstream bug in VTK where if the color is set at all, it turns the label black.