Skip to content

Refactor microphonics plots to use shared PlotTooltip utility#198

Open
hmarts9 wants to merge 1 commit intoslaclab:mainfrom
hmarts9:refactor/use-plot-tooltip-utility
Open

Refactor microphonics plots to use shared PlotTooltip utility#198
hmarts9 wants to merge 1 commit intoslaclab:mainfrom
hmarts9:refactor/use-plot-tooltip-utility

Conversation

@hmarts9
Copy link
Copy Markdown
Contributor

@hmarts9 hmarts9 commented Jan 21, 2026

Refactors all microphonics plot classes to use the shared PlotTooltip utility instead of custom tooltip implementations.

@s-aderhold s-aderhold requested a review from a team January 21, 2026 22:21

def get_formatter(self):
"""Override in subclasses for custom tooltip formatting."""
return lambda x, y: f"X: {x:.2f}, Y: {y:.2f}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maybe have a formatter in PlotTooltip that accepts the x and y labels without having to provide a whole new lambda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants