Azure-PlantUML icon indicating copy to clipboard operation
Azure-PlantUML copied to clipboard

Can't use $link property

Open martinicr opened this issue 2 years ago • 5 comments

Hi, when trying to put the $link property in several components such as AzureServiceFabric, PlantUML diagram generation fails. Can't see in the documentation of this project if this property is supported or not.

martinicr avatar Aug 09 '22 18:08 martinicr

Hi! I am not familiar with $link. Could you post an example diagram of how it is used, or a link to the relevant PlantUML documentation?

Potherca avatar Aug 09 '22 21:08 Potherca

Go to this page. Then look for the $link property. You will see how this property can be used in several C4 components.

martinicr avatar Aug 09 '22 21:08 martinicr

I think I understand what you mean... Are you trying to use $link like this: AzureServiceFabric(Alias, "Label "Technology", $link="https://example.com")?

Or to place it in a more real world context:

@startuml
!$AzurePuml='https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-1/dist'
!include $AzurePuml/AzureCommon.puml
!include $AzurePuml/Compute/AzureServiceFabric.puml

AzureServiceFabric(Alias, "Label "Technology", $link="https://example.com")
@enduml

Potherca avatar Aug 10 '22 09:08 Potherca

You right and sorry for my lack of details on this.

In regular C4 PlantUML, you can add the $link property to several definitions such as this one:

System(twitter, "Twitter", $link="https://github.com/plantuml-stdlib/C4-PlantUML")

So, I tried to do the same with the AzureServiceFabric definition, but I got an error everytime I exported the diagram. I can't see any reference to the $link property in the Azure-PlantUML documentation so I thought chances are this is not supported for this kind of elements.

martinicr avatar Aug 10 '22 15:08 martinicr

No need for apologies 👍

You are correct, in C4 there was a change in the code to go from ordered parameters[^1] to named parameters[^2], as that provides more flexibility[^3]

That functionality has not been implemented in this project, hence the errors.

I could make a ticket to look into implementing such things here (which is a good idea in itself) but I can't really give a timeline in which it would be implemented.

[^1]: i.e. Foo(a,b,c) [^2]: i.e. Foo($a='a', $b='b', $c='c') [^3]: Such making easier to support optional parameters and not requiring a fixed order parameters need to be provided in.

Potherca avatar Aug 10 '22 16:08 Potherca