I am currently working on a project that has a huge focus on generating GoJS diagrams dynamically.
Everything I saw (so far) in samples was based on a staticly defined nodeTemplate or on several templates (nodeTemplateMap - but still static).
I already implemented a way to create dynamic linkTemplates based on the following structure:
→ My component receives an array like this:
→ Based on that I create a linkTemplate for each item in the array with the following template:
→ That way I was also able to create a linkTemplate Editor that lets me create linkTemplates and append them to the linkTemplates JSON array and my dynamic linkTemplates work.
But that only works because I could create such a generic skeleton of a link template that I can fill with different values.
The requirements for nodeTemplates are a bit higher, so I want to be able to create elements with various panels, settings and all, which does not really fit into one generic structure.
Is there a way to still achieve that? Is it for example possible to add conditionals or loops into the structure? Or is it possible to create a node template gradually by appending the template if necessary?