Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FlowterFlowchartRendererMixin

The Flowter flowchart props mixins. The Flowter flowchart renderer mixins.

This class holds all the informations about what is needed for the flowchart to be rendered.

This class is responsible in shaping the retrieved props into the something that the node and the edge needs, eventually being rendered as a flowchart.

Hierarchy

Index

Properties

edges

edges: GraphEdge[]

Edges that connect the nodes.

The bare minimum of an edge is that it has to have a from and to properties in it. If the optional values are not set, it will be set to default values. See GraphEdge for more details on what are the configurable optionals.

Note that the edges are in an array, which means the order of the edges matter. The shape of the whole flowchart is going to be determined by how the edges are connected based on the order. See orderedNodes for more details.

The edges support different types of connection between nodes:

  1. Different node rows, going forward
  2. Different node rows, going backward
  3. Same node rows
  4. Same node

Each of these types of connection will be rendered differently. See [[FlowterEdge.edgePoints]] for more details.

fontSize

fontSize: number

The font size of the texts in all nodes and edges (optional). This value will be set as default when the individual node or edge doesn't set any font size.

If not specified, the value is set to DEFAULT_FONT_SIZE.

heightMargin

heightMargin: number

The margin value applied on both ends of the height (optional).

If not specified, the value is set to DEFAULT_HEIGHT_MARGIN.

mode

mode: Mode

How the flowchart is being rendered (optional).

By default, the flowchart is rendered vertically (Mode.VERTICAL).

See Mode for the supported modes.

nodeColSpacing

nodeColSpacing: number

The spacing between nodes (optional).

Note that if the nodes have its own x or y, the spacing is ignored. See shapeNodesVertically or shapeNodesHorizontally for more details.

If not specified, the value is set to DEFAULT_NODE_COL_SPACING.

nodeHeight

nodeHeight: number

The default height of all nodes, if not specified in nodes (optional).

If not specified, the value is set to DEFAULT_NODE_HEIGHT.

nodeRowSpacing

nodeRowSpacing: number

The row spacing between nodes (optional).

Note that if the nodes have its own x or y, the spacing is ignored. See shapeNodesVertically or shapeNodesHorizontally for more details.

If not specified, the value is set to DEFAULT_NODE_ROW_SPACING.

nodeWidth

nodeWidth: number

The default width of all nodes, if not specified in nodes (optional).

If not specified, the value is set to DEFAULT_NODE_WIDTH.

nodes

nodes: Record<string, GraphNode>

Nodes to be rendered.

The key of the nodes dictionary corresponds to the node id, which means the id has to be unique.

The bare minimum of a node is that it has to have a text property in it. If the optional values are not set, it will be set to default values. See GraphNode for more details on what are the configurable optionals.

Note that nodes has to connect to another note in order to be rendered. See nodeLists for more details.

widthMargin

widthMargin: number

The margin value applied on both ends of the width (optional).

If not specified, the value is set to DEFAULT_WIDTH_MARGIN.

Accessors

Private allBounds

  • The flowchart's bounds.

    For the x min/max values, it is calculated from the leftmost and the rightmost nodes. For the y min/max values, it is calculated from the topmost and the bottommost nodes. See getBounds for more details.

    Returns Bounds

containerStyle

  • get containerStyle(): Record<string, string>

Private nodeLists

Private orderedNodes

  • get orderedNodes(): object
  • All nodes sorted based on the edges, in a form of a dictionary.

    Since the way the flowchart is rendered is by rows, the rows are only defined by edges that connect one node to another node from the adjacent row, going forward. Any other connections are simply ignored, and let [[FlowterEdge]] renders the connection as the path.

    dict determines all the nodes by its id. Each member contains all the connections to another nodes along with its index, representing its position in nodeLists. maxIndex determines the maximum number of node rows.

    Returns object

Private renderedHeight

  • get renderedHeight(): number

renderedNodes

Private renderedWidth

  • get renderedWidth(): number

Methods

Private getBounds

Private getEdgeDirection

Private getEdgeSide

Private getNodeDirections

getRenderedEdge

Private shapeNode

Private shapeNodesHorizontally

  • shapeNodesHorizontally(nodeList: NodeRow[], maxHeight: number): void

Private shapeNodesVertically

  • shapeNodesVertically(nodeList: NodeRow[], maxWidth: number): void
  • Shapes all nodes position when being rendered in Mode.VERTICAL.

    The nodes' position will be rendered from the center towards the edge of the flowchart. This would take the nodes' x and y values into account if specified from nodes.

    Parameters

    • nodeList: NodeRow[]
    • maxWidth: number

    Returns void

Generated using TypeDoc