Class MermaidGraphBuilderBase
java.lang.Object
org.odpi.openmetadata.commonservices.mermaid.MermaidGraphBuilderBase
- Direct Known Subclasses:
AssetGraphMermaidGraphBuilder
,AssetLineageGraphMermaidGraphBuilder
,GovernanceActionProcessMermaidGraphBuilder
,HierarchyMermaidGraphBuilder
,InformationSupplyChainMermaidGraphBuilder
,OpenMetadataMermaidGraphBuilder
,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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSolutionComponentToGraph
(String parentNodeName, String parentLinkLabel, SolutionComponentElement solutionComponentElement, List<String> solutionLinkingWireGUIDs) 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
Add styling for nodes as requested.void
appendInvisibleMermaidLine
(String end1Id, String end2Id) Append an invisible line to the graph.void
appendMermaidLine
(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 end1Id, String label, String end2Id) Append a line to the graph.void
appendNewMermaidNode
(String currentNodeName, String currentDisplayName, String currentType, VisualStyle visualStyle) Create a node in the mermaid graph.getListLabel
(List<String> labelValues) Convert an array into a comma separated string.Add 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
-
-
Constructor Details
-
MermaidGraphBuilderBase
public MermaidGraphBuilderBase()
-
-
Method Details
-
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 void 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
-
appendMermaidThinLine
Append a line to the graph.- Parameters:
end1Id
- identifier of the starting endlabel
- label for the lineend2Id
- identifier of the ending end
-
appendMermaidLine
Append a line to the graph.- Parameters:
end1Id
- 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
protected void 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) 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 defined
-
getMermaidGraph
Add any style requests and return the built mermaid graph.- Returns:
- string markdown
-