Flowchart Symbols

SchemDraw provides basic flowcharting abilities. The SchemDraw.flow module contains a set of functions for defining flowchart blocks that can be added to SchemDraw Drawings.

from SchemDraw import flow

Flowchart blocks:

../_images/flow_1_0.svg
SchemDraw.flow.box(w=3, h=2)

Flowchart box

Parameters
  • w – width

  • h – height

Return type

dict

Returns

element definition dictionary

SchemDraw.flow.sub(w=3.5, h=2, s=0.3)

Flowchart subprocess box (box with extra vertical lines)

Parameters
  • w – width

  • h – height

  • s – spacing of side lines

Return type

dict

Returns

element definition dictionary

SchemDraw.flow.data(w=3, h=2, s=0.5)

Flowchart data or I/O block (parallelogram)

Parameters
  • w – width

  • h – height

  • s – slant of parallelogram

Return type

dict

Returns

element definition dictionary

SchemDraw.flow.start(w=3, h=2)

Flowchart start block (oval)

Parameters
  • w – width

  • h – height

Return type

dict

Returns

element definition dictionary

SchemDraw.flow.connect(r=0.75)

Flowchart connect block (circle)

Parameters

r – radius

Return type

dict

Returns

element definition dictionary

SchemDraw.flow.decision(w=4, h=2, responses=None)

Flowchart decision block (diamond)

Parameters
  • w – width

  • h – height

  • responses – Dictionary of responses to label at each point of diamond. Keys are ‘N’, ‘S’, ‘E’, ‘W’. Example: {‘E’: ‘Yes’, ‘W’: ‘No’}

Return type

dict

Returns

element definition dictionary

All flowchart symbols have four anchors named ‘N’, ‘S’, ‘E’, and ‘W’ for the four directions. The SchemDraw.elements.ic() function can be used with the flowchart elements to create blocks with multiple inputs/outputs per side if needed.

Flowchart elements do not have “leads” like electrical elements, so they must be connected with LINE elements. The ARROWHEAD element can be used to show flow direction. The w and h parameters must be manually specified to size each block to fit any labels.

Decisions

To label the decision branches, the SchemDraw.flow.decision() function takes the responses parameter, a dictionary of responses for each direction. For example:

decision = flow.decision(responses={'W': 'Yes', 'E': 'No', 'S': 'Maybe'})
../_images/flow_4_0.svg

See the Flowcharting Gallery for more examples.