Snap – A JavaScript SVG Library
snapsvg.io
snapsvg.io
I have capable and deep server-side SVG generation libraries I've written for CAD/CAM applications. I've always wanted to use them for generating all-or-mostly SVG web UIs. I can generate an SVG view straight from a model, and it's not an HTML+CSS cludge. The SVG's relationship with the data object is much more clear. With better JS manipulation support from libraries like this, the possibility of a rich and full-featured implementation is closer.
Not to mention that the browser vendors are FINALLY putting effort into truly supporting SVG, after 10+ years. It's good to prod them in this direction by demoing. Maybe we can help encourage an SVG-support vendor battle like what's going on for JS engines.
Time for me to get started on open sourcing my libs. They need to be completely broken out and made more general but I think it's time to join in and support these excellent efforts.
Then I came across the "about" section where it says it was created by the creator of Raphael.js[1].
Say no more.. I'm in!
https://twitter.com/DmitryBaranovsk/status/39305298289322393...
> Here we go: new SVG library from Adobe by yours truly Snap.svg. Snapsvg.io
I didn't know Dmitry was Raphael's creator nor that he was working for Adobe. So all I saw was "Adobe" and thought "Flash" and then, "Nah"
The fate of sustaining comfortably for more than a good decade you mean?
That IDE he's using in the video is called brackets[1] and it's originally from adobe. I'm watching it closely to jump from sublime to it.
He now has two very similar (but not compatible) libraries to support.
Raphaël.js is great, btw.
Raphael was, and is, meant to support older browsers. This comes with a cost of not being able to fully use everything SVG has to offer. Thus, Snap was born. He simply can't put everything into raphael to make it compatible with older browsers.
Raphael will still be getting bug fixes as the come in but is overall feature complete. In fact, Snap shares some of the same code raphael has, so maybe some bugs found in snap will be fixed in raphael as well.
And here it is and I am very grateful. Thank you, Dmitry. Thank you, Adobe.
We also need a world where once again Adobe create great open technologies and fund their development by building superb commercial tools for them.
I eagerly await new tools that work with Snap!
Thank you.
Does it write SMIL somewhere near the end and then let it run, or does it just run in JS? Skimming through I couldn't tell, but I don't really have time to read more closely.
the good news is: it still works (webkit), the bad news is that i still dont believe that SVG is the future. fool me once ...
and i understood why: SVG is a technology invented and specified by a committee built upon a technology invented and specified by a committee (XML). now combine this with the most anarchistic technology in the internet, i'm talking about the one technology that is still untamed in it's raw from, mischievous and sometimes plain dumbevil in it's details, yes, i'm talking about the DOM. that's why working with SVG always felt clunky and massochistic to me.
so if you touch SVG always use a high level clever abstraction. and well this seems the point of snap.svg. maybe i will give it another try. but the thing is, whenever i use a high level abstraction i will sooner or later go down into the pits again, because i want to know how it works and whatever else i can make it do, and then i will probably hate myself again for giving svg another shot....
-JD @jonathanAdunlap
One problem with intensely declarative content is bad naming, verboseness and strange groupings/ordering. Silverlight had this problem and SVG has it a bit in terms of content from other programs like Illustrator, SVG exporters etc. Adobe will probably be developing tools to edit this maybe? SVG support is still a little lagging and the web is missing vector frameworks since Flash has been sidelined with mobile.
Well that is what he said. But I believe having created Raphael.js in 2008, much before svg.js existed, also influenced his decision.
The only possible conflicting goal I can imagine is that one of svg.js' goals is to be as small as possible (e.g. generating an <ellipse> instead of a <circle> to increase code reuse between the circle and ellipse shapes[1]).
snap.svg coffee demo (click wheel to animate) http://snapsvg.io/demos/#coffee
d3.js chart demo (click buttons to animate) http://bl.ocks.org/mbostock/3943967
I've been enjoying working on my own SVG library, Pablo[1]. It's inspired in part by the fun I've had using Raphael, and wanting to explore what can happen when SVG is a first-class citizen of a library.
The obvious next step is for a drop-dead simple visual interface to choreograph the graphics and the animations, with hooks into the rest of the JavaScript application. It could might be a game, interactive art, a visualisation or anything with graphics. Flash is dead, but there is nothing that exists for the open web that is as intuitive and fun to use as the Flash IDE was.
It must be just a matter of time before a tool as brilliant as the Flash IDE comes along for the open web, and I can imagine it makes a lot of sense for Adobe to be in on it.
The game on the PBS homepage uses a prototype version of the library:
So I'm guessing this way they can map directly to SVG and not worry about breaking APIs and compatibility.
Definitely different than what I'm used to in D3js, but worst case scenario you would have to loop through each key value pair. Worth testing out.
*Edit - toString()?