Skip to content

Feature Request: Support different views/selective renderings of the same model (support C4Model approach) #711

@kmindi

Description

@kmindi

Like explained and shown for example here: https://www.workingsoftware.dev/software-architecture-documentation-the-ultimate-guide/ it would be very beneficial for D2 to have a feature to create different views of a diagram based on the same model.

This does not mean that the SVG or other available formats need to have all the views within one rendering/export.
Basic fullfillment of this feature would be to have command line options to generate different renderings/views based on the same input/d2 file.

E.g. like --tags network,security --depth-max 3 --root-node frontend will select all nodes and edges that have a tag with network and or security, as well as only render nodes until 3 nested nodes below the node frontend and does not show nodes nested below depth 3 as well as no nodes above frontend (of course also possible without specifying --root-node, aslo possible to use only --root-node without --tags and --depth to show all below that node).

If you have a good approach to provide this as some kind of annotations in the d2 file to generate multiple outputs right-away that would of course also be interesting.

See also https://c4model.com/.

Especially useful for big models/diagrams.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions