Skip to main content
Version: 4.3

selectElementPosition()

function selectElementPosition(element): PlainPoint;

Selects an element's top-left position { x, y }. A subscribed component re-renders only when the element moves.

Parameters​

ParameterTypeDescription
elementInternalElementRecord<unknown>the resolved element record

Returns​

PlainPoint

Example​

import { useCell, selectElementPosition } from '@joint/react';

const { x, y } = useCell(elementId, selectElementPosition);

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub