Hi, I have a problem I hope some of you can help to solve.
I created a custom render for an element, that depends on the name assigned to element’s outgoing connections. For example, the element should be green if there is an outgoing arrow named “Y”, red otherwise. I defined this condition inside the drawShape function, but it’s not called frequently enough: is there a solution to check the state of connections and re-render the element when I add or rename a connection (for example, when I edit the connection changing the name into “Y”)?
Generally speaking, elements only update their visual appearance once they are changed. The toolkit simply does not recognize the element as changed, thus does not update its visual apperance.
To resolve this: Make sure that the element is marked as changed from the libraries point of view, as you modify the outgoing elements label. How familiar are you with these advanced customization scenarios / hooking into the command stack?
I’m not very familiar with advanced customization or command stack, but I can try to investigate and understand how it works. Of course I’m very glad if you might help.
About the rendering trigger, do you think that calling the render for every element every time something has changed would be too much demanding? Maybe I can add something like a “validate” button to click to run renders, but how can I call a general re-render for all elements?