본문으로 건너뛰기

afterLineTitleMove

설명

라인의 텍스트 요소가 그리드 한 칸만큼 이동했을 때 발생합니다.

사용법

"afterLineTitleMove": ({
event: PointerEvent,
lineId: string | number,
titleId: string | number,
coords: object
}) => void;

매개변수

이벤트의 콜백은 다음 매개변수가 포함된 객체와 함께 호출됩니다:

  • event - 이벤트 객체
  • lineId - 라인의 id
  • titleId - 라인의 텍스트 요소 id
  • coords - 이동 후 텍스트 요소 위치의 xy 좌표가 포함된 객체이며, 여기서:
    • x - 왼쪽에서 오른쪽으로 이동하는 텍스트 요소의 수평 위치
    • y - 위에서 아래로 이동하는 텍스트 요소의 수직 위치
정보

내부 Diagram Editor 이벤트를 처리하려면 on() 메서드를 사용할 수 있습니다.

예제

// Diagram Editor 초기화
const editor = new dhx.DiagramEditor("editor_container");
// 데이터 로드
editor.parse(data);

// 이벤트에 핸들러 연결
editor.events.on("afterLineTitleMove", ({ titleId, coords }) => {
console.log(`
LineTitle ${titleId} is at the position:
x: ${coords.x}
y: ${coords.y}
`);
});

변경 로그: v6.0부터 콜백 함수는 매개변수로 객체를 받습니다