Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Association Type - Crow ended arrow #185

Open
tcbuzor opened this issue Jan 10, 2023 · 8 comments
Open

Custom Association Type - Crow ended arrow #185

tcbuzor opened this issue Jan 10, 2023 · 8 comments

Comments

@tcbuzor
Copy link

tcbuzor commented Jan 10, 2023

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?

@skanaar
Copy link
Owner

skanaar commented Jan 11, 2023

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/

@tcbuzor
Copy link
Author

tcbuzor commented Jan 11, 2023

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
Copy link
Author

tcbuzor commented Jan 17, 2023

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?

@skanaar
Copy link
Owner

skanaar commented Jan 21, 2023

@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

@tcbuzor
Copy link
Author

tcbuzor commented Jan 26, 2023

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

@tcbuzor
Copy link
Author

tcbuzor commented Jan 26, 2023

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

text2erd-plantuml

@skanaar
Copy link
Owner

skanaar commented Jan 26, 2023

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.

@tcbuzor
Copy link
Author

tcbuzor commented Feb 19, 2023

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.
mermaid-js/mermaid#2751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants