structurizr / export

Export models and views to external formats.
https://docs.structurizr.com/export
Apache License 2.0
18 stars 28 forks source link

Export for filtered views #38

Closed IMMueller closed 1 year ago

IMMueller commented 1 year ago

We rely heavily on filtered views to visualize our development roadmap as in https://github.com/structurizr/java/blob/master/docs/filtered-views.md

Currently the export command only exports the corresponding base view. Our and similar use cases would profit greatly from an option to export filtered views as well.

simonbrowndotje commented 1 year ago

The filtered view feature is really only designed for diagrams with manual layout ... so you'd have a base version of the diagram, and the filtered versions would use the same layout. From the page you linked to:

The benefit of using filtered views is that element and relationship positions are shared between the views.

The export formats are all automatic layout, so the filtered views feature is much less useful. If you're using something like the DSL, you may find that using the expressions feature is much more flexible than filtered views anyway. You can do things like:

include "element.tag==Tag 1"
IMMueller commented 1 year ago

Thanks for your reply, we already use expressions extensively.

Let me describe our use case in a bit more detail.

We have one quite large consistent model with 100+ containers, the model is developing over several milestones and is continuously adapted.

From this we automatically define about 20 base views using expressions and automatic layout (graphwiz), which works well for views of the resulting sizes. No manual adaption is required.

We use filtered views to create milestone views of these base views to reflect our progression. In terms of human readability we profit greatly from the constant layout of these milestone views and would like to export these for documentation purposes.

simonbrowndotje commented 1 year ago

I’m confused … which diagram renderer are you using? Structurizr Lite/cloud/on-premises, or one of the export formats implemented by this repo (PlantUML, Mermaid, etc)?

IMMueller commented 1 year ago

We use an on-premises installation and graphviz for the actual rendering:

  1. online visualization with structurizr, structurizr.graphviz=true (works fine with filtered views)
  2. export in dot format. These we use to batch create graphics and automatically integrate them in offline documentation

From 2. we currently cannot get the filtered milestone views.

simonbrowndotje commented 1 year ago

In terms of human readability we profit greatly from the constant layout of these milestone views and would like to export these for documentation purposes.

The on-premises installation is only applying automatic layout to the base view, and hiding elements on the filtered view. You won’t get this constant layout characteristic with a DOT export unfortunately. If your base view has 10 elements and your milestone views only have a subset of them, the Graphviz tool will provide a different diagram layout for each milestone view because the set of elements that it’s rendering is different.

It would be possible to replicate what the on-premises installation is doing, by exporting all elements from the base view and “hiding” (white border, background, text) the elements that shouldn’t appear on the filtered view. In effect, it’s a reimplementation of the feature from the on-premises installation. This is a good chunk of work though. If you’re happy to sponsor this from a financial point of view, please do let me know.

Otherwise, I’d instead suggest using the https://github.com/structurizr/puppeteer scripts to export the diagrams directly from your on-premises installation.

IMMueller commented 1 year ago

Thanks a lot for your detailed clarification and helpful suggestions!

We'll take look at puppeteer first.