You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make a converter for converting plantuml to d2 code and I encountered a difference for the usage of notes. In plantuml you can use notes on actors and connections. D2 on the other hand only allows notes for actors.
I will now provide one example in plantuml, one in d2 and two workarounds for d2 which work but aren’t optimal:
plantuml
@startuml
participant "Web Browser" as Browser
participant "Web Server" as Server
participant "Database" as DB
Browser -> Server: HTTP GET /
note right: Send request to load homepage
Server -> DB: Fetch homepage data
note right: Database processes the query
DB -> Server: Homepage data
note left: Database sends data back to server
Server -> Browser: HTTP 200 OK
note left: Browser receives the homepage HTML
@enduml
d2 notes
example 1: {
shape: sequence_diagram
Browser: Web Browser
Server: Web Server
DB: Database
Browser -> Server: HTTP GET /
Server.Send request to load homepage
Server -> DB: Fetch homepage data
DB.Database processes the query
DB -> Server: Homepage data
Server.Database sends data back to server
Server -> Browser: HTTP 200 OK
Browser.Browser receives the homepage HTML
}
The problem here is that it’s hard to tell which note belongs to which and if you don’t know it you won’t immediately think that it belongs to the connections.
d2 workaround 1
example 2: {
shape: sequence_diagram
Browser: Web Browser
Server: Web Server
DB: Database
Browser -> Server: HTTP GET / \[Send request to load homepage\]
Server -> DB: Fetch homepage data \[Database processes the query\]
DB -> Server: Homepage data \[Database sends data back to server\]
Server -> Browser: HTTP 200 OK \[Browser receives the homepage HTML\]
}
The problem with this workaround is that there’s too much text on the connections. I could also use line breaks but it would still look less clean.
d2 workaround 2
example 3: {
shape: sequence_diagram
Browser: Web Browser
Server: Web Server
DB: Database
Browser -> Server: HTTP GET / \[1\]
Server -> DB: Fetch homepage data \[2\]
DB -> Server: Homepage data \[3\]
Server -> Browser: HTTP 200 OK \[4\]
}
Notes: {
near: center-right
grid-rows: 2
1\. Send request to load homepage.shape: page
2\. Database processes the query.shape: page
3\. Database sends data back to server.shape: page
4\. Browser receives the homepage HTML.shape: page
}
This workaround keeps the connections clean but the separate box with the explanations takes up alot of space.
Conclusion
Does anybody have another workaround or is there maybe something planned that would fix this problem?
The text was updated successfully, but these errors were encountered:
I want to make a converter for converting plantuml to d2 code and I encountered a difference for the usage of notes. In plantuml you can use notes on actors and connections. D2 on the other hand only allows notes for actors.
I will now provide one example in plantuml, one in d2 and two workarounds for d2 which work but aren’t optimal:
plantuml
d2 notes
The problem here is that it’s hard to tell which note belongs to which and if you don’t know it you won’t immediately think that it belongs to the connections.
d2 workaround 1
The problem with this workaround is that there’s too much text on the connections. I could also use line breaks but it would still look less clean.
d2 workaround 2
This workaround keeps the connections clean but the separate box with the explanations takes up alot of space.
Conclusion
Does anybody have another workaround or is there maybe something planned that would fix this problem?
The text was updated successfully, but these errors were encountered: