Class: Transformer

Transformer

A Transformer is responsible for transforming a VisualGraph and the underlying ModelGraph. Transformer exposes methods such as Transformer#hideHost that allow other classes to specify how this transformer should transform graphs. Internally, it manages a bunch of Transformations to achieve the desired effect.

Shiviz Transformations can interact with each other in complex ways. For this reason, Transformer does not expose Transformations to outside classes, but instead acts as a black box that can be used to transform graphs

Typical usage for this class involves invoking methods such as Transformer#collapseNode to specifiy how the graph should be transformed and then invoking the Transformer#transform method. Note that no graphs or visual graphs are actually modified until the transform method is called.

Constructor

new Transformer()

Constructs a Transformer
Source:

Methods

collapseNode(node)

Sets this transformer to collapse the node and its group into one. Intuitively, the node's group are the nodes surrounding the argument that have no family.
Parameters:
Name Type Description
node ModelNode
Source:
See:

getHiddenHosts() → {Array.<String>}

Get all of the hosts hidden by this transformer by the last invocation of Transformer#transform. If the transform method has never been called, this method returns an empty array.
Source:
Returns:
the hosts that have been hidden by this transformer.
Type
Array.<String>

getHighlightedMotif() → {MotifGroup}

Returns the motif group that represents the highlighted elements from the last invocation of Transformer#transform. If transform has yet to be called, this method returns null
Source:
See:
Returns:
Type
MotifGroup

getHighlightMotifTransformation() → {HighlightMotifTransformation}

Returns the highlightMotifTransformation for this transformer. If highlightMotif has not been called, this method returns null
Source:
Returns:
Type
HighlightMotifTransformation

getSpecifiedHiddenHosts() → {Array.<String>}

Gets the hosts that are explicitly specified to be hidden. Note that a hosts that doesn't actually exist can be specified to be hidden. In addition, there are hosts that may be implicitly hidden by other transformations. These two facts mean that the returned list of hosts may be different from the hosts that are actually hidden.
Source:
See:
Returns:
the hosts specified to be hidden
Type
Array.<String>

getUniqueEvents() → {Array.<String>}

Get all of the unique events transformed by this transformer by the last invocation of Transformer#transform. If the transform method has never been called, this method returns an empty array.
Source:
Returns:
the unique events that have been transformed by this transformer.
Type
Array.<String>

getUniqueHosts() → {Array.<String>}

Get all of the unique hosts hidden by this transformer by the last invocation of Transformer#transform. If the transform method has never been called, this method returns an empty array.
Source:
Returns:
the unique hosts that have been hidden by this transformer.
Type
Array.<String>

hasHighlightedMotif() → {Boolean}

Determines if a motif is currently set to be highlighted.
Source:
See:
Returns:
True if a motif is currently set to be highlighted
Type
Boolean

hideDiff()

Sets this transformer to not highlight different hosts
Source:

hideHost(host)

Sets this transformer to hide the specified host. If the specified host is already set to be hidden, this method does nothing.
Parameters:
Name Type Description
host String The host that is to be hidden
Source:
See:

highlightHost(host, def)

Sets this transformer to highlight the specified host.
Parameters:
Name Type Description
host String The host to be highlighted
def Boolean Whether the transformation to remove is a default transformation.
Source:
See:

highlightMotif(motifFinder, ignoreEdges)

Sets this transformer to highlight a motif found by a MotifFinder. Only one motif can be highlighted at a time, thus if there is already a motif set to be highlighted, that one is replaced.
Parameters:
Name Type Description
motifFinder MotifFinder The motif finder that specifies which nodes and edges are to be highlighted
ignoreEdges Boolean edges will not be highlighted if true
Source:
See:

showDiff()

Sets this transformer to highlight different hosts in the View this transformer belongs to and the given View passed to the function
Source:

toggleCollapseNode(node)

Toggles collapsing of the node
Parameters:
Name Type Description
node ModelNode
Source:
See:

toggleHighlightHost(host)

Toggles highlighting of the specified host.
Parameters:
Name Type Description
host String
Source:
See:

transform()

Transforms the specified VisualGraph and the underlying ModelGraph based on the settings of this transformer. Note that this method is solely responsible for modifying visual and model graphs
Source:

uncollapseNode(node)

Sets this transformer to not collapse the node or any of the nodes in its group. Intuitively, the node's group are the nodes surrounding the argument that have no family.
Parameters:
Name Type Description
node ModelNode
Source:
See:

unhideHost(host)

Unsets this transformer to hide the specified host. If the specified host is not currently set to be hidden, this method does nothing.

A host could've been hidden either explicitly with a call to Transformer#hideHost or implicitly when a host is highlighted. In the latter case, all highlighted nodes will be unhighlighted as well.

Parameters:
Name Type Description
host String The host that is no longer to be hidden
Source:
See:

unhighlighHost(host)

Unsets this transformer to highlight the specified host.
Parameters:
Name Type Description
host String The host that is no longer to be highlighted
Source:
See:

unhighlightMotif()

Sets this transformer to not highlight motifs.
Source:
See: