marker.js 3 Documentation
    Preparing search index...

    Class CaptionFrameMarker

    Caption frame marker is a combination of a frame (rectangle) and a text caption that goes with it.

    Hierarchy (View Summary)

    Index

    Accessors

    • get container(): SVGGElement

      SVG container object holding the marker's visual.

      Returns SVGGElement

    Constructors

    Methods

    • Returns the SVG path strings for the frame and the caption background.

      Parameters

      • width: number = ...
      • height: number = ...

      Returns { caption: string; frame: string }

      SVG path strings for the frame and the caption background.

    Properties

    _container: SVGGElement

    SVG container object holding the marker's visual.

    It is created and passed to the constructor by marker editor or viewer when creating the marker.

    _fillColor: string = 'transparent'

    Fill color of the marker.

    _opacity: number = 1

    Opacity of the marker.

    _strokeColor: string = 'transparent'

    Stroke (outline) color of the marker.

    _strokeDasharray: string = ''

    Stroke (outline) dash array of the marker.

    _strokeWidth: number = 0

    Stroke (outline) width of the marker.

    applyDefaultFilter: boolean = true

    When true, the default filter is applied to the marker's visual.

    3.2.0

    DEFAULT_TEXT: string = 'Text'

    Default text for the marker type.

    defaultSize: ISize = ...

    The default marker size when the marker is created with a click (without dragging).

    height: number = 0

    Marker height.

    left: number = 0

    x coordinate of the top-left corner.

    notes?: string

    Additional information about the marker.

    Generally, this isn't used for anything functional. However, in a derived type it could be used for storing arbitrary data with no need to create extra properties and state types.

    onSizeChanged?: (textMarker: TextMarker) => void

    Callback to be called when the text size changes.

    padding: number = 2

    Text padding from the bounding box.

    rotationAngle: number = 0

    Marker's rotation angle.

    stage: MarkerStage = 'normal'

    Marker lifecycle stage.

    Most markers are created immediately after the user clicks on the canvas (normal). However, some markers are only finished creating after additional interactions (creating).

    textBlock: TextBlock = ...

    Text block handling the text rendering.

    textBoundingBox: DOMRect

    Text's bounding box where text should fit and/or be anchored to.

    title: string = 'Caption frame marker'

    Marker type title (display name) used for accessibility and other attributes.

    top: number = 0

    y coordinate of the top-left corner.

    typeName: string = 'CaptionFrameMarker'

    Marker type name.

    It's important to set this in each derived class. This value is used to identify marker types when restoring marker state and other scenarios.

    width: number = 0

    Marker width.