This change adds event prop for ui.image_annotator component with an option to specify the click and tool_change events.
The click event contains the x and y coordinates of the clicked point on the image canvas. A tool_change event contains the name of the selected tool (rect, polygon or select).
Updated API is as follows:
export interface ImageAnnotator {
/** An identifying name for this component. */
name: Id
/** The path or URL of the image to be presented for annotation. */
image: S
/** The image annotator's title. */
title: S
/** The master list of tags that can be used for annotations. */
tags: ImageAnnotatorTag[]
/** Annotations to display on the image, if any. */
items?: ImageAnnotatorItem[]
/** True if the form should be submitted as soon as an annotation is drawn. */
trigger?: B
/** The card’s image height. The actual image size is used by default. */
image_height?: S
/** List of allowed shapes. Available values are 'rect' and 'polygon'. If not set, all shapes are available by default. */
allowed_shapes?: S[]
/** The events to capture on this image annotator. One of `click` or `tool_change`. */
events?: S[]
}
This change adds
event
prop forui.image_annotator
component with an option to specify theclick
andtool_change
events.The
click
event contains thex
andy
coordinates of the clicked point on the image canvas. Atool_change
event contains the name of the selected tool (rect
,polygon
orselect
).Updated API is as follows:
Closes #2010