Class MermaidGraphBuilderBase

java.lang.Object
org.odpi.openmetadata.commonservices.mermaid.MermaidGraphBuilderBase
Direct Known Subclasses:
AssetGraphMermaidGraphBuilder, AssetLineageGraphMermaidGraphBuilder, GovernanceActionProcessMermaidGraphBuilder, HierarchyMermaidGraphBuilder, InformationSupplyChainMermaidGraphBuilder, OpenMetadataMermaidGraphBuilder, SolutionBlueprintMermaidGraphBuilder, SolutionComponentMermaidGraphBuilder, SolutionRoleMermaidGraphBuilder, SpecificationMermaidGraphBuilder

public class MermaidGraphBuilderBase extends Object
Provides the basic functions for building flowchart based graph visualizations.
  • Field Details

  • Constructor Details

    • MermaidGraphBuilderBase

      public MermaidGraphBuilderBase()
  • Method Details

    • getVisualStyleForSolutionComponent

      protected VisualStyle getVisualStyleForSolutionComponent(String solutionComponentType)
      Map the solution component type to an appropriate visual style.
      Parameters:
      solutionComponentType - type of component
      Returns:
      visual style enum
    • addSpacesToTypeName

      protected String addSpacesToTypeName(String typeName)
      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

      public String getListLabel(List<String> labelValues)
      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/identifier
      currentDisplayName - display name
      currentType - 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/identifier
      currentDisplayName - display name
      currentType - type of element
      visualStyle - mermaid defined shape and colour value
    • appendMermaidThinLine

      public void appendMermaidThinLine(String end1Id, String label, String end2Id)
      Append a line to the graph.
      Parameters:
      end1Id - identifier of the starting end
      label - label for the line
      end2Id - identifier of the ending end
    • appendMermaidLine

      public void appendMermaidLine(String end1Id, String label, String end2Id)
      Append a line to the graph.
      Parameters:
      end1Id - identifier of the starting end
      label - label for the line
      end2Id - identifier of the ending end
    • appendInvisibleMermaidLine

      public void appendInvisibleMermaidLine(String end1Id, String end2Id)
      Append an invisible line to the graph. This is used to line up descriptions etc
      Parameters:
      end1Id - identifier of the starting end
      end2Id - identifier of the ending end
    • addStyles

      protected void addStyles()
      Add styling for nodes as requested. These go at the end of the graph.
    • getNodeDisplayName

      protected String getNodeDisplayName(MetadataElementSummary metadataElementSummary)
    • 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 optional
      solutionComponentElement - element to process
      solutionLinkingWireGUIDs - list of solution wires already defined
    • getMermaidGraph

      public String getMermaidGraph()
      Add any style requests and return the built mermaid graph.
      Returns:
      string markdown