How imengx/wiremage works
Main Components
a. External Swift Packages (found under the “Package/” folder)
– Controls
– CustomAlert
– Flow
– PadControl
– PartitionKit
– Popovers
– PopupView
– SwiftNodeEditor
– SwiftUIPager
b. WireMage Application
– App Entry & Document Layer
• WireMageApp.swift
• WireMageDocument.swift (UIDocument-based storage)
– Model Layer
• Model/Codable.swift, Define.swift
• WMNode.swift + subclasses (ProcessingNode, TerminalNode, ViewNode)
– Node Creation
• NodeCreate/NodeCreate.swift, NodeTemplate.swift
– Pipeline Engine
• Pipeline/Pipeline.swift (executes data/process flow between nodes)
– Workspace & UI Layer
• WorkSpace/WorkSpace.swift, ControlPanel.swift
• Shared SwiftUI demo views (ArcKnobDemoView.swift, etc.)
Relationships & Data Flows
– The App Entry initializes the Document and Workspace UI.
– The Workspace UI uses SwiftNodeEditor (from the Swift Package) to render and interact with the node graph.
– NodeCreate modules provide factory templates to add new nodes into the graph.
– The Pipeline component orchestrates execution: it traverses WMNode subclasses, passing data between ProcessingNodes and TerminalNodes.
– Model/Codable.swift handles serialization/deserialization of the node graph in WireMageDocument.
– Shared demo views and control packages supply custom knobs, sliders, and controls embedded in the Workspace UI.
Architectural Patterns
– Document-based MVVM: SwiftUI Views ↔ ViewModels (Workspace, Node graph) ↔ Model (WMNode graph).
– Modular design via Swift Packages: reusable UI controls, node editor, pager, flow controller.
– Node graph computing pattern: nodes implement a common interface (WMNode) and are linked in a pipeline.