Refactor microphonics plots to use shared PlotTooltip utility#198
Open
hmarts9 wants to merge 1 commit intoslaclab:mainfrom
Open
Refactor microphonics plots to use shared PlotTooltip utility#198hmarts9 wants to merge 1 commit intoslaclab:mainfrom
hmarts9 wants to merge 1 commit intoslaclab:mainfrom
Conversation
|
|
||
| def get_formatter(self): | ||
| """Override in subclasses for custom tooltip formatting.""" | ||
| return lambda x, y: f"X: {x:.2f}, Y: {y:.2f}" |
Collaborator
There was a problem hiding this comment.
should this be the default in PlotTooltip?
| return f"Frequency: {x:.1f} Hz\nAmplitude: {y:.3f}" | ||
| def get_formatter(self): | ||
| """Tooltip formatter for FFT plot.""" | ||
| return lambda x, y: f"Frequency: {x:.1f} Hz\nAmplitude: {y:.3f}" |
Collaborator
There was a problem hiding this comment.
And maybe have a formatter in PlotTooltip that accepts the x and y labels without having to provide a whole new lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors all microphonics plot classes to use the shared PlotTooltip utility instead of custom tooltip implementations.