@oliasoft-open-source/charts-library 6.1.0 → 7.0.0-beta-2
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 +33 -21
- package/package.json +12 -11
- 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,57 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Chart } from 'chart.js';
|
|
3
|
-
import { IUnitOptions } from '../../line-chart.interface';
|
|
4
|
-
import { IAxisState, IState } from '../../state/state.interfaces';
|
|
5
|
-
export interface IDepthType {
|
|
6
|
-
selectedDepthType?: string;
|
|
7
|
-
setSelectedDepthType?: (type: string) => void;
|
|
8
|
-
options?: Array<string>;
|
|
9
|
-
}
|
|
10
|
-
export interface IAxisControlLabel {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}
|
|
14
|
-
export interface IAxesOptions {
|
|
15
|
-
chartRef: RefObject<Chart>;
|
|
16
|
-
state: IState;
|
|
17
|
-
controlsAxesLabels: IAxisControlLabel[];
|
|
18
|
-
onUpdateAxes: ({ axes }: {
|
|
19
|
-
axes: IAxisState;
|
|
20
|
-
}) => void;
|
|
21
|
-
onResetAxes: () => void;
|
|
22
|
-
onUpdateEdited: (edited: boolean) => void;
|
|
23
|
-
depthType?: IDepthType | object;
|
|
24
|
-
close?: () => void;
|
|
25
|
-
}
|
|
26
|
-
export interface IOnEdit {
|
|
27
|
-
name?: string;
|
|
28
|
-
value?: string;
|
|
29
|
-
id?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface IAxisFormState {
|
|
32
|
-
id: string;
|
|
33
|
-
min: number | string;
|
|
34
|
-
max: number | string;
|
|
35
|
-
unit?: string | IUnitOptions;
|
|
36
|
-
}
|
|
37
|
-
export type IInitializeAxisFormState = IAxisFormState[];
|
|
38
|
-
export interface IError {
|
|
39
|
-
id: string;
|
|
40
|
-
min: string[];
|
|
41
|
-
max: string[];
|
|
42
|
-
}
|
|
43
|
-
export interface IFormState extends IInitializeAxisFormState {
|
|
44
|
-
errors?: IError[];
|
|
45
|
-
valid?: boolean;
|
|
46
|
-
}
|
|
47
|
-
type ActionType = 'reset' | 'valueUpdated' | 'unitUpdated';
|
|
48
|
-
export type AxisKey = 'min' | 'max' | 'unit';
|
|
49
|
-
interface ActionPayload extends IOnEdit {
|
|
50
|
-
axes?: IAxisState[];
|
|
51
|
-
chartRef?: RefObject<Chart>;
|
|
52
|
-
}
|
|
53
|
-
export interface IAction {
|
|
54
|
-
type: ActionType;
|
|
55
|
-
payload: ActionPayload;
|
|
56
|
-
}
|
|
57
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IAxesOptions } from './axes-options-interfaces';
|
|
2
|
-
interface IAxesOptionsWithTranslations extends IAxesOptions {
|
|
3
|
-
translations: Record<string, string>;
|
|
4
|
-
}
|
|
5
|
-
export declare const AxesOptions: (optionsPopover: IAxesOptionsWithTranslations) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Dispatch, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { Chart } from 'chart.js';
|
|
3
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
4
|
-
import { IState } from '../state/state.interfaces';
|
|
5
|
-
export interface IControls {
|
|
6
|
-
headerComponent?: ReactNode;
|
|
7
|
-
subheaderComponent?: ReactNode;
|
|
8
|
-
table?: ReactNode;
|
|
9
|
-
chartRef: RefObject<Chart>;
|
|
10
|
-
state: IState;
|
|
11
|
-
options: ILineChartOptions;
|
|
12
|
-
dispatch: Dispatch<any>;
|
|
13
|
-
translations: Record<string, string>;
|
|
14
|
-
controlsPortalId?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface AxisControls {
|
|
17
|
-
id?: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IControls } from './controls-interfaces';
|
|
2
|
-
declare const Controls: ({ table, headerComponent, subheaderComponent, chartRef, state, options, dispatch, translations, controlsPortalId, }: IControls) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default Controls;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface IDragOptions {
|
|
2
|
-
onTogglePan: () => void;
|
|
3
|
-
onToggleZoom: () => void;
|
|
4
|
-
panEnabled: boolean;
|
|
5
|
-
zoomEnabled: boolean;
|
|
6
|
-
enableDragPoints?: boolean;
|
|
7
|
-
enableDragAnnotation?: boolean;
|
|
8
|
-
isDragDataAllowed?: boolean;
|
|
9
|
-
isDragAnnotationAllowed?: boolean;
|
|
10
|
-
onToggleDragAnnotation: () => void;
|
|
11
|
-
onToggleDragPoints: () => void;
|
|
12
|
-
onDisableDragOptions: () => void;
|
|
13
|
-
translations: Record<string, string>;
|
|
14
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IMenuSection } from '@oliasoft-open-source/react-ui-library';
|
|
2
|
-
import { IDragOptions } from './drag-options-interfaces';
|
|
3
|
-
export declare function getDragOptions({ onTogglePan, onToggleZoom, panEnabled, zoomEnabled, enableDragPoints, enableDragAnnotation, isDragDataAllowed, isDragAnnotationAllowed, onToggleDragAnnotation, onToggleDragPoints, onDisableDragOptions, translations: { dragToZoom, doubleClickToReset, dragToPan, dragToMovePoints, dragDisabled, dragToMoveAnnotation }, }: IDragOptions): ({
|
|
4
|
-
label: string;
|
|
5
|
-
description: string;
|
|
6
|
-
icon: import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
selected: boolean;
|
|
8
|
-
type: string;
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
} | {
|
|
11
|
-
label: string;
|
|
12
|
-
icon: import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
selected: boolean | undefined;
|
|
14
|
-
type: string;
|
|
15
|
-
onClick: () => void;
|
|
16
|
-
description?: undefined;
|
|
17
|
-
})[];
|
|
18
|
-
/**
|
|
19
|
-
* @param {import('./drag-options-interfaces').IDragOptions} obj
|
|
20
|
-
*/
|
|
21
|
-
export declare const DragOptions: ({ options }: {
|
|
22
|
-
options: IMenuSection[];
|
|
23
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IMenuSection } from '@oliasoft-open-source/react-ui-library';
|
|
2
|
-
interface ILineOptions {
|
|
3
|
-
lineEnabled: boolean;
|
|
4
|
-
onToggleLine: () => void;
|
|
5
|
-
onTogglePoints: () => void;
|
|
6
|
-
pointsEnabled: boolean;
|
|
7
|
-
translations: Record<string, string>;
|
|
8
|
-
}
|
|
9
|
-
export declare function getLineOptions({ lineEnabled, onToggleLine, onTogglePoints, pointsEnabled, translations, }: ILineOptions): {
|
|
10
|
-
type: string;
|
|
11
|
-
label: string;
|
|
12
|
-
icon: import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
selected: boolean;
|
|
14
|
-
onClick: () => void;
|
|
15
|
-
}[];
|
|
16
|
-
export declare const LineOptions: ({ options }: {
|
|
17
|
-
options: IMenuSection[];
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Dispatch, KeyboardEvent, RefObject, SetStateAction } from 'react';
|
|
2
|
-
import { Chart, ChartEvent } from 'chart.js';
|
|
3
|
-
import { ICommonDataValue, ICommonHoveredItems } from '../../common/common.interface';
|
|
4
|
-
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
|
|
5
|
-
import { IAxisState, IState } from '../state/state.interfaces';
|
|
6
|
-
interface IUseChartFunctions {
|
|
7
|
-
chartRef: RefObject<Chart>;
|
|
8
|
-
state: IState;
|
|
9
|
-
options: ILineChartOptions;
|
|
10
|
-
dispatch: Dispatch<any>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Custom hook that encapsulates the chart-related functions and their dependencies
|
|
14
|
-
*/
|
|
15
|
-
export declare const useChartFunctions: ({ chartRef, state, options, dispatch }: IUseChartFunctions) => {
|
|
16
|
-
resetZoom: () => void;
|
|
17
|
-
onHover: (hoveredPoint: ICommonDataValue | null, setHoveredPoint: Dispatch<SetStateAction<ICommonDataValue | null>>, datasets: TGeneratedLineChartDatasets) => (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
18
|
-
handleDownload: () => void;
|
|
19
|
-
handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
20
|
-
handleKeyUp: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
21
|
-
controlsAxesLabels: {
|
|
22
|
-
id: string;
|
|
23
|
-
label: string;
|
|
24
|
-
}[];
|
|
25
|
-
updateAxesRangesFromChart: () => void;
|
|
26
|
-
onResetAxes: () => void;
|
|
27
|
-
onUpdateAxes: ({ axes }: {
|
|
28
|
-
axes: IAxisState;
|
|
29
|
-
}) => void;
|
|
30
|
-
onUpdateEdited: (edited: boolean) => void;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Dispatch, RefObject } from 'react';
|
|
2
|
-
import { Chart, ChartOptions } from 'chart.js';
|
|
3
|
-
import { IState } from '../state/state.interfaces';
|
|
4
|
-
import { ILineChartOptions, TGeneratedLineChartDatasets } from '../line-chart.interface';
|
|
5
|
-
interface IUseChartOptions {
|
|
6
|
-
chartRef: RefObject<Chart>;
|
|
7
|
-
state: IState;
|
|
8
|
-
options: ILineChartOptions;
|
|
9
|
-
dispatch: Dispatch<any>;
|
|
10
|
-
generatedDatasets: TGeneratedLineChartDatasets;
|
|
11
|
-
persistenceId?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Custom hook to generate chart options.
|
|
15
|
-
*/
|
|
16
|
-
export declare const useChartOptions: ({ chartRef, state, options, dispatch, generatedDatasets, persistenceId, }: IUseChartOptions) => ChartOptions<"line"> & {
|
|
17
|
-
persistenceId?: string;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IState } from '../state/state.interfaces';
|
|
2
|
-
import { ILineChartOptions } from '../line-chart.interface';
|
|
3
|
-
interface IUseChartState {
|
|
4
|
-
options: ILineChartOptions;
|
|
5
|
-
state: IState;
|
|
6
|
-
persistenceId?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Hook for managing the state of the chart.
|
|
10
|
-
*/
|
|
11
|
-
export declare const useChartState: ({ options, state, persistenceId }: IUseChartState) => void;
|
|
12
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
export declare const useToggleHandlers: (dispatch: Dispatch<any>) => {
|
|
3
|
-
onToggleLegend: () => void;
|
|
4
|
-
onToggleLine: () => void;
|
|
5
|
-
onTogglePan: () => void;
|
|
6
|
-
onTogglePoints: () => void;
|
|
7
|
-
onToggleTable: () => void;
|
|
8
|
-
onToggleZoom: () => void;
|
|
9
|
-
onToggleDragPoints: () => void;
|
|
10
|
-
onToggleDragAnnotation: () => void;
|
|
11
|
-
onDisableDragOptions: () => void;
|
|
12
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieve the value for the given key from the config object.
|
|
3
|
-
* @param {string} key - The key to access the corresponding value in the config object.
|
|
4
|
-
* @returns {*} - The value associated with the given key in the config object or config.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getConfig: (key?: string) => any;
|
|
7
|
-
/**
|
|
8
|
-
* Set a new value for the given key in the config object.
|
|
9
|
-
* @param {string} key - The key to access the corresponding value in the config object.
|
|
10
|
-
* @param {*} newValue - The new value to be set for the given key.
|
|
11
|
-
*/
|
|
12
|
-
export declare const setConfig: (key: string, newValue: string | Record<string, string>) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Initialize the charts library with the provided configurations.
|
|
3
|
-
* This function will store the configuration options in a config object.
|
|
4
|
-
* @param {object} options - An object containing the configuration options for the library.
|
|
5
|
-
* @param {object} options.translations - The translations to be used in the library.
|
|
6
|
-
* @param {string} options.languageKey - The language key to be stored in the config object, used for translations.
|
|
7
|
-
* @param {...object} options - Any additional options to be stored in the config object.
|
|
8
|
-
*/
|
|
9
|
-
export declare const initializeLineChart: ({ languageKey, ...options }: {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
languageKey?: string | undefined;
|
|
12
|
-
}) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ILineChartData, ILineChartOptionsInput, ILineChartProps } from './line-chart.interface';
|
|
2
|
-
export declare const normalizeLineChartOptions: (options?: ILineChartOptionsInput) => ILineChartData["options"];
|
|
3
|
-
export declare const getDefaultProps: (props: ILineChartProps) => ILineChartData;
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DeepPartial, ICommonAnnotations, ICommonChartOptions, ICommonCustomLegend, ICommonData, ICommonDataset, ICommonDataValue, ICommonDragData, ICommonInteractions, ICommonLegend, ICommonOptions, ICommonScales, ICommonStyling, ICommonTooltip, TAxisPosition } from '../common/common.interface';
|
|
3
|
-
export interface ILChartOptions extends ICommonChartOptions {
|
|
4
|
-
showPoints?: boolean;
|
|
5
|
-
closeOnOutsideClick?: boolean;
|
|
6
|
-
showLine?: boolean;
|
|
7
|
-
enableZoom?: boolean;
|
|
8
|
-
enablePan?: boolean;
|
|
9
|
-
enableDragAnnotation?: boolean;
|
|
10
|
-
enableDragPoints?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ILineChartGraph {
|
|
13
|
-
lineTension?: number;
|
|
14
|
-
spanGaps?: boolean;
|
|
15
|
-
showDataLabels?: boolean;
|
|
16
|
-
showMinorGridlines?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface ILineChartTooltip extends ICommonTooltip {
|
|
19
|
-
hideSimulationName?: boolean;
|
|
20
|
-
scientificNotation?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ILineChartRange {
|
|
23
|
-
min?: number | string;
|
|
24
|
-
max?: number | string;
|
|
25
|
-
}
|
|
26
|
-
export interface ILineRange {
|
|
27
|
-
[key: string]: ILineChartRange;
|
|
28
|
-
}
|
|
29
|
-
export interface ILineChartAdditionalAxesOptions {
|
|
30
|
-
chartScaleType?: 'linear' | 'logarithmic' | 'time' | 'timeseries';
|
|
31
|
-
reverse?: boolean;
|
|
32
|
-
beginAtZero?: boolean;
|
|
33
|
-
stepSize?: number;
|
|
34
|
-
suggestedMin?: number;
|
|
35
|
-
suggestedMax?: number;
|
|
36
|
-
range?: ILineRange;
|
|
37
|
-
autoAxisPadding?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface IUnitOptions {
|
|
40
|
-
options: string[];
|
|
41
|
-
selectedUnit: string;
|
|
42
|
-
setSelectedUnit: (value: string) => void;
|
|
43
|
-
}
|
|
44
|
-
export interface ILineChartAxis<PositionType = TAxisPosition> {
|
|
45
|
-
id?: string;
|
|
46
|
-
label?: string;
|
|
47
|
-
position?: PositionType;
|
|
48
|
-
color?: string | string[];
|
|
49
|
-
unit?: IUnitOptions | string;
|
|
50
|
-
stepSize?: number;
|
|
51
|
-
gridLines?: ILineChartGraph;
|
|
52
|
-
min?: number | string;
|
|
53
|
-
max?: number | string;
|
|
54
|
-
}
|
|
55
|
-
export interface ILineChartAxes {
|
|
56
|
-
x: ILineChartAxis<'top' | 'bottom'>[];
|
|
57
|
-
y: ILineChartAxis<'left' | 'right'>[];
|
|
58
|
-
[key: string]: ILineChartAxis[];
|
|
59
|
-
}
|
|
60
|
-
export interface IDepthType {
|
|
61
|
-
options: string[];
|
|
62
|
-
selectedUnit: string;
|
|
63
|
-
setSelectedUnit: (value: string) => void;
|
|
64
|
-
}
|
|
65
|
-
export interface ILineChartStyling extends ICommonStyling {
|
|
66
|
-
squareAspectRatio?: number | boolean;
|
|
67
|
-
layoutPadding?: number | {
|
|
68
|
-
top: number;
|
|
69
|
-
bottom: number;
|
|
70
|
-
left: number;
|
|
71
|
-
right: number;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export interface ILineInteractions extends ICommonInteractions {
|
|
75
|
-
onAnimationComplete?: () => void;
|
|
76
|
-
}
|
|
77
|
-
export interface ILineLegend extends ICommonLegend {
|
|
78
|
-
customLegend?: ICommonCustomLegend<any>;
|
|
79
|
-
usePointStyle?: boolean;
|
|
80
|
-
}
|
|
81
|
-
export interface ILineChartOptions extends ICommonOptions {
|
|
82
|
-
title?: string | string[];
|
|
83
|
-
axes: ILineChartAxes;
|
|
84
|
-
scales: ICommonScales;
|
|
85
|
-
additionalAxesOptions: ILineChartAdditionalAxesOptions;
|
|
86
|
-
chartStyling: ILineChartStyling;
|
|
87
|
-
tooltip: ILineChartTooltip;
|
|
88
|
-
graph: ILineChartGraph;
|
|
89
|
-
annotations: ICommonAnnotations;
|
|
90
|
-
legend: ILineLegend;
|
|
91
|
-
chartOptions: ILChartOptions;
|
|
92
|
-
interactions: ILineInteractions;
|
|
93
|
-
dragData?: ICommonDragData;
|
|
94
|
-
depthType?: IDepthType | object;
|
|
95
|
-
}
|
|
96
|
-
type ILooseLineAxis = Omit<DeepPartial<ILineChartAxis<string>>, 'gridLines'> & {
|
|
97
|
-
[key: string]: unknown;
|
|
98
|
-
stepSize?: unknown;
|
|
99
|
-
gridLines?: unknown;
|
|
100
|
-
};
|
|
101
|
-
type ILooseLineAnnotation = {
|
|
102
|
-
[key: string]: unknown;
|
|
103
|
-
id?: string;
|
|
104
|
-
label?: string;
|
|
105
|
-
color?: string;
|
|
106
|
-
borderColor?: string;
|
|
107
|
-
backgroundColor?: string;
|
|
108
|
-
borderWidth?: number;
|
|
109
|
-
display?: boolean;
|
|
110
|
-
adjustScaleRange?: boolean;
|
|
111
|
-
opacity?: number;
|
|
112
|
-
hideLegend?: boolean;
|
|
113
|
-
labelOffsetPx?: number;
|
|
114
|
-
annotationAxis?: string;
|
|
115
|
-
type?: string;
|
|
116
|
-
value?: number | string | null;
|
|
117
|
-
xMin?: number | string | null;
|
|
118
|
-
xMax?: number | string | null;
|
|
119
|
-
yMin?: number | string | null;
|
|
120
|
-
yMax?: number | string | null;
|
|
121
|
-
xValue?: number | string | null;
|
|
122
|
-
yValue?: number | string | null;
|
|
123
|
-
onDragStart?: (...args: unknown[]) => void;
|
|
124
|
-
onDrag?: (...args: unknown[]) => void;
|
|
125
|
-
onDragEnd?: (...args: unknown[]) => void;
|
|
126
|
-
};
|
|
127
|
-
export type ILineChartOptionsInput = Omit<DeepPartial<ILineChartOptions>, 'title' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'graph' | 'annotations' | 'additionalAxesOptions' | 'scales' | 'plugins'> & {
|
|
128
|
-
[key: string]: unknown;
|
|
129
|
-
title?: unknown;
|
|
130
|
-
direction?: string;
|
|
131
|
-
axes?: {
|
|
132
|
-
x?: ILooseLineAxis[];
|
|
133
|
-
y?: ILooseLineAxis[];
|
|
134
|
-
[key: string]: ILooseLineAxis[] | undefined;
|
|
135
|
-
};
|
|
136
|
-
scales?: Record<string, unknown>;
|
|
137
|
-
plugins?: Record<string, unknown>;
|
|
138
|
-
legend?: Omit<DeepPartial<ILineLegend>, 'position' | 'align'> & {
|
|
139
|
-
position?: string;
|
|
140
|
-
align?: string;
|
|
141
|
-
[key: string]: unknown;
|
|
142
|
-
};
|
|
143
|
-
chartStyling?: DeepPartial<ILineChartStyling> & {
|
|
144
|
-
hideControls?: boolean;
|
|
145
|
-
minHeight?: number | string;
|
|
146
|
-
[key: string]: unknown;
|
|
147
|
-
};
|
|
148
|
-
interactions?: DeepPartial<ILineInteractions> & {
|
|
149
|
-
enableZoom?: boolean;
|
|
150
|
-
enablePan?: boolean;
|
|
151
|
-
[key: string]: unknown;
|
|
152
|
-
};
|
|
153
|
-
graph?: DeepPartial<ILineChartGraph> & {
|
|
154
|
-
tooltip?: unknown;
|
|
155
|
-
[key: string]: unknown;
|
|
156
|
-
};
|
|
157
|
-
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
158
|
-
annotationsData?: ILooseLineAnnotation[];
|
|
159
|
-
}) | ILooseLineAnnotation[] | null;
|
|
160
|
-
additionalAxesOptions?: Omit<DeepPartial<ILineChartAdditionalAxesOptions>, 'chartScaleType'> & {
|
|
161
|
-
chartScaleType?: string;
|
|
162
|
-
stepSize?: unknown;
|
|
163
|
-
range?: ILineRange | ILineChartRange | Record<string, ILineChartRange | undefined>;
|
|
164
|
-
} & Record<string, unknown>;
|
|
165
|
-
};
|
|
166
|
-
export interface ILineChartDataInput extends Omit<ILineChartData, 'data' | 'options'> {
|
|
167
|
-
data?: Omit<DeepPartial<ILineChartData['data']>, 'datasets'> & {
|
|
168
|
-
datasets?: Array<(DeepPartial<ILineChartDataset> & {
|
|
169
|
-
lineTension?: number | string;
|
|
170
|
-
fill?: boolean | string | Record<string, unknown>;
|
|
171
|
-
pointStyle?: unknown;
|
|
172
|
-
showPoint?: boolean;
|
|
173
|
-
showPoints?: boolean;
|
|
174
|
-
lineHeight?: number;
|
|
175
|
-
data?: Array<DeepPartial<ICommonDataValue> | null>;
|
|
176
|
-
[key: string]: unknown;
|
|
177
|
-
}) | object | null> | object;
|
|
178
|
-
};
|
|
179
|
-
options?: ILineChartOptionsInput;
|
|
180
|
-
}
|
|
181
|
-
export interface ILineChartDataset extends ICommonDataset {
|
|
182
|
-
lineTension?: number;
|
|
183
|
-
pointBackgroundColor?: string;
|
|
184
|
-
pointRadius?: number;
|
|
185
|
-
pointHoverRadius?: number;
|
|
186
|
-
pointHitRadius?: number;
|
|
187
|
-
fill?: boolean;
|
|
188
|
-
xAxisID?: string;
|
|
189
|
-
yAxisID?: string;
|
|
190
|
-
formation?: boolean;
|
|
191
|
-
displayGroup?: string | number;
|
|
192
|
-
pointStyle?: string;
|
|
193
|
-
}
|
|
194
|
-
export interface ILineChartData extends ICommonData {
|
|
195
|
-
data?: {
|
|
196
|
-
datasets: ILineChartDataset[];
|
|
197
|
-
};
|
|
198
|
-
options: ILineChartOptions;
|
|
199
|
-
persistenceId?: string;
|
|
200
|
-
controlsPortalId?: string;
|
|
201
|
-
}
|
|
202
|
-
export interface ILineChartProps {
|
|
203
|
-
chart: ILineChartDataInput;
|
|
204
|
-
table?: ReactNode;
|
|
205
|
-
headerComponent?: ReactNode;
|
|
206
|
-
subheaderComponent?: ReactNode;
|
|
207
|
-
}
|
|
208
|
-
export interface LineChart extends ILineChartDataInput {
|
|
209
|
-
}
|
|
210
|
-
export interface IGeneratedLineChartDataset {
|
|
211
|
-
label?: string;
|
|
212
|
-
data: ICommonDataValue[];
|
|
213
|
-
showLine?: boolean;
|
|
214
|
-
lineTension: number;
|
|
215
|
-
spanGaps: boolean;
|
|
216
|
-
borderWidth: number;
|
|
217
|
-
borderDash: number[];
|
|
218
|
-
borderJoinStyle: 'round' | 'bevel' | 'miter';
|
|
219
|
-
borderColor: string;
|
|
220
|
-
backgroundColor: string | string[];
|
|
221
|
-
pointBackgroundColor: string;
|
|
222
|
-
pointRadius: number;
|
|
223
|
-
pointHoverRadius: number;
|
|
224
|
-
pointHitRadius: number;
|
|
225
|
-
isAnnotation?: boolean;
|
|
226
|
-
annotationType?: string;
|
|
227
|
-
annotationIndex?: number;
|
|
228
|
-
annotationLabel?: string;
|
|
229
|
-
annotationBackgroundColor?: string;
|
|
230
|
-
annotationPointBackgroundColor?: string;
|
|
231
|
-
annotationBorderColor?: string;
|
|
232
|
-
annotationBorderDash?: number[];
|
|
233
|
-
annotationBorderWidth?: number;
|
|
234
|
-
displayGroup?: string | number;
|
|
235
|
-
hideLegend?: boolean;
|
|
236
|
-
pointStyle?: string;
|
|
237
|
-
xAxisID?: string;
|
|
238
|
-
yAxisID?: string;
|
|
239
|
-
}
|
|
240
|
-
export type TGeneratedLineChartDatasets = IGeneratedLineChartDataset[];
|
|
241
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChartType, Plugin } from 'chart.js';
|
|
2
|
-
import { TCalloutConnector } from './helpers';
|
|
3
|
-
declare module 'chart.js' {
|
|
4
|
-
interface PluginOptionsByType<TType extends ChartType> {
|
|
5
|
-
calloutConnectorPlugin?: {
|
|
6
|
-
enableCalloutAnnotation?: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare const calloutConnectorPlugin: Plugin;
|
|
11
|
-
export type { TCalloutConnector };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type TCalloutConnector = {
|
|
2
|
-
enabled?: boolean | ((context: {
|
|
3
|
-
chart: any;
|
|
4
|
-
labelEl?: TAnnotationLike;
|
|
5
|
-
fromEl?: TAnnotationLike;
|
|
6
|
-
option?: any;
|
|
7
|
-
}) => boolean);
|
|
8
|
-
fromId: string;
|
|
9
|
-
strokeStyle?: string;
|
|
10
|
-
lineWidth?: number;
|
|
11
|
-
lineDash?: number[];
|
|
12
|
-
startOffset?: number;
|
|
13
|
-
endOffset?: number;
|
|
14
|
-
anchor?: {
|
|
15
|
-
position?: string;
|
|
16
|
-
xAdjust?: number;
|
|
17
|
-
yAdjust?: number;
|
|
18
|
-
labelOffsetPx?: number;
|
|
19
|
-
tickSize?: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type TAnnotationLike = {
|
|
23
|
-
centerX: number;
|
|
24
|
-
centerY: number;
|
|
25
|
-
width?: number;
|
|
26
|
-
height?: number;
|
|
27
|
-
options?: {
|
|
28
|
-
display: boolean;
|
|
29
|
-
radius?: number;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export type TConnectorPoints = {
|
|
33
|
-
startX: number;
|
|
34
|
-
startY: number;
|
|
35
|
-
endX: number;
|
|
36
|
-
endY: number;
|
|
37
|
-
tickStartX: number;
|
|
38
|
-
tickStartY: number;
|
|
39
|
-
tickEndX: number;
|
|
40
|
-
tickEndY: number;
|
|
41
|
-
};
|
|
42
|
-
export declare const computeConnectorPoints: (fromEl: TAnnotationLike, labelEl: TAnnotationLike, connector: TCalloutConnector) => TConnectorPoints;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Chart, ChartConfiguration, Plugin } from 'chart.js';
|
|
2
|
-
import { Position } from '../../common/enums';
|
|
3
|
-
interface CustomChartConfiguration extends ChartConfiguration {
|
|
4
|
-
showLabel?: boolean;
|
|
5
|
-
text: string;
|
|
6
|
-
fontSize: number;
|
|
7
|
-
xOffset: number;
|
|
8
|
-
yOffset: number;
|
|
9
|
-
lineHeight: number;
|
|
10
|
-
maxWidth: number;
|
|
11
|
-
position: Position;
|
|
12
|
-
}
|
|
13
|
-
export declare const chartAreaTextPlugin: {
|
|
14
|
-
id: string;
|
|
15
|
-
beforeDraw: (chart: Chart, _args: Plugin, options: CustomChartConfiguration) => void;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Chart, Scale } from 'chart.js';
|
|
2
|
-
export declare const getLargestMajorTickWidth: (majorTickPositions: number[]) => number;
|
|
3
|
-
export declare const isValidPosition: (minorTickPosition: number, majorTickPositions: number[], scale: Scale) => boolean;
|
|
4
|
-
export declare const getMinorTickPositions: (majorTickPositions: number[], scale: Scale) => number[];
|
|
5
|
-
export declare const chartMinorGridlinesPlugin: {
|
|
6
|
-
id: string;
|
|
7
|
-
beforeDatasetsDraw: (chart: Chart) => void;
|
|
8
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Chart } from 'chart.js';
|
|
2
|
-
import { TLineMarkerTick, TLineMarkerDirection, TStickSide } from './types.ts';
|
|
3
|
-
export type TDrawLineArgs = {
|
|
4
|
-
chart: Chart;
|
|
5
|
-
x1: number;
|
|
6
|
-
y1: number;
|
|
7
|
-
x2: number;
|
|
8
|
-
y2: number;
|
|
9
|
-
color: string;
|
|
10
|
-
opacity: number;
|
|
11
|
-
lineWidth: number;
|
|
12
|
-
lineDash: number[];
|
|
13
|
-
};
|
|
14
|
-
export declare const drawLineSegment: ({ chart, x1, y1, x2, y2, color, opacity, lineWidth, lineDash }: TDrawLineArgs) => {
|
|
15
|
-
x1: number;
|
|
16
|
-
y1: number;
|
|
17
|
-
x2: number;
|
|
18
|
-
y2: number;
|
|
19
|
-
};
|
|
20
|
-
export type TDrawTickArgs = {
|
|
21
|
-
ctx: CanvasRenderingContext2D;
|
|
22
|
-
chartArea: {
|
|
23
|
-
left: number;
|
|
24
|
-
right: number;
|
|
25
|
-
top: number;
|
|
26
|
-
bottom: number;
|
|
27
|
-
};
|
|
28
|
-
direction: TLineMarkerDirection;
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
side: TStickSide;
|
|
32
|
-
reverse?: boolean;
|
|
33
|
-
labelY?: number;
|
|
34
|
-
tick: TLineMarkerTick;
|
|
35
|
-
defaultColor: string;
|
|
36
|
-
defaultFont: string;
|
|
37
|
-
};
|
|
38
|
-
export declare const drawTick: (args: TDrawTickArgs) => void;
|
|
39
|
-
export declare const getTickLabelHeight: (tick: TLineMarkerTick, defaultFont: string) => number;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ChartType, Plugin } from 'chart.js';
|
|
2
|
-
import { TLineMarkersOptions } from './types';
|
|
3
|
-
declare module 'chart.js' {
|
|
4
|
-
interface PluginOptionsByType<TType extends ChartType> {
|
|
5
|
-
lineMarkersPlugin?: {
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
} | TLineMarkersOptions;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare const lineMarkersPlugin: Plugin;
|