Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.60.0
B&W Flowchart Sketcher - User Manual
This manual provides a detailed guide on installing, launching, and designing beautiful black-and-white (B&W) flowcharts using either the Tkinter Desktop App (flowchart_app.py) or the Streamlit Web App (app.py).
Table of Contents
- System Requirements & Installation
- Interface Overview
- Managing Nodes
- Managing Edges (Connectors)
- Arranging & Laying Out the Chart
- Saving, Loading, & Exporting
- Tips for Creating Professional Diagrams
1. System Requirements & Installation
Requirements
- Python: Version 3.8 or higher.
- Operating System: Windows, macOS, or Linux.
Installation Steps
- Clone or download the repository to your local machine.
- Install the necessary dependencies (primarily
Pillowfor image generation, andstreamlitif running the web application):pip install Pillow streamlit
2. Interface Overview
The program provides a unified side-by-side workspace:
- Left Panel (Sidebar): Input forms, lists, action triggers, and file operations.
- Right Panel (Canvas): Live preview area rendering the flowchart. In the desktop version, this canvas is scrollable and fully interactive with drag-and-drop support.
3. Managing Nodes
Every node represents a step or symbol in your diagram.
Adding a New Node
- Navigate to the Node Manager section in the sidebar.
- Designation / Label (Short ID): Enter a short, unique name for the node (e.g.,
Start,Step 1,A,Q1). This ID serves as the identifier when connecting nodes with edges. - Icon Shape: Select a shape from the dropdown menu:
- Circle: Typically used for start/end terminals or connectors.
- Oval: Used for starting/ending process bounds.
- Square: Standard process step, task, or operation.
- Diamond: Decision point (creates branching paths).
- Inverted Triangle: Data input/output, yield, or storage.
- Description: Enter the text that will be displayed inside the node shape. This text automatically word-wraps to fit the shape boundaries.
- Click Add/Save Node. The node will appear at the center of the canvas.
Editing an Existing Node
- Desktop: Click on a node in the Canvas. Its properties will load into the Node Manager. Change the shape or description, and click Save Node.
- Web: Type the node's Short ID into the form. The details will update once you click Add/Save Node.
Deleting a Node
Select the node (or enter its ID in the form) and click Delete Node. This will also remove any connecting edges associated with that node.
4. Managing Edges (Connectors)
Edges connect your nodes together. The application allows you to connect multiple nodes in a single input path.
Adding Edges
- Locate the Edge Manager section in the sidebar.
- Path: Input a path of nodes using delimiters. Supported formats:
- Arrows:
Start -> Step 1 -> Check - Commas:
Start, Step 1, Check - Spaces:
Start Step 1 Check
- Arrows:
- Connector Line Style: Select the style of the lines:
- Straight: A crisp, direct line from the border of the source node to the border of the target node.
- Curved: A smooth, sweeping Bezier curve that arcs around other elements (helpful for loops).
- Dotted: A dashed, clean B&W line (often used for alternative flow paths or data streams).
- Click Add Edges.
Deleting Edges
In the Edge List section:
- Select the edge you wish to delete from the listbox (formatted as
Source -> Target (Style)). - Click Delete Selected Edge.
5. Arranging & Laying Out the Chart
The application provides both automatic sorting and manual positioning.
Auto-Layout
Click the Auto-Layout button under Actions. The application will compute a clean, hierarchical tree layout from top to bottom based on the flow direction of your edges. Disconnected nodes or cycles will be handled gracefully.
Manual Adjustments
- Desktop (Drag-and-Drop): Left-click on any node in the canvas and drag it with your mouse to your desired position. All arrows will stretch and pivot in real-time.
- Web (Coordinate Sliders): Expand the Manual Node Positioning section in the sidebar, select a node, and slide the X and Y coordinate controls to reposition it precisely.
6. Saving, Loading, & Exporting
Save / Load Projects (JSON)
To save your work so you can edit it later:
- Click Save Project (Desktop) or Download JSON Project File (Web). This saves the configurations of all nodes (positions, shapes, text) and edges to a lightweight
.jsonfile. - Click Load Project (Desktop) or Upload JSON Project (Web) and select a previously saved
.jsonfile to restore the chart.
Exporting Flowcharts (PNG)
To export the diagram for use in your documents, slides, or papers:
- Click Export PNG (Desktop) or Download Flowchart Image (Web).
- Save the file.
- The exported PNG features:
- A clean white background (grid lines and editing highlights are hidden).
- High-contrast B&W rendering.
- Auto-Cropping: The image bounds are automatically cropped to the contents of the flowchart with a clean 50px border margin (no wasted blank space).
7. Tips for Creating Professional Diagrams
- Use the Grid: In the desktop app, visual gridlines help you align nodes.
- Looping Back: When drawing a connector that loops back to a previous stage (e.g.
Error -> Start), set the edge style to Curved so it bows outward and does not overlap your straight, forward-flowing arrows. - Decision Branches: For diamonds (decisions), try to route one branch straight down and the other out to the side to keep the flow readable.
- Short Texts: Keep description labels concise. Long descriptions will wrap to multiple lines, which can crowd smaller shapes like diamonds or circles.