Classes in this package are mappings of the architecture model classes to the abstractions of the The C4 model for visualising software architecture.
The classes in this package do not introduce any new structural features (attributes or references) or operations, just new semantics. E.g. System and Container extend CompositeNode - they can have documentation, icon, incoming and outgoing connections, nested elements, … The difference between them is in definitions.
There is also a demo of documentation produced with “Direct Generation” approach explained in Visual communication continuum story (also in Resources):
The direct generation approach is simpler and might be easier to get started with. It was designed to be compatible with semantic mapping explained here to simplify migration.
semantic-id
property to have meaningful (semantic) URL’s in generated documentation and meaningful identifiers for cross-referencing.Context
container from the C4 library to a sub-diargram page.type
property and add selector
property to link the diagram element to an already defined mapping of a diagram element to a semantic element. For example, getDocument().getModelElementById('user')
would link a diagram element to another diagram element with id user
. getDocument().getModelElementByProperty('semantic-id', 'personal-banking-customer')
selects an element by its property value. It is also possible to do page-level selections: getDocument().getPageByXXX().getModelElementByXXX()
.Relationships documentation can be accessed by clicking relationships on diagrams in generated documentation. To link relationships from Markdown use references/outgoingConnections/<id>/index.html
URL relative to the relationship source. <id>
stands for the semantic id, which defaults to the diagram element id if not set via semantic-id
property.
nsd app model site -f C:\_temp\c4\c4.drawio C:\_temp\c4\site --root-action-text="Nasdanika C4 Model Demos"