Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

inline style syntax issues #1320

Closed
grivo opened this issue Mar 13, 2023 · 4 comments
Closed

inline style syntax issues #1320

grivo opened this issue Mar 13, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@grivo
Copy link

grivo commented Mar 13, 2023

I can create a relation without declaring participating elements

@startuml
:joe: --> (action)
@enduml

link


I can set some relation style inline

@startuml
:joe: -[#green]-> (action)
@enduml

link

or (this variant seems to me kind of illogical though - and it's better to deprecate it)

@startuml
:joe: --> (action) #green
@enduml

link


I can not set inline style for link and for participating elements other way than declaring elements first alongside with their style, and i can not set stereotype or mark participating element as business valuable other way than declaring this separately as well

code below is best inline solution, imo

@startuml
:joe:/ <<xxx>> #green -[#blue]-> (action)/ <<yyy>> #orange
@enduml

link

desired behaviour

@startuml
:joe:/ <<xxx>> #green
(action)/ <<yyy>> #orange
joe -[#blue]-> action
@enduml

link


moreover - i can not distnguish ordinary and business valueble actors / actions in terms of css styling - it may be useful for applying different style onto these elements without a need to apply separate stereotype

@arnaudroques
Copy link
Contributor

With last snapshot, we have fixed:

@startuml
<style>
actor {
  BackGroundColor blue;
  business {
    BackGroundColor red;
  }
}
usecase {
  BackGroundColor lightBlue;
  business {
    BackGroundColor orange;
  }
}
</style>
:joe:
:joe2:/
(walk)
(run)/
@enduml

and

@startuml
:joe:/  --> (action) 
@enduml

However, we have an minor issue with your proposal:

@startuml
:joe:/ <<xxx>> #green -[#blue]-> (action)/ <<yyy>> #orange
@enduml

This is because the following syntax is actually working:

@startuml
<style>
.red {
	LineColor red;
}
</style>
:joe:  --> (action) <<red>>
@enduml

So the <<red>> stereotype applies here to the link itself, not to (action).

We may propose to slightly change the syntax and to move the stereotype on the link after the :

So to apply stereotype on the link, you would have to use :joe: --> (action) : <<red>>

Your modified example could be:

@startuml
:joe:/ <<xxx>> #green -[#blue]-> (action)/ <<yyy>> #orange : some message <<zzz>>
@enduml

where <<xxx>> applies on joe, <<yyy>> applies on action and <<zzz>> applies on the link itself.

This would slightly break existing diagrams that put stereotype on link, though.
What do you think about it?

@grivo
Copy link
Author

grivo commented Mar 14, 2023

@arnaudroques

With last snapshot, we have fixed:

that's exactly what i want, thanks!


:joe:/ <> #green -[#blue]-> (action)/ <> #orange : some message <>

where <> applies on joe, <> applies on action and <> applies on the link itself.
This would slightly break existing diagrams that put stereotype on link, though.
What do you think about it?

i'd rather say sort of...

as for compatibility - yet we may assume some workaround (hereafter term styles includes possible stereotypes list as well)

  • these variants applly style on relation only
    • :joe:/ -d-> (action)/ <<zzz, uuu, iii>> #blue : some message - applicable for a relation that does not have any inline styles but it's own inline style only (as it is for now)
    • :joe:/ -d[<<zzz, uuu, iii>> #blue]-> (action)/ : some message - applicable for a relation that may have multiple inline styles declared
  • these variants apply style on actor
    • :joe:/ <<xxx, qqq, ooo>> #green - applicable for an actor that does not have any inline styles but it's own inline style only or for an actor declaration apart of relation (as it is for now)
    • :joe:/ [<<xxx, qqq, ooo>> #green] - applicable for an actor that may have multiple inline styles declared
  • these variants apply style on action
    • (action)/ <<yyy, hhh, mmm>> #orange - applicable for an action that does not have any inline styles but it's own inline style only or for an action declaration apart of relation (as it is for now)
    • (action)/ [<<yyy, hhh, mmm>> #orange] - applicable for an action that may have multiple inline styles declared
  • these variants apply style on action
  • these examples may apply multiple inline style on actor, relation and action same time
    • :joe:/ [<<xxx, qqq, ooo>> #green] -d[<<zzz, uuu, iii>> #blue]-> (action)/ [<<yyy, hhh, mmm>> #orange] : some message - actor, relation and action
    • :joe:/ [<<xxx, qqq, ooo>> #green] -d-> (action)/ [<<yyy, hhh, mmm>> #orange] : some message - actor and action
    • :joe:/ [<<xxx, qqq, ooo>> #green] -d[<<zzz, uuu, iii>> #blue]-> (action)/ : some message - actor and relation
    • :joe:/ -d[<<zzz, uuu, iii>> #blue]-> (action)/ [<<yyy, hhh, mmm>> #orange] : some message - relation and action

literally - optional square brackets may solve style / stereotype clash issues indeed

@evantill
Copy link
Collaborator

Maybe we can close this issue and follow the discussion on gh discussions ?

@arnaudroques arnaudroques added the enhancement New feature or request label Mar 18, 2023
@grivo
Copy link
Author

grivo commented Mar 20, 2023

@evantill - do you want me to do this?

what are the chances for this proposal to be implemented then? because current solution with inline syntax seems to be bit incomplete

@plantuml plantuml locked and limited conversation to collaborators Mar 20, 2023
@arnaudroques arnaudroques converted this issue into discussion #1347 Mar 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants