Skip to content

Add support for custom Tags and Styles #86

@SlavaVedernikov

Description

@SlavaVedernikov

Context

At the moment all C4 and C4 Static diagrams are rendered with support for a set of built-in Element and Relationship Tags and Styles.

AddElementTag("c4interflow:lifecycle:new", $bgColor=green, $fontColor=#ffffff, $borderColor=green, $shadowing="False")
AddElementTag("c4interflow:lifecycle:changed", $bgColor=orange, $fontColor=#ffffff, $borderColor=orange, $shadowing="False")
AddElementTag("c4interflow:lifecycle:removed", $bgColor=red, $fontColor=#ffffff, $borderColor=red, $shadowing="False")

AddRelTag("c4interflow:lifecycle:new", $textColor=green, $lineColor=green)
AddRelTag("c4interflow:lifecycle:changed", $textColor=orange, $lineColor=orange)
AddRelTag("c4interflow:lifecycle:removed", $textColor=red, $lineColor=red)

Requirements

Add support for custom Tags and Styles, so that any Structures can be tagged with custom Tags and then styled accordingly when the diagrams are generated.

Custom Tags should be added under Tags object in AaC. For example the built-in C4InterFlow Tags would be defined in YAML AaC as follows:

Tags:
  C4InterFlow:
    Lifecycle:
      New:
        ElementStyle:
          BackgroundColor: green
          FontColor: #ffffff
          BorderColor: green
          Shadowing: false
        RelationshipStyle:
          TextColor: green
          LineColor: green
      Changed:
        ElementStyle:
          BackgroundColor: orange
          FontColor: #ffffff
          BorderColor: orange
          Shadowing: false
        RelationshipStyle:
          TextColor: orange
          LineColor: orange
      Removed:
        ElementStyle:
          BackgroundColor: red
          FontColor: #ffffff
          BorderColor: red
          Shadowing: false
        RelationshipStyle:
          TextColor: red
          LineColor: red

The Structures would be tagged in AaC as follows:

Tags:
  - "C4InterFlow.Lifecycle.New"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions