# miroiu/nodify architecture

> Architecture diagram of the GitHub repository miroiu/nodify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/miroiu/nodify
- Repository: https://github.com/miroiu/nodify

## Overview

#### Purpose and Entry Points
Nodify is a C#/WPF control library for MVVM-oriented node-graph editors, packaged as `Nodify/Nodify.csproj`. Its primary public surface is the editor control stack, not a standalone application. Runnable WPF reference implementations start through each example’s `App.xaml` and `MainWindow.xaml`, notably `Examples/Nodify.Playground/App.xaml`, `Examples/Nodify.Workflow/App.xaml`, and `Examples/Nodify.StateMachine/App.xaml`.

#### Editor Canvas and Interaction Orchestration
`NodifyEditor` is the interaction coordinator: it hosts graph items on `NodifyCanvas` and partitions editing behavior into panning, dragging, selection, cutting, keyboard navigation, scrolling, and pushing-item concerns. State classes make interaction modes explicit rather than embedding all pointer logic in controls.
- `Nodify/Editor/NodifyEditor.cs`
- `Nodify/Editor/NodifyCanvas.cs`
- `Nodify/Editor/States/EditorState.cs`

#### Input, Gestures, and Navigation
The interactivity layer maps mouse/key gesture definitions to handlers and maintains element-state stacks during gestures such as drags. This is the boundary between WPF input events and editor/control state transitions. Keyboard navigation is separately modeled through focus navigators and navigation layers.
- `Nodify/Interactivity/InputProcessor.cs`
- `Nodify/Interactivity/Gestures/EditorGestures.cs`
- `Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs`

#### Nodes, Item Containers, and Grouping
Consumer-provided node view models are rendered through node controls and wrapped in `ItemContainer` instances, which own selection, location, drag state, and preview-location events. Specialized controls support input/output nodes, knots, state-machine nodes, and grouping. The library exposes UI behavior/events; domain graph persistence and semantics remain application-owned.
- `Nodify/Containers/ItemContainer.cs`
- `Nodify/Nodes/Node.cs`
- `Nodify/Nodes/GroupingNode.cs`

#### Connectors and Connections
Connectors initiate and complete links via a pending-connection workflow; application view models react to connector/connection events to create, remove, or retarget their domain edges. Connection controls render several graph-edge styles and expose states for actions such as split and disconnect. This separates visual interaction from the host’s graph model.
- `Nodify/Connectors/Connector.cs`
- `Nodify/Connectors/PendingConnection.cs`
- `Nodify/Connections/Connection.cs`

#### Viewport, Selection, and Auxiliary Editing
The editor supports selection, zoom/pan, cutting lines, and minimap navigation. A minimap maintains a reduced viewport/item representation and has its own pan/zoom/navigation states. Movement and resizing surface event arguments so hosts can update bound model positions and execute undo/redo policies.
- `Nodify/Minimap/Minimap.cs`
- `Nodify/CuttingLine/CuttingLine.cs`
- `Nodify/Editor/Events/ItemsMovedEventArgs.cs`

#### Presentation and Runtime Boundaries
The runtime is WPF/.NET with no stated dependency beyond WPF. Default control templates, dark/light palettes, and styles are delivered as XAML resources; host applications can override them. CI builds, analyzes, releases, publishes the NuGet package, and syncs documentation via GitHub Actions. No backend, database, or external runtime service is represented.
- `Nodify/Themes/Generic.xaml`
- `Nodify/Themes/Styles/NodifyEditor.xaml`
- `.github/workflows/publish-package.yml`

#### Reference Applications
Examples demonstrate distinct host-owned graph semantics: a configurable editor playground, workflow designer, drawable shapes canvas, executable state machine, and reactive calculator. They are integration references for MVVM bindings, view-model graph ownership, commands, and optional undo/redo—not dependencies of the package.
- `Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs`
- `Examples/Nodify.StateMachine/Runner/StateMachine.cs`
- `Examples/Nodify.Calculator/OperationGraphViewModel.cs`

Main entry points: [`Nodify/Editor/NodifyEditor.cs`](https://github.com/miroiu/nodify/blob/master/Nodify/Editor/NodifyEditor.cs) (NodifyEditor), [`Nodify/Nodify.csproj`](https://github.com/miroiu/nodify/blob/master/Nodify/Nodify.csproj) (Nodify package), [`Nodify/Containers/ItemContainer.cs`](https://github.com/miroiu/nodify/blob/master/Nodify/Containers/ItemContainer.cs) (ItemContainer), [`Nodify/Nodes/Node.cs`](https://github.com/miroiu/nodify/blob/master/Nodify/Nodes/Node.cs) (Node controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Nodify WPF Library"]
  node_package["Nodify package<br/>C&#35; WPF library<br/>[Nodify.csproj]"]
  node_editor["NodifyEditor<br/>interaction coordinator<br/>[NodifyEditor.cs]"]
  node_canvas["NodifyCanvas<br/>graph canvas<br/>[NodifyCanvas.cs]"]
  node_editor_state["Editor states<br/>interaction state machine<br/>[EditorState.cs]"]
  node_input["Input processor<br/>WPF input bridge<br/>[InputProcessor.cs]"]
  node_gestures["Editor gestures<br/>gesture definitions<br/>[EditorGestures.cs]"]
  node_navigation["Focus navigation<br/>keyboard navigation"]
  node_container["ItemContainer<br/>node item container<br/>[ItemContainer.cs]"]
  node_node["Node controls<br/>node presentation<br/>[Node.cs]"]
  node_grouping_node["GroupingNode<br/>group node control<br/>[GroupingNode.cs]"]
  node_connector["Connector<br/>link endpoint control<br/>[Connector.cs]"]
  node_pending_connection["Pending connection<br/>connection workflow"]
  node_connection["Connection controls<br/>edge presentation<br/>[Connection.cs]"]
  node_minimap["Minimap<br/>viewport navigator<br/>[Minimap.cs]"]
  node_cutting["CuttingLine<br/>edge cutting control<br/>[CuttingLine.cs]"]
  node_move_events["Items moved events<br/>host update contract"]
  node_themes["Default themes<br/>XAML resources<br/>[Generic.xaml]"]
  node_editor_styles["Editor styles<br/>XAML styles<br/>[NodifyEditor.xaml]"]
end

subgraph group_examples["Reference Hosts"]
  node_playground["Playground view model<br/>reference host graph"]
  node_state_machine["State machine runtime<br/>host graph semantics<br/>[StateMachine.cs]"]
  node_calculator["Calculator graph VM<br/>host graph semantics"]
end

subgraph group_delivery["Packaging"]
  node_publish["Package publishing<br/>GitHub Actions workflow"]
end

node_package -->|"exports"| node_editor
node_editor -->|"hosts items on"| node_canvas
node_editor -->|"uses"| node_editor_state
node_input -->|"drives"| node_editor
node_gestures -->|"defines bindings for"| node_input
node_navigation -->|"participates in"| node_editor_state
node_canvas -->|"contains"| node_container
node_container -->|"wraps"| node_node
node_grouping_node -->|"specializes"| node_node
node_node -->|"presents endpoints"| node_connector
node_connector -->|"creates"| node_pending_connection
node_pending_connection -->|"completes as"| node_connection
node_editor -->|"shares viewport with"| node_minimap
node_editor -->|"orchestrates"| node_cutting
node_container -->|"raises"| node_move_events
node_themes -->|"includes"| node_editor_styles
node_editor_styles -->|"templates"| node_editor
node_playground -.->|"integrates"| node_package
node_state_machine -.->|"integrates"| node_package
node_calculator -.->|"integrates"| node_package
node_publish -->|"builds and publishes"| node_package

click node_package "https://github.com/miroiu/nodify/blob/master/Nodify/Nodify.csproj"
click node_editor "https://github.com/miroiu/nodify/blob/master/Nodify/Editor/NodifyEditor.cs"
click node_canvas "https://github.com/miroiu/nodify/blob/master/Nodify/Editor/NodifyCanvas.cs"
click node_editor_state "https://github.com/miroiu/nodify/blob/master/Nodify/Editor/States/EditorState.cs"
click node_input "https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/InputProcessor.cs"
click node_gestures "https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/Gestures/EditorGestures.cs"
click node_navigation "https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs"
click node_container "https://github.com/miroiu/nodify/blob/master/Nodify/Containers/ItemContainer.cs"
click node_node "https://github.com/miroiu/nodify/blob/master/Nodify/Nodes/Node.cs"
click node_grouping_node "https://github.com/miroiu/nodify/blob/master/Nodify/Nodes/GroupingNode.cs"
click node_connector "https://github.com/miroiu/nodify/blob/master/Nodify/Connectors/Connector.cs"
click node_pending_connection "https://github.com/miroiu/nodify/blob/master/Nodify/Connectors/PendingConnection.cs"
click node_connection "https://github.com/miroiu/nodify/blob/master/Nodify/Connections/Connection.cs"
click node_minimap "https://github.com/miroiu/nodify/blob/master/Nodify/Minimap/Minimap.cs"
click node_cutting "https://github.com/miroiu/nodify/blob/master/Nodify/CuttingLine/CuttingLine.cs"
click node_move_events "https://github.com/miroiu/nodify/blob/master/Nodify/Editor/Events/ItemsMovedEventArgs.cs"
click node_themes "https://github.com/miroiu/nodify/blob/master/Nodify/Themes/Generic.xaml"
click node_editor_styles "https://github.com/miroiu/nodify/blob/master/Nodify/Themes/Styles/NodifyEditor.xaml"
click node_playground "https://github.com/miroiu/nodify/blob/master/Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs"
click node_state_machine "https://github.com/miroiu/nodify/blob/master/Examples/Nodify.StateMachine/Runner/StateMachine.cs"
click node_calculator "https://github.com/miroiu/nodify/blob/master/Examples/Nodify.Calculator/OperationGraphViewModel.cs"
click node_publish "https://github.com/miroiu/nodify/blob/master/.github/workflows/publish-package.yml"

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_package,node_editor,node_canvas,node_editor_state,node_input,node_gestures,node_navigation,node_container,node_node,node_grouping_node,node_connector,node_pending_connection,node_connection,node_minimap,node_cutting,node_move_events,node_themes,node_editor_styles toneBlue
class node_playground,node_state_machine,node_calculator toneAmber
class node_publish toneMint
```

## Components

### Nodify WPF Library

Reusable MVVM-oriented node editor controls.

- [Nodify package](https://github.com/miroiu/nodify/blob/master/Nodify/Nodify.csproj): C# WPF library · Public control library distributed as NuGet. · `Nodify/Nodify.csproj`
- [NodifyEditor](https://github.com/miroiu/nodify/blob/master/Nodify/Editor/NodifyEditor.cs): interaction coordinator · Hosts graph editing and coordinates editor modes. · `Nodify/Editor/NodifyEditor.cs`
- [NodifyCanvas](https://github.com/miroiu/nodify/blob/master/Nodify/Editor/NodifyCanvas.cs): graph canvas · `Nodify/Editor/NodifyCanvas.cs`
- [Editor states](https://github.com/miroiu/nodify/blob/master/Nodify/Editor/States/EditorState.cs): interaction state machine · Explicit modes for pan, drag, selection, cutting, and navigation. · `Nodify/Editor/States/EditorState.cs`
- [Input processor](https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/InputProcessor.cs): WPF input bridge · Converts input events into control state transitions. · `Nodify/Interactivity/InputProcessor.cs`
- [Editor gestures](https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/Gestures/EditorGestures.cs): gesture definitions · `Nodify/Interactivity/Gestures/EditorGestures.cs`
- [Focus navigation](https://github.com/miroiu/nodify/blob/master/Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs): keyboard navigation · `Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs`
- [ItemContainer](https://github.com/miroiu/nodify/blob/master/Nodify/Containers/ItemContainer.cs): node item container · Owns selection, position, drag state, and preview events. · `Nodify/Containers/ItemContainer.cs`
- [Node controls](https://github.com/miroiu/nodify/blob/master/Nodify/Nodes/Node.cs): node presentation · Renders consumer-provided node view models. · `Nodify/Nodes/Node.cs`
- [GroupingNode](https://github.com/miroiu/nodify/blob/master/Nodify/Nodes/GroupingNode.cs): group node control · `Nodify/Nodes/GroupingNode.cs`
- [Connector](https://github.com/miroiu/nodify/blob/master/Nodify/Connectors/Connector.cs): link endpoint control · Starts and completes user link interactions. · `Nodify/Connectors/Connector.cs`
- [Pending connection](https://github.com/miroiu/nodify/blob/master/Nodify/Connectors/PendingConnection.cs): connection workflow · `Nodify/Connectors/PendingConnection.cs`
- [Connection controls](https://github.com/miroiu/nodify/blob/master/Nodify/Connections/Connection.cs): edge presentation · Renders graph links and split/disconnect actions. · `Nodify/Connections/Connection.cs`
- [Minimap](https://github.com/miroiu/nodify/blob/master/Nodify/Minimap/Minimap.cs): viewport navigator · Maintains reduced item and viewport representation. · `Nodify/Minimap/Minimap.cs`
- [CuttingLine](https://github.com/miroiu/nodify/blob/master/Nodify/CuttingLine/CuttingLine.cs): edge cutting control · `Nodify/CuttingLine/CuttingLine.cs`
- [Items moved events](https://github.com/miroiu/nodify/blob/master/Nodify/Editor/Events/ItemsMovedEventArgs.cs): host update contract · Lets hosts update positions and apply undo/redo policies. · `Nodify/Editor/Events/ItemsMovedEventArgs.cs`
- [Default themes](https://github.com/miroiu/nodify/blob/master/Nodify/Themes/Generic.xaml): XAML resources · Templates, palettes, and editor styles overridable by hosts. · `Nodify/Themes/Generic.xaml`
- [Editor styles](https://github.com/miroiu/nodify/blob/master/Nodify/Themes/Styles/NodifyEditor.xaml): XAML styles · `Nodify/Themes/Styles/NodifyEditor.xaml`

### Reference Hosts

Applications own graph semantics and persistence.

- [Playground view model](https://github.com/miroiu/nodify/blob/master/Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs): reference host graph · Configurable editor integration example. · `Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs`
- [State machine runtime](https://github.com/miroiu/nodify/blob/master/Examples/Nodify.StateMachine/Runner/StateMachine.cs): host graph semantics · Executable domain behavior owned by a reference application. · `Examples/Nodify.StateMachine/Runner/StateMachine.cs`
- [Calculator graph VM](https://github.com/miroiu/nodify/blob/master/Examples/Nodify.Calculator/OperationGraphViewModel.cs): host graph semantics · Reactive calculator integration example. · `Examples/Nodify.Calculator/OperationGraphViewModel.cs`

### Packaging

- [Package publishing](https://github.com/miroiu/nodify/blob/master/.github/workflows/publish-package.yml): GitHub Actions workflow · Builds, analyzes, releases, and publishes the package. · `.github/workflows/publish-package.yml`

## Connections

- Nodify package → NodifyEditor: exports
- NodifyEditor → NodifyCanvas: hosts items on
- NodifyEditor → Editor states: uses
- Input processor → NodifyEditor: drives
- Editor gestures → Input processor: defines bindings for
- Focus navigation → Editor states: participates in
- NodifyCanvas → ItemContainer: contains
- ItemContainer → Node controls: wraps
- GroupingNode → Node controls: specializes
- Node controls → Connector: presents endpoints
- Connector → Pending connection: creates
- Pending connection → Connection controls: completes as
- NodifyEditor → Minimap: shares viewport with
- NodifyEditor → CuttingLine: orchestrates
- ItemContainer → Items moved events: raises
- Default themes → Editor styles: includes
- Editor styles → NodifyEditor: templates
- Playground view model → Nodify package: integrates
- State machine runtime → Nodify package: integrates
- Calculator graph VM → Nodify package: integrates
- Package publishing → Nodify package: builds and publishes
