@oliasoft-open-source/charts-library 6.0.0 → 7.0.0-beta-1
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.d.ts +1266 -15
- package/dist/index.js +327 -303
- package/package.json +21 -20
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -146
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -4
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -54
- package/dist/src/components/common/common.interface.d.ts +0 -273
- package/dist/src/components/common/controls-portal.d.ts +0 -7
- package/dist/src/components/common/enums.d.ts +0 -89
- package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -25
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
- package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
- package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
- package/dist/src/components/common/helpers/container.d.ts +0 -18
- package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
- package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
- package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +0 -28
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -139
- package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
- package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -6
- package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
- package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
- package/dist/src/components/common/helpers/input-normalizers.d.ts +0 -15
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
- package/dist/src/components/common/helpers/range/range.d.ts +0 -33
- package/dist/src/components/common/helpers/text.d.ts +0 -1
- package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
- package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
- package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
- package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -47
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
- package/dist/src/components/common/legend-component/legend.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
- package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -19
- package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
- package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
- package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -32
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.d.ts +0 -3
- package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -241
- package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -42
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
- package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +0 -39
- package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +0 -10
- package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +0 -109
- package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +0 -40
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
- package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
- package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
- package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -18
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
- package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
- package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
- package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -5
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -85
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -69
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -73
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -4
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -111
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -5
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
|
@@ -1,20 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returning boolean condition depends on label position and chart area
|
|
3
|
-
*/
|
|
4
|
-
export declare const getCondition: (x: number | null, y: number | null, left: number | null, right: number | null, bottom: number | null) => {
|
|
5
|
-
overLeftSide: boolean;
|
|
6
|
-
overRightSide: boolean;
|
|
7
|
-
overBottomSide: boolean;
|
|
8
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IAlignmentContext } from './datalabels-alignment.interface';
|
|
2
|
-
/**
|
|
3
|
-
* Safely extracts coordinates and chart area info for alignment
|
|
4
|
-
*/
|
|
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
|
-
};
|
package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AlignOptions } from '../../../common/enums';
|
|
2
|
-
import { IAlignmentContext } from './datalabels-alignment.interface.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Returning position depends on condition
|
|
5
|
-
*/
|
|
6
|
-
export declare const getPosition: () => (context: IAlignmentContext) => AlignOptions.End | AlignOptions.Start | AlignOptions.Right | AlignOptions.Left;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IState } from '../state/state.interfaces';
|
|
2
|
-
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
|
|
3
|
-
/**
|
|
4
|
-
* Generates line chart datasets based on the provided datasets, state, and options.
|
|
5
|
-
*/
|
|
6
|
-
export declare const generateLineChartDatasets: (datasets: Array<any>, state: IState, options: ILineChartOptions, { label }: {
|
|
7
|
-
label: string;
|
|
8
|
-
}) => TGeneratedLineChartDatasets;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getAnnotationsData(data: any[]): Object;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getAxesDataFromMetasets(generatedDatasets: any, scalesKeys: any, annotationsData: any): any;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Chart } from 'chart.js';
|
|
2
|
-
import { RefObject } from 'react';
|
|
3
|
-
import { ILineChartAxes } from '../line-chart.interface';
|
|
4
|
-
export declare const getAxesRangesFromChart: (chartRef: RefObject<Chart>, axes: ILineChartAxes) => {
|
|
5
|
-
unit?: string | import('../line-chart.interface').IUnitOptions | undefined;
|
|
6
|
-
id: string;
|
|
7
|
-
min: number;
|
|
8
|
-
max: number;
|
|
9
|
-
}[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Chart } from 'chart.js';
|
|
3
|
-
import { ICommonAnnotationsData } from '../../common/common.interface.ts';
|
|
4
|
-
export type TAxisType = 'x' | 'y' | 'x1' | 'y1';
|
|
5
|
-
interface IMinMax {
|
|
6
|
-
min: number;
|
|
7
|
-
max: number;
|
|
8
|
-
}
|
|
9
|
-
export declare const getAxisRangeByType: (chartRef: RefObject<Chart>, axesType: TAxisType, annotationsData: ICommonAnnotationsData[]) => IMinMax | null;
|
|
10
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TooltipItem } from 'chart.js';
|
|
2
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
-
import { UnusedParameter } from '../../common/common.interface';
|
|
4
|
-
/**
|
|
5
|
-
* adjusts the position of the label depends on chart area
|
|
6
|
-
*/
|
|
7
|
-
declare const getLineChartDataLabels: (options: ILineChartOptions) => {
|
|
8
|
-
display: string;
|
|
9
|
-
align: (context: import('./datalabels-alignment/datalabels-alignment.interface').IAlignmentContext) => import("../../common/enums").AlignOptions.End | import("../../common/enums").AlignOptions.Start | import("../../common/enums").AlignOptions.Right | import("../../common/enums").AlignOptions.Left;
|
|
10
|
-
formatter: (_: UnusedParameter, context: TooltipItem<any>) => any;
|
|
11
|
-
} | {
|
|
12
|
-
display: boolean;
|
|
13
|
-
align?: undefined;
|
|
14
|
-
formatter?: undefined;
|
|
15
|
-
};
|
|
16
|
-
export default getLineChartDataLabels;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IState } from '../state/state.interfaces';
|
|
2
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
-
import { ICommonScaleOptions } from '../../common/common.interface';
|
|
4
|
-
declare const getLineChartScales: (options: ILineChartOptions, state: IState) => Record<string, ICommonScaleOptions>;
|
|
5
|
-
export default getLineChartScales;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TooltipItem } from 'chart.js';
|
|
2
|
-
import { ChartHoverMode } from '../../common/enums';
|
|
3
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
4
|
-
export declare const getUnitsFromLabel: (label: string) => string;
|
|
5
|
-
declare const getLineChartToolTips: (options: ILineChartOptions) => {
|
|
6
|
-
enabled: boolean;
|
|
7
|
-
callbacks: {};
|
|
8
|
-
mode?: undefined;
|
|
9
|
-
intersect?: undefined;
|
|
10
|
-
padding?: undefined;
|
|
11
|
-
usePointStyle?: undefined;
|
|
12
|
-
boxWidth?: undefined;
|
|
13
|
-
boxHeight?: undefined;
|
|
14
|
-
boxPadding?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
enabled: boolean | undefined;
|
|
17
|
-
mode: ChartHoverMode;
|
|
18
|
-
intersect: boolean;
|
|
19
|
-
padding: number;
|
|
20
|
-
usePointStyle: boolean;
|
|
21
|
-
boxWidth: number;
|
|
22
|
-
boxHeight: number;
|
|
23
|
-
boxPadding: number;
|
|
24
|
-
callbacks: {
|
|
25
|
-
title: ((...args: unknown[]) => unknown) | ((tooltipItem: TooltipItem<any>[]) => string);
|
|
26
|
-
label: ((...args: unknown[]) => unknown) | ((tooltipItem: TooltipItem<any>) => string);
|
|
27
|
-
afterLabel: ((...args: unknown[]) => unknown) | ((tooltipItem: Record<string, any>) => string);
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default getLineChartToolTips;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TPrimitive } from '../../common/common.interface';
|
|
2
|
-
import { IState } from '../state/state.interfaces';
|
|
3
|
-
export declare const toNum: (value: string | number) => any;
|
|
4
|
-
export declare const isLessThanMax: (value: string | number, max: string | number) => boolean;
|
|
5
|
-
export declare const isGreaterThanMin: (value: string | number, min: string | number) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {'x'|'y'} axisType
|
|
9
|
-
* @param {number} [index] - axis index; optional, 0 by default
|
|
10
|
-
* @param {boolean} [hasMultiAxes] - optional, false by default
|
|
11
|
-
* @return {string} - e.g. x if chart has singular axes; x, x2 - in case of multiple axes
|
|
12
|
-
*/
|
|
13
|
-
export declare const generateAxisId: (axisType: string, index?: number, hasMultiAxes?: boolean) => string;
|
|
14
|
-
/**
|
|
15
|
-
Get axis type from a key string.
|
|
16
|
-
@param {string} string - The key string to extract from.
|
|
17
|
-
@returns {string} e.g. x1 => x
|
|
18
|
-
*/
|
|
19
|
-
export declare const getAxisTypeFromKey: (string: string) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Checks if a value is a primitive value (which includes strings, numbers, booleans, and null).
|
|
22
|
-
*/
|
|
23
|
-
export declare const isPrimitiveValue: (value: TPrimitive) => value is string | number | boolean | null;
|
|
24
|
-
export declare const getChartKey: (state: IState, languageKey: string) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { defaultTranslations } from '../../constants/default-translations';
|
|
2
|
-
/**
|
|
3
|
-
* Merges custom getTranslations with the default getTranslations.
|
|
4
|
-
* If a custom translation is provided for a key, it will override the default one.
|
|
5
|
-
* @param {object} translations - Custom getTranslations.
|
|
6
|
-
* @returns {object} - The resulting getTranslations object, containing both default and custom getTranslations.
|
|
7
|
-
*/
|
|
8
|
-
export declare const getTranslations: (translations?: Partial<Record<keyof typeof defaultTranslations, string>>) => {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ChartEvent } from 'chart.js';
|
|
2
|
-
import { ICommonTooltip } from '../common/common.interface';
|
|
3
|
-
import { AlignOptions, Position } from '../common/enums';
|
|
4
|
-
import { IPieChartDataset, IPieOptions } from './pie-chart.interface';
|
|
5
|
-
export interface IDefaultChartStyling {
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number | string;
|
|
8
|
-
maintainAspectRatio: boolean;
|
|
9
|
-
staticChartHeight: boolean;
|
|
10
|
-
performanceMode: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface IDefaultPieGraph {
|
|
13
|
-
showDataLabels: boolean;
|
|
14
|
-
stacked: boolean;
|
|
15
|
-
cutout: number | string;
|
|
16
|
-
}
|
|
17
|
-
interface IDefaultPieLegend {
|
|
18
|
-
display: boolean;
|
|
19
|
-
useDataset: boolean;
|
|
20
|
-
position: Position;
|
|
21
|
-
align: AlignOptions;
|
|
22
|
-
}
|
|
23
|
-
interface IDefaultChartOptions {
|
|
24
|
-
enableZoom: boolean;
|
|
25
|
-
enablePan: boolean;
|
|
26
|
-
}
|
|
27
|
-
interface IDefaultInteractions {
|
|
28
|
-
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
29
|
-
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: IPieChartDataset[]) => void;
|
|
30
|
-
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IPieChartDataset[]) => void;
|
|
31
|
-
}
|
|
32
|
-
interface IDefaultChartData {
|
|
33
|
-
labels: string[];
|
|
34
|
-
datasets: IPieChartDataset[];
|
|
35
|
-
}
|
|
36
|
-
interface IDefaultPieOptions extends IPieOptions {
|
|
37
|
-
title: string | string[];
|
|
38
|
-
chartStyling: IDefaultChartStyling;
|
|
39
|
-
tooltip: ICommonTooltip;
|
|
40
|
-
graph: IDefaultPieGraph;
|
|
41
|
-
legend: IDefaultPieLegend;
|
|
42
|
-
chartOptions: IDefaultChartOptions;
|
|
43
|
-
interactions: IDefaultInteractions;
|
|
44
|
-
}
|
|
45
|
-
export interface IPieChartDefaultProps {
|
|
46
|
-
testId: string | null;
|
|
47
|
-
data: IDefaultChartData;
|
|
48
|
-
options: IDefaultPieOptions;
|
|
49
|
-
}
|
|
50
|
-
export {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { DeepPartial, IChartDataLabelsOptions, IChartGeneratedLabel, IChartLegendItemFilter, ICommonChartOptions, ICommonData, ICommonDataValue, ICommonDataset, ICommonLegend, ICommonOptions, ICommonStyling, ICommonTooltip } from '../common/common.interface';
|
|
2
|
-
export interface IPieLegend extends ICommonLegend {
|
|
3
|
-
useDataset?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface IPieGraph {
|
|
6
|
-
showDataLabels?: boolean;
|
|
7
|
-
stacked?: boolean;
|
|
8
|
-
cutout?: number | string;
|
|
9
|
-
}
|
|
10
|
-
export interface IPieOptions extends ICommonOptions {
|
|
11
|
-
graph?: IPieGraph;
|
|
12
|
-
legend?: IPieLegend;
|
|
13
|
-
axes?: unknown;
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
|
-
export interface IPieDataValue extends ICommonDataValue {
|
|
17
|
-
label: string;
|
|
18
|
-
borderWidth: string | number;
|
|
19
|
-
value: number;
|
|
20
|
-
backgroundColor?: string | string[];
|
|
21
|
-
borderColor?: string;
|
|
22
|
-
labels: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface IPieChartDataset extends ICommonDataset {
|
|
25
|
-
data: IPieDataValue[];
|
|
26
|
-
hideLegend?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface IPieData {
|
|
29
|
-
labels?: string[];
|
|
30
|
-
datasets?: IPieChartDataset[];
|
|
31
|
-
xUnit?: string;
|
|
32
|
-
yUnit?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IPieChartData extends ICommonData {
|
|
35
|
-
data: IPieData;
|
|
36
|
-
options: IPieOptions;
|
|
37
|
-
}
|
|
38
|
-
export type IPieOptionsInput = Omit<DeepPartial<IPieOptions>, 'title' | 'graph' | 'legend' | 'chartStyling' | 'tooltip' | 'chartOptions' | 'interactions'> & {
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
title?: unknown;
|
|
41
|
-
graph?: DeepPartial<IPieGraph>;
|
|
42
|
-
legend?: Omit<DeepPartial<IPieLegend>, 'position' | 'align'> & {
|
|
43
|
-
position?: string;
|
|
44
|
-
align?: string;
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
};
|
|
47
|
-
chartStyling?: DeepPartial<ICommonStyling> & {
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
};
|
|
50
|
-
tooltip?: DeepPartial<ICommonTooltip>;
|
|
51
|
-
chartOptions?: DeepPartial<ICommonChartOptions>;
|
|
52
|
-
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
53
|
-
[key: string]: unknown;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export interface IPieChartDataInput extends Omit<IPieChartData, 'data' | 'options'> {
|
|
57
|
-
data?: Omit<DeepPartial<IPieChartData['data']>, 'datasets'> & {
|
|
58
|
-
datasets?: Array<(Omit<DeepPartial<IPieChartDataset>, 'data'> & {
|
|
59
|
-
data?: Array<DeepPartial<IPieDataValue> | number>;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}) | object | null>;
|
|
62
|
-
};
|
|
63
|
-
options?: IPieOptionsInput;
|
|
64
|
-
}
|
|
65
|
-
export interface IPieChartProps {
|
|
66
|
-
chart: IPieChartDataInput;
|
|
67
|
-
testId?: string | null;
|
|
68
|
-
}
|
|
69
|
-
export type IPieGeneratedLabel = IChartGeneratedLabel;
|
|
70
|
-
export type IPieLegendItemFilter = IChartLegendItemFilter;
|
|
71
|
-
export type IPiesDataLabelsOptions = IChartDataLabelsOptions;
|
|
72
|
-
export interface IGeneratedPieChartDataset {
|
|
73
|
-
label: string;
|
|
74
|
-
backgroundColor: string[];
|
|
75
|
-
borderColor: string;
|
|
76
|
-
borderWidth: number;
|
|
77
|
-
borderDash: number[];
|
|
78
|
-
annotationType?: string;
|
|
79
|
-
data: IPieDataValue[];
|
|
80
|
-
hideLegend?: boolean;
|
|
81
|
-
displayGroup?: string | number;
|
|
82
|
-
isAnnotation?: boolean;
|
|
83
|
-
annotationIndex?: number;
|
|
84
|
-
}
|
|
85
|
-
export type TGeneratedPieChartDatasets = IGeneratedPieChartDataset[];
|
|
@@ -1,42 +0,0 @@
|
|
|
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;
|
|
12
|
-
backgroundColor: string | string[];
|
|
13
|
-
data: IPieDataValue[];
|
|
14
|
-
hideLegend?: boolean;
|
|
15
|
-
label?: string;
|
|
16
|
-
hidden?: boolean;
|
|
17
|
-
}[];
|
|
18
|
-
getTitle: () => {
|
|
19
|
-
display: boolean;
|
|
20
|
-
text: string | string[];
|
|
21
|
-
} | {
|
|
22
|
-
display?: undefined;
|
|
23
|
-
text?: undefined;
|
|
24
|
-
};
|
|
25
|
-
legendClick: (_: UnusedParameter, legendItem?: LegendItem, legend?: ILegendPlugin) => void;
|
|
26
|
-
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: ChartJS) => void;
|
|
27
|
-
onHover: (evt: ChartEvent, hoveredItems: ActiveElement[]) => void;
|
|
28
|
-
getDatalabels: () => IPiesDataLabelsOptions;
|
|
29
|
-
getLegend: () => object;
|
|
30
|
-
getToolTips: () => {
|
|
31
|
-
callbacks: {
|
|
32
|
-
title: (tooltipItem: TooltipItem<any>[]) => string;
|
|
33
|
-
label: (tooltipItem: TooltipItem<any>) => string;
|
|
34
|
-
};
|
|
35
|
-
padding: number;
|
|
36
|
-
boxWidth: number;
|
|
37
|
-
boxHeight: number;
|
|
38
|
-
boxPadding: number;
|
|
39
|
-
usePointStyle: boolean;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ActiveElement, AnimationSpec, Chart, ChartEvent } from 'chart.js';
|
|
2
|
-
import { IScatterChartDefaultProps } from '../scatter-chart-default-props.interface';
|
|
3
|
-
import { MutableRefObject } from 'react';
|
|
4
|
-
import { ICommonHoveredItems } from '../../common/common.interface';
|
|
5
|
-
import { TGeneratedScatterChartDatasets } from '../scatter-chart.interface';
|
|
6
|
-
export declare const useScatterChartConfig: (chart: IScatterChartDefaultProps, chartRef: MutableRefObject<Chart | null>) => {
|
|
7
|
-
generatedDatasets: TGeneratedScatterChartDatasets;
|
|
8
|
-
scatterOptions: {
|
|
9
|
-
interactions: {
|
|
10
|
-
onLegendClick: (_: import('../../common/common.interface').UnusedParameter, legendItem: import('chart.js').LegendItem) => void;
|
|
11
|
-
onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
12
|
-
};
|
|
13
|
-
scales: {
|
|
14
|
-
x: import('../../common/common.interface').ICommonScaleOptions;
|
|
15
|
-
y: import('../../common/common.interface').ICommonScaleOptions;
|
|
16
|
-
};
|
|
17
|
-
animation: Partial<AnimationSpec<"scatter">>;
|
|
18
|
-
plugins: {
|
|
19
|
-
legend: {
|
|
20
|
-
display: boolean;
|
|
21
|
-
events: never[];
|
|
22
|
-
position: any;
|
|
23
|
-
align: "center" | "start" | "end";
|
|
24
|
-
labels: {
|
|
25
|
-
boxHeight: number;
|
|
26
|
-
boxWidth: number | undefined;
|
|
27
|
-
usePointStyle: boolean | undefined;
|
|
28
|
-
};
|
|
29
|
-
onClick: (_: import('../../common/common.interface').UnusedParameter, legendItem: import('chart.js').LegendItem) => void;
|
|
30
|
-
};
|
|
31
|
-
customLegendPlugin: {
|
|
32
|
-
htmlLegend: any;
|
|
33
|
-
};
|
|
34
|
-
title: {
|
|
35
|
-
display: boolean;
|
|
36
|
-
text: string | string[];
|
|
37
|
-
} | {
|
|
38
|
-
display?: undefined;
|
|
39
|
-
text?: undefined;
|
|
40
|
-
};
|
|
41
|
-
annotation: {
|
|
42
|
-
annotations: {};
|
|
43
|
-
};
|
|
44
|
-
chartAreaBorder: {
|
|
45
|
-
borderColor: string;
|
|
46
|
-
};
|
|
47
|
-
datalabels: {
|
|
48
|
-
display: boolean;
|
|
49
|
-
};
|
|
50
|
-
tooltip: {
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
callbacks: {
|
|
53
|
-
title: (tooltipItems: import('chart.js').TooltipItem<"scatter">[]) => string | undefined;
|
|
54
|
-
label: (tooltipItems: import('../utils/get-tooltip-config').IScatterTooltipItem) => string;
|
|
55
|
-
};
|
|
56
|
-
backgroundColor: string;
|
|
57
|
-
displayColors: boolean;
|
|
58
|
-
padding: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
width?: number | string;
|
|
62
|
-
height?: number | string;
|
|
63
|
-
maintainAspectRatio: boolean;
|
|
64
|
-
staticChartHeight: boolean;
|
|
65
|
-
performanceMode: boolean;
|
|
66
|
-
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: Chart) => void;
|
|
67
|
-
onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ChartEvent } from 'chart.js';
|
|
2
|
-
import { ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonCustomLegend, ICommonLegend, ICommonScales } from '../common/common.interface';
|
|
3
|
-
import { ChartDirection } from '../common/enums';
|
|
4
|
-
import { IScatterAxes, IScatterChartDataset } from './scatter-chart.interface';
|
|
5
|
-
export interface IDefaultChartStyling {
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number | string;
|
|
8
|
-
maintainAspectRatio: boolean;
|
|
9
|
-
staticChartHeight: boolean;
|
|
10
|
-
performanceMode: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface IDefaultTooltip {
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
tooltips: boolean;
|
|
15
|
-
showLabelsInTooltips: boolean;
|
|
16
|
-
backgroundColor: string;
|
|
17
|
-
displayColors: boolean;
|
|
18
|
-
scientificNotation: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface IDefaultScatterGraph {
|
|
21
|
-
showMinorGridlines: boolean;
|
|
22
|
-
showDataLabels: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface IDefaultScatterLegend extends ICommonLegend {
|
|
25
|
-
customLegend?: ICommonCustomLegend<any>;
|
|
26
|
-
}
|
|
27
|
-
interface IDefaultChartOptions {
|
|
28
|
-
enableZoom: boolean;
|
|
29
|
-
enablePan: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface IDefaultInteractions {
|
|
32
|
-
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
33
|
-
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: IScatterChartDataset[]) => void;
|
|
34
|
-
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IScatterChartDataset[]) => void;
|
|
35
|
-
onAnimationComplete?: () => void;
|
|
36
|
-
}
|
|
37
|
-
interface IDefaultChartData {
|
|
38
|
-
labels: string[];
|
|
39
|
-
datasets: IScatterChartDataset[];
|
|
40
|
-
}
|
|
41
|
-
export interface IDefaultScatterOptions {
|
|
42
|
-
title: string | string[];
|
|
43
|
-
chartStyling: IDefaultChartStyling;
|
|
44
|
-
tooltip: IDefaultTooltip;
|
|
45
|
-
graph: IDefaultScatterGraph;
|
|
46
|
-
axes: IScatterAxes;
|
|
47
|
-
scales?: ICommonScales;
|
|
48
|
-
additionalAxesOptions: ICommonAdditionalAxesOptions;
|
|
49
|
-
legend: IDefaultScatterLegend;
|
|
50
|
-
chartOptions: IDefaultChartOptions;
|
|
51
|
-
interactions: IDefaultInteractions;
|
|
52
|
-
annotations?: ICommonAnnotations;
|
|
53
|
-
direction: ChartDirection;
|
|
54
|
-
}
|
|
55
|
-
export interface IScatterChartDefaultProps {
|
|
56
|
-
testId: string | null;
|
|
57
|
-
data: IDefaultChartData;
|
|
58
|
-
options: {
|
|
59
|
-
title: string | string[];
|
|
60
|
-
chartStyling: IDefaultChartStyling;
|
|
61
|
-
tooltip: IDefaultTooltip;
|
|
62
|
-
graph: IDefaultScatterGraph;
|
|
63
|
-
axes: IScatterAxes;
|
|
64
|
-
scales?: ICommonScales;
|
|
65
|
-
additionalAxesOptions: ICommonAdditionalAxesOptions;
|
|
66
|
-
legend: IDefaultScatterLegend;
|
|
67
|
-
chartOptions: IDefaultChartOptions;
|
|
68
|
-
interactions: IDefaultInteractions;
|
|
69
|
-
annotations?: ICommonAnnotations;
|
|
70
|
-
direction: ChartDirection;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IScatterChartDefaultProps } from './scatter-chart-default-props.interface';
|
|
2
|
-
import { IScatterChartProps, IScatterOptionsInput } from './scatter-chart.interface';
|
|
3
|
-
export declare const normalizeScatterOptions: (options?: IScatterOptionsInput) => IScatterChartDefaultProps["options"];
|
|
4
|
-
export declare const getDefaultProps: (props: IScatterChartProps) => IScatterChartDefaultProps;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { DeepPartial, IChartDataLabelsOptions, IChartGeneratedLabel, IChartLegendItemFilter, ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonAnnotationsData, ICommonAxis, ICommonData, ICommonDataValue, ICommonDataset, ICommonLegend, ICommonOptions, ICommonScales } from '../common/common.interface';
|
|
2
|
-
import { ChartDirection } from '../common/enums.ts';
|
|
3
|
-
export interface IScatterLegend extends ICommonLegend {
|
|
4
|
-
useDataset?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface IScatterGraph {
|
|
7
|
-
showMinorGridlines?: boolean;
|
|
8
|
-
showDataLabels?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface IScatterTooltip {
|
|
11
|
-
enabled?: boolean;
|
|
12
|
-
tooltips?: boolean;
|
|
13
|
-
showLabelsInTooltips: boolean;
|
|
14
|
-
backgroundColor?: string;
|
|
15
|
-
displayColors?: boolean;
|
|
16
|
-
scientificNotation?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface IScatterAxes {
|
|
19
|
-
x: ICommonAxis<'top' | 'bottom'>[];
|
|
20
|
-
y: ICommonAxis<'left' | 'right'>[];
|
|
21
|
-
[key: string]: ICommonAxis[];
|
|
22
|
-
}
|
|
23
|
-
export interface IScatterOptions extends ICommonOptions {
|
|
24
|
-
graph?: IScatterGraph;
|
|
25
|
-
legend?: IScatterLegend;
|
|
26
|
-
axes?: IScatterAxes;
|
|
27
|
-
scales?: ICommonScales;
|
|
28
|
-
additionalAxesOptions?: ICommonAdditionalAxesOptions;
|
|
29
|
-
direction?: ChartDirection;
|
|
30
|
-
}
|
|
31
|
-
export interface IScatterDataValue extends ICommonDataValue {
|
|
32
|
-
label?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IScatterChartDataset extends ICommonDataset {
|
|
35
|
-
data: IScatterDataValue[];
|
|
36
|
-
hideLegend?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface IScatterData {
|
|
39
|
-
labels?: string[];
|
|
40
|
-
datasets?: IScatterChartDataset[];
|
|
41
|
-
xUnit?: string;
|
|
42
|
-
yUnit?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface IScatterChartData extends ICommonData {
|
|
45
|
-
data: IScatterData;
|
|
46
|
-
options: IScatterOptions;
|
|
47
|
-
}
|
|
48
|
-
type ILooseScatterAxis = DeepPartial<ICommonAxis<string>> & {
|
|
49
|
-
[key: string]: unknown;
|
|
50
|
-
};
|
|
51
|
-
type ILooseScatterAnnotation = Omit<DeepPartial<ICommonAnnotationsData>, 'annotationAxis'> & {
|
|
52
|
-
[key: string]: unknown;
|
|
53
|
-
annotationAxis?: string;
|
|
54
|
-
type?: string;
|
|
55
|
-
value?: number | string | null;
|
|
56
|
-
};
|
|
57
|
-
export type IScatterOptionsInput = Omit<DeepPartial<IScatterOptions>, 'title' | 'direction' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'annotations' | 'scales'> & {
|
|
58
|
-
[key: string]: unknown;
|
|
59
|
-
title?: unknown;
|
|
60
|
-
direction?: string;
|
|
61
|
-
axes?: {
|
|
62
|
-
x?: ILooseScatterAxis[];
|
|
63
|
-
y?: ILooseScatterAxis[];
|
|
64
|
-
[key: string]: ILooseScatterAxis[] | undefined;
|
|
65
|
-
};
|
|
66
|
-
scales?: Record<string, unknown>;
|
|
67
|
-
legend?: Omit<DeepPartial<IScatterLegend>, 'position' | 'align'> & {
|
|
68
|
-
position?: string;
|
|
69
|
-
align?: string;
|
|
70
|
-
[key: string]: unknown;
|
|
71
|
-
};
|
|
72
|
-
chartStyling?: {
|
|
73
|
-
[key: string]: unknown;
|
|
74
|
-
};
|
|
75
|
-
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
76
|
-
enableZoom?: boolean;
|
|
77
|
-
enablePan?: boolean;
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
};
|
|
80
|
-
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
81
|
-
annotationsData?: ILooseScatterAnnotation[];
|
|
82
|
-
}) | null;
|
|
83
|
-
};
|
|
84
|
-
export interface IScatterChartDataInput extends Omit<IScatterChartData, 'data' | 'options'> {
|
|
85
|
-
data?: Omit<DeepPartial<IScatterChartData['data']>, 'datasets'> & {
|
|
86
|
-
datasets?: Array<DeepPartial<IScatterChartDataset> | object | null>;
|
|
87
|
-
};
|
|
88
|
-
options?: IScatterOptionsInput;
|
|
89
|
-
}
|
|
90
|
-
export interface IScatterChartProps {
|
|
91
|
-
chart: IScatterChartDataInput;
|
|
92
|
-
testId?: string | null;
|
|
93
|
-
}
|
|
94
|
-
export type IScatterGeneratedLabel = IChartGeneratedLabel;
|
|
95
|
-
export type IScatterLegendItemFilter = IChartLegendItemFilter;
|
|
96
|
-
export type IScatterDataLabelsOptions = IChartDataLabelsOptions;
|
|
97
|
-
export interface IGeneratedScatterChartDataset {
|
|
98
|
-
label: string;
|
|
99
|
-
backgroundColor: string[];
|
|
100
|
-
borderColor: string;
|
|
101
|
-
borderWidth: number;
|
|
102
|
-
borderDash: number[];
|
|
103
|
-
annotationType?: string;
|
|
104
|
-
data: IScatterDataValue[];
|
|
105
|
-
hideLegend?: boolean;
|
|
106
|
-
displayGroup?: string | number;
|
|
107
|
-
isAnnotation?: boolean;
|
|
108
|
-
annotationIndex?: number;
|
|
109
|
-
}
|
|
110
|
-
export type TGeneratedScatterChartDatasets = IGeneratedScatterChartDataset[];
|
|
111
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IDefaultScatterOptions } from '../scatter-chart-default-props.interface';
|
|
2
|
-
export declare const getScatterChartScales: (options: IDefaultScatterOptions) => {
|
|
3
|
-
x: import('../../common/common.interface').ICommonScaleOptions;
|
|
4
|
-
y: import('../../common/common.interface').ICommonScaleOptions;
|
|
5
|
-
};
|