When comparing Raphael vs ZIM, the Slant community recommends Raphael for most people. In the question“What are the best JavaScript drawing libraries?” Raphael is ranked 5th while ZIM is ranked 29th. The most important reason people chose Raphael is:
Because Raphael supports rendering VML + SVG, it is one of the few drawing libraries that is backwards compatible with older browsers that do not support canvas.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Works with older browsers
Because Raphael supports rendering VML + SVG, it is one of the few drawing libraries that is backwards compatible with older browsers that do not support canvas.
Pro Built in animations
Several built-in animations (such as ways of easing) are provided for you out of the box, but Raphael also allows cubic beziers for more complicated easing functions. Any drawing object property can be modified making it similar to css animations in jQuery.
Pro Every object is interactive with events
Everything that is drawn in Raphael is an object which means it is easy to manipulate any part of the rendered image after it is processed. It uses an event handler system for user inputs which makes it easy to learn for JavaScript developers used to event based libraries.
This style of handling objects makes Raphael a good fit for rendering interactive diagrams and charts that can also interact with other parts of the page.
Pro Easy creation of charts with extension
gRaphael is a Raphael extension to help you easily create graphs and charts.
Pro ZIM lets you write less code
Here is a chart of examples showing ZIM at 37% less code the developer writes when compared to other frameworks such as PixiJS, Flutter, CreateJS, PaperJS, P5js, Phaser and the DOM.
Pro ZIM supports chaining
It is quite common in ZIM to not even store an object in a variable as chaining is available for almost all methods and there are short chainable methods for most properties.
new Circle().center().drag();
new Rectangle()
.loc(100,100)
.alp(0) // alpha
.animate({x:200, alpha:1}, .5);
Pro ZIM has dynamic parameters
new Tile(new Circle(20, series(red, blue, green), 10, 10).center();
// tiles 10x10 circles with colors is series of red, blue or green
new Emitter([new Circle(), new Rectangle()]).center();
// emits random circles and rectangles
interval({min:1, max:3}, ()=>{});
// each interval is between 1 and 3 seconds
So passing in a series lets you pick in order, passing in an array lets you pick randomly, passing in a min/max range picks from the range, passing in a function picks the result of the function. These can be applied to all styles too.
Pro ZIM has Style on the Canvas
Style = {
color:red,
Button:{
color:blue;
}
}
new Circle().center(); // red
new Button().center(); // blue
Pro The ZIM DUO technique of providing regular parameters or a configuration object literal is very handy.
For instance:
new Rectangle(100,100,undefined,undefined,undefined,20).center();
or
new Rectangle({width:100, height:100, corner:20}).center();
Cons
Con Complicated, confusing documentation
The documentation is often not clear and lacks practical examples.
Con Can be difficult to get support
Online communities for Raphael are small and inactive compared to other drawing libraries, and many issues opened on github are never addressed.