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

Feat: add possibility to expand (drill down) several blocks at a time #358

Open
beliaev-maksim opened this issue Nov 19, 2024 · 4 comments

Comments

@beliaev-maksim
Copy link

beliaev-maksim commented Nov 19, 2024

Description

Hello,
We are looking for a diagramming tool that can dynamically render the C4 model. For example, if two systems are defined, each with two containers, we want to define the model once and automatically visualize the connections between different levels and combinations.

I better illustrate this on the example of a simple org chart.

DSL Code
workspace "Name" "Description"

    !identifiers hierarchical

    model {
        department-1 = softwareSystem "department-1" {
            product-managers = container "Product Management"
            market = container "Market Analytics"
        }
        
        department-2 = softwareSystem "department-2" {
            design = container "Design Team"
            branding = container "Branding Team"
        }
        
        department-1.product-managers -> department-2.design "Provides specifications to"
        department-2.design -> department-2.branding "Works with"
    }
    views {
        systemContext department-1 "Diagram1" {
            include *
            autolayout lr
        }

        container department-1 "Diagram2" {
            include *
            autolayout lr
        }
        
        container department-2 "Diagram3" {
            include *
            autolayout lr
        }
    }
}

which renders perfectly fine into system context:
image

which renders fine from container in department-1 to department-2:
image

which renders fine from department-1 to container in department-2:
image

The challenge arises when a user wants to drill down into department-1 while viewing Diagram3 (which shows the connection from department-1 to a container in department-2). Without this feature, the user would need to remember Diagram2 and Diagram3 and mentally connect the information themselves.
See PlantUML example for the desired view:
image

PlantUML Code

@startuml
set separator none
title department-1 - Containers

left to right direction

!include <C4/C4>
!include <C4/C4_Context>
!include <C4/C4_Container>


System_Boundary("department2_boundary", "department-2", $tags="") {
  Container(department2.DesignTeam, "Design Team", $techn="", $descr="", $tags="", $link="")
  Container(department2.BrandingTeam, "Branding Team", $techn="", $descr="", $tags="", $link="")
}

System_Boundary("department1_boundary", "department-1", $tags="") {
  Container(department1.ProductManagement, "Product Management", $techn="", $descr="", $tags="", $link="")
  Container(department1.MarketAnalytics, "Market Analytics", $techn="", $descr="", $tags="", $link="")
}

Rel(department1.ProductManagement, department2.DesignTeam, "Provides specifications to", $techn="", $tags="", $link="")
Rel(department2.DesignTeam, department2.BrandingTeam, "Works with", $techn="", $tags="", $link="")


SHOW_LEGEND(true)
@enduml

It’s possible to add an explicit view to the DSL example above, but this doesn’t allow for automatic, selectable expansion of blocks. This becomes even more complicated as the number of systems increases, then one would need to generate a matrix of the possible view combinations.

        container department-1 "AllContainersView" {
            include department-1.product-managers department-2.design department-2.branding department-1.market
            autoLayout lr
        }

image

Priority

I'm willing to pay for this feature (add details below)

More information

We can consider paying for the feature or trying to contribute it by ourselves

@simonbrowndotje
Copy link
Contributor

Unless I've misunderstood, you can do this already; see https://docs.structurizr.com/dsl/cookbook/container-view-multiple-software-systems/

Example:

container department-1 "Diagram4" {
    include "element.parent==department-1"
    include "element.parent==department-2"
    autolayout lr
}

image

@beliaev-maksim
Copy link
Author

beliaev-maksim commented Nov 19, 2024

It’s possible to add an explicit view to the DSL example above, but this doesn’t allow for automatic, selectable expansion of blocks. This becomes even more complicated as the number of systems increases, then one would need to generate a matrix of the possible view combinations.

        container department-1 "AllContainersView" {
            include department-1.product-managers department-2.design department-2.branding department-1.market
            autoLayout lr
        }

as I wrote in the description that will not allow me the automatic click and drill down. And then I have to specify a matrix of all the possible variations. For example, imagine I have 10 Systems and see only 2 or 3 of them expanded not to clutter the view. Or am I missing something and this is somehow implemented?

@simonbrowndotje
Copy link
Contributor

that will not allow me the automatic click and drill down

Correct, and this is by design. The recommendation is 1 workspace = 1 software system, and I don't recommend showing containers outside of the scoped software system. See my "The C4 Model – Misconceptions, Misuses & Mistakes" talk for the rationale behind this.

If you do want this feature, you'd need to modify the UI -> https://github.com/structurizr/ui

Alternatively, something like Ilograph might provide a better UI.

@beliaev-maksim
Copy link
Author

thank you for the reply. Let me first get familiar with the talk

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

No branches or pull requests

2 participants