Raphael.Js
Mohd Saeed Khan
UI Developer
Cross Browser Vector Graphics
Creating Graphics which never dies,
By Using
Raphaël v.2.1.0
Raphaël helps you work
with SVG just like jQuery
to manipulate the DOM
Size:-
Minified : 89 KB
GZIP : 58 KB
Vector v/s Raster
• Vector : Mathematical Representation of Shapes.
Rendered at runtime(SVG, Canvas)
• Raster : Rectangula...
SVG
Raphael.Js
VML
SVG VML
Raphaël
Not use
Canvas
SVG, VML, Canvas
SVG :- Scalable Vector Graphics by W3C in 1999
VML :- Vector Markup Language by Autodesk,
Hewlett-Packard...
SVG Canvas VML
Representation DOM Nodes Pixels DOM Nodes
Scalability Vector Raster Vector
Event Handling DOM Events Pixel ...
Image v/s SVG(Vector)
How to check that browser
support SVG/Canvas ?
Does Browser Support Canvas…?
If(window.CanvasRenderingContex2D){
//….your ...
Size Does Matter
Very easy to use…(Syntex)
Create your canvas:
var paper = Raphael(document.getElementById(”Cont_Id"),
320, 200);
Draw on i...
Supports…
specially you
Generic and non-generic..
Creating generic API and non-generic file
.Js File
Raphael quality
at Same Size
2X 3X
Graph shows salary across the company
Graph shows salary within the company
Salary according to the Average Experience
Paycheck load time
Using Raphael
Paycheck load time
Using images
Firebug Stats
2.68s
Load time difference
Total download time if page having 10 different graphs/images
Before cache Before cache
After cache
3...
Demos…
• RaphaelAnimation.htm
• RaphaelBouncer.htm
• RaphaelPie Chart.htm
• RaphaelInteractive Chart.htm
• RaphaelAustrali...
Contact:
saeed3e@gmail.com
+91-7503438005
Raphael.js
Raphael.js
Upcoming SlideShare
Loading in …5
×

Raphael.js

1,387 views

Published on

Raphaël helps you work with SVG just like jQuery to manipulate the DOM

Published in: Technology
2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total views
1,387
On SlideShare
0
From Embeds
0
Number of Embeds
320
Actions
Shares
0
Downloads
8
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide
  • Vector images are made of hundreds of thousands of tiny lines and curves (or paths) to create an image

    Raster images are often called bitmap images because they are made of millions of tiny squares, called pixels. You can identify a raster or bitmap image by looking at it very closely.

    Example showing effect of vector graphics versus raster graphics. The original vector-based illustration is at the left. The upper-right image illustrates magnification of 7x as a vector graphic. The lower-right illustrates the same magnification as a raster (bitmap) graphic. Raster images are based on pixels and so when scaled there is a loss of clarity, while vector-based graphics can be scaled by any amount without degrading quality.
  • How raphel merge SVG and VML?

    By using javascript merge both technology and make a amzing API which support mostly all the browser..
  • Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics that has support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999.

    Vector Markup Language (VML) is an XML-based file format for two-dimensional vector graphics in 1989.

    Canvas was initially introduced by Apple for use inside their own Mac OS X WebKit component in 2004,[1] powering applications like Dashboard widgets and the Safari browser. Later, in 2005 it was adopted in version 1.8 of Gecko browsers,[2] and Opera in 2006,[3] and standardized by the Web Hypertext Application Technology Working Group (WHATWG) on new proposed specifications for next generation web technologies.[citation needed]
  • Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics that has support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999.

    Vector Markup Language (VML) is an XML-based file format for two-dimensional vector graphics in 1989.

    Canvas was initially introduced by Apple for use inside their own Mac OS X WebKit component in 2004,[1] powering applications like Dashboard widgets and the Safari browser. Later, in 2005 it was adopted in version 1.8 of Gecko browsers,[2] and Opera in 2006,[3] and standardized by the Web Hypertext Application Technology Working Group (WHATWG) on new proposed specifications for next generation web technologies.[citation needed]
  • SVG is an earlier standard for drawing shapes in browsers. However, unlike Canvas which is raster-based, SVG is vector-based, i.e., each drawn shape is remembered as an object in a scene graph or Document Object Model, which is subsequently rendered to a bitmap. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.
    In the Canvas example above, once the rectangle is drawn, the fact that it was drawn is forgotten by the system. If its position were to be changed, the entire scene would need to be redrawn, including any objects that might have been covered by the rectangle. But in the equivalent SVG case, one could simply change the position attributes of the rectangle and the browser would determine how to repaint it. There are additional JavaScript libraries that add scene-graph capabilities to the Canvas element. It is also possible to paint a canvas in layers and then recreate specific layers.
    SVG images are represented in XML, and complex scenes can be created and maintained with XML editing tools.
    The SVG scene graph enables event handlers to be associated with objects, so a rectangle may respond to an onClick event. To get the same functionality with canvas, one must manually match the coordinates of the mouse click with the coordinates of the drawn rectangle to determine whether it was clicked.
    Conceptually, canvas is a lower-level API upon which an engine, supporting for example SVG, might be built. There are JavaScript libraries that provide partial SVG implementations using Canvas for browsers that do not provide SVG but support Canvas. However, this is not (normally) the case—they are independent standards. The situation is complicated because there are scene graph libraries for Canvas, and SVG has some bitmap manipulation functionality.
  • Responsive layout…
  • Raphael.js

    1. 1. Raphael.Js Mohd Saeed Khan UI Developer Cross Browser Vector Graphics Creating Graphics which never dies, By Using
    2. 2. Raphaël v.2.1.0 Raphaël helps you work with SVG just like jQuery to manipulate the DOM Size:- Minified : 89 KB GZIP : 58 KB
    3. 3. Vector v/s Raster • Vector : Mathematical Representation of Shapes. Rendered at runtime(SVG, Canvas) • Raster : Rectangular grid of pixels Pre-render before runtime(jpg, png)
    4. 4. SVG Raphael.Js VML
    5. 5. SVG VML Raphaël Not use Canvas
    6. 6. SVG, VML, Canvas SVG :- Scalable Vector Graphics by W3C in 1999 VML :- Vector Markup Language by Autodesk, Hewlett-Packard, Macromedia, Microsoft in 1989 and submitted to W3C in 1998 Canvas :- Raster-based, By Apple in 2004
    7. 7. SVG Canvas VML Representation DOM Nodes Pixels DOM Nodes Scalability Vector Raster Vector Event Handling DOM Events Pixel Cords DOM Events Browser Support IE9+, all majors IE9+, all majors Only IE browser Mobile Support Yes Yes Windows Accessibility Yes No Yes Image Save No Yes(PNG or JPG) No SVG v/s Canvas v/s VML
    8. 8. Image v/s SVG(Vector)
    9. 9. How to check that browser support SVG/Canvas ? Does Browser Support Canvas…? If(window.CanvasRenderingContex2D){ //….your code.. } Does Browser Support SVG..? If(window.SVGAngle){ //…your code… }
    10. 10. Size Does Matter
    11. 11. Very easy to use…(Syntex) Create your canvas: var paper = Raphael(document.getElementById(”Cont_Id"), 320, 200); Draw on it: var c = paper.circle(300, 200, 60); var p = paper.path("M10 10 l90 90"); var q = paper.rect(X,Y, W,H); Set attributes c.attr({ "fill”: "#f00”, “stroke-width”: 0 }); Example W H x y r
    12. 12. Supports… specially you
    13. 13. Generic and non-generic.. Creating generic API and non-generic file .Js File
    14. 14. Raphael quality at Same Size 2X 3X
    15. 15. Graph shows salary across the company
    16. 16. Graph shows salary within the company
    17. 17. Salary according to the Average Experience
    18. 18. Paycheck load time Using Raphael
    19. 19. Paycheck load time Using images
    20. 20. Firebug Stats 2.68s
    21. 21. Load time difference Total download time if page having 10 different graphs/images Before cache Before cache After cache 343 milliseconds 278 milliseconds 794 milliseconds 2.68 seconds After cache Raphael v/s Image
    22. 22. Demos… • RaphaelAnimation.htm • RaphaelBouncer.htm • RaphaelPie Chart.htm • RaphaelInteractive Chart.htm • RaphaelAustralia.htm • RaphaelGear.htm • RaphaelTiger.htm • http://raphaeljs.com/scape/
    23. 23. Contact: saeed3e@gmail.com +91-7503438005

    ×