How would the messages reach the browser? Would there be a Go gadget that outputs these through socket messages? A gadget that would accept setpoints as input? I would create it using svg, but using D3 feels like overkill to draw a few lines. I used svg.js in other visualizers.
I understand, that's why it was thinking of starting with files as input. But if you think we should create a live simulator we can try. I don't understand these event's your talking about. I was thinking of creating a separate little project for now, one which just becomes a socket client. Integrating it into the main circuit editor require much more time, partly because I would have to learn AngularJS. Also it would require some ui design, since it would become a page or panel.
You can add a sense of time to the simulator by reading a sample file, as you suggest, and instead of processing it right away, turning each of the entries into an event, sent gradually over time. IOW, the simulator will need to respond to a callback which "feeds" it new setpoints. In short: use JS's `setInterval` to "emit" events, then write the simulator to subscribe to those events. With such an approach, you can easily switch to events which come from the websocket, later on. I suspect that a lot can be done without immediately having to dive into Angular as well.
[Here](http://cycling74.com/docs/max6/dynamic/c74_docs.html#docnew) is an example of a graph in a circuit (patch) in Max/MSP - see the "Improved Audio Engine" section. A simulator for Tosqa could perhaps look like that in the browser, with the option to view it outside the circuit editor as well.
That's very neat! I was worried that something like that might be to small for a preview. But maybe we could implement a maximize kind of trick, where it temporarily fills up most of the screen.
what about adding (java)scripted gadgets to the circuit editor. A gadget with a script[string] feed and a run[bool] feed. The script will be put in the DB and will be executed when run==true
Yes, that's on the map. It'll take some work, though - JS needs to run on the host in Go, and also has to be tied into the Flow mechanism
this (maybe needles to say) will then easily become any simulator we need
Ah, good point. On the host side, JS could indeed act motor simulator, etc - I may have been mixing up simulators and visualisers. Ok, this does raise the priority to get JS going.
Small update, I have a static preview https://github.com/peteruithoven/SetPointsPreviewer/ My ToDo: https://github.com/peteruithoven/SetPointsPreviewer/issues
I think my previewer is starting to get useful. Could we put it behind visualizer.tosqa.com or something so we can start using it?
Nice work. We can indeed deploy it on a subdomain. Will you be @ VCXL today?
( The repository is moved to: https://github.com/tosqa/SetPointsPreviewer )
It's online at [http://tosqa.com/visualizer/](http://tosqa.com/visualizer/)
I've re implemented it using D3 and added zoom and pan functionality. David could you pull and update (or give me a way to do so)?