Support CLI to export in png/svg format #126
Replies: 3 comments
-
@simonbrowndotje Hi! I think this topic has indeed several subtopics. Indeed decoupling is one thing. But even besides that. I'd like to ask - I found this project https://github.com/structurizr/puppeteer giving the idea how this images could be fetched. I'd like to bring here several ideas:
Something like this could work
in this case we'll just have very minimalistic logic in NodeJS/Puppeter and the rest of the logic will be delegated to UI. Meanwhile, decoupling it entirely to JSDOM/SSR would be a better option probably but I understand that it's hardly doable now. |
Beta Was this translation helpful? Give feedback.
-
The diagram rendering code is open source, so you're welcome to submit a PR that adds this capability. There's a lot of async/callback code to deal with loading themes and icons, so if you do add this feature, please be sure to check that it works with themes and icons. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Sure! Meanwhile I've found an alternative solution https://likec4.dev/ which has this feature by default in their CLI. Unfortunately that cli also uses puppeteer - but that's fine - at least I was able to build set of images from one text file |
Beta Was this translation helpful? Give feedback.
-
Description
Hi!
I see that it's possible currently to export images from UI as png or svg. This is very convenient but manual feature now. TO be able to build automations and for example compile images from DSL files as project artifacts it would be nice if CLI could have this feature too.
I see that currently this feature is implemented in the frontend.
How about decoupling it from UI to a standalone module and let's say make it available as a standalone package or part of this CLI at least? I see that jsdom now supports canvas so theoretically is possible to build diagrams now using nodeJS.
I have found also https://github.com/extenda/structurizr-to-png project, but unfortunately the way it generates images is not even close to what we see in UI currently
Priority
Low
Resolution
I have no budget, please add this feature for free
More information
No response
Beta Was this translation helpful? Give feedback.
All reactions