I am working on minfusion library. It works fine but whenever i fold or unfold. it give the below error attached in pic can you please look in to this problem and let me know where i am going wrong.
this.diagram.addEventListener(Events.containerFolded, (sender, args) => {
const node = args.getNode();
const r = node.getBounds();
r.height = nodeAttribute.height;
r.width = nodeAttribute.width;
node.setBounds(r, true, true);
this.setOffsetFoldedChildNode(node, node.unfoldedSize.height - node.captionHeight);
node.updateLinks();
});
this.diagram.addEventListener(Events.containerUnfolded, (sender, args) => {
const node = args.getNode();
const r = node.getBounds();
r.height = node.unfoldedSize.height;
r.width = node.unfoldedSize.width;
node.setBounds(r, true, true);
this.setOffsetUnFoldedChildNode(node, node.unfoldedSize.height - node.captionHeight);
node.updateLinks();
});
this.diagram.addEventListener(Events.nodeClicked, (sender, args) => {
const node = args.getNode();
this.nodeClick.emit(node.data);
});
private setOffsetFoldedChildNode(node, offset) {
const links = node.getOutgoingLinks();
for (let l = 0; l < links.length; l++) {
const link = links[l];
const child = link.getDestination();
const rect = child.getBounds().clone();
rect.y -= offset;
child.setBounds(rect, true, true);
for (let c = 1; c < link.getControlPoints().length - 1; c++) {
link.getControlPoints()[c].y -= offset;
}
link.updateFromPoints();
this.setOffsetFoldedChildNode(child, offset);
}
}
private setOffsetUnFoldedChildNode(node, offset) {
const links = node.getOutgoingLinks();
for (let l = 0; l < links.length; l++) {
const link = links[l];
const child = link.getDestination();
const rect = child.getBounds().clone();
rect.y += offset;
child.setBounds(rect, true, true);
for (let c = 1; c < link.getControlPoints().length - 1; c++) {
link.getControlPoints()[c].y += offset;
}
link.updateFromPoints();
this.setOffsetUnFoldedChildNode(child, offset);
}
}