plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

Information Engineering (IE) data modelling notation support. #31

Closed mgeorge closed 7 years ago

mgeorge commented 7 years ago

Extended @bminderh's crowsfoot work to include the full IE notation except for OR/XOR.

Includes

Diagram example

@startuml

hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute
   optional_attribute
}

' zero or one
A |o--o| B

' exactly one
C ||--|| D

' zero or many
E }o--o{ F

' one or many
G }|--|{ H

@enduml

To do

Couldn't work out how to do the following myself.

Updated to use the '{' brace notation that was actually used in the merged version.

mgeorge commented 7 years ago

The above syntax would produce the following diagram. ie-demo

arnaudroques commented 7 years ago

That's great! Congratulation for your work. We will be glad to merge this in the base branch. And we will have a look at the hard-coded black issue. We just have a syntax suggestion: wouldn't it be more logical to use { instead of < to be consistent with exising crowsfoot notation ? That is, using: E }o--o{ F G }|--|{ H

What do you think about it ? (You don't have to do the code modification, we could if you want).

mgeorge commented 7 years ago

Using '{' is fine by me. If you could make the change during the merge then that would be great.

Also note that the crowsfoot in this version is smaller and narrower than @bminderh's version. This is because the crowsfoot in both versions do not work well with non-perpendicular angles since one leg may overlap the entity while the other dangles. Smaller and narrower makes this effect slightly less obnoxious. The following image demonstrates what I mean.

test

I thought about trying to dynamically scale the legs to ensure they intersect with the entity, but there are many cases where one leg will never intersect. If users don't like it they always have the option of using the ortho linetype to avoid weird angles.

mgeorge commented 7 years ago

And thank you for accepting this work, and for your great work on PlantUML. I added the IE notation because we will likely use PlantUML as our primary diagramming tool for teaching several software engineering related courses in the Department of Information Science at the University of Otago (New Zealand).

arnaudroques commented 7 years ago

Here is a beta that integrates your code with { modification. https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Note that in V8052 we have patched @bminderh version so that non-perpendicular angles are displayed warped. We've just added a projection to Point2D left and right, see https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/svek/extremity/ExtremityCrowfoot.java

The result is not perfect:

Compare for example:

@startuml hide circle hide empty members

foo1 --{ bar1 foo1 --{ bar2 foo1 --{ bar3

aa --o{ bb aa --o{ cc aa --o{ dd @enduml

If you like the result, we could do the same trick with your code. What do you think about it ?

mgeorge commented 7 years ago

Yes that looks good.

mgeorge commented 7 years ago

Just noticed a problem with using the '*' character for the new visibility modifier - it conflicts with the creole bold.

I am fine with you choosing another character for the visibility modifier.

arnaudroques commented 7 years ago

Well, we like the * notation :-)

So in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar we've fixed the following clash:

@startuml
hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute **in bold**
   **optional_attribute**
}
@enduml

Tell us if you find other issues, Thanks

keenan-v1 commented 5 years ago

So to my disappointment, the crows feet notation shown above does not appear to be a feature in PlantUML? It's hard to tell what was included and what was not.

keenan-v1 commented 5 years ago

Well, we like the * notation :-)

So in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar we've fixed the following clash:

@startuml
hide circle
hide empty members

entity Entity {
   * identifying_attribute
   --
   * mandatory_attribute **in bold**
   **optional_attribute**
}
@enduml

Tell us if you find other issues, Thanks

Also this doesn't appear to work, with the curly brace after the name of the entity.

mgeorge commented 5 years ago

It was merged ages ago. It is not documented yet, but is basically piggy backing off the class diagrams.

https://www.planttext.com/?text=FSnD2e0W48RX_PnYre9tq6uobe7aJupJmgIxfmHjlitpyPegn7Ab252Fa4zYIbYbHJ-Mm_gHpnAaeSKEQYy5j0P73CylonHqT4zIE3y3BUgE2u3nUHkT5m00

Not sure what you other comment refers to - your exact code seem to do what I would expect it to do:

https://www.planttext.com/?text=HOqx2e0m40NxFSNM2zx1ndF8Ig8in8t4Pn74k_ihKZsO6NZz3YquraGK7ORAmpydCREmXHVFrNmP5IWs7OYlwhe_MDM38fVQD8kOyvHJ4FaYoHiikwRMFEOYwgE7v_i6

keenan-v1 commented 5 years ago

It would appear to be an error with the Atom plantuml-viewer plugin. My apologies. It is giving me a syntax error.

And just to confirm, and I should've done this before but I assumed it was using the plantuml.jar I downloaded, when I run it via command line, I do see what I expect.

Thank you for your reply.

ThaDaVos commented 5 years ago

So, any documentation? When?

spawnia commented 4 years ago

@mgeorge thank you very much for your implementation work. I would really appreciate some documentation for this feature, even just a quick few paragraphs would help me greatly. You can add it in the wiki: http://wiki.plantuml.net/site/index

mgeorge commented 4 years ago

@spawnia Done. Thank you for actually pointing out how/where to add the documentation.

http://wiki.plantuml.net/site/ie-diagram

spawnia commented 4 years ago

@mgeorge thank you very much. I find it more clear to name the page Entity Relationship diagram. Information Engineering seems more like the discipline associated with creating ER diagrams.

I actually edited that in just now, did not realize the Wiki allows me to just edit that directly. If you want i can revert that, though.

What do you think?

mgeorge commented 4 years ago

I was thinking the same thing. Keep the edit. I just added a sentence that clarified which notation is being used (there are a bunch of them and Information Engineering is the actual name of the crows foot notation that most people use).

arnaudroques commented 4 years ago

Many thanks for your contributions on documentation. It's now online at http://plantuml.com/ie-diagram

You can go on with further modifications if needed. Thanks again !