When comparing Paper.js vs Raphael, the Slant community recommends Paper.js for most people. In the question“What are the best JavaScript drawing libraries?” Paper.js is ranked 3rd while Raphael is ranked 5th. The most important reason people chose Paper.js is:
It is written in a language nearly identical to JavaScript, but adds helpful operator overloading to allow you to perform coordinate arithmetic.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Operator overloading
It is written in a language nearly identical to JavaScript, but adds helpful operator overloading to allow you to perform coordinate arithmetic.
Pro Geometric Tests
An almost-unique feature: can test geometry if contains(), isInside() or intersects() one other object. Offers even hit-testing methods!
Pro Behaviours handled by objects
Objects in Paper make it easy to extend parent objects and run constructor functions without having to worry about JavaScript prototypal inheritance. Because of this it is easy to make compound drawing objects with their own instance variables and behaviors.
Example: each swimming tadpole follows its own behavior
These features make it easier to create objects that can act autonomously with complex behaviors. This makes Paper a good choice for particle effects and game development.
Pro Object constructors
Elements all have the option of being created with a hash of properties which promotes clean, concise, and contextually local coding practice.
Pro Good for making games
Paper uses a frame based approach to rendering the canvas. This makes it conceptually easier to create objects with animations and behaviors that interact and perform with other objects.
Along with Paper's approach to creating and managing objects this makes Paper especially good for creating applications with complex behaviors with many elements doing different actions at once, and makes it a good choice for making games.
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.
Cons
Con Limited to single instance
The code is written in a way that everything is global and limited to a single instance, there is no clean way to use 2 separate instances in the same page
Con Not supported in older browsers
Paper.js runs on top of HTML5 Canvas, which is not supported in older browsers.
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.