-
Notifications
You must be signed in to change notification settings - Fork 440
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
Redraw ChartMPL on Plotter render #3731
Conversation
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... the general updates to the BasePlotter
look good to me (calling update()
on the renderers when BasePlotter.update()
is called).
Otherwise, I trust you, @dcbr, as I'm totally unfamiliar with what's going on with the charting
Codecov Report
@@ Coverage Diff @@
## main #3731 +/- ##
==========================================
+ Coverage 93.99% 94.16% +0.16%
==========================================
Files 82 86 +4
Lines 18553 18906 +353
==========================================
+ Hits 17439 17802 +363
+ Misses 1114 1104 -10 |
Alright, I tested locally on Windows, but I'll add a test tomorrow to improve coverage as well :) |
I added the test, ready for review (again) if everything turns green :) |
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.
I know I gave this an initial approval but now I have some counter thoughts on adding an update()
method to the Renderer
class - IMO, this should be in the render()
calls
Hmm yea I thought of adding it to the |
Maybe for now I can just move it to the |
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.
Overall, I'm happy with this! but I think Renderer.render()
needs to call self.Render()
too
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.
on_plotter_render()
is a good choice. LGTM!
Overview
As requested in #3380 this PR adds functionality to automatically redraw
ChartMPL
charts whenever thePlotter.update()
method is called. Furthermore, a bug in the chart's_resize
method is fixed. Resolves #3380.Details
redraw_on_render
property forChartMPL
(defaultTrue
), which enables automatic redrawing of these charts when thePlotter.render()
method is called. To support this feature, extraon_plotter_render
methods to theRenderer
andRenderers
classes are needed to discern between a manual call toPlotter.render
and manual/automatic calls toRenderer.Render
(which invoke VTKStartEvent
, also used by charts)._resize
method of charts used exact comparisons of floats, which lead to unnecessary resizings (and redrawings) of charts. This PR converts all current and target dimensions to integers to resolve this bug.