[Dashboards] Improve tooltip animations (#16357)
before - https://github.com/user-attachments/assets/069a8737-fcc9-4186-bdbf-e9ed0dfa41a8 after - https://github.com/user-attachments/assets/dbc8604c-dda0-46a9-a67b-f59cc91d7f53
This commit is contained in:
-18
@@ -1,18 +0,0 @@
|
||||
import { type VirtualElement } from '@floating-ui/react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const getTooltipReferenceFromBarChartElementAnchor = (
|
||||
anchorElement: Element,
|
||||
containerId: string,
|
||||
): {
|
||||
reference: Element | VirtualElement;
|
||||
boundary: Element;
|
||||
} => {
|
||||
const containerElement = document.getElementById(containerId);
|
||||
|
||||
if (!isDefined(containerElement)) {
|
||||
throw new Error(`Bar chart container not found: ${containerId}`);
|
||||
}
|
||||
|
||||
return { reference: anchorElement, boundary: containerElement };
|
||||
};
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
import { createVirtualElementFromContainerOffset } from '@/page-layout/widgets/graph/utils/createVirtualElementFromContainerOffset';
|
||||
import { type VirtualElement } from '@floating-ui/react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const getTooltipReferenceFromLineChartPointAnchor = (
|
||||
containerId: string,
|
||||
offsetLeft: number,
|
||||
offsetTop: number,
|
||||
): {
|
||||
reference: VirtualElement;
|
||||
boundary: Element;
|
||||
} => {
|
||||
const containerElement = document.getElementById(containerId);
|
||||
|
||||
if (!isDefined(containerElement)) {
|
||||
throw new Error(`Chart container not found: ${containerId}`);
|
||||
}
|
||||
|
||||
return {
|
||||
reference: createVirtualElementFromContainerOffset(
|
||||
containerElement,
|
||||
offsetLeft,
|
||||
offsetTop,
|
||||
),
|
||||
boundary: containerElement,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user