

Ask YC: 2D rendering method via JS?  - yan

My recent project idea requires the rendering of a fairly custom UI to
mimic something similar to the interface of multi-track audio recording
tools.  i.e., potentially large virtual surface that can extend far in X
and Y directions that is easily pannable and zoomable. (a la gmaps) and
revolves around placing UI pieces along horizontal 'tracks' with the
caveat that elements on tracks can collapse with other elements on
consecutive tracks.<p>How would you implement it?<p>Something I'm throwing around:
 * Straight JS and a large table to add/delete rows/columns<p>* Dynamically generated divs<p>* Huge canvas rendering<p>* Generate imgs on backend and update a la Google Maps (not preferable)<p>* Use something like Cappuccino and follow AppKit-style rendering<p>I'd love to hear your thoughts.
======
mbrubeck
SVG is probably better than Canvas for an interactive UI with lots of elements
that change. SVG has its own DOM, so you can update elements and they will
redraw automatically (as opposed to Canvas where you are responsible for
rendering a whole new bitmap each time anything changes). Depending on your
use cases, something like Primer might simplify things:

<http://github.com/mojombo/primer>

