Apparatus, a project by Toby Schachman and Joshua Horowitz, is a hybrid graphics editor and programming environment for creating interactive diagrams. They offer an online editor that allows authors to use a direct-manipulation style interface to create paramaterized interactive widgets. This video offers a quick overview:
In this post I'll show how Apparatus graphics can be embedded in Idyll documents, and how a two way binding between Idyll variables and Apparatus attributes can be created.
Embedding
First, we need an Apparatus figure. I'll use an existing example for the purposes of this walkthrough. It displays a visual technique for thinking about summations of consecutive odd numbers starting with one: they always add to a perfect square! Drag the handle in this graphic to see.
The graphic provides a geometric intuition for why this mathematical statement would hold true. The next odd number always completes the next outer "layer" of the square.
This post originally featured interactive Apparatus graphics embedded via Idyll. The interactive components have been archived. Visit idyll-lang.org and aprt.us to learn more about the tools.
Communicating with the document
Idyll's reactive variable system is a natural match for the architecture that Apparatus uses, and the Apparatus component makes it easy to create two way bindings between Idyll variables and Apparatus attributes.
The component is open source and available at https://github.com/idyll-lang/idyll-apparatus-component. Thanks to Josh Horowitz for all of his help getting this to work!
Learn more about the two projects: