Refreshing BPMN Diagram in Viewer mode

Hi Team,

Is there a way to re-render whole BPMN diagram in Viewer mode?
or re-render text labels?
There is a requirement in my project where I have to dynamically change the styling of text labels when we Zoom In/Out the diagram. So, when I am changing the font-size, the text labels are not aligned properly. So is there a way to align them again or may be re-render?

Thanks, Neha

It’s possible to manually re-render elements in the viewer but there are a couple of issues that would need to be solved:

  1. The font can only be configured when creating the viewer but not during runtime. Regardless of what CSS you apply, the text layout will be calculated based on the initial configuration.
  2. When re-rendering external labels (e.g. of bpmn:StartEvent) you’d need to resize their corresponding shape.
  3. You could run into performance issues since re-calculating the layout of every label whenever you change the zoom is an expensive operation.

TL;DR It’s possible but far from trivial.