Table of Contents

Class DefaultLayoutMergeStrategy

Namespace
C4.Net
Assembly
C4.Net.Core.dll

A default implementation of a LayoutMergeStrategy that:

  • Sets the paper size (if not set).
  • Copies element x,y positions.
  • Copies relationship vertices.

Elements are matched using the following properties, in order:

  • the element's full canonical name
  • the element's name
  • the element's description
public class DefaultLayoutMergeStrategy : LayoutMergeStrategy
Inheritance
DefaultLayoutMergeStrategy
Implements
Inherited Members

Methods

CopyLayoutInformation(View, View)

Attempts to copy the visual layout information (e.g. x,y coordinates) of elements and relationships from the specified source view into the specified destination view.

public void CopyLayoutInformation(View viewWithLayoutInformation, View viewWithoutLayoutInformation)

Parameters

viewWithLayoutInformation View

the source view (e.g. the version stored by the Structurizr service)

viewWithoutLayoutInformation View

the destination View (e.g. the new version, created locally with code)

findElementView(View, Element)

Finds an element. Override this to change the behaviour.

protected ElementView findElementView(View viewWithLayoutInformation, Element elementWithoutLayoutInformation)

Parameters

viewWithLayoutInformation View

the view to search

elementWithoutLayoutInformation Element

the Element to find

Returns

ElementView

The matching ElementView, or null when no suitable element can be matched.