r/programming • • Oct 09 '10

Raphaël—JavaScript Library for making Vector graphics on the web easy

http://raphaeljs.com/index.html
131 Upvotes

28 comments sorted by

19

u/[deleted] Oct 09 '10

I wrote an interactive math demo using this. It's really nice, and it works for all browsers. I really like it.

0

u/[deleted] Oct 09 '10

[deleted]

1

u/[deleted] Oct 10 '10

thanks

9

u/nyeholt Oct 09 '10

I used to work with Dmitry several years ago at Squiz in Sydney. He was a relatively reserved kind of guy, but holy shit can he dance. Not in a Britney Spears kind of way, but in a "what the hell how are his legs moving like that" kind of way. Worth sitting down for a few drinks with him to see it :)

2

u/slappybag Oct 09 '10

I worked with him at Atlassian in Sydney, get a beer into him and he'll tell you how to torture people!

6

u/DmitryBaranovskiy Oct 10 '10

In fact I don’t need beer to dance or talk about tortures. ;)

1

u/rioter Oct 09 '10

I had a job offer from squiz when i first finish uni, i currently use dmitry's old monitor at Atlassian. Reddit is a small world :) But yes, the more i use raphael the more i am impressed with its power.

1

u/rioter Oct 09 '10

Also looking at your comment history, i think you sit next to our beer fridge :P

2

u/phanboy Oct 09 '10

I wonder if this will get extended to WebGL someday.

3

u/[deleted] Oct 09 '10

This is awesome, but I see it's under Sencha who runs Ext JS. Anyone know if they're going to keep the license as MIT or if they plan on a switcheroo like they did with Ext (BSD -> LGPL -> GPL+commercial)

9

u/DmitryBaranovskiy Oct 10 '10

Raphaël will remain MIT forever.

1

u/falser Oct 09 '10

Yeah now that this is part of Sencha I wouldn't count on there being more free versions for long.

Not that it's necessarily a bad thing. It's a TON of work to produce a library like this -- people should be willing to pay for a license if they require it for their job. The general reason that there aren't many good JavaScript libraries and frameworks is that few people are willing to pay for them.

3

u/[deleted] Oct 09 '10

I don't mind paying for stuff, but the problem is that the type of license can have an impact on the type of application you can use it to build. For example, say you're using a library as part of an open source web application, maybe a content management system that people install on their own servers. If that library switched licenses to a pay-per-instance or GPL, that could be a show stopper if you don't want to license your app as GPL. You either stick with the old version and hope for a fork, or rip it out and use something else.

1

u/falser Oct 09 '10

A license change doesn't affect anything -- you can still use the GPL version of the software in your app, but you'll now be responsible for the source code. That's the whole point of open source software. Open source does not mean FREE support. That is where a lot of people got really mixed up about what open source means. Most people think:

open source = free software + free support + free updates + free labor

And that is not true. And when they realize it, they complain.

4

u/[deleted] Oct 09 '10

I think you're arguing against a position I'm not taking. I probably should have used a closed source example instead of an open source one, but I was trying to avoid an OSS philosophy battle. In such a case, you can use software with a permissive license in a variety of ways. If that license becomes more restrictive, then that may affect how you do things, which can be disruptive. With a more permissive license, I can just donate money or code to the project and be on my way, but if the license switched, I may have to open source my stuff or license individual installs, which may be troublesome if I don't normally track the individual installs of customers. It's a risk.

I realize projects need resources, and I have no problem if a project changes their licensing model. It's just that those changes can be disruptive in certain scenarios.

1

u/ugoagogo Oct 09 '10

As good as this library is there's no documented method for converting a .svg file to a rapheal compatible .js file. That's been a big stumbling block for me.

Another useful library I've found for dropping svg graphics straight on to the canvas element is canvg

5

u/hector_villalobos Oct 09 '10

2

u/sisyphus Oct 11 '10

I think that's not what he wants. That takes a raphael canvas to and from json. He wants his designer to sit down in Illustrator or Inkscape, make an svg file, and then run that file through a converter to Raphael. There are several projects that do what he wants, but last I checked most of them were incomplete.

1

u/[deleted] Oct 09 '10

The clock demo looks real nice but uses so much CPU on Chrome.

1

u/[deleted] Oct 10 '10

Really impressive! I can't believe I've never stumbled on this before. Now I need to think of a suitable use for it. To the lab!

1

u/bostonvaulter Oct 10 '10

Is the source code for that github impact graph open sorce?

1

u/nupogodi Oct 11 '10

Hmm, now if only I could get something like Prefuse in JS...!

0

u/kostmo Oct 09 '10

I'd like to see a summary of what this offers beyond HTML5 Canvas.

4

u/cesutherland Oct 09 '10

It's an SVG library, so it comes with the trade-offs of SVG vs. Canvas.

Additionally, Canvas and SVG are both pretty low level. Raphael offers documented and organized collection of routines for manipulating an SVG canvas., adding a layer of abstraction which serves as a toolkit for a programmer or designer.

3

u/sazzer Oct 09 '10

Plus the thing that I really like is that it lets you do 2D graphics calls - draw a circle here, an image there, etc - and then add events to them jQuery style. Can draw a circle to the screen and then make it so that when you click on it it fires a piece of javascript in the page.

2

u/[deleted] Oct 09 '10

This is one simple answer. It uses SVG aswell as Microsofts format VML (wich was rarely used but actually is supported by IE6). Thus you can archive Html5 effects even on IE6+ browsers and older versions of other browsers.

0

u/psilokan Oct 10 '10

I've built a few things with Raphael and G.raphael and they all turned out beautiful and work well in every browser (even IE6). Only problem is the complete lack of documentation (especially so with g.raphael). I had to rip apart his demos and figure them out line, often by commenting out a line and seeing what happens. Would've been nice if he had at least put comments in his examples.

0

u/lurchpop Oct 10 '10

Seriously, this will never truely blow up if there's a big learning curve. Good docs are a huge reason for jQuery's success, IMO.

0

u/[deleted] Oct 09 '10

[deleted]

1

u/UK-sHaDoW Oct 09 '10

You know something i don't know?

1

u/jeffus Oct 09 '10

The Pope is the lead developer of this library.