Can we put a validation to prevent circular reference in Go JS diagram

Please refer the uploaded figure where in after the process block , it is re linked to “A” block resulting in a circular block. Is there a way I could prevent adding such a reference in my diagram.? Please advise!

I also have another question-> in my text area (“A”/“B”) inside process block , can we add a custom css class ?

Yes, set Diagram.validCycle. See http://gojs.net/latest/api/symbols/Diagram.html#validCycle and read about the various constants named “Cycle…” to choose the one that you want.

You cannot style the TextBlock using CSS, but you can set or bind a lot of properties on it: http://gojs.net/latest/api/symbols/TextBlock.html.

One advantage of using Canvas compared to SVG is that it doesn’t have the overhead of using DOM elements. But I suppose the inconvenience of not being able to share the same CSS rules for styling text as the rest of your page is a disadvantage. On the other hand, it is surprisingly infrequent that programmers really want to use the same fonts and stuff in diagrams as in the rest of the web page.

Oh, and if Diagram.validCycle does not give you the exact choice that you want, you can implement your own custom link validation: http://gojs.net/latest/intro/validation.html.