@oliasoft-open-source/charts-library 3.8.0-beta-5 → 3.8.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 +568 -569
- package/dist/index.js.map +1 -1
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +2 -73
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +36 -10
- package/dist/src/components/bar-chart/{get-bar-chart-data-labels.d.ts → utils/get-bar-chart-data-labels.d.ts} +1 -4
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +3 -0
- package/dist/src/components/bar-chart/{get-bar-chart-tooltips.d.ts → utils/get-bar-chart-tooltips.d.ts} +1 -1
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +24 -0
- package/dist/src/components/common/common.interface.d.ts +7 -3
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +10 -2
- package/dist/src/components/common/helpers/chart-consts.d.ts +3 -3
- package/dist/src/components/common/helpers/chart-utils.d.ts +10 -12
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -5
- package/dist/src/components/common/helpers/get-draggableData.d.ts +13 -13
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +2 -4
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +3 -1
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +3 -3
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +11 -15
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -7
- package/dist/src/components/line-chart/hooks/use-generated-labels.d.ts +4 -1
- package/dist/src/components/line-chart/hooks/use-legend-state.d.ts +6 -5
- package/dist/src/components/line-chart/legend/legend-interface.d.ts +2 -2
- package/dist/src/components/line-chart/line-chart.interface.d.ts +41 -6
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -1
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +5 -4
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +2 -5
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +3 -4
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +9 -9
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +4 -4
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +4 -8
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +6 -10
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +2 -1
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +3 -2
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +1 -6
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +3 -5
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +2 -9
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +53 -0
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +2 -42
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +10 -2
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +41 -0
- package/package.json +2 -3
- package/dist/src/components/bar-chart/get-bar-chart-scales.d.ts +0 -5
- package/dist/src/components/line-chart/controls/legend-options.d.ts +0 -1
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { IGeneratedLineChartDataset, TGeneratedLineChartDatasets } from '../../line-chart.interface';
|
|
1
2
|
type TCustomOptionType = {
|
|
2
3
|
[key: string]: string;
|
|
3
4
|
} | string | string[];
|
|
4
|
-
type TDataType =
|
|
5
|
+
type TDataType = IGeneratedLineChartDataset | Partial<IGeneratedLineChartDataset> | TGeneratedLineChartDatasets | Partial<TGeneratedLineChartDatasets> | any[];
|
|
5
6
|
/**
|
|
6
7
|
* Checks if a single dataset or an array of datasets has a custom option.
|
|
7
8
|
* Iterates through each custom option defined in the customOptions parameter.
|
|
8
9
|
* Returns true if any dataset has any custom option, otherwise returns false.
|
|
9
|
-
*
|
|
10
|
-
* @param {any | any[]} data - The dataset or array of datasets to check.
|
|
11
|
-
* @param {TCustomOptionType} customOptions - The custom options to check for.
|
|
12
|
-
* @returns {boolean} - True if any dataset has any custom option, otherwise false.
|
|
13
10
|
*/
|
|
14
11
|
export declare const checkCustomOption: (data: TDataType, customOptions: TCustomOptionType) => boolean;
|
|
15
12
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface IChartArea {
|
|
2
|
+
left: number | null;
|
|
3
|
+
right: number | null;
|
|
4
|
+
bottom: number | null;
|
|
5
|
+
}
|
|
6
|
+
interface IChartMeta {
|
|
7
|
+
data: Array<{
|
|
8
|
+
x: number | null;
|
|
9
|
+
y: number | null;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export interface IAlignmentContext {
|
|
13
|
+
chart: {
|
|
14
|
+
chartArea: IChartArea;
|
|
15
|
+
getDatasetMeta: (datasetIndex: number) => IChartMeta;
|
|
16
|
+
};
|
|
17
|
+
dataIndex: number;
|
|
18
|
+
datasetIndex: number;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @return {object} - returning object with boolean props
|
|
1
|
+
/**
|
|
2
|
+
* Returning boolean condition depends on label position and chart area
|
|
4
3
|
*/
|
|
5
|
-
export declare const getCondition: (x: number, y: number, left: number, right: number, bottom: number) => {
|
|
4
|
+
export declare const getCondition: (x: number | null, y: number | null, left: number | null, right: number | null, bottom: number | null) => {
|
|
6
5
|
overLeftSide: boolean;
|
|
7
6
|
overRightSide: boolean;
|
|
8
7
|
overBottomSide: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
1
|
+
import { IAlignmentContext } from './datalabels-alignment.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Returning destructured data from context
|
|
4
4
|
*/
|
|
5
|
-
export declare const getAlignmentData: (context:
|
|
6
|
-
x:
|
|
7
|
-
y:
|
|
8
|
-
left:
|
|
9
|
-
right:
|
|
10
|
-
bottom:
|
|
5
|
+
export declare const getAlignmentData: (context: IAlignmentContext) => {
|
|
6
|
+
x: number | null;
|
|
7
|
+
y: number | null;
|
|
8
|
+
left: number | null;
|
|
9
|
+
right: number | null;
|
|
10
|
+
bottom: number | null;
|
|
11
11
|
};
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlignOptions } from '../../../common/helpers/enums';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
2
|
+
import { IAlignmentContext } from './datalabels-alignment.interface.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Returning position depends on condition
|
|
5
5
|
*/
|
|
6
|
-
export declare const getPosition: () => (context:
|
|
6
|
+
export declare const getPosition: () => (context: IAlignmentContext) => AlignOptions.End | AlignOptions.Start | AlignOptions.Right | AlignOptions.Left;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { IState } from '../state/state.interfaces';
|
|
2
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
2
|
+
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Generates line chart datasets based on the provided datasets, state, and options.
|
|
5
|
-
*
|
|
6
|
-
* @param {Array} datasets - The initial datasets for the line chart.
|
|
7
|
-
* @param {Object} state - The state object containing chart settings (e.g., lineEnabled, pointsEnabled, axes).
|
|
8
|
-
* @param {Object} options - The options object containing additional settings (e.g., annotations, graph).
|
|
9
|
-
* @param {Object} translations - The getTranslations object with the label property
|
|
10
|
-
* @returns {Array} - The generated line chart datasets with applied settings and configurations.
|
|
11
5
|
*/
|
|
12
|
-
export declare const generateLineChartDatasets: (datasets: Array<any>, state: IState, options: ILineChartOptions, { label }:
|
|
6
|
+
export declare const generateLineChartDatasets: (datasets: Array<any>, state: IState, options: ILineChartOptions, { label }: {
|
|
7
|
+
label: string;
|
|
8
|
+
}) => TGeneratedLineChartDatasets;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Chart } from 'chart.js';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
id: any;
|
|
10
|
-
min: any;
|
|
11
|
-
max: any;
|
|
3
|
+
import { ILineChartAxes } from '../line-chart.interface';
|
|
4
|
+
export declare const getAxesRangesFromChart: (chartRef: RefObject<Chart>, axes: ILineChartAxes) => {
|
|
5
|
+
unit?: import("../line-chart.interface").IUnitOptions | undefined;
|
|
6
|
+
id: string;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
12
9
|
}[];
|
|
13
|
-
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Chart, LegendItem } from 'chart.js';
|
|
2
|
+
export declare const getGeneratedLabels: (chart: Chart) => LegendItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TooltipItem } from 'chart.js';
|
|
2
2
|
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
+
import { UnusedParameter } from '../../common/common.interface';
|
|
3
4
|
/**
|
|
4
5
|
* adjusts the position of the label depends on chart area
|
|
5
6
|
*
|
|
@@ -8,8 +9,8 @@ import { ILineChartOptions } from '../line-chart.interface';
|
|
|
8
9
|
*/
|
|
9
10
|
declare const getLineChartDataLabels: (options: ILineChartOptions) => {
|
|
10
11
|
display: string;
|
|
11
|
-
align: (context:
|
|
12
|
-
formatter: (
|
|
12
|
+
align: (context: import("./datalabels-alignment/datalabels-alignment.interface").IAlignmentContext) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
|
|
13
|
+
formatter: (_: UnusedParameter, context: TooltipItem<any>) => any;
|
|
13
14
|
} | {
|
|
14
15
|
display: boolean;
|
|
15
16
|
align?: undefined;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { IState } from '../state/state.interfaces';
|
|
2
2
|
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @param {ILineChartOptions} options - line chart options object
|
|
6
|
-
* @param {IState} state - chart state object controlled by useReducer or similar
|
|
7
|
-
*/
|
|
8
|
-
declare const getLineChartScales: (options: ILineChartOptions, state: IState) => any;
|
|
3
|
+
declare const getLineChartScales: (options: ILineChartOptions, state: IState) => {};
|
|
9
4
|
export default getLineChartScales;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { TooltipItem } from 'chart.js';
|
|
1
2
|
import { ChartHoverMode } from '../../common/helpers/enums';
|
|
2
3
|
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
4
|
export declare const getUnitsFromLabel: (label: string) => string;
|
|
4
|
-
/**
|
|
5
|
-
* @param {import('../line-chart.interface').ILineChartOptions} options - line chart options object
|
|
6
|
-
*/
|
|
7
5
|
declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
8
6
|
enabled: boolean;
|
|
9
7
|
mode: ChartHoverMode;
|
|
@@ -14,8 +12,8 @@ declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
|
14
12
|
boxHeight: number;
|
|
15
13
|
boxPadding: number;
|
|
16
14
|
callbacks: {
|
|
17
|
-
title: (tooltipItem: any
|
|
18
|
-
label: (tooltipItem: any) => string;
|
|
15
|
+
title: (tooltipItem: TooltipItem<any>[]) => string;
|
|
16
|
+
label: (tooltipItem: TooltipItem<any>) => string;
|
|
19
17
|
afterLabel: (tooltipItem: Record<string, any>) => string;
|
|
20
18
|
};
|
|
21
19
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ILineRange } from '../line-chart.interface';
|
|
2
|
+
import { TPrimitive } from '../../common/common.interface';
|
|
2
3
|
export declare const toNum: (value: string | number) => any;
|
|
3
4
|
export declare const isLessThanMax: (value: string | number, max: string | number) => boolean;
|
|
4
5
|
export declare const isGreaterThanMin: (value: string | number, min: string | number) => boolean;
|
|
@@ -19,21 +20,13 @@ export declare const getAxisTypeFromKey: (string: string) => string;
|
|
|
19
20
|
/**
|
|
20
21
|
* Generates a key based on an array of values. The key changes
|
|
21
22
|
* if any of the values in the array change.
|
|
22
|
-
*
|
|
23
|
-
* @param {Array} values - The array of values to base the key on.
|
|
24
|
-
* @returns {String} The key.
|
|
25
23
|
*/
|
|
26
24
|
export declare const generateKey: (values: Array<any>) => string;
|
|
27
25
|
/**
|
|
28
26
|
* Checks if a value is a primitive value (which includes strings, numbers, booleans, and null).
|
|
29
|
-
* @param {*} value - The value to check.
|
|
30
|
-
* @returns {boolean} - Returns true if the value is a primitive value, otherwise false.
|
|
31
27
|
*/
|
|
32
|
-
export declare const isPrimitiveValue: (value:
|
|
28
|
+
export declare const isPrimitiveValue: (value: TPrimitive) => boolean;
|
|
33
29
|
/**
|
|
34
30
|
* Validates a range object to ensure none of its properties are null, undefined, or empty strings.
|
|
35
|
-
*
|
|
36
|
-
* @param {Object} r - The range object to validate.
|
|
37
|
-
* @returns {boolean} True if all properties of the range are valid, otherwise false.
|
|
38
31
|
*/
|
|
39
32
|
export declare const isRangeValid: (r?: ILineRange) => boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChartEvent } from 'chart.js';
|
|
2
|
+
import { IPieChartDataset, IPieOptions } from './pie-chart.interface';
|
|
3
|
+
import { AlignOptions, Position } from '../common/helpers/enums';
|
|
4
|
+
interface IDefaultChartStyling {
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
maintainAspectRatio: boolean;
|
|
8
|
+
staticChartHeight: boolean;
|
|
9
|
+
performanceMode: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface IDefaultTooltip {
|
|
12
|
+
tooltips: boolean;
|
|
13
|
+
showLabelsInTooltips: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface IDefaultPieGraph {
|
|
16
|
+
showDataLabels: boolean;
|
|
17
|
+
stacked: boolean;
|
|
18
|
+
cutout: number | string;
|
|
19
|
+
}
|
|
20
|
+
interface IDefaultPieLegend {
|
|
21
|
+
display: boolean;
|
|
22
|
+
useDataset: boolean;
|
|
23
|
+
position: Position;
|
|
24
|
+
align: AlignOptions;
|
|
25
|
+
}
|
|
26
|
+
interface IDefaultChartOptions {
|
|
27
|
+
enableZoom: boolean;
|
|
28
|
+
enablePan: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface IDefaultInteractions {
|
|
31
|
+
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
32
|
+
onHover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IPieChartDataset[]) => void;
|
|
33
|
+
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
|
|
34
|
+
}
|
|
35
|
+
interface IDefaultChartData {
|
|
36
|
+
labels: string[];
|
|
37
|
+
datasets: IPieChartDataset[];
|
|
38
|
+
}
|
|
39
|
+
interface IDefaultPieOptions extends IPieOptions {
|
|
40
|
+
title: string | string[];
|
|
41
|
+
chartStyling: IDefaultChartStyling;
|
|
42
|
+
tooltip: IDefaultTooltip;
|
|
43
|
+
graph: IDefaultPieGraph;
|
|
44
|
+
legend: IDefaultPieLegend;
|
|
45
|
+
chartOptions: IDefaultChartOptions;
|
|
46
|
+
interactions: IDefaultInteractions;
|
|
47
|
+
}
|
|
48
|
+
export interface IPieChartDefaultProps {
|
|
49
|
+
testId: string | null;
|
|
50
|
+
data: IDefaultChartData;
|
|
51
|
+
options: IDefaultPieOptions;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -1,43 +1,3 @@
|
|
|
1
1
|
import { IPieChartProps } from './pie-chart.interface';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getDefaultProps: (props: IPieChartProps) =>
|
|
4
|
-
testId: string | null;
|
|
5
|
-
data: {
|
|
6
|
-
labels: string[];
|
|
7
|
-
datasets: import("./pie-chart.interface").IPieChartDataset[];
|
|
8
|
-
};
|
|
9
|
-
options: {
|
|
10
|
-
title: string | string[];
|
|
11
|
-
chartStyling: {
|
|
12
|
-
width: string | number | undefined;
|
|
13
|
-
height: string | number | undefined;
|
|
14
|
-
maintainAspectRatio: boolean;
|
|
15
|
-
staticChartHeight: boolean;
|
|
16
|
-
performanceMode: boolean;
|
|
17
|
-
};
|
|
18
|
-
tooltip: {
|
|
19
|
-
tooltips: boolean;
|
|
20
|
-
showLabelsInTooltips: boolean;
|
|
21
|
-
};
|
|
22
|
-
graph: {
|
|
23
|
-
showDataLabels: boolean;
|
|
24
|
-
stacked: boolean;
|
|
25
|
-
cutout: string | number;
|
|
26
|
-
};
|
|
27
|
-
legend: {
|
|
28
|
-
display: boolean;
|
|
29
|
-
useDataset: boolean;
|
|
30
|
-
position: Position;
|
|
31
|
-
align: AlignOptions;
|
|
32
|
-
};
|
|
33
|
-
chartOptions: {
|
|
34
|
-
enableZoom: boolean;
|
|
35
|
-
enablePan: boolean;
|
|
36
|
-
};
|
|
37
|
-
interactions: {
|
|
38
|
-
onLegendClick: ((text: string, hidden: boolean) => void) | undefined;
|
|
39
|
-
onHover: ((event?: import("chart.js").ChartEvent | undefined, datasetIndex?: number | undefined, index?: number | undefined, generatedDataset?: any[] | undefined) => void) | undefined;
|
|
40
|
-
onUnhover: ((event?: import("chart.js").ChartEvent | undefined, datasetIndex?: number | undefined, index?: number | undefined, generatedDataset?: any[] | undefined) => void) | undefined;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
2
|
+
import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
|
|
3
|
+
export declare const getDefaultProps: (props: IPieChartProps) => IPieChartDefaultProps;
|
|
@@ -16,7 +16,7 @@ export interface IPieDataValue extends ICommonDataValue {
|
|
|
16
16
|
borderWidth: string | number;
|
|
17
17
|
value: number;
|
|
18
18
|
backgroundColor?: string | string[];
|
|
19
|
-
borderColor?: string;
|
|
19
|
+
borderColor?: string | string[];
|
|
20
20
|
labels: string[];
|
|
21
21
|
}
|
|
22
22
|
export interface IPieChartDataset extends ICommonDataset {
|
|
@@ -30,11 +30,12 @@ export interface IPieData {
|
|
|
30
30
|
yUnit?: string;
|
|
31
31
|
}
|
|
32
32
|
export interface IPieChartData extends ICommonData {
|
|
33
|
-
data
|
|
33
|
+
data: IPieData;
|
|
34
34
|
options: IPieOptions;
|
|
35
35
|
}
|
|
36
36
|
export interface IPieChartProps {
|
|
37
37
|
chart: IPieChartData;
|
|
38
|
+
testId?: string | null;
|
|
38
39
|
}
|
|
39
40
|
export interface IPieGeneratedLabel {
|
|
40
41
|
text: string;
|
|
@@ -53,3 +54,10 @@ export interface IPiesDataLabelsOptions {
|
|
|
53
54
|
anchor?: 'center';
|
|
54
55
|
formatter?: (_value: any, context: any) => any;
|
|
55
56
|
}
|
|
57
|
+
export interface IGeneratedPieChartDataset {
|
|
58
|
+
label: string;
|
|
59
|
+
backgroundColor: string[];
|
|
60
|
+
borderColor: string[];
|
|
61
|
+
borderWidth: number;
|
|
62
|
+
data: IPieDataValue[];
|
|
63
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ActiveElement, Chart, Chart as ChartJS, ChartEvent, LegendItem, Plugin, TooltipItem } from 'chart.js';
|
|
2
|
+
import { IGeneratedPieChartDataset, IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
|
|
3
|
+
import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
|
|
4
|
+
import { UnusedParameter } from '../common/common.interface';
|
|
5
|
+
interface ILegendPlugin extends Plugin {
|
|
6
|
+
chart?: Chart;
|
|
7
|
+
}
|
|
8
|
+
export declare const usePieChartConfig: (chart: IPieChartDefaultProps) => {
|
|
9
|
+
generatedDatasets: IGeneratedPieChartDataset[] | {
|
|
10
|
+
borderWidth: number;
|
|
11
|
+
borderColor: string | string[];
|
|
12
|
+
backgroundColor: string | string[];
|
|
13
|
+
data: IPieDataValue[];
|
|
14
|
+
hideLegend?: boolean | undefined;
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
}[];
|
|
17
|
+
getTitle: () => {
|
|
18
|
+
display: boolean;
|
|
19
|
+
text: string | string[];
|
|
20
|
+
} | {
|
|
21
|
+
display?: undefined;
|
|
22
|
+
text?: undefined;
|
|
23
|
+
};
|
|
24
|
+
legendClick: (_: UnusedParameter, legendItem?: LegendItem, legend?: ILegendPlugin) => void;
|
|
25
|
+
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: ChartJS) => void;
|
|
26
|
+
onHover: (evt: ChartEvent, hoveredItems: ActiveElement[]) => void;
|
|
27
|
+
getDatalabels: () => IPiesDataLabelsOptions;
|
|
28
|
+
getLegend: () => object;
|
|
29
|
+
getToolTips: () => {
|
|
30
|
+
callbacks: {
|
|
31
|
+
title: (tooltipItem: TooltipItem<any>[]) => string;
|
|
32
|
+
label: (tooltipItem: TooltipItem<any>) => string;
|
|
33
|
+
};
|
|
34
|
+
padding: number;
|
|
35
|
+
boxWidth: number;
|
|
36
|
+
boxHeight: number;
|
|
37
|
+
boxPadding: number;
|
|
38
|
+
usePointStyle: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "3.8.0
|
|
3
|
+
"version": "3.8.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": {
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@fontsource/noto-sans": "^5.0.18",
|
|
46
45
|
"chart.js": "^4.2.1",
|
|
47
46
|
"chartjs-plugin-annotation": "^3.0.1",
|
|
48
47
|
"chartjs-plugin-datalabels": "^2.1.0",
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"react-use": "^17.4.0"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
|
-
"@oliasoft-open-source/react-ui-library": "
|
|
60
|
+
"@oliasoft-open-source/react-ui-library": "^3.15.1",
|
|
62
61
|
"@oliasoft-open-source/units": "^3.4.2",
|
|
63
62
|
"@storybook/addon-actions": "^7.0.18",
|
|
64
63
|
"@storybook/addon-docs": "^7.0.18",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LegendOptions: ({ legendEnabled, onToggleLegend, translations: { hideLegend, showLegend }, }: any) => import("react/jsx-runtime").JSX.Element;
|