@oliasoft-open-source/charts-library 4.3.0-beta-1 → 4.3.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.
@@ -26,6 +26,7 @@ export interface ICommonAnnotationElement {
26
26
  content: string;
27
27
  };
28
28
  options: {
29
+ id?: string;
29
30
  scaleID?: string;
30
31
  borderColor?: string;
31
32
  borderWidth?: number;
@@ -45,6 +46,7 @@ export interface ICoordinates {
45
46
  export interface ICommonAnnotationsData {
46
47
  display?: boolean;
47
48
  hideLegend?: boolean;
49
+ id?: string;
48
50
  adjustScaleRange: boolean;
49
51
  annotationAxis: 'x' | 'y';
50
52
  color: string;
@@ -58,6 +60,7 @@ export interface ICommonAnnotationsData {
58
60
  yMax: number;
59
61
  xValue?: number;
60
62
  yValue?: number;
63
+ radius?: number;
61
64
  enableDrag?: boolean;
62
65
  onDragStart?: (coordinates: ICoordinates) => void;
63
66
  onDrag?: (coordinates: ICoordinates) => void;
@@ -5,6 +5,9 @@ export interface IGetAnnotationsProps {
5
5
  showAnnotations: boolean;
6
6
  annotationsData: ICommonAnnotationsData[];
7
7
  }
8
+ interface TChart extends Chart {
9
+ hoveredAnnotationId?: string | null;
10
+ }
8
11
  declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotationsProps) => ICommonAnnotationElement[] | {
9
12
  display: boolean | undefined;
10
13
  annotationIndex: number;
@@ -34,12 +37,12 @@ declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotat
34
37
  enter: ({ element, }: {
35
38
  element: ICommonAnnotationElement;
36
39
  }, { chart, }: {
37
- chart: Chart;
40
+ chart: TChart;
38
41
  }) => void;
39
42
  leave: ({ element, }: {
40
43
  element: ICommonAnnotationElement;
41
44
  }, { chart, }: {
42
- chart: Chart;
45
+ chart: TChart;
43
46
  }) => void;
44
47
  onDragStart: () => (cord: ICoordinates) => void;
45
48
  onDrag: () => (cord: ICoordinates) => void;
@@ -55,6 +58,7 @@ declare const getAnnotation: ({ showAnnotations, annotationsData, }: IGetAnnotat
55
58
  yMax: number;
56
59
  xValue?: number | undefined;
57
60
  yValue?: number | undefined;
61
+ radius?: number | undefined;
58
62
  enableDrag?: boolean | undefined;
59
63
  }[];
60
64
  export default getAnnotation;
@@ -1,6 +1,6 @@
1
1
  import { Chart } from 'chart.js';
2
2
  import { IScales } from '../../../common/plugins/annotation-dragger-plugin/annotation-dragger-plugin';
3
3
  import { ICommonAnnotationsData } from '../../../common/common.interface';
4
- export declare const handleAnnotationMouseDown: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, annotations: Record<string, ICommonAnnotationsData>, setDraggingState: (isDragging: boolean, annotation: ICommonAnnotationsData | null, dragStartX: number, dragStartY: number) => void) => void;
4
+ export declare const handleAnnotationMouseDown: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, annotations: Record<string, ICommonAnnotationsData>, setDraggingState: (isDragging: boolean, annotation: ICommonAnnotationsData | null, dragStartX: number, dragStartY: number) => void, hoveredAnnotationId: string | null) => void;
5
5
  export declare const handleAnnotationMouseMove: (event: MouseEvent, canvas: HTMLCanvasElement, scales: IScales, isDragging: boolean, activeAnnotation: ICommonAnnotationsData | null, dragStartX: number, dragStartY: number, chart: Chart) => void;
6
6
  export declare const handleAnnotationMouseUp: (isDragging: boolean, activeAnnotation: ICommonAnnotationsData | null, chart: Chart, setDraggingState: (isDragging: boolean, annotation: ICommonAnnotationsData | null) => void) => void;
@@ -8,7 +8,6 @@ export declare const getMousePositionInCoordinates: (event: MouseEvent, canvas:
8
8
  x: number;
9
9
  y: number;
10
10
  };
11
- export declare const getActiveAnnotation: (x: number, y: number, annotations: Record<string, ICommonAnnotationsData>) => ICommonAnnotationsData;
12
11
  export declare const calculateAnnotationMetricsInValues: (annotation: ICommonAnnotationsData) => {
13
12
  centerX: number | undefined;
14
13
  centerY: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "4.3.0-beta-1",
3
+ "version": "4.3.0-beta-2",
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": {