3 ms·
One of the areas I think diagrams as code could really improve in is the potential to add rendering rules. For instance: these (sub) groups must be equally size
by Koffiepoeder 2y ago
One of the areas I think diagrams as code could really improve in is the potential to add rendering rules. For instance: these (sub) groups must be equally sized, these boxes must be aligned vertically, etc.
Bonus points: an interface where you enter your diagram code and where a random set of 9 renders is shown with a different rendering rule added. You can go through this step multiple times by just clicking the diagram you think looks best. After a couple of iterations you have a diagram that is fairly fixed (avoiding the complete re-render problem when making changes) and beautiful.
Bonus points 2: make it also an editor where you can configure these rules in the GUI. When changing the rules in the diagram this is reflected in the 'view' part of the code.
- causal 2y agoAgreed, there's a lot missing here. Been using it a few hours now and here's a few problems with Diagram: Pros: - Some nice conceptual overlap with imperative programming. In theory could be very powerful. - It comes with a nice set of product icons. This was the main draw for me TBH, I wish MermaidJS had these built in. Cons: - Having to regenerate each time you make a change. Needs a better UX, as you say. MermaidJS and others have nice web GUIs that react to changes, Diagram at best I can have side by side with my code editor and I manually regen with each change. - Only outputs PNGs with white background? Why not transparent? Edit: You can change output format, and looks like there is a way to override some graphviz settings to achieve transparent background. - Lots of rendering glitches, for edges in particular that seem to vanish at random. - Justification is random - sometimes things center, sometimes they go to the top, sometimes the bottom, etc. - Direction is completely broken. Clusters have a direction param that is entirely decorative as far as I can tell. It is impossible to tell what direction a set of items will end up having based on the code alone. - Ordering is broken. You can group items with Python lists - cool! - but for some horrific reason Diagram ignores the list order and displays the items ordered by label alphabetically. Wtf? Edit: On further investigation this might actually just be reversing the list from the expected order? Hard to tell since direction is generally unpredictable. I'm sure there are more positives, but the gaps have been so glaring and frustrating that I cannot imagine using this regularly in its current state.