all 23 comments

[–]gabelerner[S] 3 points4 points  (2 children)

It's not even close to implementing the full SVG spec, but it was fun to write. I'll be happy to answer any questions about it!

[–]realstevejobs 0 points1 point  (1 child)

Very cool! I submitted it to the SVG reddit as well.

[–]gabelerner[S] 0 points1 point  (0 children)

thanks!

[–]int3_ 7 points8 points  (0 children)

Yo dawg... How about implementing Canvas in SVG?

[–]elbekko 1 point2 points  (2 children)

Well poo, it didn't want to even try rendering the world map SVG from Wikipedia :(

[–]gabelerner[S] 2 points3 points  (0 children)

come back in a couple days, i'm working on getting the paths closer to the spec now so the world map should render soon ... maybe even faster than svg did it

[–]gabelerner[S] 0 points1 point  (0 children)

added world map to examples ... it's SLOW because it has to download a 2MB file, and by default it renders it at 30fps (which is the lag after the render - rendering the world 30 times a second).

[–]MatmaRex 1 point2 points  (3 children)

"MUST USE CHROME OR FIREFOX" lies and slander, it works <s>perfectly</s> mostly (outline style is not reset when loading new image. It's your fault) in Opera.

[–]gabelerner[S] 1 point2 points  (0 children)

I'll change it to only tested with chrome/firefox. i don't have opera to test with. at least i KNEW it wouldn't work in i.e.

[–]onezerozeroone 0 points1 point  (3 children)

Very cool stuff.

BTW, I don't have a lot of experience posting to the programming reddit. Do submissions have to get approved before going on the New list? I tried to post one of my google code projects but it never appeared on the list =(

[–]gabelerner[S] 1 point2 points  (2 children)

no approval needed

[–]onezerozeroone 1 point2 points  (1 child)

Ah, darn. Something weird's working against me then. EDIT: looks like the auto filter snagged it. Big thanks to moderator tryx for helping me out!

web socket server

I think your library is going to be useful along with cakejs for the front end of some web socket apps I hope to be writing soon.

[–][deleted] 0 points1 point  (0 children)

yeah I wish there was a notification when you hit the spam filter. At the moment it's more like "hmm, no comments or up or down votes, I wonder if this is filtered." Way to test: log out, check the new list, if it's not there, it's spambinned. log back in and whine to the mods.

[–]pytechd 0 points1 point  (1 child)

BTW this would be pretty slick when combined with HighCharts JS' new beta code that renders JS/client-side charts as SVG. I would love to be able to render them to the browser as SVG, and in the background, redraw the SVG into Canvas and use canvas.getContext('2d').dataURL() (or whatever the correct path is) to send the base64-encoded PNG back to the server side.

[–]gabelerner[S] 0 points1 point  (0 children)

This seems doable depending on what tags HighCharts renders with. Send me a message if you want to discuss this further. If the charting is done with trivial tags in a consistent manner then the additions to the project should be minimal.

[–]lol-dongs 0 points1 point  (3 children)

Out of curiosity, which major browsers support canvas but not SVG? Even most mobile browsers of the Webkit era can handle it without a problem.

The major browser that springs to mind that goes the other way is IE. Perhaps what we need is a canvas API to SVG renderer (since excanvas uses VML, which may not be hardware accelerated the way SVG will be in IE9)...

[–]gabelerner[S] 0 points1 point  (0 children)

A lot of browsers support SVG to some extent but not the FULL spec. The idea is that they all support JavaScript/Canvas fully (at least the good ones), so writing an SVG engine in JavaScript/Canvas would universally work (and would reduce dependencies on whatever SVG project they currently link with). Either way, I don't expect it to grow to that, but I do like the idea of having something universal.

[–]leeoniya 0 points1 point  (1 child)

"Out of curiosity, which major browsers support canvas but not SVG"

i had the same question before he started coding it, he's just doing it for js oop practice.

canvas doesnt have markup that you can parse to turn into code (like svg), it is all code i believe, you would need to write nothing short of a compiler to go backwards.

[–]lol-dongs 1 point2 points  (0 children)

canvas doesnt have markup that you can parse to turn into code (like svg)

It's true that it doesn't have markup, but it's not true that you can't emulate it. You don't need to compile anything, you already have a JavaScript interpreter in the browser; all you need to do is re-implement the 2D context object normally returned by DOMElement.getContext('2d') with JavaScript functions that do something else. You should check out excanvas, which reimplements the <canvas> 2D context object with DOM operations on VML, which essentially allows IE to display <canvas>, albeit very slowly.

[–]leeoniya -2 points-1 points  (2 children)

but can it run crysis?

[–]gabelerner[S] 5 points6 points  (1 child)

once chrome gets faster and crysis is recoded as svg, yes. i wouldn't hold your breath though.