swyxio / spark-joy

✨😂 2000+ ways to add design flair, user delight, and whimsy to your product.
https://www.learninpublic.org/
MIT License
9.37k stars 327 forks source link

Add Mocodo to Entity-Relationship diagramming tools #91

Closed laowantong closed 1 year ago

laowantong commented 1 year ago

My own tool adopts a mixed approach to the layout problem : diagram-as-text, but the line breaks and the order of the boxes (entities and relations) are used as position hints. The resulting layout is constrained to an invisible grid corresponding to a left-to-right and top-to-down reading of the source.

Moreover, since there are relatively few possible grid positions, automatically rearranging the layout becomes an assignment problem, which can be solved by a simple b&b algorithm.

Obviously, this wouldn't scale, but this is just a teaching tool that I use to present small ERDs to my students.

You may test it at https://mocodo.net/. Click the turning arrows symbol to draw the diagram and the shuffle symbol to rearrange it randomly.

Warning: French-flavored ERD, aka Merise MCD.

swyxio commented 1 year ago

thank you!