Thanks to GenerateGraph, graphical representations of data in SystemWeaver can be included in generated reports and documents. However, large graphs, such as the one below, can sometimes be difficult to read in the output.



In such cases, consider splitting the graph into smaller, easy-to-read graphs in your report/document. This article provides an example of how to do this. 


Example Meta Model


Example Data

Example Configuration 

The below snippet shows how to break down the above graph into smaller parts. 

...
<ApplyItemTemplates/>

<ItemTemplate type="26SCGO">
    <ApplyTemplate name="SafetyGoalTable"/>
    <ApplyTemplate name="SafetyGoalGraph"/>
</ItemTemplate>

<Template name="SafetyGoalTable">
    <Table autoMerge="True">
        <Columns/>
        ...         
    </Table>
  </Template>

<Template name="SafetyGoalGraph">
    <GenerateGraph>
        <Options>
            <ObjIcons/>
        </Options>
        <Layout name="incrementalHierarchical">
            <Setting name="layoutOrientation" value="topToBottom"/>
        </Layout>

      <NodeStyles>
        <NodeStyle name="Context" fillColor="#ffcccc" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape> 
            <Rectangle cornerRadius="30"/>
          </Shape>
        </NodeStyle>   
        <NodeStyle name="Goal" fillColor="#efffdf" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape>
            <Rectangle/>
          </Shape>
        </NodeStyle>  
        <NodeStyle name="Strategy" shapeType="parallelogram" fillColor="#7acfff" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape>
            <Parallelogram/>
          </Shape>
        </NodeStyle> 
        <NodeStyle name="Justification" shapeType="ellipse" fillColor="#efffdf" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape> 
            <Ellipse/>
          </Shape>
        </NodeStyle> 
        <NodeStyle name="Solution" shapeType="circle" fillColor="#F5DEB3" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape> 
            <Circle diameter="140"/>
          </Shape>
        </NodeStyle>        
        <NodeStyle name="Module" shapeType="circle" fillColor="#FFDFFF" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape> 
            <Circle diameter="200"/>
          </Shape>
        </NodeStyle>        
        <NodeStyle name="Contract" shapeType="ellipse" fillColor="#FFFFFF" fillColor2="#ffffff" borderThickness="1" borderColor="#000000">
          <Shape> 
            <Ellipse/>
          </Shape>
        </NodeStyle>                
      </NodeStyles>
      <EdgeStyles>
        <EdgeStyle name="SupportedBy" fillColor="#000000" thickness="2" lineType="solid" fromArrowType="none" toArrowType="default"/>
        <EdgeStyle name="InContextOf" fillColor="#000000" thickness="2" lineType="solid" fromArrowType="none" toArrowType="triangle"/>   
      </EdgeStyles>

        <Node style="Goal" caption="Claim: #{Name}"/>
        <ForEach select="/part::ISGO">
            <!-- sub goals -->
            <Choose>
                <When test="/defobj::[Type.SID='26SCGO']">
                    <!-- Goal -->
                    <ForEach select="/defobj::">
                        <Node style="Goal" caption="Claim: #{Name}"/>
                    </ForEach>
                    <Edge from="Owner" to="DefObj" style="SupportedBy"/>
                </When>
                <When test="/defobj::[Type.SID='26SCSTR']">
                    <!-- Strategy -->
                    <ForEach select="/defobj::">
                        <Node style="Strategy" caption="Argument: #{Name}"/>
                        <ForEach select="/part::ISGO">
                            <Choose>
                                <When test="/defobj::[Type.SID='26SCGO']">
                                    <!-- Goal -->
                                    <ForEach select="/defobj::">
                                        <Node style="Goal" caption="Claim: #{Name}"/>
                                    </ForEach>
                                    <Edge from="Owner" to="DefObj" style="SupportedBy"/>
                                </When>
                            </Choose>
                        </ForEach>
                    </ForEach>
                    <Edge from="Owner" to="DefObj" style="SupportedBy"/>
                </When>
            </Choose>
        </ForEach>
    </GenerateGraph>
</Template>
...


Example Result