marker.js 3 Documentation
    Preparing search index...

    Class TextMarkerEditor<TMarkerType>

    Editor for text markers.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Accessors

    • get container(): SVGGElement

      Returns the SVG container for the marker's and editor's visual elements.

      Returns SVGGElement

    • get continuousCreation(): boolean

      When set to true, a new marker of the same type is created immediately after the current one is finished.

      Returns boolean

    • get overlayContainer(): HTMLDivElement

      Overlay container for HTML elements like text editors, etc.

      Returns HTMLDivElement

    • get strokeDasharray(): string

      Gets marker's stroke (outline) dash array.

      Returns string

    • set strokeDasharray(dashes: string): void

      Sets marker's stroke (outline) dash array.

      Parameters

      • dashes: string

        dash array as string

      Returns void

    Constructors

    Methods

    • Handles pointer (mouse, touch, stylus, etc.) double click event.

      Parameters

      • point: IPoint

        event coordinates.

      • Optionaltarget: EventTarget

        direct event target element.

      • Optionalev: MouseEvent

        pointer event.

      Returns void

    • Type guard for specific marker editor types.

      This allows to check if the editor is of a specific type which is useful for displaying type-specific UI.

      Type Parameters

      • T

        specific marker editor type.

      Parameters

      • cls: new (...args: any[]) => T

      Returns this is T

    • Returns true if the marker or the editor owns supplied target element.

      Parameters

      • el: EventTarget

        target element

      Returns boolean

    • Positions specific grip.

      Parameters

      • grip: undefined | SVGGraphicsElement
      • x: number
      • y: number

      Returns void

    • Called by a marker when its state could have changed. Does a check if the state has indeed changed before firing the handler.

      Returns void

    Properties

    _container: SVGGElement

    SVG container for the marker's and editor's visual elements.

    _continuousCreation: boolean = false

    When set to true, a new marker of the same type is created immediately after the current one is finished.

    _controlBox: SVGGElement = ...

    SVG group holding editor's control box.

    _creationStyle: MarkerCreationStyle = 'draw'

    Marker creation style.

    Markers can either be created by drawing them or just dropping them on the canvas.

    _isSelected: boolean = false

    Is this marker selected?

    _marker: TMarkerType

    Marker instance.

    _markerType: new (container: SVGGElement) => TMarkerType

    Marker type constructor.

    Type declaration

      • new (container: SVGGElement): TMarkerType
      • Marker type constructor.

        Parameters

        • container: SVGGElement

        Returns TMarkerType

    _overlayContainer: HTMLDivElement

    Overlay container for HTML elements like text editors, etc.

    _state: MarkerEditorState = 'new'

    Editor's state.

    _suppressMarkerCreateEvent: boolean = false

    When set to true marker created event will not be triggered.

    activeGrip?: Grip

    Active grip during manipulation

    controlBox: SVGGElement = ...

    Container for the marker's editing controls.

    disabledResizeGrips: GripLocation[] = []

    Array of disabled resize grips.

    Use this in derived classes to disable specific resize grips.

    isMultiSelected: boolean = false

    Is this marker selected in a multi-selection?

    manipulationBox: SVGGElement = ...

    Container for the marker's manipulation grips.

    manipulationStartHeight: number = 0

    Height at the start of manipulation.

    manipulationStartLeft: number = 0

    x coordinate of the top-left corner at the start of manipulation.

    manipulationStartState?: string

    Marker's state when it is selected

    manipulationStartTop: number = 0

    y coordinate of the top-left corner at the start of manipulation.

    manipulationStartWidth: number = 0

    Width at the start of manipulation.

    manipulationStartX: number = 0

    x coordinate of the pointer at the start of manipulation.

    manipulationStartY: number = 0

    y coordinate of the pointer at the start of manipulation.

    offsetX: number = 0

    Pointer's horizontal distance from the top left corner.

    offsetY: number = 0

    Pointer's vertical distance from the top left corner.

    onMarkerCreated?: <T extends MarkerBaseEditor<MarkerBase>>(editor: T) => void

    Method called when marker creation is finished.

    onStateChanged?: <T extends MarkerBaseEditor<MarkerBase>>(editor: T) => void

    Method to call when marker state changes.

    textBlockEditor: TextBlockEditor

    Text block editor.

    textBlockEditorContainer: SVGForeignObjectElement = ...

    Container for text block editor.