@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.
Files changed (126) hide show
  1. package/dist/index.d.ts +1266 -15
  2. package/dist/index.js +327 -303
  3. package/package.json +21 -20
  4. package/dist/src/components/bar-chart/bar-chart-const.d.ts +0 -2
  5. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +0 -3
  6. package/dist/src/components/bar-chart/bar-chart.d.ts +0 -3
  7. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +0 -146
  8. package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +0 -10
  9. package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +0 -4
  10. package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +0 -6
  11. package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +0 -13
  12. package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +0 -54
  13. package/dist/src/components/common/common.interface.d.ts +0 -273
  14. package/dist/src/components/common/controls-portal.d.ts +0 -7
  15. package/dist/src/components/common/enums.d.ts +0 -89
  16. package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +0 -1
  17. package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +0 -25
  18. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -16
  19. package/dist/src/components/common/helpers/chart-consts.d.ts +0 -39
  20. package/dist/src/components/common/helpers/chart-utils.d.ts +0 -86
  21. package/dist/src/components/common/helpers/container.d.ts +0 -18
  22. package/dist/src/components/common/helpers/custom-format-number.d.ts +0 -1
  23. package/dist/src/components/common/helpers/download-pgn.d.ts +0 -3
  24. package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +0 -28
  25. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -139
  26. package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +0 -1
  27. package/dist/src/components/common/helpers/get-custom-legend-plugin-example.d.ts +0 -6
  28. package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
  29. package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +0 -1
  30. package/dist/src/components/common/helpers/input-normalizers.d.ts +0 -15
  31. package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +0 -8
  32. package/dist/src/components/common/helpers/range/range.d.ts +0 -33
  33. package/dist/src/components/common/helpers/text.d.ts +0 -1
  34. package/dist/src/components/common/helpers/to-annotation.d.ts +0 -4
  35. package/dist/src/components/common/hooks/use-generated-labels.d.ts +0 -4
  36. package/dist/src/components/common/hooks/use-legend-state.d.ts +0 -28
  37. package/dist/src/components/common/hooks/use-legend.d.ts +0 -4
  38. package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -4
  39. package/dist/src/components/common/legend-component/legend-dropzone.d.ts +0 -3
  40. package/dist/src/components/common/legend-component/legend-interface.d.ts +0 -47
  41. package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +0 -5
  42. package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +0 -3
  43. package/dist/src/components/common/legend-component/legend-panel.d.ts +0 -3
  44. package/dist/src/components/common/legend-component/legend.d.ts +0 -3
  45. package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +0 -3
  46. package/dist/src/components/common/legend-component/state/legend-context.d.ts +0 -14
  47. package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +0 -30
  48. package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +0 -27
  49. package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +0 -2
  50. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +0 -15
  51. package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +0 -7
  52. package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +0 -21
  53. package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +0 -6
  54. package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +0 -53
  55. package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +0 -5
  56. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +0 -9
  57. package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +0 -18
  58. package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +0 -10
  59. package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +0 -2
  60. package/dist/src/components/line-chart/constants/default-translations.d.ts +0 -25
  61. package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +0 -13
  62. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -57
  63. package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +0 -6
  64. package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +0 -8
  65. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +0 -19
  66. package/dist/src/components/line-chart/controls/controls.d.ts +0 -3
  67. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +0 -14
  68. package/dist/src/components/line-chart/controls/drag-options.d.ts +0 -23
  69. package/dist/src/components/line-chart/controls/line-options.d.ts +0 -19
  70. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -32
  71. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +0 -19
  72. package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +0 -7
  73. package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +0 -12
  74. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +0 -12
  75. package/dist/src/components/line-chart/initialize/config.d.ts +0 -12
  76. package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +0 -12
  77. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +0 -3
  78. package/dist/src/components/line-chart/line-chart.d.ts +0 -3
  79. package/dist/src/components/line-chart/line-chart.interface.d.ts +0 -241
  80. package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +0 -11
  81. package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +0 -42
  82. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +0 -17
  83. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +0 -8
  84. package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +0 -39
  85. package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +0 -10
  86. package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +0 -109
  87. package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +0 -40
  88. package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +0 -11
  89. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +0 -9
  90. package/dist/src/components/line-chart/state/action-types.d.ts +0 -12
  91. package/dist/src/components/line-chart/state/helpers.d.ts +0 -13
  92. package/dist/src/components/line-chart/state/initial-state.d.ts +0 -11
  93. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +0 -2
  94. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +0 -15
  95. package/dist/src/components/line-chart/state/state.interfaces.d.ts +0 -26
  96. package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +0 -2
  97. package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +0 -18
  98. package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +0 -12
  99. package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +0 -20
  100. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +0 -8
  101. package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +0 -11
  102. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +0 -6
  103. package/dist/src/components/line-chart/utils/enums.d.ts +0 -4
  104. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +0 -8
  105. package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +0 -1
  106. package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +0 -1
  107. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +0 -9
  108. package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +0 -10
  109. package/dist/src/components/line-chart/utils/get-generated-labels.d.ts +0 -2
  110. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +0 -16
  111. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +0 -5
  112. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +0 -30
  113. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +0 -24
  114. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +0 -8
  115. package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +0 -50
  116. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +0 -3
  117. package/dist/src/components/pie-chart/pie-chart.d.ts +0 -3
  118. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +0 -85
  119. package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +0 -42
  120. package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +0 -69
  121. package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +0 -73
  122. package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +0 -4
  123. package/dist/src/components/scatter-chart/scatter-chart.d.ts +0 -3
  124. package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +0 -111
  125. package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +0 -5
  126. package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +0 -21
