# Refreshing BPMN Diagram in Viewer mode

**URL:** <https://forum.bpmn.io/t/refreshing-bpmn-diagram-in-viewer-mode/7161>\
**Category:** General\
**Created:** [January 31, 2022, 1:15pm UTC](https://forum.bpmn.io/t/refreshing-bpmn-diagram-in-viewer-mode/7161 "2022-01-31T13:15:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neha058](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/n/838e76/32.png) [@Neha058](https://forum.bpmn.io/u/Neha058)\
**Post date:** [January 31, 2022, 1:15pm UTC](https://forum.bpmn.io/t/refreshing-bpmn-diagram-in-viewer-mode/7161/1 "2022-01-31T13:15:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [February 3, 2022, 9:25am UTC](https://forum.bpmn.io/t/refreshing-bpmn-diagram-in-viewer-mode/7161/2 "2022-02-03T09:25:32Z")

</div>

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](https://github.com/bpmn-io/bpmn-js/blob/develop/lib/draw/TextRenderer.js#L11) 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.

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2025, 3:41pm UTC](https://forum.bpmn.io/t/refreshing-bpmn-diagram-in-viewer-mode/7161/3 "2025-07-22T15:41:54Z")

</div>

Closed on July 22, 2025, 3:41pm UTC


