By default, all relationships are rendered as dashed grey lines as shown in the example diagram below.
However, the following characteristics of the relationships can be customized:
- Line thickness (pixels)
- Colour (HTML hex value)
- Line style (dashed or solid)
- Smooth (angled or curved)
- Font size (pixels)
- Width (of the description, in pixels)
- Position (of the description along the line, as a percentage from start to end)
All relationships within a software architecture model can have one or more tags associated with them. A tag is simply a free-format string. By default, the .NET client library adds the "Relationship" tag to relationships. You can add your own custom tags to relationships using the AddTags() method on the relationship.
To style a relationship, simply create a RelationshipStyle for a particular tag and specify the characteristics that you would like to change. For example, you can change the colour of all relationships as follows.
Styles styles = workspace.Views.Configuration.Styles;
styles.add(new RelationshipStyle(Tags.Relationship) { Color = "#ff0000" });You can also change the colour of specific relationships, based upon their tag, as follows.
user.Relationships.ToList().ForEach(r => r.AddTags("HTTPS"));
styles.add(new RelationshipStyle(Tags.Relationship) { Color = "#3366ff" });
styles.add(new RelationshipStyle("HTTPS") { Color = "#33cc33", Dashed = false });Structurizr will automatically add all relationship styles to a diagram key.



