Class MermaidGraphBuilderBase
java.lang.Object
org.odpi.openmetadata.commonservices.mermaid.MermaidGraphBuilderBase
- Direct Known Subclasses:
AssetGraphMermaidGraphBuilder
,AssetLineageEdgeGraphMermaidGraphBuilder
,AssetLineageGraphMermaidGraphBuilder
,GovernanceActionProcessMermaidGraphBuilder
,GovernanceDefinitionMermaidGraphBuilder
,HierarchyMermaidGraphBuilder
,InformationSupplyChainMermaidGraphBuilder
,OpenMetadataMermaidGraphBuilder
,ProjectMermaidGraphBuilder
,SolutionBlueprintMermaidGraphBuilder
,SolutionComponentMermaidGraphBuilder
,SolutionRoleMermaidGraphBuilder
,SpecificationMermaidGraphBuilder
Provides the basic functions for building flowchart based graph visualizations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringBuilder
protected final Map<String,
VisualStyle> protected final PropertyHelper
protected final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAnchorLinks
(boolean allAnchors) Add links to anchors to the graph.protected void
addSolutionComponentToGraph
(String parentNodeName, String parentLinkLabel, SolutionComponentElement solutionComponentElement, List<String> solutionLinkingWireGUIDs, boolean fullDisplay) Add a solution component to graph.protected String
addSpacesToTypeName
(String typeName) Convert a type name into a spaced string to allow the names to wrap nicely in a mermaid box.protected void
addStyles
(Map<String, VisualStyle> nodeColours) Add styling for nodes as requested.void
appendInvisibleMermaidLine
(String end1Id, String end2Id) Append an invisible line to the graph.void
appendMermaidDottedLine
(String lineName, String end1Id, String label, String end2Id) Append a new single pixel width line to the graph.void
appendMermaidLine
(String lineName, String end1Id, String label, String end2Id) Append a line to the graph.void
appendMermaidNode
(String currentNodeName, String currentDisplayName, String currentType) Create a node in the mermaid graph.void
appendMermaidThinLine
(String lineName, String end1Id, String label, String end2Id) Append a new single pixel width line to the graph.boolean
appendNewMermaidNode
(String currentNodeName, String currentDisplayName, String currentType, Map<String, String> additionalProperties, VisualStyle visualStyle) Create a node in the mermaid graph.boolean
appendNewMermaidNode
(String currentNodeName, String currentDisplayName, String currentType, VisualStyle visualStyle) Create a node in the mermaid graph.protected void
extractAnchorInfo
(ElementHeader elementHeader) Extract any anchor information to allow the graph to include linkages to anchors.getListLabel
(List<String> labelValues) Convert an array into a comma separated string.Add any style requests and return the built mermaid graph.getMermaidGraph
(boolean allAnchors) Add anchors, any style requests and return the built mermaid graph.protected String
getNodeDisplayName
(MetadataElementSummary metadataElementSummary) protected VisualStyle
getVisualStyleForSolutionComponent
(String solutionComponentType) Map the solution component type to an appropriate visual style.
-
Field Details
-
mermaidGraph
-
nodeColours
-
propertyHelper
-
sourceName
- See Also:
-
-
Constructor Details
-
MermaidGraphBuilderBase
public MermaidGraphBuilderBase()
-
-
Method Details
-
extractAnchorInfo
Extract any anchor information to allow the graph to include linkages to anchors. This can help join up lineage graphs.- Parameters:
elementHeader
- header of extracted element
-
addAnchorLinks
protected void addAnchorLinks(boolean allAnchors) Add links to anchors to the graph.- Parameters:
allAnchors
- should all anchors be added - or just those to known nodes?
-
getVisualStyleForSolutionComponent
Map the solution component type to an appropriate visual style.- Parameters:
solutionComponentType
- type of component- Returns:
- visual style enum
-
addSpacesToTypeName
Convert a type name into a spaced string to allow the names to wrap nicely in a mermaid box.- Parameters:
typeName
- type name- Returns:
- spaced type name
-
getListLabel
Convert an array into a comma separated string.- Parameters:
labelValues
- array of labels- Returns:
- string value
-
appendMermaidNode
public void appendMermaidNode(String currentNodeName, String currentDisplayName, String currentType) Create a node in the mermaid graph.- Parameters:
currentNodeName
- unique name/identifiercurrentDisplayName
- display namecurrentType
- type of element
-
appendNewMermaidNode
public boolean appendNewMermaidNode(String currentNodeName, String currentDisplayName, String currentType, VisualStyle visualStyle) Create a node in the mermaid graph.- Parameters:
currentNodeName
- unique name/identifiercurrentDisplayName
- display namecurrentType
- type of elementvisualStyle
- mermaid defined shape and colour value- Returns:
- whether a new node was created or not.
-
appendNewMermaidNode
public boolean appendNewMermaidNode(String currentNodeName, String currentDisplayName, String currentType, Map<String, String> additionalProperties, VisualStyle visualStyle) Create a node in the mermaid graph.- Parameters:
currentNodeName
- unique name/identifiercurrentDisplayName
- display namecurrentType
- type of elementadditionalProperties
- additional properties to add to the nodevisualStyle
- mermaid defined shape and colour value- Returns:
- whether a new node was created or not.
-
appendMermaidThinLine
Append a new single pixel width line to the graph.- Parameters:
lineName
- unique identifier of the line - may be nullend1Id
- identifier of the starting endlabel
- label for the lineend2Id
- identifier of the ending end
-
appendMermaidDottedLine
Append a new single pixel width line to the graph.- Parameters:
lineName
- unique identifier of the line - may be nullend1Id
- identifier of the starting endlabel
- label for the lineend2Id
- identifier of the ending end
-
appendMermaidLine
Append a line to the graph.- Parameters:
lineName
- unique identifier of the line - may be nullend1Id
- identifier of the starting endlabel
- label for the lineend2Id
- identifier of the ending end
-
appendInvisibleMermaidLine
Append an invisible line to the graph. This is used to line up descriptions etc- Parameters:
end1Id
- identifier of the starting endend2Id
- identifier of the ending end
-
addStyles
Add styling for nodes as requested. These go at the end of the graph. -
getNodeDisplayName
-
addSolutionComponentToGraph
protected void addSolutionComponentToGraph(String parentNodeName, String parentLinkLabel, SolutionComponentElement solutionComponentElement, List<String> solutionLinkingWireGUIDs, boolean fullDisplay) Add a solution component to graph.- Parameters:
parentNodeName
- identifier of the parent node (maybe null)parentLinkLabel
- add label to parent link - also optionalsolutionComponentElement
- element to processsolutionLinkingWireGUIDs
- list of solution wires already definedfullDisplay
- print all elements
-
getMermaidGraph
Add anchors, any style requests and return the built mermaid graph.- Parameters:
allAnchors
- should all anchors be added - or just those to known nodes?- Returns:
- string markdown
-
getMermaidGraph
Add any style requests and return the built mermaid graph.- Returns:
- string markdown
-