The container in which consumer rendered some DOM.
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.
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.
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.
the rectangle which we need to fit inside of the boundingRectangle
the rectangle which the innerRectangle must fit inside
extra margin to be applied [optional, defaults to 0]
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.
position relative to container
position of container relative to page/document
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.
position relative to page/document
position of container relative to page/document
The position relative to the container.
Converts an object returned by getBoundingClientRect from screen relative coordiantes to page/document relative coordinates.
An object returned by getBoundingClientRect
The position relative to the page/document.
Finds a center point within a Bezier curve https://stackoverflow.com/questions/5634460/quadratic-b%C3%A9zier-curve-calculate-points#5634528
The center Position
Returns the current scroll position.
The current scroll position.
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.
The subtracted position object.
Generated using TypeDoc
This callback is called to cleanup event handlers for DOM rendered by the consumer before diagram maker removes the DOM.
Destroy callback when using React (diagramMakerContainer: HTMLElement) => ReactDOM.unmountComponentAtNode(diagramMakerContainer)