pace-chart-lib 1.0.70 → 1.0.71

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,5 +1,6 @@
1
1
  import { TData } from "../Core/Common.types";
2
2
  import type { TDefaultChartFormatOptionsType } from "../Core/DefaultProperties.types";
3
+ import type { TVfxOnElementClick, TVfxTooltipFormatter } from "../Core/VfxInteraction";
3
4
  export type TMargin = {
4
5
  top: number;
5
6
  left: number;
@@ -57,6 +58,9 @@ export type TChartProps = {
57
58
  isAdvancedAnalyticsWaterFall?: boolean;
58
59
  onDataLabelCoordinatesChange?: (coords: any[]) => void;
59
60
  addLocalFilterFromLib?: (clickedLegendData: any) => void;
61
+ tooltipFormatter?: TVfxTooltipFormatter;
62
+ onElementClick?: TVfxOnElementClick;
63
+ vfxPickModeActive?: boolean;
60
64
  };
61
65
  export type TChartJSON = {
62
66
  dimensionList: string[];
@@ -1,4 +1,5 @@
1
1
  import { TDefaultChartFormatOptionsType, TLegendEntry, TPieOfPieSeries, TSeries } from "../Core/Common.types";
2
+ import type { TVfxOnElementClick } from "../Core/VfxInteraction";
2
3
  export interface IChartProps {
3
4
  chartId: string;
4
5
  data: {
@@ -10,6 +11,8 @@ export interface IChartProps {
10
11
  isReportEditable?: boolean;
11
12
  onDataLabelCoordinatesChange?: (coords: any[]) => void;
12
13
  addLocalFilterFromLib?: (clickedLegendData: any) => void;
14
+ onElementClick?: TVfxOnElementClick;
15
+ vfxPickModeActive?: boolean;
13
16
  }
14
17
  export interface IPieofPieChartProps {
15
18
  chartId: string;
@@ -42,6 +45,8 @@ export type TSankeyChartProps = {
42
45
  clientWidth: number;
43
46
  clientHeight: number;
44
47
  formatOptions: TDefaultChartFormatOptionsType;
48
+ onElementClick?: TVfxOnElementClick;
49
+ vfxPickModeActive?: boolean;
45
50
  };
46
51
  export type TNodePairs = {
47
52
  source: string;
@@ -1,3 +1,4 @@
1
+ import type { TVfxOnElementClick } from "./VfxInteraction";
1
2
  export declare enum staticLegendShape {
2
3
  rectangle = "rectangle",
3
4
  circle = "circle",
@@ -373,6 +374,8 @@ export type TBubbleChartProps = {
373
374
  legendEntries?: TLegendsFormatting[];
374
375
  formatOptions?: TDefaultChartFormatOptionsType;
375
376
  addLocalFilterFromLib?: (clickedLegendData: any) => void;
377
+ onElementClick?: TVfxOnElementClick;
378
+ vfxPickModeActive?: boolean;
376
379
  };
377
380
  export declare const referenceLineTypes: {
378
381
  None: string;
@@ -388,6 +391,8 @@ export type TScatterChartProps = {
388
391
  shapesList: TLegendsFormatting[];
389
392
  colorsList: TLegendsFormatting[];
390
393
  formatOptions: TDefaultChartFormatOptionsType;
394
+ onElementClick?: TVfxOnElementClick;
395
+ vfxPickModeActive?: boolean;
391
396
  };
392
397
  export declare enum commonColors {
393
398
  white = "#ffffff",
@@ -2,6 +2,7 @@ import * as d3 from "d3";
2
2
  import type { TChartJSON } from "../ChartsWithAxis/ChartsWithAxisTypes.types";
3
3
  import { TVennSeries } from "../ChartsWithoutAxis/ChartsWithoutAxisTypes.types";
4
4
  import { type TAnnotationObject, type TChartMargins, TData, type TDataPoint, type TDefaultChartFormatOptionsType, type TSeries, type TTextDimensions } from "./Common.types";
5
+ import type { TVfxTooltipFormatter } from "./VfxInteraction";
5
6
  export declare const svgID = "scaling-svg-";
6
7
  export declare function getRandomColor(): {
7
8
  color: string;
@@ -51,7 +52,7 @@ export declare function calculateMaxLegendWidth(list: string[], formatOptions: T
51
52
  *
52
53
  * @returns {void} This function does not return a value; it appends and updates SVG marker elements in the DOM.
53
54
  */
54
- export declare function lineMarkers(lines: any, chartData: TSeries[], type: any, xScale: any, yScale: any, yScaleRight: any, tooltipHandle: any, formatOptions: TDefaultChartFormatOptionsType, chartJSON: TChartJSON, secondaryCustomYaxisMaxValue: number, secondaryCustomYaxisMinValue: number, customYaxisMinValue: number, customYaxisMaxValue: number, isNormalizedChart: boolean): void;
55
+ export declare function lineMarkers(lines: any, chartData: TSeries[], type: any, xScale: any, yScale: any, yScaleRight: any, tooltipHandle: any, formatOptions: TDefaultChartFormatOptionsType, chartJSON: TChartJSON, secondaryCustomYaxisMaxValue: number, secondaryCustomYaxisMinValue: number, customYaxisMinValue: number, customYaxisMaxValue: number, isNormalizedChart: boolean, tooltipFormatter?: TVfxTooltipFormatter): void;
55
56
  export declare function Markershapes(Shape: any): d3.SymbolType;
56
57
  /**
57
58
  * Attaches hover interactions to the area chart elements to show markers and tooltips
@@ -92,7 +93,7 @@ export declare function getAutoNumberWithFormat(value: any): any;
92
93
  * @param chartFormatOptions -> rightpane format options;
93
94
  * @param event -> optional mouse event to track mouse;
94
95
  */
95
- export declare function showTooltipOnMouseMove(elements: any, chartFormatOptions: TDefaultChartFormatOptionsType, event?: MouseEvent, prop?: any): void;
96
+ export declare function showTooltipOnMouseMove(elements: any, chartFormatOptions: TDefaultChartFormatOptionsType, event?: MouseEvent, prop?: any, customHTML?: string): void;
96
97
  export declare function hideTooltipOnMouseOut(): void;
97
98
  /**
98
99
  * Adds chart title to svg
@@ -0,0 +1,25 @@
1
+ import { MutableRefObject } from "react";
2
+ export declare enum VfxDataAttr {
3
+ SeriesId = "data-series-id",
4
+ DimValue = "data-dim-value"
5
+ }
6
+ export declare const VFX_TOOLTIP_FONT_SIZE = "11px";
7
+ export declare const VFX_TOOLTIP_LINE_HEIGHT = "1.6";
8
+ export type TVfxElementClickPayload = {
9
+ seriesId: string;
10
+ dimValue: string;
11
+ legendUniqueId: string;
12
+ seriesDisplayName: string;
13
+ };
14
+ export type TVfxOnElementClick = (payload: TVfxElementClickPayload) => void;
15
+ export type TVfxTooltipFormatter = (dimensionValue: string, seriesProperties: any) => string | null;
16
+ /**
17
+ * Returns a D3-compatible click handler that gates on vfxPickModeActive.
18
+ * Accepts a buildPayload fn so each chart controls what it puts in the event payload.
19
+ */
20
+ export declare function makeVfxClickHandler(vfxPickModeActiveRef: MutableRefObject<boolean | undefined>, onElementClickRef: MutableRefObject<TVfxOnElementClick | undefined>, buildPayload: (_event: MouseEvent, datum: any) => TVfxElementClickPayload): (_event: MouseEvent, datum: any) => void;
21
+ /**
22
+ * Resolves custom tooltip HTML from the project-side formatter.
23
+ * Returns undefined when no formatter is supplied or the formatter returns null.
24
+ */
25
+ export declare function resolveCustomTooltipHTML(tooltipFormatter: TVfxTooltipFormatter | undefined, dimValue: string, seriesProperties: any): string | undefined;