Skip to content

Commit 87a080b

Browse files
committed
Update type definitions for elements
This adds type definitions for the properties accessed by the draggable demo: https://www.chartjs.org/chartjs-plugin-annotation/latest/samples/interaction/dragging.html
1 parent d67ce8b commit 87a080b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Please do not use issues for support requests. For help using the annotation plu
1212

1313
Well structured, detailed bug reports are hugely valuable for the project.
1414

15-
Guidlines for reporting bugs:
15+
Guidelines for reporting bugs:
1616

1717
- Check the issue search to see if it has already been reported
1818
- Isolate the problem to a simple test case

types/element.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ export interface AnnotationBoxModel {
1010
height: number,
1111
width: number,
1212
radius?: number
13+
// Used by polygon annotations' child point AnnotationElements
14+
bx?: number;
15+
by?: number;
1316
}
1417

1518
export interface AnnotationElement extends AnnotationBoxModel {
1619
label?: AnnotationElement,
17-
options: AnnotationOptions
20+
options: AnnotationOptions,
21+
/**
22+
* Sub-elements: e.g., a box annotation's label, or a polygon's points
23+
*/
24+
elements?: AnnotationElement[],
1825
}

0 commit comments

Comments
 (0)