@vizzly/dashboard 0.14.4-dev-dcdf669a67550a23017aa4648c565ad57c836104 → 0.14.4-dev-04cdc366aba20e3ec13c6b9b5fa22cdcd72826c7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  import { ShapeDefinition, ConditionalFormattingRule, DataItem, Key } from '../../../../../shared-logic/src/ChartsV2/types';
3
3
  import { LineStyles } from '../../../../../shared-logic/src/LineChartV2/types';
4
4
  import { BarStyles } from '../../../../../shared-logic/src/BarChartV2/types';
@@ -20,5 +20,5 @@ interface TooltipProps<T> {
20
20
  conditionalFormattingRules: Array<ConditionalFormattingRule>;
21
21
  theme: CSSProperties;
22
22
  }
23
- export declare const Tooltip: ({ keys, legendItems, showRoundedTotal, tooltipData, tooltipLeft, tooltipTop, visibleYKeys, xKey, yKeys, conditionalFormattingRules, theme, }: TooltipProps<LineStyles | BarStyles | AreaStyles>) => JSX.Element;
23
+ export declare const Tooltip: ({ keys, legendItems, showRoundedTotal, tooltipData, tooltipLeft, tooltipTop, visibleYKeys, xKey, yKeys, conditionalFormattingRules, theme, }: TooltipProps<LineStyles | BarStyles | AreaStyles>) => React.ReactPortal;
24
24
  export {};
@@ -0,0 +1,16 @@
1
+ export declare type UseTooltipParams<TooltipData> = {
2
+ tooltipOpen: boolean;
3
+ tooltipLeft?: number;
4
+ tooltipTop?: number;
5
+ lineLeft?: number;
6
+ tooltipData?: TooltipData;
7
+ updateTooltip: (args: UpdateTooltipArgs<TooltipData>) => void;
8
+ showTooltip: (args: ShowTooltipArgs<TooltipData>) => void;
9
+ hideTooltip: () => void;
10
+ };
11
+ declare type UseTooltipState<TooltipData> = Pick<UseTooltipParams<TooltipData>, 'tooltipOpen' | 'tooltipLeft' | 'tooltipTop' | 'lineLeft' | 'tooltipData'>;
12
+ declare type ValueOrFunc<T> = T | ((t: T) => T);
13
+ declare type ShowTooltipArgs<TooltipData> = ValueOrFunc<Omit<UseTooltipState<TooltipData>, 'tooltipOpen'>>;
14
+ declare type UpdateTooltipArgs<TooltipData> = ValueOrFunc<UseTooltipState<TooltipData>>;
15
+ export default function useTooltip<TooltipData = {}>(initialTooltipState?: Partial<UseTooltipParams<TooltipData>>): UseTooltipParams<TooltipData>;
16
+ export {};
@@ -24,8 +24,7 @@ interface getTooltipDataArgs {
24
24
  chartType: ChartType;
25
25
  }
26
26
  interface TooltipDataReturn {
27
- tooltipLeft: number;
28
- tooltipTop: number;
27
+ lineLeft: number;
29
28
  tooltipData: TooltipData | null;
30
29
  }
31
30
  export declare const getTooltipData: ({ data, event, margin, xScaleKey, xScaleDataType, xScale, xOrdering, chartType, }: getTooltipDataArgs) => TooltipDataReturn | undefined;