Here’s a demo of some the cool things you could do :http://clockamatics.googlepages.com/live.html
Those clocks were written for Linux desktop in svg, all they needed to work in Firefox was javascript.
105363 items (97572 unread) in 19 feeds
Friends
(1021 unread)
Build
(68091 unread)
Heads
(716 unread)
News
(27537 unread)
fun
(207 unread)
Here’s a demo of some the cool things you could do :http://clockamatics.googlepages.com/live.html
Those clocks were written for Linux desktop in svg, all they needed to work in Firefox was javascript.
This might be a lame idea, but could you use // for the prioritized choice? I can not think of a reason why you would want to use // when defining a regular expression. Everybody knows that two is better then one.
Also, | is OR sometimes and || is OR other times, so why not / sometimes and // other times….
re. prioritised choice: How about |>
FYI - Opera 9 and Safari 3 have similiar level of support for SVG. Firefox 3.1 should have some level of support for declarative animations (SMIL) as should the next version of Safari (after 3.1). Opera has had SMIL and SVG support for years.
The only browser really not playing the SVG game at the moment is Internet Explorer.
P.S. I was worried that DojoX GFX would have dependencies on a lot of the other (huge) Dojo libraries, but it looks like the dependencies are very minimal. So, that’s another point in Dojo’s favor.
I haven’t tried out dojox.gfx yet - still working down my list of libraries to try. It looks pretty usable and mature. (Raphael on the other hand was first released last week, so it’s hard to say yet.)
My use case is pretty simple (just some black-and-white line drawing), so it probably won’t make that much difference which library I use. At that level, they all have the same features. If I chose Raphael it would probably be because it would be less intimidating to customize or debug the library myself. On the other hand with a more mature library I might not need to.
@Matt: how is Raphaël different than DojoX GFX? Just that it’s more minimalistic?
I just found Raphaël, which is just the SVG-based, jQuery-like JavaScript library I’ve been searching for! Vector graphics, here I come…
Yes, DOM manipulation of XHTML/SVG compound documents should work the same everywhere - it’s just the XML DOM at work.
As for canvas, it’s way less capable than SVG but also makes some simple things much simpler (and potentially faster). For example, from these slides:
SVG
var rect = document.createElementNS(SVG_NS, “rect”);
rect.setAttribute(”x”, “5″);
rect.setAttribute(”y”, “5″);
rect.setAttribute(”width”, “20″);
rect.setAttribute(”height”, “20″);
rect.setAttribute(”fill”, “red”);
parent.appendChild(rect);
Canvas
with (ctx) {
fillStyle = “red”;
fillRect(5, 5, 20, 20);
}
But SVG makes other things simple that are impossible in Canvas without implementing your own “document model” on top of it.
For simple programmatic drawing without much animation, they’re pretty close to equivalent in speed and code.