Date: | Tue, 9 Aug 2016 21:58:53 -0700 |
From: | Toby Schachman |
Subject: | Re: embedding Apparatus diagrams into webpages |
- The only elements you can drag in the viewer are the ones which have been explicitly set to be "controllers" (by clicking some little red circles in the editor). AFAIK, this is what the "controller" concept has been meant for all along, so it is satisfying to see it in action.
- As a reminder, here's what it looks like when a slider's "Circle" is set as a controller for its "value":
- I kept the red highlight-on-hover for controllers.:
In the long run, this should be removed – diagram editors should be able to define their own hover behaviors using Apparatus itself. But that's not possible yet, so for now, it's very useful to have feedback about what is controllable.
- When embedding a diagram, you have to specify a "region of interest" in diagram coordinates. The library will then scale the diagram to fit the DOM element you give it, while showing the entire region of interest. Really, you should be able to specify a region of interest ("canvas"?) directly in the editor:
- There should definitely be a "Load in Apparatus Editor" button in the corner of embeds!
- When hooking up the second example, I first told the link to set the value of "number of circles", a top-level variable. But it turned out I had built this diagram by setting "number of circles" to the slider's "value", so setting "number of circles" from outside the diagram had the effect of disconnecting the slider!
This suggests that, usually, what you REALLY want to do from outside a diagram is "drag" an attribute to a value – that is, use Apparatus's constraint-solving system to try to get an attribute to a value without changing its symbolic expression. This is not possible now, but it feels very natural to me and I should make it possible.
I would like to play with this set-up a bit more, and then merge it into momma Apparatus sooner rather than later. (I am not worried about backwards-compatibility, since users of this system should be downloading the version of "apparatus-viewer.js" which loads their diagrams correctly to their own host anyway.)