Skip to main content

Interface: PointsEditorInstance

Defined in: dom/src/points-editor/index.ts:97

Properties​

beginPointDrag​

beginPointDrag: (id, modifiers) => void;

Defined in: dom/src/points-editor/index.ts:117

A pointer went down on a point: work out the new selection and remember where everything the drag picked up started.

Ctrl / meta add the point to the selection or take it out: shift is the fine-adjustment key on every control here, and it cannot be both. A press on a point already selected keeps the selection, so the group can be dragged.

Parameters​

ParameterType
idstring
modifiersModifierState

Returns​

void


beginSelectionBox​

beginSelectionBox: (at, modifiers) => void;

Defined in: dom/src/points-editor/index.ts:152

A drag on empty space started at at: start a selection box there.

Parameters​

ParameterType
atPointPosition
modifiersModifierState

Returns​

void


destroy​

destroy: () => void;

Defined in: dom/src/points-editor/index.ts:160

Returns​

void


endSelectionBox​

endSelectionBox: () => void;

Defined in: dom/src/points-editor/index.ts:159

End the selection box. The press that started it left the focus on nothing, and the arrow keys and the wheel reach a point only through the focus, so it is handed to one of the points the box selected.

Returns​

void


isPointElement​

isPointElement: (element) => boolean;

Defined in: dom/src/points-editor/index.ts:107

Whether the element is a point, or inside one.

Parameters​

ParameterType
elementElement | null | undefined

Returns​

boolean


movePointDrag​

movePointDrag: (delta) => void;

Defined in: dom/src/points-editor/index.ts:122

Move everything the drag picked up by delta from where it started, stopping the whole group together at the edge.

Parameters​

ParameterType
deltaPointPosition

Returns​

void


moveSelectionBox​

moveSelectionBox: (to) => void;

Defined in: dom/src/points-editor/index.ts:153

Parameters​

ParameterType
toPointPosition

Returns​

void


nudgeFocusedPoint​

nudgeFocusedPoint: (axis, direction, modifiers) => boolean;

Defined in: dom/src/points-editor/index.ts:146

Move the point holding the focus by one wheel notch, with its own wheel option. The wheel is listened to once for the whole editor, since a wheel event only reaches what the cursor is over. Returns whether a point took it, so the caller knows whether to consume the event.

Parameters​

ParameterType
axis"x" | "y"
directionnumber
modifiersModifierState

Returns​

boolean


nudgePoint​

nudgePoint: (id, axis, direction, option, modifiers?) => void;

Defined in: dom/src/points-editor/index.ts:133

Move id by one press of option along one axis, taking the selection along as PointsEditorInstance.nudgeSelection does.

Parameters​

ParameterType
idstring
axis"x" | "y"
directionnumber
optionModifierValue<InputEventOption>
modifiers?ModifierState

Returns​

void


nudgeSelection​

nudgeSelection: (id, delta) => void;

Defined in: dom/src/points-editor/index.ts:128

Move id — and the selection, when it is part of one — by delta from where the points are now: an input that is not a drag has no earlier position to measure against.

Parameters​

ParameterType
idstring
deltaPointPosition

Returns​

void


registerPoint​

registerPoint: (id, read) => () => void;

Defined in: dom/src/points-editor/index.ts:105

Register a point under id. read is called whenever the editor needs the point, so it can return what the point is now rather than what it was when it registered. Returns the function that unregisters it.

Parameters​

ParameterType
idstring
read() => PointsEditorPoint

Returns​

() => void


update​

update: (options) => void;

Defined in: dom/src/points-editor/index.ts:99

Replace the given options.

Parameters​

ParameterType
optionsPartial<PointsEditorOptions>

Returns​

void