'BPMN diagram is not expanding with div dynamically

I am facing one issue, while opening the bpmn diagram on a resizable & draggable modal popup. I am using the bpmn.io js library to load the diagram. I need to resize the diagram when I resize the modal popup.

When modal popup open this diagram loaded

But when I expand/resize the modal popup, the div expands but the bpmn diagram does not

After expanding the modal popup

The diagram loaded in a convas and rendered as an .svg

enter image description here

Can anyone help me to figure out that how to expand the bpmn diagram dynamically. The below library I am using

bpmn.io



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source