Vertex Viewer SDK
    Preparing search index...

    Interface VertexViewerMarkup

    interface VertexViewerMarkup {
        addMarkup: (
            markup: Markup,
        ) => Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement,
        >;
        arrowTemplateId?: string;
        centeringBehavior: MarkupCenteringBehavior;
        circleTemplateId?: string;
        disabled: boolean;
        endLineAnchorStyle: LineAnchorStyle;
        freeformTemplateId?: string;
        getMarkupElement: (
            id: string,
        ) => Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >;
        getMarkupElements: () => Promise<
            (
                | HTMLVertexViewerMarkupArrowElement
                | HTMLVertexViewerMarkupCircleElement
                | HTMLVertexViewerMarkupFreeformElement
            )[],
        >;
        offset?: Point.Point;
        originatingViewport?: Dimensions.Dimensions;
        removeMarkup: (
            id: string,
        ) => Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >;
        scale: number;
        selectedMarkupId?: string;
        selectNew: boolean;
        startLineAnchorStyle: LineAnchorStyle;
        tool: ViewerMarkupToolType;
        viewer?: HTMLVertexViewerElement;
    }
    Index
    addMarkup: (
        markup: Markup,
    ) => Promise<
        | HTMLVertexViewerMarkupArrowElement
        | HTMLVertexViewerMarkupCircleElement
        | HTMLVertexViewerMarkupFreeformElement,
    >

    Adds a new markup as a child to this component. A new markup component will be created from the template specified by arrow-template-id, circle-template-id, or if undefined a default element will be created.

    Type Declaration

      • (
            markup: Markup,
        ): Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement,
        >
      • Parameters

        • markup: Markup

          The markup to add.

        Returns Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement,
        >

        The markup element that was created.

    arrowTemplateId?: string

    An HTML template that describes the HTML to use for new arrow markup. It's expected that the template contains a <vertex-viewer-markup-arrow>.

    centeringBehavior: MarkupCenteringBehavior

    Defines the behavior of the provided markup when the originating viewport is smaller than the current viewport, or is scaled to a size smaller than the current viewport using the scale property.

    Options: - x-only: Markup will be centered horizontally, but not vertically. - y-only: Markup will be centered vertically, but not horizontally. - both: Markup will be centered both horizontally and vertically. - none: Markup will not be centered (default).

    'none'
    
    circleTemplateId?: string

    An HTML template that describes the HTML to use for new circle markup. It's expected that the template contains a <vertex-viewer-markup-circle>.

    disabled: boolean

    If true, disables adding or editing of markup through user interaction.

    false
    
    endLineAnchorStyle: LineAnchorStyle

    The style of the ending anchor. This defaults to 'arrow-triangle.'

    'arrow-triangle'
    
    freeformTemplateId?: string

    An HTML template that describes the HTML to use for new freeform markup. It's expected that the template contains a <vertex-viewer-markup-freeform>.

    getMarkupElement: (
        id: string,
    ) => Promise<
        | HTMLVertexViewerMarkupArrowElement
        | HTMLVertexViewerMarkupCircleElement
        | HTMLVertexViewerMarkupFreeformElement
        | undefined,
    >

    Returns the markup element associated to the given ID.

    Type Declaration

      • (
            id: string,
        ): Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >
      • Parameters

        • id: string

          The ID of the markup element to return.

        Returns Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >

        A markup element, or undefined.

    getMarkupElements: () => Promise<
        (
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
        )[],
    >

    Returns a list of markup elements that are children of this component.

    Type Declaration

      • (): Promise<
            (
                | HTMLVertexViewerMarkupArrowElement
                | HTMLVertexViewerMarkupCircleElement
                | HTMLVertexViewerMarkupFreeformElement
            )[],
        >
      • Returns Promise<
            (
                | HTMLVertexViewerMarkupArrowElement
                | HTMLVertexViewerMarkupCircleElement
                | HTMLVertexViewerMarkupFreeformElement
            )[],
        >

        A list of all markups.

    offset?: Point.Point

    The current offset of the visible viewport. This value is used to determine where markup should be rendered relative to the current viewport, enabling some markup to appear "off-screen".

    When provided, all computed coordinates will be offset by this amount.

    originatingViewport?: Dimensions.Dimensions

    The original viewport dimensions where this markup was created. This value is used to determine where the markup should be rendered relative to the current viewport, enabling some markup to appear "off-screen".

    When provided, all NDC values will be considered relative to this viewport.

    removeMarkup: (
        id: string,
    ) => Promise<
        | HTMLVertexViewerMarkupArrowElement
        | HTMLVertexViewerMarkupCircleElement
        | HTMLVertexViewerMarkupFreeformElement
        | undefined,
    >

    Removes a markup with the given ID, and returns the HTML element associated to the markup. Returns undefined if no markup is found.

    Type Declaration

      • (
            id: string,
        ): Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >
      • Parameters

        • id: string

          The ID of the markup to remove.

        Returns Promise<
            | HTMLVertexViewerMarkupArrowElement
            | HTMLVertexViewerMarkupCircleElement
            | HTMLVertexViewerMarkupFreeformElement
            | undefined,
        >

        The markup element, or undefined.

    scale: number

    The scale to render this markup at. This value is used to scale the element's bounds along with any offset to determine the final computed coordinates.

    When provided, all computed coordinates will be scaled by this amount.

    1
    
    selectedMarkupId?: string

    The ID of the markup that is selected.

    selectNew: boolean

    Indicates if new markup should be automatically selected.

    false
    
    startLineAnchorStyle: LineAnchorStyle

    The style of the starting anchor. This defaults to none.

    'none'
    

    The type of markup to perform.

    'arrow'
    
    viewer?: HTMLVertexViewerElement

    The viewer to connect to markup. If nested within a , this property will be populated automatically.