Element describes the common metadata of all visible elements in a note file (and in document annotation scenarios), such as strokes, titles, links, TextBox, geometries, and pictures.
An Element uses type to distinguish its category and provides more specific structures under the corresponding fields (e.g. stroke, title, link, textBox, geometry, picture).
If you only care about the element category, read type. If you need to operate on the content, read typed fields such as stroke/title/link/textBox/geometry based on type.
Type Constants
ElementType defines the value range of Element.type.
ElementType
In the table below, the ElementType. prefix is omitted in the Constant column. In code, use the full name: ElementType.XXX.
Fields
angles and contoursSrc are accessor objects, not full arrays. Fetch data asynchronously via size()/get()/getRange() to avoid JS memory issues caused by transferring large point sets at once.
maxX and maxY are still EMR-scale values. In sn-plugin-lib later than 0.1.65, they are not on the same scale as the returned Android sample points, so do not use them in coordinate calculations. Avoid using them; they are kept for 0.1.65 and earlier. Coordinates are based on the actual page size from getPageSize.
FiveStar (Five-star)
When type === 800, the fiveStar field provides the point set of the five-star element.
Methods
element.recycle() is equivalent to PluginCommAPI.recycleElement(element.uuid) — it’s just called directly on the Element instance instead. Either form works; see recycleElement and Element Caching and Release for details.