@oliasoft-open-source/charts-library 4.3.3-beta-10 → 4.3.3

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.
@@ -1,6 +1,6 @@
1
1
  import { IBarOptions } from '../bar-chart.interface.ts';
2
2
  type ExtendedDisplayOptions = 'auto' | boolean;
3
- interface IExtendedDataLabelsOptions {
3
+ export interface IExtendedDataLabelsOptions {
4
4
  display: ExtendedDisplayOptions;
5
5
  }
6
6
  /**
@@ -0,0 +1,54 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { Chart } from 'chart.js';
3
+ import { AxisType, ChartHoverMode } from '../../common/helpers/enums';
4
+ import { IBarDefaultProps } from '../bar-chart.interface';
5
+ export interface IUseBarChartOptionsProps {
6
+ chart: IBarDefaultProps;
7
+ chartRef: MutableRefObject<Chart | null>;
8
+ }
9
+ export declare const useBarChartOptions: ({ chart, chartRef, }: IUseBarChartOptionsProps) => {
10
+ onClick: (_evt: import("chart.js").ChartEvent, _elements: import("chart.js").ActiveElement[], chartInstance: Chart<keyof import("chart.js").ChartTypeRegistry, (number | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | null)[], unknown>) => void;
11
+ onHover: (evt: import("chart.js").ChartEvent, hoveredItems: import("../../common/common.interface").ICommonHoveredItems[]) => void;
12
+ indexAxis: AxisType;
13
+ maintainAspectRatio: boolean | undefined;
14
+ animation: false | {
15
+ duration: number;
16
+ } | undefined;
17
+ hover: {
18
+ mode: ChartHoverMode;
19
+ intersect: boolean;
20
+ };
21
+ scales: any;
22
+ plugins: {
23
+ title: {
24
+ display: boolean;
25
+ text: string | string[] | undefined;
26
+ } | {
27
+ display?: undefined;
28
+ text?: undefined;
29
+ };
30
+ datalabels: import("./get-bar-chart-data-labels").IExtendedDataLabelsOptions;
31
+ annotation: {
32
+ annotations: {};
33
+ };
34
+ tooltip: Record<string, any>;
35
+ legend: {
36
+ display: boolean;
37
+ position: any;
38
+ align: "end" | "start" | "center";
39
+ labels: {
40
+ boxHeight: number;
41
+ boxWidth: number | undefined;
42
+ usePointStyle: boolean | undefined;
43
+ };
44
+ onClick: (_: any, legendItem: import("chart.js").LegendItem) => void;
45
+ };
46
+ customLegendPlugin: {
47
+ htmlLegend: any;
48
+ };
49
+ chartAreaBorder: {
50
+ borderColor: string;
51
+ };
52
+ dragData: false | object | import("../../common/helpers/get-draggableData").IDraggableData | undefined;
53
+ };
54
+ };
@@ -9,6 +9,7 @@ interface TChart extends Chart {
9
9
  hoveredAnnotationId?: string | null;
10
10
  }
11
11
  declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotationsProps) => ICommonAnnotationElement[] | {
12
+ drawTime: string;
12
13
  display: boolean | undefined;
13
14
  annotationIndex: number;
14
15
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { ICommonOptions } from '../common.interface';
2
- interface IDraggableDataOptions {
2
+ export interface IDraggableDataOptions {
3
3
  dragX: boolean;
4
4
  dragY: boolean;
5
5
  round: boolean;
@@ -8,7 +8,7 @@ interface IDraggableDataOptions {
8
8
  onDrag: () => void;
9
9
  onDragEnd: () => void;
10
10
  }
11
- interface IDraggableData {
11
+ export interface IDraggableData {
12
12
  dragData: IDraggableDataOptions;
13
13
  }
14
14
  /**
@@ -1,7 +1,7 @@
1
1
  import { ChartEvent } from 'chart.js';
2
2
  import { IPieChartDataset, IPieOptions } from './pie-chart.interface';
3
3
  import { AlignOptions, Position } from '../common/helpers/enums';
4
- interface IDefaultChartStyling {
4
+ export interface IDefaultChartStyling {
5
5
  width?: number | string;
6
6
  height?: number | string;
7
7
  maintainAspectRatio: boolean;
@@ -0,0 +1,107 @@
1
+ import { ActiveElement, Chart, ChartEvent } from 'chart.js';
2
+ import { IScatterChartDefaultProps } from '../../scatter-chart/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
+ onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: Chart) => void;
10
+ onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
11
+ chartStyling: import('../../scatter-chart/scatter-chart-default-props.interface').IDefaultChartStyling;
12
+ interactions: {
13
+ onLegendClick: (_: any, legendItem: import("chart.js").LegendItem) => void;
14
+ onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
15
+ };
16
+ scales: {
17
+ x: {
18
+ type: "linear";
19
+ position: any;
20
+ beginAtZero: boolean;
21
+ reverse: boolean;
22
+ suggestedMax: number | undefined;
23
+ suggestedMin: number | undefined;
24
+ min: number | undefined;
25
+ max: number | undefined;
26
+ title: {
27
+ display: boolean;
28
+ text: string | undefined;
29
+ padding: number;
30
+ };
31
+ ticks: {
32
+ includeBounds: boolean;
33
+ font: {
34
+ size: number;
35
+ };
36
+ stepSize: number | undefined;
37
+ };
38
+ grid: {};
39
+ };
40
+ y: {
41
+ type: "linear";
42
+ position: any;
43
+ beginAtZero: boolean;
44
+ reverse: boolean;
45
+ suggestedMax: number | undefined;
46
+ suggestedMin: number | undefined;
47
+ min: number | undefined;
48
+ max: number | undefined;
49
+ title: {
50
+ display: boolean;
51
+ text: string | undefined;
52
+ padding: number;
53
+ };
54
+ ticks: {
55
+ includeBounds: boolean;
56
+ font: {
57
+ size: number;
58
+ };
59
+ stepSize: number | undefined;
60
+ };
61
+ grid: {};
62
+ };
63
+ };
64
+ plugins: {
65
+ legend: {
66
+ display: boolean;
67
+ position: any;
68
+ align: "end" | "start" | "center";
69
+ labels: {
70
+ boxHeight: number;
71
+ boxWidth: number | undefined;
72
+ usePointStyle: boolean | undefined;
73
+ };
74
+ onClick: (_: any, legendItem: import("chart.js").LegendItem) => void;
75
+ };
76
+ customLegendPlugin: {
77
+ htmlLegend: any;
78
+ };
79
+ title: {
80
+ display: boolean;
81
+ text: string | string[] | undefined;
82
+ } | {
83
+ display?: undefined;
84
+ text?: undefined;
85
+ };
86
+ annotation: {
87
+ annotations: {};
88
+ };
89
+ chartAreaBorder: {
90
+ borderColor: string;
91
+ };
92
+ datalabels: {
93
+ display: boolean;
94
+ };
95
+ tooltip: {
96
+ enabled: boolean;
97
+ callbacks: {
98
+ title: (tooltipItems: import("chart.js").TooltipItem<"scatter">[]) => string | undefined;
99
+ label: (tooltipItem: import('../../scatter-chart/utils/get-tooltip-config').IScatterTooltipItem) => string;
100
+ };
101
+ backgroundColor: string;
102
+ displayColors: boolean;
103
+ padding: number;
104
+ };
105
+ };
106
+ };
107
+ };
@@ -2,7 +2,7 @@ import { ChartEvent } from 'chart.js';
2
2
  import { ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonCustomLegend, ICommonLegend } from '../common/common.interface';
3
3
  import { ChartDirection } from '../common/enums';
4
4
  import { IScatterAxes, IScatterChartDataset } from './scatter-chart.interface';
5
- interface IDefaultChartStyling {
5
+ export interface IDefaultChartStyling {
6
6
  width?: number | string;
7
7
  height?: number | string;
8
8
  maintainAspectRatio: boolean;
@@ -4,7 +4,7 @@ interface IRawData {
4
4
  x: number;
5
5
  y: number;
6
6
  }
7
- interface IScatterTooltipItem extends TooltipItem<'scatter'> {
7
+ export interface IScatterTooltipItem extends TooltipItem<'scatter'> {
8
8
  raw: IRawData;
9
9
  }
10
10
  export declare const getTooltipsConfig: (options: IDefaultScatterOptions) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "4.3.3-beta-10",
3
+ "version": "4.3.3",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "resolutions": {