nomnoml icon indicating copy to clipboard operation
nomnoml copied to clipboard

Custom Association Type - Crow ended arrow

Open tcbuzor opened this issue 2 years ago • 8 comments

This is more like a enhancement request or a guide on how to implement. I would like to add a crow type association for representing 1:many in ERDs. Is there an easy way to add it?

tcbuzor avatar Jan 10 '23 22:01 tcbuzor

I have been thinking about adding the crow foot type association for a long time. Nice to get an actual request!

There is some slight layouting issues that have to be resolved as the edges in nomnoml are not always perpendicular to the node borders.

Is this a good specification for crows feet?: https://vertabelo.com/blog/crow-s-foot-notation/

skanaar avatar Jan 11 '23 10:01 skanaar

Yes, that is a very good (standard) specification for ERD diagramming. Please see attached image for a full specification that could be implemented. I could also help out with some tasks. I must say that nomnoml is really cool and useful and would be even more useful with the support for ERD diagramming. erd_associations

tcbuzor avatar Jan 11 '23 23:01 tcbuzor

Daniel, do you mind describing how you intend to implement the the crow foot association or in general how the associations are rendered? Do you have a repo for the current work with layout issues?

tcbuzor avatar Jan 17 '23 17:01 tcbuzor

@tcbuzor the fact that edges could leave a node at 45° angle from a corner is actually a pretty big obstacle to implementing crow feet connectors…

not sure how to deal with that

skanaar avatar Jan 21 '23 04:01 skanaar

Why 45 deg angle? Do you have some time to discuss so I can understand better?

tcbuzor avatar Jan 26 '23 18:01 tcbuzor

See example from plantuml - } to denote crow feet (many side)

text2erd-plantuml

tcbuzor avatar Jan 26 '23 19:01 tcbuzor

For some diagrams the associations meet the nodes at 90 degrees. 90degree

But for other the associations would meet at 45 degrees (or any other angle) and maybe hit a corner like in this example: 45degree

To enable crows feet we would have to draw the edges differently, which is not supported out of the box right now.

skanaar avatar Jan 26 '23 19:01 skanaar

found this on mermaid: The answer I came up with was actually to join two arcs and a centre line to the centre of each entity box, and then to superimpose the opaque entity box on top, thus 'cutting' off what would otherwise look a bit like a leaf, and turning it into a crows foot intersecting with the edge of the box perfectly. This was a eureka moment for me in making it work nicely, but it is something you will have to alter to achieve your goal, otherwise every incoming relationship line will always orient towards the centre of the entity. https://github.com/mermaid-js/mermaid/issues/2751

tcbuzor avatar Feb 19 '23 00:02 tcbuzor