Skip to main content


fires after an item has been collapsed

afterCollapse: (id: Id, dir?: TreeDirection) => void;


  • id: string | number - the id of an item which has been collapsed
  • dir: string - optional, the side the children were hidden in relation to the parent shape ("left" or "right" for type:"topic", otherwise - undefined)

Example"afterCollapse", function(id, dir) {
console.log( + " was collapsed", dir);

Change log:

The dir parameter has been added in v3.1.