@oliasoft-open-source/charts-library 4.7.0-beta-6 → 4.7.0-beta-8

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,5 +1,7 @@
1
+ import { Chart } from 'chart.js';
1
2
  import { ICommonAnnotationsData } from '../../../common/common.interface';
2
3
  import { IScales } from '../../../common/plugins/annotation-dragger-plugin/annotation-dragger-plugin';
4
+ import { AnnotationType, DragAxis } from './enums';
3
5
  export declare const getMousePosition: (event: MouseEvent, canvas: HTMLCanvasElement) => {
4
6
  x: number;
5
7
  y: number;
@@ -20,3 +22,29 @@ export declare const calculateAnnotationMetricsInValuesInPixels: (annotation: IC
20
22
  width: number | undefined;
21
23
  height: number | undefined;
22
24
  };
25
+ export interface IIsWithinChartAreaProps {
26
+ x?: number;
27
+ y?: number;
28
+ chartArea: {
29
+ left: number;
30
+ right: number;
31
+ top: number;
32
+ bottom: number;
33
+ };
34
+ scales: IScales;
35
+ metrics: {
36
+ width?: number;
37
+ height?: number;
38
+ };
39
+ resizable?: boolean;
40
+ dragRange?: {
41
+ x?: [number, number];
42
+ y?: [number, number];
43
+ } | null;
44
+ annotationType: AnnotationType;
45
+ }
46
+ export declare const isWithinChartArea: ({ x, y, chartArea, scales, metrics, resizable, dragRange, annotationType, }: IIsWithinChartAreaProps) => boolean;
47
+ export declare const updateAnnotationPositionWithinBounds: (axis: DragAxis, newPosition: number, activeAnnotation: ICommonAnnotationsData, chart: Chart, scales: IScales, metrics?: {
48
+ width?: number;
49
+ height?: number;
50
+ }) => void;
@@ -4,6 +4,7 @@ export interface ILChartOptions extends ICommonChartOptions {
4
4
  showPoints: boolean;
5
5
  closeOnOutsideClick: boolean;
6
6
  showLine: boolean;
7
+ enableDragAnnotation?: boolean;
7
8
  }
8
9
  export interface ILineChartGraph {
9
10
  lineTension: number;