3 ms·
Ask YC: 2D rendering method via JS?
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.
How would you implement it?
Something I'm throwing around:
* Straight JS and a large table to add/delete rows/columns
* Dynamically generated divs
* Huge canvas rendering
* Generate imgs on backend and update a la Google Maps (not preferable)
* Use something like Cappuccino and follow AppKit-style rendering
I'd love to hear your thoughts.
- mbrubeck 17y agoSVG 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 http://github.com/mojombo/primer