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

[Question] PlantUML images from any URL? #46

Open
Potherca opened this issue Apr 17, 2023 · 5 comments
Open

[Question] PlantUML images from any URL? #46

Potherca opened this issue Apr 17, 2023 · 5 comments

Comments

@Potherca
Copy link

I was curious regarding two statements regarding PlantUML and images/icon:

Icons: Icons and images are essential to professional-looking diagrams. How do the different tools handle it? Note: PlantUML's icon system is to include pre-packaged icon sets, so the example shown is one that uses their icon set.

and

Features PlantUML
Images & Icons: What are the available options for including images and icons X

As far as I'm aware, in PlantUML, an icon or image can be loaded from any URL. At least, I've not had any issues thus far.
Am I missing something, or am I reading the content wrong?

@alixander
Copy link
Contributor

PlantUML, an icon or image can be loaded from any URL

do you have an example? I must've missed it, I was looking at https://plantuml.com/stdlib

@Potherca
Copy link
Author

Sure!

For instance, using the example from the gilbarbara-plantuml-sprites repo:

@startuml
!$SPRITESURL = 'https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.0/sprites'
!include $SPRITESURL/flask.puml
!include $SPRITESURL/kafka.puml
!include $SPRITESURL/kotlin.puml
!include $SPRITESURL/cassandra.puml

rectangle "<$flask>\nwebapp" as webapp
queue "<$kafka>" as kafka
rectangle "<$kotlin>\ndaemon" as daemon
database "<$cassandra>" as cassandra

webapp -> kafka
kafka -> daemon
daemon --> cassandra
@enduml

All "sprites" are loaded from remote files. Sprites are a converted form of image, but the same can be done using images:

@startuml
!$IMAGEURL = 'https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/master/pngs'

rectangle "<img:$IMAGEURL/flask.png>\nwebapp" as webapp
queue "<img:$IMAGEURL/kafka-icon.png>" as kafka
rectangle "<img:$IMAGEURL/kotlin.png>\ndaemon" as daemon
database "<img:$IMAGEURL/cassandra.png>" as cassandra

webapp -> kafka
kafka -> daemon
daemon --> cassandra
@enduml

@alixander
Copy link
Contributor

alixander commented Apr 17, 2023

@Potherca Right but that's a pre-package icon set. That's what the site is saying it can do.

Can it for example use your profile pic?

Screen Shot 2023-04-17 at 1 56 31 PM

https://play.d2lang.com/?script=qlDQtVOo5KrUA4WclUJGSUlBsZW-fmJZYkliUbFeemZJRmlSaXFqUXJ-XklqXolecn6ufqm-oaWpuam5fbGthYFama0JFyAAAP__&

@Potherca
Copy link
Author

Potherca commented Apr 18, 2023

Ah, I think I am beginning to understand... From the perspective of PlantUML "prepackaged" means it is part of the jar and can be used by !include <whatever> instead of being an external (or local) URL !include .... But it doesn't distinguish the need to make a "sprite" from an image (to be used as an icon) as "packaged".

The PlantUML equivalent of the above could be

@startuml
rectangle "<img:https://avatars.githubusercontent.com/u/195757?s=80&v=4>" as y

[x] --> y
@enduml

but then the question would be if that constitutes an "icon"... 🤔

I think the different concepts in PlantUML (Image, Sprite, Icon) are also slightly skewed and confused. Especially because you can also use <&icon> but only from a predefined list which (as far as I can see) can't even be extended. Then again, I've also never really seen that used in the wild (everybody uses "sprites" instead).

From my perspective, PlantUML is a great tool for all it can do, but I'm very hesitant in suggesting it to new users.
Especially as it has consistently shown to be confusing and inconsistent. 😞

@alixander
Copy link
Contributor

alixander commented Apr 18, 2023

"prepackaged" means it is part of the jar

yeah that's a reasonable definition -- i'll change it to just "packaged".

The PlantUML equivalent of the above could be

oh, that totally counts, I'll make the change that says PlantUML can load from any URL too. thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants