Skip to main content

FlowChart Explorer is a GitHub-integrated tool that analyzes all execution paths in a flowchart. It helps identify bottlenecks and redundancies in your codebase, providing a new level of clarity and control.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowchart_explorer-0.1.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

flowchart_explorer-0.1.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file flowchart_explorer-0.1.2.tar.gz.

File metadata

  • Download URL: flowchart_explorer-0.1.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for flowchart_explorer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6f0562d3907978e58be637817e02c9a469fc80b1a41ebcbe1e159d9f5ed37484
MD5 fb098373a3d78624e5275d64d9dd21a3
BLAKE2b-256 000cef854366600efd32c3285efac6fbbf54b38a12eb6d39001e75876e808de9

See more details on using hashes here.

File details

Details for the file flowchart_explorer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flowchart_explorer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b55a7c97afaeaadd5458e5494aa98bf3508801f6630212c433f0a0b216d2786
MD5 232becde0d6a152a75fc14c0aab3dd34
BLAKE2b-256 e41d20da15aabfed97ebfe94f39fdeb01763e6b39bcb78a85460379a24b7f8be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page