Skip to main content

scroll

Description

Fires when a diagram is being scrolled

Usage

scroll: (position: object) => void;

Parameters

The callback of the event takes the following parameter:

  • position - (required) the position of a scroll. The object contains x and y coordinates of the current scroll position, e.g.: {x: 67, y: 130}

Example

// initializing Diagram
const diagram = new dhx.Diagram("diagram_container", {
type: "org",
scroll: true
});
// loading data
diagram.data.parse(data);

// attaching a handler to the event
diagram.events.on("scroll", function(pos){
console.log("The diagram has been scrolled")
});

Related articles:

Related samples: