# nkh/p5-app-asciio architecture

> Architecture diagram of the GitHub repository nkh/p5-app-asciio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nkh/p5-app-asciio
- Repository: https://github.com/nkh/p5-app-asciio

## Overview

Asciio is a diagram editor for creating ASCII/Unicode diagrams, primarily through GUI or terminal interfaces, then exporting plain text or saving an editable diagram. The README also documents scripting, customizable bindings, stencils, connected shapes, and automatic crossing handling. The tree supports paths for these product areas, but no source excerpts were supplied, so internal call ownership is not verifiable; the graph therefore uses documented relationships and marks inferred internal links as unverified.

Main entry points: [`lib/App/Asciio/GTK/Asciio.pm`](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/GTK/Asciio.pm) (GUI editor), [`lib/App/Asciio/Text/Asciio.pm`](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Text/Asciio.pm) (Terminal editor), [`lib/App/Asciio/Elements.pm`](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Elements.pm) (Grid canvas), [`lib/App/Asciio/Io.pm`](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Io.pm) (Diagram file I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_gui["GUI editor<br/>[Asciio.pm]"]
  node_tui["Terminal editor<br/>[Asciio.pm]"]
end

subgraph group_editing["Diagram editing"]
  node_canvas["Grid canvas<br/>[Elements.pm]"]
  node_shapes["Shapes and text"]
  node_connectors["Arrow connections<br/>[Connections.pm]"]
  node_crossings["Crossing handling<br/>[Cross.pm]"]
  node_editingops["Selection and grouping<br/>[Selection.pm]"]
  node_history["Undo and redo<br/>[Undo.pm]"]
  node_execbox["Command output box<br/>[exec_box.pm]"]
end

subgraph group_formats["Diagram formats"]
  node_io["Diagram file I/O<br/>[Io.pm]"]
  node_editable["Editable diagram<br/>[json.pl]"]
  node_textout["ASCII text export<br/>[Ascii.pm]"]
  node_converter["Text converters"]
end

subgraph group_extensions["Customization"]
  node_stencils["Stencil library<br/>[Stencil.pm]"]
  node_bindings["Keyboard bindings"]
  node_scripting["Diagram scripting<br/>[Scripting.pm]"]
end

node_user(("Diagram author"))
node_externalapp(("External command"))

node_user -->|"opens diagram"| node_gui
node_user -->|"opens diagram"| node_tui
node_gui -.->|"edits diagrams"| node_canvas
node_tui -.->|"edits diagrams"| node_canvas
node_canvas -.->|"contains elements"| node_shapes
node_canvas -->|"connects shapes"| node_connectors
node_canvas -->|"handles crossings"| node_crossings
node_gui -->|"supports editing"| node_editingops
node_tui -->|"supports editing"| node_editingops
node_gui -->|"supports undo"| node_history
node_tui -.->|"supports undo"| node_history
node_gui -->|"uses stencils"| node_stencils
node_gui -->|"customizes bindings"| node_bindings
node_tui -->|"customizes bindings"| node_bindings
node_user -->|"generates diagrams"| node_scripting
node_execbox -->|"runs command"| node_externalapp
node_gui -.->|"opens and saves"| node_io
node_io -->|"stores editable form"| node_editable
node_gui -->|"exports text"| node_textout
node_tui -->|"converts diagrams"| node_converter
node_user -->|"converts text"| node_converter

click node_gui "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/GTK/Asciio.pm"
click node_tui "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Text/Asciio.pm"
click node_canvas "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Elements.pm"
click node_shapes "https://github.com/nkh/p5-app-asciio/tree/main/lib/App/Asciio/stripes"
click node_connectors "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Connections.pm"
click node_crossings "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Cross.pm"
click node_editingops "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Actions/Selection.pm"
click node_history "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Undo.pm"
click node_stencils "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Stencil.pm"
click node_bindings "https://github.com/nkh/p5-app-asciio/blob/main/setup/actions/default_bindings.pl"
click node_scripting "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Scripting.pm"
click node_execbox "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/stripes/exec_box.pm"
click node_io "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Io.pm"
click node_editable "https://github.com/nkh/p5-app-asciio/blob/main/setup/import_export/json.pl"
click node_textout "https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Ascii.pm"
click node_converter "https://github.com/nkh/p5-app-asciio/blob/main/script/asciio_to_text"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gui,node_tui toneBlue
class node_canvas,node_shapes,node_connectors,node_crossings,node_editingops,node_history,node_execbox toneAmber
class node_io,node_editable,node_textout,node_converter toneMint
class node_stencils,node_bindings,node_scripting toneRose
class node_user,node_externalapp toneIndigo
```

## Components

### User interfaces

- [GUI editor](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/GTK/Asciio.pm): `lib/App/Asciio/GTK/Asciio.pm`
- [Terminal editor](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Text/Asciio.pm): `lib/App/Asciio/Text/Asciio.pm`

### Diagram editing

- [Grid canvas](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Elements.pm): `lib/App/Asciio/Elements.pm`
- [Shapes and text](https://github.com/nkh/p5-app-asciio/tree/main/lib/App/Asciio/stripes): `lib/App/Asciio/stripes`
- [Arrow connections](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Connections.pm): `lib/App/Asciio/Connections.pm`
- [Crossing handling](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Cross.pm): `lib/App/Asciio/Cross.pm`
- [Selection and grouping](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Actions/Selection.pm): `lib/App/Asciio/Actions/Selection.pm`
- [Undo and redo](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Undo.pm): `lib/App/Asciio/Undo.pm`
- [Command output box](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/stripes/exec_box.pm): `lib/App/Asciio/stripes/exec_box.pm`

### Diagram formats

- [Diagram file I/O](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Io.pm): `lib/App/Asciio/Io.pm`
- [Editable diagram](https://github.com/nkh/p5-app-asciio/blob/main/setup/import_export/json.pl): `setup/import_export/json.pl`
- [ASCII text export](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Ascii.pm): `lib/App/Asciio/Ascii.pm`
- [Text converters](https://github.com/nkh/p5-app-asciio/blob/main/script/asciio_to_text): `script/asciio_to_text`

### Customization

- [Stencil library](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Stencil.pm): `lib/App/Asciio/Stencil.pm`
- [Keyboard bindings](https://github.com/nkh/p5-app-asciio/blob/main/setup/actions/default_bindings.pl): `setup/actions/default_bindings.pl`
- [Diagram scripting](https://github.com/nkh/p5-app-asciio/blob/main/lib/App/Asciio/Scripting.pm): `lib/App/Asciio/Scripting.pm`

### Other components

- **Diagram author**
- **External command**

## Connections

- Diagram author → GUI editor: opens diagram (evidence: `README.md`)
- Diagram author → Terminal editor: opens diagram (evidence: `README.md`)
- GUI editor → Grid canvas: edits diagrams
- Terminal editor → Grid canvas: edits diagrams
- Grid canvas → Shapes and text: contains elements
- Grid canvas → Arrow connections: connects shapes (evidence: `README.md`)
- Grid canvas → Crossing handling: handles crossings (evidence: `README.md`)
- GUI editor → Selection and grouping: supports editing (evidence: `README.md`)
- Terminal editor → Selection and grouping: supports editing (evidence: `README.md`)
- GUI editor → Undo and redo: supports undo (evidence: `README.md`)
- Terminal editor → Undo and redo: supports undo
- GUI editor → Stencil library: uses stencils (evidence: `README.md`)
- GUI editor → Keyboard bindings: customizes bindings (evidence: `README.md`)
- Terminal editor → Keyboard bindings: customizes bindings (evidence: `README.md`)
- Diagram author → Diagram scripting: generates diagrams (evidence: `README.md`)
- Command output box → External command: runs command (evidence: `README.md`)
- GUI editor → Diagram file I/O: opens and saves
- Diagram file I/O → Editable diagram: stores editable form (evidence: `README.md`)
- GUI editor → ASCII text export: exports text (evidence: `README.md`)
- Terminal editor → Text converters: converts diagrams (evidence: `README.md`)
- Diagram author → Text converters: converts text (evidence: `README.md`)
