How Do I Create and Customize a Matrix View?

Customizing a matrix view is easy when using the View Manager and the properties pad. Just follow these steps:

  1. In order to create a matrix view, open your graph file (.slg) with the Open View Dialog. Select the view type “Matrix” on the left-hand side of the Open View Dialog window. Then choose the default view template “Matrix” or one of your self-made view templates under “My View Templates” if you have saved view templates beforehand. Generally speaking, the columns and rows of a matrix represent nodes while the matrix fields between these represent edges.
    The View Settings section gives you the opportunity to select which node class(es) you would like to select as row and column elements (dropdowns: “Columns (nodes)” and “Rows (nodes)”. In the fields “Row/Column label”, you should select a unique identifying attribute for your nodes, such as name or id number. Furthermore, you can choose which edge class you would like to model in the matrix fields (“Cells (edges)”). In the field “Cell labels”, you can select an attribute of your selected edge class defined in the Metamodel. Note that even if you did not define any edge attributes in your Metamodel, you can select the “_guid”. This is an internally used identification number which is unique for each node or edge instance. Thus, if you are only interested in finding out if an edge exists or not, you can always use the _guid.

    View Settings for the Matrix View
    View Settings for the Matrix View

    In the shown example, we want to know whether two part nodes are connected by an edge. Thus, we select “Part” as node class both for the columns and rows. As label, we choose the attribute “id” as it is unique for each node. Lastly, we select the “All edges” in the cells field and “_guid” as cell label as we do not care about the edge class which connects the part nodes. We rather want to know if there is any connecting edge between them at all.
    An excerpt of the resulting matrix is shown below. The _guid can be found in the matrix field between the two part nodes which are connected by an existing edge.

    Example of a Matrix View
    Example of a Matrix View
  2. Open the View Manager and select the node series of your row/column if you want to adapt the visualization of all rows/columns. To highlight just a certain row/column, you can simply click on it in the view. Then go to the properties pad in order to modify the view settings. Have a look at the bottom of this article for a description of all available properties.

    Select a row series and customize the view in the properties pad
    Select a row series and customize the view in the properties pad
  3. Adjust the properties of the matrix view in the properties pad by selecting the bild1symbol on the top left-hand side of the matrix:

    View properties in the properties pad
    View properties in the properties pad
  4. As soon as you are happy with your customized view, you can save the settings by extracting a view template. Thus, you can reuse it for any graph file. You find your saved view templates under “My View Templates in the Open View Dialog.

    Extract a View Template and Save It for Reuse. You find it under My View Templates in the Open View Dialog
    Extract a View Template and save It for reuse

Adaptable View Properties

Graph ElementsProperty NameDescription
NodeFill ColorDefines the color of your element
Node, EdgeLabel Font ColorDefines the color of your label text
Node, EdgeLabel Font SizeDefines the size of your label
Node, EdgeLabel PositionDefines the position of your label according to cardinal directions
Node, EdgeLabel TextDefines the label text
Node, EdgeTooltipDefines the text which is showed while hovering over the element with the mouse
bild1Diagonal Cell ColorDefines the color of diagonal cells
bild1Empty Cell ColorDefines the color of empty cells
bild1Influence DirectionDefines the edges that should be visualized depending on how rows and columns influence each other
bild1Self Loop ColorDefines the color of entries which are source and target of the same edge
bild1Sort Columns byDefines an attribute for sorting the columns
bild1Sort Columns DirectionDefines how columns should be sorted (ascending or descending)
bild1Sort Rows byDefines an attribute for sorting the rows
bild1Sort Rows DirectionDefines how rows should be sorted (ascending or descending)
bild1ZoomDefines how big the matrix should be visualized
NodesIndexDefines at which position the node should appear
Nodes, EdgesLabel AngleDefines the angle in which the label text is presented

Was this article helpful?

Related Articles