@oliasoft-open-source/charts-library 5.2.2-beta-3 → 5.3.0
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.
package/dist/index.js
CHANGED
|
@@ -18698,7 +18698,8 @@ var defaultTooltip$3 = (tooltip) => ({
|
|
|
18698
18698
|
tooltips: tooltip?.tooltips ?? true,
|
|
18699
18699
|
showLabelsInTooltips: tooltip?.showLabelsInTooltips ?? false,
|
|
18700
18700
|
hideSimulationName: tooltip?.hideSimulationName ?? false,
|
|
18701
|
-
scientificNotation: tooltip?.scientificNotation ?? true
|
|
18701
|
+
scientificNotation: tooltip?.scientificNotation ?? true,
|
|
18702
|
+
callbacks: tooltip?.callbacks
|
|
18702
18703
|
});
|
|
18703
18704
|
var defaultGraph$3 = (graph) => ({
|
|
18704
18705
|
lineTension: graph?.lineTension ?? .01,
|
|
@@ -19184,6 +19185,12 @@ var getLineChartToolTips = (options) => {
|
|
|
19184
19185
|
};
|
|
19185
19186
|
return `${label}: ${getTooltipItemValue()} ${getUnitsFromLabel(valueAxisLabel)} ${getTooltipLabel(tooltipItem, showLabelsInTooltips)}`;
|
|
19186
19187
|
};
|
|
19188
|
+
const userCallbacks = options?.tooltip?.callbacks ?? null;
|
|
19189
|
+
const callbacks = {
|
|
19190
|
+
title: userCallbacks?.title ?? titleCallback$1,
|
|
19191
|
+
label: userCallbacks?.label ?? labelCallback$1,
|
|
19192
|
+
afterLabel: userCallbacks?.afterLabel ?? afterLabelCallback
|
|
19193
|
+
};
|
|
19187
19194
|
return {
|
|
19188
19195
|
enabled: options?.tooltip?.tooltips,
|
|
19189
19196
|
mode: ChartHoverMode.Nearest,
|
|
@@ -19193,11 +19200,7 @@ var getLineChartToolTips = (options) => {
|
|
|
19193
19200
|
boxWidth: 12,
|
|
19194
19201
|
boxHeight: 12,
|
|
19195
19202
|
boxPadding: 4,
|
|
19196
|
-
callbacks
|
|
19197
|
-
title: titleCallback$1,
|
|
19198
|
-
label: labelCallback$1,
|
|
19199
|
-
afterLabel: afterLabelCallback
|
|
19200
|
-
}
|
|
19203
|
+
callbacks
|
|
19201
19204
|
};
|
|
19202
19205
|
};
|
|
19203
19206
|
var get_line_chart_tooltips_default = getLineChartToolTips;
|
package/dist/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1762517829123,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@storybook/testing-library":"0.2.2","eslint-plugin-vitest":"0.5.4","eslint-plugin-vitest-globals":"1.5.0","vitest":"4.0.4"},"hasRouterPackage":false,"packageManager":{"type":"yarn","agent":"yarn","nodeLinker":"undefined"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"9.1.16","language":"javascript","storybookPackages":{"@storybook/react-vite":{"version":"9.1.16"},"@storybook/testing-library":{"version":"0.2.2"},"eslint-plugin-storybook":{"version":"9.1.16"},"storybook":{"version":"9.1.16"}},"addons":{"@storybook/addon-themes":{"version":"9.1.16"},"@storybook/addon-docs":{"version":"9.1.16"}}}
|
|
@@ -106,10 +106,16 @@ export interface ICommonLegend {
|
|
|
106
106
|
position: Position;
|
|
107
107
|
align: AlignOptions;
|
|
108
108
|
}
|
|
109
|
+
export interface ICommonTooltipCallbacks {
|
|
110
|
+
title?: () => void;
|
|
111
|
+
label?: () => void;
|
|
112
|
+
afterLabel?: () => void;
|
|
113
|
+
}
|
|
109
114
|
export interface ICommonTooltip {
|
|
110
115
|
tooltips: boolean;
|
|
111
116
|
showLabelsInTooltips: boolean;
|
|
112
117
|
scientificNotation: boolean;
|
|
118
|
+
callbacks?: ICommonTooltipCallbacks;
|
|
113
119
|
}
|
|
114
120
|
export interface ICommonAdditionalAxesOptions {
|
|
115
121
|
chartScaleType?: 'linear' | 'logarithmic';
|
|
@@ -4,11 +4,7 @@ import { ILineChartOptions } from '../line-chart.interface';
|
|
|
4
4
|
export declare const getUnitsFromLabel: (label: string) => string;
|
|
5
5
|
declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
6
6
|
enabled: boolean;
|
|
7
|
-
callbacks: {
|
|
8
|
-
title?: undefined;
|
|
9
|
-
label?: undefined;
|
|
10
|
-
afterLabel?: undefined;
|
|
11
|
-
};
|
|
7
|
+
callbacks: {};
|
|
12
8
|
mode?: undefined;
|
|
13
9
|
intersect?: undefined;
|
|
14
10
|
padding?: undefined;
|
|
@@ -26,9 +22,9 @@ declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
|
26
22
|
boxHeight: number;
|
|
27
23
|
boxPadding: number;
|
|
28
24
|
callbacks: {
|
|
29
|
-
title: (tooltipItem: TooltipItem<any>[]) => string;
|
|
30
|
-
label: (tooltipItem: TooltipItem<any>) => string;
|
|
31
|
-
afterLabel: (tooltipItem: Record<string, any>) => string;
|
|
25
|
+
title: (() => void) | ((tooltipItem: TooltipItem<any>[]) => string);
|
|
26
|
+
label: (() => void) | ((tooltipItem: TooltipItem<any>) => string);
|
|
27
|
+
afterLabel: (() => void) | ((tooltipItem: Record<string, any>) => string);
|
|
32
28
|
};
|
|
33
29
|
};
|
|
34
30
|
export default getLineChartToolTips;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"resolutions": {
|