Skip to content

merijndejonge/Structurizr.Dgml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structurizr.Dgml

Description

Structurizr.Dgml is a small DotNet library for converting Structurizr's C4 models to corresponding DGML graphs.

Checkout the following for more information:

Example

Below is an example that shows how the Contoso University example has been converted to DGML: Contoso university converted to DGML

In the Visual Studio DGML viewer you can collapse different elements of the model to focus on different aspect of the model:

Partly collapsed version of Contoso university converted to DGML

Using Structurizr.Dgml

Given an C4 model in a Structurizr.Workspace instance, you can simply convert the model to Dgml with the extention method ToDgml(). I.e.,

using OpenSoftware.DgmlTools.Model;
using OpenSoftware.Structurizr.Dgml;
using Structurizr;

namespace MyC4Model
{
    class Program
    {
        static void Main(string[] args)
        {
            var workspace = new Workspace("My model", "This is an example C4 model.");
            // Fill your model here (see https://github.com/structurizr/dotnet)

            // Convert to DGML
            var dgml = workspace.ToDgml();
            // Write to file
            dgml.WriteToFile("c4model.dgml");
        }
    }
}

You can then open the file c4model.dgml in Visual Studio to view and analyze it. You can find more information about creating a C4 model for dotnet at https://github.com/structurizr/dotnet.

More info

Source code of Structurizr.Dgml is available at GitHub. Nuget packages are available at Nuget.org.

Structurizr.Dgml is distributed under the Apache 2.0 License.

About

Structurizr.Dgml is a library for converting Structurizr's C4 models to corresponding Dgml graphs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages