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

Generate mermaid class diagram #634

Closed
sirex opened this issue Jun 4, 2024 · 5 comments · Fixed by #667
Closed

Generate mermaid class diagram #634

sirex opened this issue Jun 4, 2024 · 5 comments · Fixed by #667
Assignees

Comments

@sirex
Copy link
Collaborator

sirex commented Jun 4, 2024

Create a new Manifest, that can output model as mermaid diagram.

For example if we have following DSA table:

d | r | b | m | property    | type    | ref     | prepare
datasets/gov/rc/ar/ws       |         |         |
  |   |   | Administration  |         | id      |
  |   |   |   | id          | integer |         |
  |   |   |   | name        | string  |         |
  |   |   |   | type        | string  |         |
  |   |   |   |             | enum    |         | "country"
  |   |   |   |             |         |         | "municipality"
  |   |   |   |             |         |         | "eldership"

Command spinta copy dsa.csv -o dsa.mmd shoudl create a dsa.mmd file with following content:

classDiagram
  class Administration {
    + id: integer [1..1]
    + name: string [1..1]
  }

  class AdministrationType {
    <<enumeration>> 
    country
    municipality
  }

  Administration ..> "[1..1]" AdministrationType : type

Which can be imported to draw.io and should be displayed as:

classDiagram
  class Administration {
    + id: integer [1..1]
    + name: string [1..1]
  }

  class AdministrationType {
    <<enumeration>> 
    country
    municipality
  }

  Administration ..> "[1..1]" AdministrationType : type
Loading

Documentation for Mermaid class diagrams: https://mermaid.js.org/syntax/classDiagram.html

Other relationships are:

dependency - relationship between two models that have references (ref or backref) to each other. It's indicated by this type of arrow: -->

inheritance - relationship between a model and it's base model. It's indicated by this type of arrow: --|>

@karina-klinkeviciute
Copy link
Contributor

karina-klinkeviciute commented Jun 21, 2024

Ar savybė type turi būti prie Administration ar neturi?

t.y. ar turi būti kaip viršuj parodyta, ar taip?

classDiagram
  class Administration {
    + id: integer [1..1]
    + name: string [1..1]
    + type: string [1..1]
  }

  class AdministrationType {
    <<enumeration>> 
    country
    municipality
  }

  Administration ..> "[1..1]" AdministrationType : type

@sirex
Copy link
Collaborator Author

sirex commented Jun 21, 2024

Pagal UML, type nereikia pridėti prie klasės, jis turėtu būti prie asociacijos (rodyklės).

@karina-klinkeviciute
Copy link
Contributor

bet mes tada "pametam" type tipą. Bet jei taip tinka, tai galiu taip padaryti.

@sirex
Copy link
Collaborator Author

sirex commented Jun 22, 2024

bet mes tada "pametam" type tipą. Bet jei taip tinka, tai galiu taip padaryti.

Nepametam, type tipas yra ref, kuris rodo į modelį su rodykle.

@karina-klinkeviciute
Copy link
Contributor

Bet type yra string:
| | | | type | string | |

Aišku, gal šitoje situacijoje nėra būtina? O gal pridėti kažkur kitur?

karina-klinkeviciute added a commit that referenced this issue Jun 25, 2024
karina-klinkeviciute added a commit that referenced this issue Jun 25, 2024
karina-klinkeviciute added a commit that referenced this issue Jun 25, 2024
karina-klinkeviciute added a commit that referenced this issue Jun 25, 2024
karina-klinkeviciute added a commit that referenced this issue Jun 25, 2024
@karina-klinkeviciute karina-klinkeviciute linked a pull request Jun 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants