BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    Interface AnnotationLayerOptions<D>

    interface AnnotationLayerOptions<D> {
        align?: AnnotationAlign | null;
        anchor?:
            | string
            | (
                (
                    bounds: { max: number[]; min: number[] },
                    row: AnnotationRow<D>,
                ) => number[]
            );
        clustering?: boolean;
        dotBeyondMm?: number | null;
        expand?: "none" | "click" | "hover";
        filter?: (row: AnnotationRow<D>) => boolean;
        group?: string;
        join?: "query" | "union";
        key?: "qid" | "globalId";
        limit?: number | null;
        maxDistanceMm?: number;
        occlusion?: "none" | "hide" | "dim";
        onAction?: (action: string, row: AnnotationRow<D>, event: Event) => void;
        onClick?: (row: AnnotationRow<D>, event: Event) => void;
        query?:
            | string
            | {
                get?: Record<string, string>;
                models?: string[];
                parameters?: Record<string, unknown>;
                where?: string;
            };
        rows?: Iterable<AnnotationRow<Partial<D>>, any, any>;
        scaleByDistance?: boolean | null;
        template: string | AnnotationTemplate<D>;
        visibility?: "always" | "hover";
    }

    Type Parameters

    • D
    Index

    Properties

    align?: AnnotationAlign | null

    Which side of the anchor the compact box is drawn on, as Annotation.align; default the template's origin

    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?: boolean

    Whether overlapping annotations of the layer merge into one with a count; default true

    dotBeyondMm?: number | null

    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. It turns back nearer than 90 % of the distance. Default: never

    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?: (row: AnnotationRow<D>) => boolean
    group?: string

    Annotation group name; default "layer:" + template name + a counter

    join?: "query" | "union"

    With a query: "query" (default) shows only objects the query returned, "union" also application rows it did not

    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?: number | null

    At most this many annotations of the layer show, the nearest (Annotation.groupLimit)

    maxDistanceMm?: number
    occlusion?: "none" | "hide" | "dim"

    As Annotation.occlusion; default "hide"

    onAction?: (action: string, row: AnnotationRow<D>, event: Event) => void

    A click on an element with data-action="" inside an annotation

    onClick?: (row: AnnotationRow<D>, event: Event) => void

    A click on an annotation, or Enter/Space on it; makes the annotations focusable buttons

    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, AS …, … WHERE

    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?: boolean | null
    template: string | AnnotationTemplate<D>

    The template, or the name it is registered under

    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