@@ -1,89 +0,0 @@
1
- export declare enum AxisType {
2
- X = "x",
3
- Y = "y"
4
- }
5
- export declare enum Position {
6
- Bottom = "bottom",
7
- Top = "top",
8
- Left = "left",
9
- Right = "right",
10
- TopRight = "top-right",
11
- TopLeft = "top-left",
12
- BottomLeft = "bottom-left",
13
- BottomRight = "bottom-right"
14
- }
15
- export declare enum ChartType {
16
- LINE = "line",
17
- BAR = "bar",
18
- PIE = "pie",
19
- DOUGHNUT = "doughnut",
20
- SCATTER = "scatter"
21
- }
22
- export declare enum CursorStyle {
23
- Pointer = "pointer",
24
- Initial = "initial",
25
- Grab = "grab",
26
- Grabbing = "grabbing",
27
- Crosshair = "crosshair",
28
- Move = "move"
29
- }
30
- export declare enum ScaleType {
31
- Category = "category",
32
- Linear = "linear",
33
- Logarithmic = "logarithmic",
34
- Time = "time",
35
- TimeSeries = "timeseries"
36
- }
37
- export declare enum ChartDirection {
38
- VERTICAL = "vertical",
39
- HORIZONTAL = "horizontal"
40
- }
41
- export declare enum TooltipLabel {
42
- Y = "yLabel",
43
- X = "xLabel"
44
- }
45
- export declare enum AlignOptions {
46
- End = "end",
47
- Start = "start",
48
- Center = "center",
49
- Right = "right",
50
- Left = "left"
51
- }
52
- export declare enum PointType {
53
- Casing = "casing"
54
- }
55
- export declare enum AnnotationType {
56
- Box = "box",
57
- Ellipse = "ellipse",
58
- Line = "line",
59
- Text = "text",
60
- Label = "label"
61
- }
62
- export declare enum PointStyle {
63
- Circle = "circle",
64
- Square = "rect",
65
- Diamond = "rectRot",
66
- Triangle = "triangle"
67
- }
68
- export declare enum ChartHoverMode {
69
- Nearest = "nearest"
70
- }
71
- export declare enum PanZoomMode {
72
- X = "x",
73
- Y = "y",
74
- XY = "xy",
75
- Z = "z"
76
- }
77
- export declare enum Key {
78
- Shift = "Shift"
79
- }
80
- export declare enum Events {
81
- Mousemove = "mousemove",
82
- Mouseout = "mouseout",
83
- Click = "click",
84
- Touchstart = "touchstart",
85
- Touchmove = "touchmove",
86
- Dblclick = "dblclick"
87
- }
88
- export { AnnotationType as DraggableAnnotationType, DragAxis } from './plugins/annotation-dragger-plugin/enums';
89
- export { GradientDirection } from './plugins/gradient-background-plugin/enums';
@@ -1 +0,0 @@
1
- export declare function addTransparency(input: string, alpha: number, out?: 'rgb' | 'hex'): string;
@@ -1,25 +0,0 @@
1
- import { ICommonAnnotationsData } from '../../common.interface';
2
- export interface ICalloutCfg extends Record<string, unknown> {
3
- enabled?: boolean;
4
- onlyWhenOverlapping?: boolean;
5
- margin?: number;
6
- gapPx?: number;
7
- minConnectorLengthPx?: number;
8
- xAdjust?: number;
9
- yAdjust?: number;
10
- xValue?: number;
11
- yValue?: number;
12
- font?: string | {
13
- size?: number | string;
14
- };
15
- padding?: number | {
16
- top?: number;
17
- right?: number;
18
- bottom?: number;
19
- left?: number;
20
- };
21
- }
22
- export declare const isCalloutOverlapping: (ctx: any, refAnnotation: ICommonAnnotationsData, index: number) => boolean;
23
- export declare const resolveCalloutXValue: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: ICalloutCfg, index: number) => number | undefined;
24
- export declare const resolveCalloutYValue: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: ICalloutCfg, index: number) => number | undefined;
25
- export declare const isCalloutAnchorInChartArea: (ctx: any, refAnnotation: ICommonAnnotationsData, margin?: number) => boolean;
@@ -1,16 +0,0 @@
1
- import { Chart } from 'chart.js';
2
- import { UnusedParameter } from '../common.interface';
3
- interface IChartAreaBorderPluginOptions {
4
- borderColor: string;
5
- borderWidth: number;
6
- borderDash: number[];
7
- borderDashOffset?: number;
8
- }
9
- /**
10
- * Chart border plugin config
11
- */
12
- export declare const chartAreaBorderPlugin: {
13
- id: string;
14
- beforeDraw(chart: Chart, _: UnusedParameter, options: IChartAreaBorderPluginOptions): void;
15
- };
16
- export {};
@@ -1,39 +0,0 @@
1
- import { ICommonGradientColor } from '../common.interface';
2
- export declare const BORDER_WIDTH: {
3
- ZERO: number;
4
- INITIAL: number;
5
- HOVERED: number;
6
- POINT_HOVERED: number;
7
- };
8
- export declare const BORDER_COLOR = "rgba(0,0,0,0.1)";
9
- export declare const ANNOTATION_DASH: number[];
10
- export declare const DEFAULT_FONT_SIZE = 12;
11
- export declare const DEFAULT_FONT_FAMILY = "\"Roobert\", \"Noto Sans\", sans-serif";
12
- export declare const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
13
- export declare const LEGEND_LABEL_BOX_SIZE = 12;
14
- export declare const TOOLTIP_PADDING = 8;
15
- export declare const TOOLTIP_BOX_PADDING = 4;
16
- export declare const TRANSPARENT = "transparent";
17
- export declare const LOGARITHMIC_STEPS: number[];
18
- export declare const COLORS: string[];
19
- /**
20
- * @type {string}
21
- * @desc equivalent of 0.6 rgba alpha chanel
22
- */
23
- export declare const ALPHA_CHANEL = "99";
24
- /**
25
- * @type {number}
26
- * @desc #FFFFFF as decimal number
27
- */
28
- export declare const WHITE_COLOR_AS_DECIMAL = 16777215;
29
- export declare const AUTO = "auto";
30
- export declare const ANIMATION_DURATION: {
31
- NO: number;
32
- SLOW: number;
33
- FAST: number;
34
- };
35
- export declare const DEFAULT_CHART_NAME = "new_chart";
36
- export declare const CUSTOM_LEGEND_PLUGIN_NAME = "htmlLegend";
37
- export declare const DECIMAL_POINT_TOLERANCE = 9;
38
- export declare const MAX_DECIMAL_DIFF: number;
39
- export declare const GRADIENT_COLORS: ICommonGradientColor[];
@@ -1,86 +0,0 @@
1
- import { ChartTypeRegistry, LegendItem, Plugin } from 'chart.js';
2
- import { ICommonCustomLegend, UnusedParameter } from '../common.interface';
3
- import { Position } from '../enums';
4
- export interface IChartGraph {
5
- showMinorGridlines?: boolean;
6
- }
7
- interface IOptions {
8
- title?: string | string[];
9
- legend?: {
10
- position?: Position;
11
- display?: boolean;
12
- align?: string;
13
- usePointStyle?: boolean;
14
- };
15
- }
16
- interface IStyling {
17
- width?: string | number;
18
- height?: string | number;
19
- squareAspectRatio?: number | boolean;
20
- maintainAspectRatio?: boolean;
21
- staticChartHeight?: boolean;
22
- performanceMode?: boolean;
23
- }
24
- interface IAxis {
25
- label?: string;
26
- }
27
- interface ILegend {
28
- customLegend?: ICommonCustomLegend<any>;
29
- }
30
- /**
31
- * @param { graph } graph - graph data from chart options
32
- * @param { legend } legend
33
- * @return {[]}
34
- */
35
- export declare const getPlugins: <T extends keyof ChartTypeRegistry>(graph: IChartGraph | undefined, legend: ILegend) => Plugin<T>[] | any;
36
- /**
37
- * @param {string[]} colors - color schema
38
- * @return {string} - random color
39
- */
40
- export declare const generateRandomColor: (colors: string[]) => string[];
41
- /**
42
- * @param {ICommonChartOptions} options - chart options object
43
- * @return {{color: (string|undefined), display: boolean, text}|{}}
44
- */
45
- export declare const getTitle: (options: IOptions) => {
46
- display: boolean;
47
- text: string | string[];
48
- } | {
49
- display?: undefined;
50
- text?: undefined;
51
- };
52
- /**
53
- * @function isVertical
54
- */
55
- export declare const isVertical: (direction: "vertical" | "horizontal") => direction is "vertical";
56
- /**
57
- * @param {'x'|'y'} axisType
58
- * @param {number} i - index
59
- * @return {'top'|'bottom'|'left'|'right'|*}
60
- */
61
- export declare const getAxisPosition: (axisType: string, i: number) => Position;
62
- /**
63
- * @param {chartStyling} chartStyling
64
- * @param {Object} styles - styles imported form .less file
65
- * @return {string} - class name
66
- */
67
- export declare const getClassName: (chartStyling: IStyling, styles: Record<string, string>) => string;
68
- export declare const getLegend: (options: IOptions, clickHandler: (_: UnusedParameter, legendItem: LegendItem) => void) => {
69
- position: any;
70
- display: boolean | undefined;
71
- align: "center" | "start" | "end";
72
- labels: {
73
- boxHeight: number;
74
- boxWidth: number | undefined;
75
- usePointStyle: boolean | undefined;
76
- };
77
- onClick: (_: UnusedParameter, legendItem: LegendItem) => void;
78
- };
79
- export declare const afterLabelCallback: (tooltipItem: Record<string, any>) => string;
80
- export declare const getTooltipLabel: (tooltipItem: Record<string, any>, showLabelsInTooltips: boolean) => string;
81
- export declare const sanitize: (str: string) => string;
82
- export declare const getChartFileName: (axes?: IAxis[]) => string;
83
- export declare const setDefaultTheme: () => void;
84
- export declare const isNilOrEmpty: <T>(value: T | null | undefined) => boolean;
85
- export declare const isEmptyString: (value: string) => value is "";
86
- export {};
@@ -1,18 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- interface ContainerProps {
3
- style?: CSSProperties;
4
- children: ReactNode;
5
- margin?: boolean;
6
- deprecatedMessage?: string;
7
- warningMessage?: string;
8
- }
9
- export declare const Container: {
10
- ({ style, children, margin, deprecatedMessage, warningMessage }: ContainerProps): import("react/jsx-runtime").JSX.Element;
11
- defaultProps: {
12
- style: {};
13
- margin: boolean;
14
- deprecatedMessage: null;
15
- warningMessage: null;
16
- };
17
- };
18
- export {};
@@ -1 +0,0 @@
1
- export declare const customFormatNumber: (labelNumber: number, scientificNotation: boolean) => string;
@@ -1,3 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { Chart } from 'chart.js';
3
- export declare const downloadPgn: (chartRef: RefObject<Chart>) => void;
@@ -1,28 +0,0 @@
1
- import { Tick } from 'chart.js';
2
- import { ICommonScaleOptions, UnusedParameter } from '../common.interface';
3
- type TScaleType = NonNullable<ICommonScaleOptions['type']>;
4
- export declare const isTimeScaleType: (scaleType?: ICommonScaleOptions["type"]) => scaleType is "time" | "timeseries";
5
- interface IGetCartesianScaleOptionsParams {
6
- axisData?: {
7
- gridLines?: unknown;
8
- label?: string;
9
- position?: unknown;
10
- stepSize?: number;
11
- unit?: unknown;
12
- };
13
- scaleType?: TScaleType;
14
- scaleConfigFromProps?: ICommonScaleOptions;
15
- display?: boolean;
16
- beginAtZero?: boolean;
17
- reverse?: boolean;
18
- suggestedMax?: number | string;
19
- suggestedMin?: number | string;
20
- min?: number | string;
21
- max?: number | string;
22
- additionalStepSize?: number | null;
23
- useStepSize?: boolean;
24
- stacked?: boolean;
25
- numericTickCallback?: (tick: string | number, unused: UnusedParameter, ticks: Tick[]) => unknown;
26
- }
27
- export declare const getCartesianScaleOptions: ({ axisData, scaleType, scaleConfigFromProps, display, beginAtZero, reverse, suggestedMax, suggestedMin, min, max, additionalStepSize, useStepSize, stacked, numericTickCallback, }: IGetCartesianScaleOptionsParams) => ICommonScaleOptions;
28
- export {};
@@ -1,139 +0,0 @@
1
- import { Chart } from 'chart.js';
2
- import { AnnotationType } from '../plugins/annotation-dragger-plugin/enums';
3
- import { Position } from '../enums';
4
- import { ICommonAnnotationElement, ICommonAnnotationsData, ICoordinates } from '../common.interface';
5
- export interface IGetAnnotationsProps {
6
- showAnnotations: boolean;
7
- annotationsData: ICommonAnnotationsData[];
8
- }
9
- interface TChart extends Chart {
10
- hoveredAnnotationId?: string | null;
11
- }
12
- export declare const generateAnn: (ann: ICommonAnnotationsData, index: number) => {
13
- display: boolean | undefined;
14
- annotationIndex: number;
15
- id: string;
16
- scaleID: "x" | "y" | undefined;
17
- label: {
18
- backgroundColor: string;
19
- content: string | undefined;
20
- display: boolean;
21
- position: Position;
22
- color?: undefined;
23
- font?: undefined;
24
- borderWidth?: undefined;
25
- padding?: undefined;
26
- borderRadius?: undefined;
27
- borderColor?: undefined;
28
- } | {
29
- backgroundColor: string;
30
- content: string | undefined;
31
- display: boolean;
32
- position: string;
33
- color: string;
34
- font: string;
35
- borderWidth: number;
36
- padding: number;
37
- borderRadius: number;
38
- borderColor: string;
39
- } | {
40
- position: {
41
- x: string;
42
- y: string;
43
- } | undefined;
44
- content: string | undefined;
45
- backgroundColor?: string;
46
- display: boolean;
47
- color?: string;
48
- font: string | {
49
- weight: string;
50
- };
51
- borderColor?: string;
52
- callout?: Record<string, unknown>;
53
- borderWidth?: undefined;
54
- padding?: undefined;
55
- borderRadius?: undefined;
56
- } | {
57
- position: {
58
- x: string;
59
- y: string;
60
- } | undefined;
61
- content: string | undefined;
62
- backgroundColor?: string;
63
- display: boolean;
64
- color?: string;
65
- font: string | {
66
- weight: string;
67
- };
68
- borderColor?: string;
69
- callout?: Record<string, unknown>;
70
- borderWidth?: undefined;
71
- padding?: undefined;
72
- borderRadius?: undefined;
73
- } | {
74
- position: {
75
- x: string;
76
- y: string;
77
- } | undefined;
78
- content: string | undefined;
79
- backgroundColor?: string;
80
- display: boolean;
81
- color?: string;
82
- font: string | {
83
- weight: string;
84
- };
85
- borderColor?: string;
86
- callout?: Record<string, unknown>;
87
- borderWidth?: undefined;
88
- padding?: undefined;
89
- borderRadius?: undefined;
90
- };
91
- backgroundColor: string;
92
- borderColor: string;
93
- borderWidth: number;
94
- borderDash: number[] | undefined;
95
- type: AnnotationType;
96
- adjustScaleRange: boolean | undefined;
97
- enter: ({ element, }: {
98
- element: ICommonAnnotationElement;
99
- }, { chart, }: {
100
- chart: TChart;
101
- }) => void;
102
- leave: ({ element, }: {
103
- element: ICommonAnnotationElement;
104
- }, { chart, }: {
105
- chart: TChart;
106
- }) => void;
107
- onDragStart: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
108
- onDrag: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
109
- onDragEnd: () => (cord: ICoordinates, annotation: ICommonAnnotationsData) => void;
110
- pointStyle: string;
111
- resizable: boolean;
112
- displayDragCoordinates: boolean;
113
- hideLegend?: boolean;
114
- labelOffsetPx?: number;
115
- annotationAxis?: "x" | "y";
116
- rotation?: number;
117
- color?: string;
118
- endValue?: number;
119
- labelConfig?: import('../common.interface').IAnnotationLabelConfig;
120
- value?: number;
121
- xMin?: number;
122
- xMax?: number;
123
- yMin?: number;
124
- yMax?: number;
125
- xValue?: number;
126
- yValue?: number;
127
- radius?: number;
128
- enableDrag?: boolean;
129
- dragAxis?: import('../plugins/annotation-dragger-plugin/enums').DragAxis;
130
- dragRange?: {
131
- x?: [number, number];
132
- y?: [number, number];
133
- };
134
- xScaleID?: string;
135
- yScaleID?: string;
136
- opacity?: number;
137
- };
138
- export declare const getAnnotation: ({ showAnnotations, annotationsData }: IGetAnnotationsProps) => ICommonAnnotationElement[] | Record<string, any>[];
139
- export {};
@@ -1 +0,0 @@
1
- export declare const getChartFromCtx: (ctx: any) => any;
@@ -1,6 +0,0 @@
1
- import { Plugin } from 'chart.js';
2
- /**
3
- * Gets an example custom legend plugin for use in storybook.
4
- * @param {string} customLegendContainerID - the id of the div container to put the generated legend in
5
- */
6
- export declare const getCustomLegendPlugin: (customLegendContainerID: string) => Plugin;
@@ -1,18 +0,0 @@
1
- import { ICommonOptions } from '../common.interface';
2
- export interface IDraggableDataOptions {
3
- dragX: boolean;
4
- dragY: boolean;
5
- round: boolean;
6
- showTooltip: boolean;
7
- onDragStart: () => void;
8
- onDrag: () => void;
9
- onDragEnd: () => void;
10
- }
11
- export interface IDraggableData {
12
- dragData: IDraggableDataOptions;
13
- }
14
- /**
15
- * @param {ICommonChartOptions} options - line chart options object
16
- */
17
- declare const getDraggableData: (options: ICommonOptions) => IDraggableData | object;
18
- export default getDraggableData;
@@ -1 +0,0 @@
1
- export declare const getGroupedColorScheme: (length: number, startingColor: string) => string[];
@@ -1,15 +0,0 @@
1
- import { AlignOptions, ChartDirection, Position } from '../enums';
2
- type TDragRange = {
3
- x?: [number, number];
4
- y?: [number, number];
5
- };
6
- export declare const normalizeTitle: (title: unknown) => string | string[];
7
- export declare const normalizeCartesianDirection: (direction: unknown) => "vertical" | "horizontal";
8
- export declare const normalizeChartDirection: (direction: unknown) => ChartDirection;
9
- export declare const normalizeLegendPosition: (position: unknown, fallback: Position) => Position;
10
- export declare const normalizeLegendAlign: (align: unknown, fallback: AlignOptions) => AlignOptions;
11
- export declare const normalizeDragRange: (range?: {
12
- x?: number[] | [number, number];
13
- y?: number[] | [number, number];
14
- }) => TDragRange;
15
- export {};
@@ -1,8 +0,0 @@
1
- import { TGeneratedLineChartDatasets } from '../../../line-chart/line-chart.interface';
2
- /**
3
- * Estimates whether any of the data series has values that are all close together
4
- * - checks only the first and last values in each series (i.e. assumes they are ordered)
5
- * - uses an equality check with tolerance for decimal precision noise
6
- * - this is just an inexpensive "guesstimate" (full min/max detection can be used afterwards)
7
- */
8
- export declare const estimateDataSeriesHaveCloseValues: (generatedDatasets: TGeneratedLineChartDatasets) => boolean;
@@ -1,33 +0,0 @@
1
- interface IGetSuggestedAxisRange {
2
- data: number[];
3
- beginAtZero: boolean;
4
- autoAxisPadding: boolean;
5
- }
6
- /**
7
- * Overrides the default chart.js axis range for some edge-cases:
8
- * - when no data -> default range
9
- * - when all values are close to zero -> default range
10
- * - when all values are close to each other -> custom 5% padding
11
- * - when autoAxisPadding is set -> custom 5% padding
12
- * - all other cases fall back to chart.js default behaviour
13
- *
14
- * `autoAxisPadding` feature requirements:
15
- * - specified by Truls and ported by Mark+Oleg
16
- * - numbers that are equal (within tolerance) shall be presented as a straight line
17
- * - all other data series shall use 90% of width of axis (5% padding each side)
18
- * - the padding on each side shall be symmetric
19
- *
20
- * @param {object} args
21
- * @param {array<number|null>} args.data
22
- * @param {boolean} [args.beginAtZero]
23
- * @param {boolean>} [args.autoAxisPadding]
24
- * @returns {object} returns {min, max} pair
25
- */
26
- export declare const getSuggestedAxisRange: ({ data, beginAtZero, autoAxisPadding, }: IGetSuggestedAxisRange) => {
27
- min: number;
28
- max: number;
29
- } | {
30
- min: undefined;
31
- max: undefined;
32
- };
33
- export {};
@@ -1 +0,0 @@
1
- export declare const getTextWidth: (text: string, font: string) => number | undefined;
@@ -1,4 +0,0 @@
1
- import { ICommonAnnotationElement } from '../common.interface';
2
- export declare const toAnnotationObject: (annotationArr?: ICommonAnnotationElement[]) => {
3
- annotations: {};
4
- };
@@ -1,4 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { Chart } from 'chart.js';
3
- import { TLegendDatasets } from '../legend-component/legend-interface';
4
- export declare const useGeneratedLabels: (chartRef: RefObject<Chart>, generatedDatasets: TLegendDatasets) => any[];
@@ -1,28 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { Chart, LegendItem } from 'chart.js';
3
- import { UnusedParameter } from '../common.interface';
4
- export interface IUseLegendStateProps {
5
- chartRef: RefObject<Chart>;
6
- options: any;
7
- }
8
- /**
9
- * Custom hook to manage legend state.
10
- */
11
- export declare const useLegendState: ({ chartRef, options }: IUseLegendStateProps) => {
12
- legendClick: (_: UnusedParameter, legendItem: LegendItem) => void;
13
- annotation: import('../common.interface').ICommonAnnotationElement[];
14
- legend: {
15
- position: any;
16
- display: boolean | undefined;
17
- align: "center" | "start" | "end";
18
- labels: {
19
- boxHeight: number;
20
- boxWidth: number | undefined;
21
- usePointStyle: boolean | undefined;
22
- };
23
- onClick: (_: UnusedParameter, legendItem: LegendItem) => void;
24
- };
25
- customLegendPlugin: {
26
- htmlLegend: any;
27
- };
28
- };
@@ -1,4 +0,0 @@
1
- export declare const useLegend: () => {
2
- state: import('../legend-component/state/legend-state-reducer').ILegendState;
3
- dispatch: React.Dispatch<any>;
4
- };
@@ -1,4 +0,0 @@
1
- import { Dispatch } from 'react';
2
- import { TLegendAction } from '../legend-component/state/legend-state-reducer';
3
- import { TChartsOption } from '../legend-component/legend-interface';
4
- export declare const useUpdateAnnotations: (options: TChartsOption, dispatch: Dispatch<TLegendAction>) => void;
@@ -1,3 +0,0 @@
1
- import { ILegendDropZones } from './legend-interface';
2
- declare const LegendDropZones: (legendDropZonesProps: ILegendDropZones) => import("react/jsx-runtime").JSX.Element;
3
- export default LegendDropZones;
@@ -1,47 +0,0 @@
1
- import { MouseEventHandler, RefObject } from 'react';
2
- import { Chart, ChartArea } from 'chart.js';
3
- import { IGeneratedScatterChartDataset, TGeneratedScatterChartDatasets, IScatterOptions } from '../../scatter-chart/scatter-chart.interface';
4
- import { Position, ChartType } from '../enums';
5
- import { IGeneratedLineChartDataset, ILineChartOptions, TGeneratedLineChartDatasets } from '../../line-chart/line-chart.interface';
6
- import { IBarOptions, IGenerateBarChartDataset, TGenerateBarChartDatasets } from '../../bar-chart/bar-chart.interface';
7
- import { IGeneratedPieChartDataset, IPieOptions, TGeneratedPieChartDatasets } from '../../pie-chart/pie-chart.interface';
8
- export interface ILegendDropZone {
9
- position: Position;
10
- onDrop: () => void;
11
- placeholderSize?: {
12
- width?: number;
13
- height?: number;
14
- };
15
- }
16
- export interface ILegendDropZones {
17
- chartArea?: ChartArea;
18
- setLegendPosition: (position: Position) => void;
19
- isDragging: boolean;
20
- placeholderSize?: {
21
- width?: number;
22
- height?: number;
23
- };
24
- }
25
- export type TLegendDataset = IGeneratedLineChartDataset | IGenerateBarChartDataset | IGeneratedPieChartDataset | IGeneratedScatterChartDataset;
26
- export type TLegendDatasets = TGeneratedLineChartDatasets | TGenerateBarChartDatasets | TGeneratedPieChartDatasets | TGeneratedScatterChartDatasets;
27
- export type TChartsOption = ILineChartOptions | IBarOptions | IPieOptions | IScatterOptions;
28
- export interface ILegendItem {
29
- hidden: boolean;
30
- dataset: TLegendDataset;
31
- handleClick: MouseEventHandler<HTMLDivElement>;
32
- chartType: ChartType;
33
- index: number;
34
- }
35
- export interface ILegendConfig {
36
- options: TChartsOption;
37
- generatedDatasets: TLegendDatasets;
38
- chartType: ChartType;
39
- }
40
- export interface ILegend {
41
- chartRef: RefObject<Chart>;
42
- legendConfig: ILegendConfig;
43
- }
44
- export interface ILegendPanel extends ILegend {
45
- legendPosition: Position;
46
- isDragging: boolean;
47
- }
@@ -1,5 +0,0 @@
1
- import { IGeneratedLineChartDataset } from '../../../line-chart/line-chart.interface';
2
- export interface ILineLegendItemProp {
3
- dataset: IGeneratedLineChartDataset;
4
- }
5
- export declare const LegendItemLine: ({ dataset }: Record<string, any>) => import("react/jsx-runtime").JSX.Element;