afterLineTitleMove
Description
Fires when a text element of a line is moved one grid step
Usage
"afterLineTitleMove": ({
event: PointerEvent,
lineId: string | number,
titleId: string | number,
coords: object
}) => void;
Parameters
The callback of the event is called with an object with the following parameters:
event
- an event objectlineId
- the id of a linetitleId
- the id of a text element of a linecoords
- an object with thex
andy
coordinates of the text element position after movement, where:x
- the horizontal position of the text element, moving from left to righty
- the vertical position of the text element, moving from top to bottom
info
For handling the inner Diagram Editor events you can use the on() method.
Example
// initializing Diagram Editor
const editor = new dhx.DiagramEditor("editor_container");
// loading data
editor.parse(data);
// attaching a handler to the event
editor.events.on("afterLineTitleMove", ({ titleId, coords }) => {
console.log(`
LineTitle ${titleId} is at the position:
x: ${coords.x}
y: ${coords.y}
`);
});
Change log: The callback function takes an object as a parameter since v6.0