Open source · early preview · Apache-2.0

MartyGraphics

The Swift scene engine that draws Morrowdock’s teaching pictures. A scene is validated JSON; MartyGraphics turns it into drawing primitives, parametric templates, layout, animation, patches and streaming, rendered with SwiftUI or SceneKit. No external Swift package dependencies.

Source on GitHub Get started

What these pictures are

Native exports. Every image on this page is a frame from the public MGCanvasRenderer and MGTimeline, rendered offscreen with SwiftUI’s ImageRenderer inside a small caption card. They are not screenshots of the Morrowdock app and not browser re-creations. The interactive stops on the homepage are browser re-creations, written separately in JavaScript.

All six scenes are original synthetic examples under Apache-2.0. They use the engine’s two public built-in templates (binary-search tree and two-pointer array) and its generic primitives. They don’t imply a curriculum, a solver, a running service or an AI model. No video, live interactive playback, accessibility or performance result is claimed for them.

Use it

Requires Swift 6 and macOS 14+, or iOS 17+ when embedded in an app. From a checkout: swift build && swift test. Add it as a local Swift package and draw a scene from a SwiftUI view:

import Foundation
import MartyGraphics

let json = #"{"v":1,"items":[{"id":"dot","k":"body","at":[3,4],"shape":"ball","size":1}]}"#
let scene = try MGParser.scene(data: Data(json.utf8)).get()
// Inside your SwiftUI view:
MartyGraphicsView(scene: scene)

Early preview: APIs and the wire format may change, and there is no versioned release yet. The renderers use Apple frameworks, so Windows and Linux builds are unsupported. Packs are code a host registers; no catalog, downloader or trust store is bundled.

Reproduce the exports

The receipt pins the exporter source at 7c7c280e. Build, 23 package tests (zero failures), scene verification and native export passed on macOS 26.6.2 with Apple Swift 6.3.3 (arm64, SwiftPM debug, renderer scale 1). The files here are byte-identical to the accepted copies in docs/assets/native; their SHA-256 digests are in the receipt.

swift build
swift test
swift run --package-path Examples/Showcase marty-showcase --verify
swift run --package-path Examples/Showcase marty-showcase --export <new output directory>