Complete Diagram Guide

by Peta Team

Complete Diagram Guide

Flowchart Diagrams

Flowcharts are the most versatile diagram type in Peta. They're perfect for visualizing processes, workflows, decision trees, and algorithmic logic.

Basic Syntax

The fundamental syntax for flowcharts uses nodes connected by arrows:

Basic Flowchart Start Process End

This creates a linear flow from left to right.

Node Syntax

Creating Nodes

Nodes are created simply by typing their name. The renderer automatically:

  • Calculates optimal positioning
  • Draws rounded rectangles for nodes
  • Adds appropriate spacing
Node A Node B Node C

Naming Conventions

  • Use descriptive names
  • Spaces are allowed in node names
  • Keep names concise
  • Use consistent capitalization

Arrow Syntax

Basic Arrows

Use `->` to connect nodes:

Source Destination

Multiple Connections

A node can connect to multiple nodes:

Start Process A Process B End

Branching

Decision Points

Create decision points by branching from a single node:

Decision Flow Decision Option A Option B

Labelled Branches

Add labels to branches using the arrow label syntax:

Labelled Decision Decision Yes Continue No Stop

The text after the arrow becomes the branch label.

Complex Flows

Sequential Flow

Chain multiple nodes together:

Step 1 Step 2 Step 3 Step 4 Step 5

Parallel Processing

Show parallel processes:

Parallel Processing Start Fork Process A Process B Join End

Feedback Loops

Create loops and iterations:

Feedback Loop Start Process Check Passed End Failed

Advanced Features

Complex Workflows

Combine multiple concepts:

Complete Workflow User Input Validation Valid Processing Invalid Show Error Save Database Success Message End Error Message

Practical Examples

User Authentication

User Authentication User Login Page Validate Credentials Valid Dashboard Invalid Show Error Logout

CI/CD Pipeline

CI/CD Pipeline Code Push Build Tests Passed Deploy Failed Notify Developer Staging Production Fix

Order Processing

Order Processing Order Received Check Inventory In Stock Process Payment Out of Stock Notify Customer Payment Confirmed Ship Order Delivery Confirmation Complete End Payment Failed Cancel Order

Tips and Best Practices

  1. Keep it simple: Avoid overly complex flows
  2. Use clear labels: Make node names descriptive
  3. Logical flow: Arrange nodes in logical order
  4. Consistent direction: Generally left-to-right or top-to-bottom
  5. Balance branches: Try to keep branches balanced

Common Patterns

Decision Tree

Decision Tree Root Question 1 Yes Action A No Question 2 Action B Action C

Error Handling

Error Handling Operation Success Next Step Failure Log Error Retry Max Retries Abort

Next Steps

Now that you've mastered flowcharts, let's move on to Gantt charts for timeline visualization in the next chapter.