Options
All
  • Public
  • Public/Protected
  • All
Menu

Module service

Index

Type aliases

BoundRenderCallback: (diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void) => HTMLElement | undefined | void

Type declaration

    • (diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void): HTMLElement | undefined | void
    • Parameters

      • diagramMakerContainer: HTMLElement
      • Optional consumerContainer: HTMLElement | void

      Returns HTMLElement | undefined | void

DestroyCallback: (diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void) => void

Type declaration

    • (diagramMakerContainer: HTMLElement, consumerContainer?: HTMLElement | void): void
    • This callback is called to cleanup event handlers for DOM rendered by the consumer before diagram maker removes the DOM.

      example

      Destroy callback when using React (diagramMakerContainer: HTMLElement) => ReactDOM.unmountComponentAtNode(diagramMakerContainer)

      Parameters

      • diagramMakerContainer: HTMLElement

        The container in which consumer rendered some DOM.

      • Optional consumerContainer: HTMLElement | void

        This is passed only if the consumer returned this in renderCallback. Useful for Preact, where you need to provide the element within the container to diff against.

      Returns void

EventListener: (event: Event) => void

Type declaration

    • (event: Event): void
    • Parameters

      • event: Event

      Returns void

EventNormalizer: (event: any, contextOffset: Position) => NormalizedEvent | void | undefined

Type declaration

Variables

ConnectorPlacement: { BOUNDARY: BOUNDARY; CENTERED: CENTERED; LEFT_RIGHT: LEFT_RIGHT; TOP_BOTTOM: TOP_BOTTOM } = ...

Type declaration

DragEvent: { DRAG: DRAG; DRAG_END: DRAG_END; DRAG_START: DRAG_START } = ...

Type declaration

DropEvent: { DRAG_ENTER: DRAG_ENTER; DRAG_LEAVE: DRAG_LEAVE; DRAG_OVER: DRAG_OVER; DROP: DROP } = ...

Type declaration

Event: { DRAG: DRAG; DRAG_END: DRAG_END; DRAG_ENTER: DRAG_ENTER; DRAG_LEAVE: DRAG_LEAVE; DRAG_OVER: DRAG_OVER; DRAG_START: DRAG_START; DROP: DROP; KEY_DOWN: KEY_DOWN; KEY_PRESS: KEY_PRESS; KEY_UP: KEY_UP; LEFT_CLICK: LEFT_CLICK; MOUSE_DOWN: MOUSE_DOWN; MOUSE_MOVE: MOUSE_MOVE; MOUSE_OUT: MOUSE_OUT; MOUSE_OVER: MOUSE_OVER; MOUSE_UP: MOUSE_UP; MOUSE_WHEEL: MOUSE_WHEEL; RESIZE: RESIZE; RIGHT_CLICK: RIGHT_CLICK } = ...

Type declaration

KeyboardEvent: { KEY_DOWN: KEY_DOWN; KEY_PRESS: KEY_PRESS; KEY_UP: KEY_UP } = ...

Type declaration

MouseClickEvent: { LEFT_CLICK: LEFT_CLICK; MOUSE_DOWN: MOUSE_DOWN; MOUSE_UP: MOUSE_UP; RIGHT_CLICK: RIGHT_CLICK } = ...

Type declaration

MouseMoveEvent: { MOUSE_MOVE: MOUSE_MOVE; MOUSE_OUT: MOUSE_OUT; MOUSE_OVER: MOUSE_OVER } = ...

Type declaration

Shape: { CIRCLE: CIRCLE; RECTANGLE: RECTANGLE } = ...

Type declaration

VisibleConnectorTypes: { BOTH: BOTH; INPUT_ONLY: INPUT_ONLY; NONE: NONE; OUTPUT_ONLY: OUTPUT_ONLY } = ...

Type declaration

WheelEvent: { MOUSE_WHEEL: MOUSE_WHEEL } = ...

Type declaration

WindowEvent: { RESIZE: RESIZE } = ...

Type declaration

Functions

  • Adds two position objects. Keep in mind that one of the positions should be of the entity that the other position is relative to. For example: firstPosition is position of A relative to B & secondPosition is position of B relative to C, then this function returns position of A relative to C.

    Parameters

    Returns Position

    The added position object.

  • Returns a position which is based off of innerRectangle's position but is modified so that the etirety of the innerRectangle fits inside of the boundingRectangle if possible.

    The difference between the returned position and innerRectangle.position should be as small as possible while still constraining the innerRectangle within the boundingRectangle.

    If the innerRectangle is already fully within the boundingRectangle, the returned position is the same as innerRectangle.position.

    Parameters

    • innerRectangle: Rectangle

      the rectangle which we need to fit inside of the boundingRectangle

    • boundingRectangle: Rectangle

      the rectangle which the innerRectangle must fit inside

    • margin: number = 0

      extra margin to be applied [optional, defaults to 0]

    Returns Position

    the new position for innerRectangle in order to constrain it within the boundingRectangle

  • Converts a position relative to the container to a position relative to page/document. Relies on container's position relative to the page/document.

    Parameters

    • contextPosition: Position

      position relative to container

    • contextOffset: Position

      position of container relative to page/document

    Returns Position

    The position relative to the page/document.

  • Converts a position relative to the page/document to a position relative to the container. Relies on container's position relative to the page/document.

    Parameters

    • pagePosition: Position

      position relative to page/document

    • contextOffset: Position

      position of container relative to page/document

    Returns Position

    The position relative to the container.

  • Converts a position relative to the page/document to a position relative to the screen. Relies on the current scroll position.

    Parameters

    • pagePosition: Position

      position relative to the page/document

    Returns Position

    The position relative to the screen.

  • fromScreenToPage(screenRect: ClientRect | DOMRect): Position
  • Converts an object returned by getBoundingClientRect from screen relative coordiantes to page/document relative coordinates.

    Parameters

    • screenRect: ClientRect | DOMRect

      An object returned by getBoundingClientRect

    Returns Position

    The position relative to the page/document.

  • Returns Rectangle

  • getBrowserSize(): Size
  • Returns Size

  • getCenteredPosition(topLeftPosition: Position, size: Size): { x: number; y: number }
  • Returns the centered position inside the container.

    Parameters

    • topLeftPosition: Position

      Position of the top left edge of the container

    • size: Size

      Size of the container

    Returns { x: number; y: number }

    Position for the center of the container

    • x: number
    • y: number
  • Finds point to draw curve between two position objects

    Parameters

    Returns Position

    The inflection point position object

  • Finds the center between two position objects.

    Parameters

    Returns Position

    The center position object

  • Returns the current scroll position.

    Returns Position

    The current scroll position.

  • Returns true if the given position is within the given rectangle

    Parameters

    • position: Position

      the position which much be in the rectangle

    • rectange: Rectangle

      the rectangle which must contain the position

    Returns boolean

    indicates whether the position is inside of the rectangle

  • Subtracts the second position object from the first. Keep in mind that both positions should be relative to the same entity. For example: firstPosition is position of A relative to C & secondPosition is position of B relative to C, then this function returns position of A relative to B.

    Parameters

    Returns Position

    The subtracted position object.

Generated using TypeDoc