How change ProseMirror view between 2 types?

Greetings, I hope this message finds you well. Thank you for the incredible job you have done with ProseMirror, it is greatly appreciated!

Our team is currently working on implementing an editor that provides users with the flexibility to switch between two modes: a common text editor and a flowchart editor where nodes are represented in a diagram. While this is a challenging task, we believe that this approach will significantly improve the user experience and enhance the overall flexibility of the editor. One of the key questions that we have been grappling with is how to effectively rerender the common WYSIWYG to the diagram view. This is a critical piece of functionality, and we want to ensure that it is implemented in the most efficient and effective way possible. To that end, we have been exploring a number of different approaches, and have identified a few best practices that we believe will be particularly effective. Thanks!