kevincobain2000 / laravel-erd

Automatically generate ERD Diagrams from Model's relations in Laravel
https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716
138 stars 25 forks source link

Overlapping elements #7

Closed stephenjason89 closed 1 year ago

stephenjason89 commented 3 years ago

With a big schema, There are a lot of overlapping elements.

image

Thank you for the wonderful package

kevincobain2000 commented 3 years ago

Hi, Yes that is one issue. This was the same issue with the https://github.com/beyondcode/laravel-er-diagram-generator. In which, the produced diagram in beyondcode's is large that needs to be zoomed in and out and trace back the lines and nodes along to identify a connecting.

Therefore, in this package I tried to address that issue by adding 1) check-boxes for the tables 2) check-boxes for relations 3) and interactive to make it usable.

If there are proposals, to make it user-friendly, I would love to hear feedback.

stephenjason89 commented 3 years ago

graph I believe they, https://github.com/beyondcode/laravel-er-diagram-generator, may have fixed the issue of overlapping elements. I would much prefer your package though, primarily because it is interactive and easier to read.

I see what you meant by the diagram becoming to large and the need to zoom in and out frequently just to follow the connections. In my personal opinion, it would be much better to zoom in and out a little bit instead of having it overlap each other.

To be clear, i am referring to the overlapping tables. In the example on the first post, it is the table, receipts, wallets, inventory, sales, etc..

The checkboxes helps a bit on managing the diagram. if i may comment, by default, all tables are shown. Which means, the first action should be uncheck all, not check all.

To get the best of both worlds, i suggest that every time you check or uncheck a table, it re-arranges the tables to fit snugly with each other without overlapping. In this case, if all tables are shown, there's definitely a need to zoom in and out. But showing just a few tables will re-arrange it to be centered in the viewport and without so much spaces in between due to the hidden tables.

I believe, it is already user friendly. Would just be a lot better if the spacing between elements can be fixed and also relationship labels with the same table overlaps the table fields, making it hard to read.

I would love to see the line connecting the table's relationships together with the respective tables being highlighted when you hover the mouse, or much better click since you would have to zoom frequently, on a table or on the field with a relationship. It would be really easy to follow the lines if that happens.

Overall, this is a great package. Thank you

kevincobain2000 commented 3 years ago

Thank you for the details. Now I understand about the overlapping issue in details together with your suggestions.

I will take all the suggestions and see if I can find a way to make it useful. It might take some time but will work on it.

I ll keep this issue open.

stephenjason89 commented 3 years ago

Thank you as well. Will be waiting patiently ☺️

Thavarajan commented 2 years ago

First of all thanks for this wonder full package, in the mean while is it possible to fetch all the related model for one level when we select a particular model, depends on the selection

stephenjason89 commented 2 years ago

@kevincobain2000 Is there any update on this?

kevincobain2000 commented 2 years ago

Sorry no update on this, I haven't been working on this much lately. I welcome pull reqs tho, will merge em if it fixes your issue.

stephenjason89 commented 2 years ago

Thanks @kevincobain2000, will try it out once i'm free