Diagram Feature Test
Diagram Feature Test
This article tests all the diagram types supported by Peta's diagram rendering feature.
Flowchart Example
This is a simple flowchart showing a decision-making process. The flowchart renderer automatically calculates node positions and draws edges with arrowheads.
Flowchart with Title
This flowchart demonstrates the order processing workflow with a custom title. Notice how the title is displayed at the top of the diagram.
Complex Flowchart
This flowchart shows the iterative nature of software development with feedback loops.
Gantt Chart Example
This Gantt chart shows a typical software development timeline with tasks, dates, and durations.
Gantt Chart with Title
This Gantt chart displays a quarterly project timeline with overlapping phases.
Sequence Diagram Example
This sequence diagram illustrates the interaction between a user, system, and database during a login process.
Sequence Diagram with Title
This sequence diagram shows the complete e-commerce checkout process with multiple actors.
Class Diagram Example
This class diagram shows the relationships between different components in a system, including composition (+|+) and aggregation (|o|).
Class Diagram with Title
This class diagram illustrates the relationships in a blog system with multiple interconnected entities.
State Diagram Example
This state diagram demonstrates the state transitions in a simple system with start, pause, resume, and stop actions.
State Diagram with Title
This state diagram models a traffic light system with both automatic and emergency state transitions.
How Diagrams Work
All diagrams are rendered in Rust during the build time. The SVG markup is generated directly and embedded in the final HTML output. This means:
- No client-side JavaScript rendering required
- Fast page load times
- Static, cacheable output
- Full control over styling and theming
The diagram syntax is text-based and easy to write, similar to Mermaid but with Peta's own custom rendering engine.
Supported Diagram Types
Flowchart: Node-based process diagrams with arrows Gantt Chart: Timeline-based project schedules Sequence Diagram: Interaction sequences between actors Class Diagram: UML class structures and relationships
- State Diagram: State transitions and events
Future Enhancements
The diagram system is designed to be extensible. Future versions may include:
Advanced layout algorithms (force-directed, hierarchical) Interactive hover effects Pan and zoom capabilities Export to PNG/SVG Customizable node shapes Subdiagram support