AnnotationLayerOptions
Interface in @bimworks/viewercommon.
API catalogue · @bimworks/viewercommon · Interface
interface AnnotationLayerOptions<D>Type parameters#
| Name | Constraint | Description |
|---|---|---|
D |
`` |
Members#
| Member | Kind | Description |
|---|---|---|
| align | Property | Which side of the anchor the compact box is drawn on, as Annotation.align; default the template's origin |
| anchor | Property | Where on the object: a point of its box in its model's axes as Annotation.anchor (default the template's, else "center"), or a function of its bounds in view… |
| clustering | Property | Whether overlapping annotations of the layer merge into one with a count; default true |
| dotBeyondMm | Property | Beyond this distance a row is a 10 px dot in its status colour with its label as the title, and the template is not called; hovered, it shows the template. I… |
| expand | Property | When an expandable template's card shows: "hover" (after 250 ms; a click, tap or Enter pins it), "click", or "none". Default: "none" for a layer shown only o… |
| filter | Property | |
| group | Property | Annotation group name; default "layer:" + template name + a counter |
| join | Property | With a query: "query" (default) shows only objects the query returned, "union" also application rows it did not |
| key | Property | What identifies a row: the object's qid (default), or its IFC GlobalId for data from outside. With a query the layer gets attribute.GlobalId and joins on it … |
| limit | Property | At most this many annotations of the layer show, the nearest (Annotation.groupLimit) |
| maxDistanceMm | Property | |
| occlusion | Property | As Annotation.occlusion; default "hide" |
| onAction | Property | A click on an element with data-action="" inside an annotation |
| onClick | Property | A click on an annotation, or Enter/Space on it; makes the annotations focusable buttons |
| query | Property | Data from BQL, fetched in one batch on the loaded models (and on models loaded later). A string is sent as it is and its data keeps the records' shape (d.att… |
| rows | Property | Data from the application, joined to the query's rows by key (the application's fields win) |
| scaleByDistance | Property | |
| template | Property | The template, or the name it is registered under |
| visibility | Property | "hover": shown only while its object is hovered, fading in after a moment and out quickly. Without onClick, onAction or a card (expand), the pointer goes thr… |
align#
align?: AnnotationAlign | nullWhich side of the anchor the compact box is drawn on, as Annotation.align; default the template's origin
anchor#
anchor?: string | (bounds: { max: (number)[]; min: (number)[] }, row: AnnotationRow<D>) => (number)[]Where on the object: a point of its box in its model's axes as Annotation.anchor (default the
template's, else "center"), or a function of its bounds in viewer coordinates
clustering#
clustering?: booleanWhether overlapping annotations of the layer merge into one with a count; default true
dotBeyondMm#
dotBeyondMm?: number | nullBeyond this distance a row is a 10 px dot in its status colour with its label as the title, and the template is not called; hovered, it shows the template. It turns back nearer than 90 % of the distance. Default: never
expand#
expand?: "none" | "click" | "hover"When an expandable template's card shows: "hover" (after 250 ms; a click, tap or Enter pins it), "click", or "none". Default: "none" for a layer shown only on hover (visibility "hover"), else the template's default, else "hover"
filter#
filter?: (row: AnnotationRow<D>) => booleangroup#
group?: stringAnnotation group name; default "layer:" + template name + a counter
join#
join?: "query" | "union"With a query: "query" (default) shows only objects the query returned, "union" also application rows it did not
key#
key?: "qid" | "globalId"What identifies a row: the object's qid (default), or its IFC GlobalId for data from outside. With a query the layer gets attribute.GlobalId and joins on it (a string query returns it as a globalId column); without one it finds the GlobalIds' objects in one query, and again for GlobalIds it has not seen and for models loaded later
limit#
limit?: number | nullAt most this many annotations of the layer show, the nearest (Annotation.groupLimit)
maxDistanceMm#
maxDistanceMm?: numberocclusion#
occlusion?: "none" | "hide" | "dim"As Annotation.occlusion; default "hide"
onAction#
onAction?: (action: string, row: AnnotationRow<D>, event: Event) => voidA click on an element with data-action="
onClick#
onClick?: (row: AnnotationRow<D>, event: Event) => voidA click on an annotation, or Enter/Space on it; makes the annotations focusable buttons
query#
query?: string | { get?: Record<string, string>; models?: (string)[]; parameters?: Record<string, unknown>; where?: string }Data from BQL, fetched in one batch on the loaded models (and on models loaded later). A string is sent as it
is and its data keeps the records' shape (d.attribute.Name); {where, get} asks for the template's fields and
get's as their keys: GET qid, type,
rows#
rows?: Iterable<AnnotationRow<Partial<D>>, any, any>Data from the application, joined to the query's rows by key (the application's fields win)
scaleByDistance#
scaleByDistance?: boolean | nulltemplate#
template: string | AnnotationTemplate<D>The template, or the name it is registered under
visibility#
visibility?: "always" | "hover""hover": shown only while its object is hovered, fading in after a moment and out quickly. Without onClick, onAction or a card (expand), the pointer goes through it to the objects below, and Viewer3D draws it beside its object's footprint on screen