Skip to main content

Flow Chart Explorer

It’s difficult to identify all the execution paths of a complex program from a flowchart, isn’t it? Flow Chart Explorer analyzes and visualizes all execution paths in a flowchart.

Features

You can input a flowchart file (.drawio) drawn with the graph tool (draw.io), and FlowChartExplorer can output all the execution paths as .png files.

Input file(drawio)

This flow chart has eight execution paths.

image-20240511181448887

Output files

These are three excerpts from the total of eight execution paths that were automatically generated by this tool from the above .drawio file.

Usage

sample_exe.py is a implementation example.

from pathlib import Path

from flowchart_explorer.chartpath import FlowChartPath
from flowchart_explorer.explorer import Explorer
from flowchart_explorer.graph.drawio import Drawio

def main():
    # input drawio file path
    drawio = Drawio(Path("./charts/sample_chart.drawio"))
    graph = drawio.get_graph()
    explorer = Explorer()
    key, flow_path = explorer.run(graph)
    dir_path = Path("tests/chart_path/simple_double_loop_chart")
    flowchart = FlowChartPath(dir_path=dir_path)
    flowchart.draw(flow_path=flow_path, graph=graph)

Guidelines for Flowchart Creation

Prerequisites

  • It may be obvious, but the flowchart needs to be a Directed Acyclic Graph (DAG). It must not contain any cyclic structures.
  • There should be only one flowchart, starting from a single Start Node, in each .drawio file.
  • Currently, this tool only supports flowcharts created with drawio. (In the future, we have internally considered supporting other tools if there is a user demand.)

Guidelines for drawio

Start Node

image-20240512143434668
  • The "Start Node" should be created as an Ellipse or Circle, and should only be the source of Edges.
  • Again, there should be only one Start Node in the flowchart.

Loop

Please enclose loop processes like while and for statements with a set of "In Loop" and "Out Loop" . Also, these nodes need to have properties set for handling multiple loops. Please refer to the example in charts/example_chart.drawio.

In Loop(Loop Limit)

Represents the starting point of the loop process.

image-20240512150727067
Properties

You need to set in-loop (required) and max-loop (optional).

  • in-loop (required): This is the id name to identify the loop. Please set it as an integer value. Please set the same value for both the In Loop and Out Loop nodes.
  • max-loop (optional): This is the number of loops that the "Flow Chart Explorer" will iterate for path exploration. The default is 2 times, so set it only if you want to change it.
Out Loop(Reversed Loop Limit)

Represents the end point of the loop process.

image-20240512151119314
Properties
  • out-loop (required): This is the id name to identify the loop. Please set it as an integer value. You must set the same value as the “in-loop” of the corresponding “In Loop”.
Exit Loop

If you need to break from the loop process due to a status or other condition and exit midway, please add an Exit Loop node to the exit route. This is a rule that strongly depends on the “Flow Chart Explorer” specification.

image-20240512154159742
  • The “Exit Loop” should be created as an Ellipse or Circle. Be sure to set the exit-loop property to the id value of the loop you want to exit.
Properties
  • exit-loop (required): This is the id name to identify the loop you want to exit. Please set it as an integer value.

Supplementary Notes

  • There is no problem with how many edges come out from one node for conditional branching. Also, the type of node for conditional branching in drawio does not necessarily have to be a Diamond.

Setting Node Properties Procedure

Right-click on the node → Edit Data

image-20240512145158061
  1. Input those properties → Add Property → Input value
image-20240512145452408
  1. Click Apply
image-20240512145653862

Metadata

Release files for flowchart-explorer 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowchart-explorer 0.1.2
File Size Uploaded
flowchart_explorer-0.1.2.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flowchart-explorer 0.1.2
File Interpreter ABI Platform
flowchart_explorer-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / flowchart_explorer-0.1.2.tar.gz

Download URL flowchart_explorer-0.1.2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6f0562d3907978e58be637817e02c9a469fc80b1a41ebcbe1e159d9f5ed37484
BLAKE2b-256 checksum
How to use checksums
000cef854366600efd32c3285efac6fbbf54b38a12eb6d39001e75876e808de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / flowchart_explorer-0.1.2-py3-none-any.whl

Download URL flowchart_explorer-0.1.2-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b55a7c97afaeaadd5458e5494aa98bf3508801f6630212c433f0a0b216d2786
BLAKE2b-256 checksum
How to use checksums
e41d20da15aabfed97ebfe94f39fdeb01763e6b39bcb78a85460379a24b7f8be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page