Hacker News new | ask | show | jobs
by pak 5677 days ago
I didn't downvote you, and I've spent enough time on reddit to stop questioning downvotes because they are too stochastic to spend braincell-seconds trying to interpret. But when I read your comment I immediately questioned why you would call canvas best suited for rendering vector graphics. If anything, VML/SVG via something like Raphael.js is best suited for that, because you can use graphics data exportable from a vector graphics editor like Illustrator, and manipulate the data in your page in a structured way--Raphael somewhat mitigates the painfulness of DOM operations.

I would say canvas is best suited for rendering/processing sprite or pixel-based graphics that does not need mouse interaction, if I had to pigeonhole it. Sure, I've used it via Flot to draw charts, and for purposes that were decidedly vector-ish, but I would never expect to be able to manipulate that stuff without complicated collision data and redraw logic. The API for drawing with the canvas pen is moderately featured but drawing imperatively and trying to act on <canvas>-mouse interaction just isn't scalable or maintainable.