-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add a tooltip to plots with long titles that are cut by Vega #4840
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { ReactElement, PropsWithChildren } from 'react' | ||
import Tooltip from '../../shared/components/tooltip/Tooltip' | ||
|
||
interface ZoomablePlotWrapperProps { | ||
title?: string | ||
id: string | ||
} | ||
|
||
export const ZoomablePlotWrapper: React.FC< | ||
PropsWithChildren<ZoomablePlotWrapperProps> | ||
> = ({ title, id, children }) => { | ||
const isTitleCut = title?.indexOf('…') === 0 | ||
|
||
return isTitleCut ? ( | ||
<Tooltip content={id} placement="top" interactive> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please confirm that having a tooltip in place does not break the ability to zoom the plot 🙏🏻 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not prevent from zooming the plot. There should also be a tooltip on the zoomed plot though. I'll add one there as well. |
||
{children as ReactElement} | ||
</Tooltip> | ||
sroy3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) : ( | ||
children | ||
) | ||
} |
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.
TIL we aren't doing this in code.
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.
no wait.... we are doing this in code but you can bypass because the id is the title, got it