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

PlantUML generation? #50

Open
swails opened this issue Apr 8, 2022 · 4 comments
Open

PlantUML generation? #50

swails opened this issue Apr 8, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@swails
Copy link
Contributor

swails commented Apr 8, 2022

When I stumbled on this project, what I was really looking for was a way to generate an ERD in PlantUML. I've implemented that for personal use, but I'm happy to contribute the work back if it would be considered for inclusion. The changes are quite small.

This was a remarkably easy code base to grok and dig into, so kudos on a useful project!

@jayqi
Copy link
Member

jayqi commented Apr 8, 2022

Hi @swails, thank you for the positive feedback! Being able to support PlantUML does sound useful. I'd be interested in seeing your implementation to better understand the complexity, what additional dependencies might be introduced, etc. Based on that, I think we can figure out if and how integrating it makes sense.

@jayqi
Copy link
Member

jayqi commented Apr 5, 2024

I took a stab at hand-writing the PlantUML spec for the classes in erdantic.examples.

@startuml

map Party {
 name => str
 formed_datetime => datetime
 members => List[Adventurer]
 active_quest => Optional[Quest]
}

map Adventurer {
 name => str 
 profession => str
 alignment => Alignment
 level => int
}

map Quest {
 name => str
 giver => QuestGiver
 reward_gold => int
}

map QuestGiver {
 name => str
 faction => Optional[str]
 location => str
}

Party::members -{ Adventurer::Adventurer
Party::active_quest -o| Quest::Quest
Quest::giver -|| QuestGiver::QuestGiver
@enduml

Using this web editor, I got a rendered diagram like this:

plantuml_example

This doesn't look production-ready to me. I'm not that familiar with PlantUML, so it would be great to have someone who knows PlantUML better to figure out how to get the output to look nicer (e.g., layout, where edges connect up to).

@jayqi jayqi added enhancement New feature or request help wanted Extra attention is needed labels Apr 5, 2024
@swails
Copy link
Contributor Author

swails commented Apr 5, 2024

Ah, here were the changes I made way back when: main...swails:erdantic:feature/plantuml-diagrams

It looks like the code base has changed substantially since I did that, but this worked for me.

@jayqi
Copy link
Member

jayqi commented Apr 5, 2024

@swails do you have an example of the output PlantUML spec you created?

The code base has indeed changed substantially, though this happened fairly recently. See v1.0.0rc1. It generally shouldn't be too hard to figure out equivalent changes under the new backend design though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants