From 6cdd1d13546ae30650eb0e8d5d279b3f2edcfaf1 Mon Sep 17 00:00:00 2001 From: Preet <833927+pshihn@users.noreply.github.com> Date: Wed, 27 May 2020 00:46:13 -0700 Subject: [PATCH] Update README.md --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 02de0c5..8173b7c 100644 --- a/README.md +++ b/README.md @@ -60,17 +60,6 @@ ag.show(); When you create an annotation object, you pass in a config. The config only has one mandatory field, which is the `type` of the annotation. But you can configure the annotation in many ways. -export interface RoughAnnotationConfig { - type: RoughAnnotationType; - animate?: boolean; // defaults to true - animationDuration?: number; // defaulst to 1000ms - animationDelay?: number; // default = 0 - color?: string; // defaults to currentColor - strokeWidth?: number; // default based on type - padding?: number; // defaults to 5px -} - - #### type This is a mandatory field. It sets the annotation style. Following are the list of supported annotation types: @@ -103,4 +92,18 @@ Width of the annotation strokes. Default value is `1`. #### padding Padding between the element and roughly where the annotation is drawn. Default value is `5` (in pixels). +## Annotation Object +When you call the `annotate` function, you get back an annotation object, which has the following methods: + +#### isShowing(): boolean +Returns if the annotation is showing + +#### show() +Drawns the annotation. If the annotation is set to animate (default), it will animate the drawing. If called again, it will re-draw the animation. + +#### hide() +Hides the annotation if showing. This is not animated. + +#### remove() +Unlinks the annotation from the element.