SlideShare une entreprise Scribd logo
1  sur  25
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 : Rectangular grid of pixels
Pre-render before runtime(jpg, png)
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, Macromedia,
Microsoft in 1989 and submitted to W3C in 1998
Canvas :- Raster-based, By Apple in 2004
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
Image v/s SVG(Vector)
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…
}
Size Does Matter
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
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
343 milliseconds
278 milliseconds 794 milliseconds
2.68 seconds
After cache
Raphael v/s Image
Demos…
• RaphaelAnimation.htm
• RaphaelBouncer.htm
• RaphaelPie Chart.htm
• RaphaelInteractive Chart.htm
• RaphaelAustralia.htm
• RaphaelGear.htm
• RaphaelTiger.htm
• http://raphaeljs.com/scape/
Contact:
saeed3e@gmail.com
+91-7503438005

Contenu connexe

Similaire à Raphael.js

Easy charting with
Easy charting withEasy charting with
Easy charting with
Major Ye
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
tnsuarez
 
101207 raphael
101207 raphael101207 raphael
101207 raphael
jonwyatt
 

Similaire à Raphael.js (20)

Easy charting with
Easy charting withEasy charting with
Easy charting with
 
pastel
pastelpastel
pastel
 
pastel
pastelpastel
pastel
 
Visualizing Data with JavaScript and Canvas
Visualizing Data with JavaScript and CanvasVisualizing Data with JavaScript and Canvas
Visualizing Data with JavaScript and Canvas
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScript
 
SVG Strikes Back
SVG Strikes BackSVG Strikes Back
SVG Strikes Back
 
Image converter ppt.pdf
Image converter ppt.pdfImage converter ppt.pdf
Image converter ppt.pdf
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
Next generation Graphics: SVG
Next generation Graphics: SVGNext generation Graphics: SVG
Next generation Graphics: SVG
 
Visualizing data on web
Visualizing data on webVisualizing data on web
Visualizing data on web
 
svg Scalable Vector Graphics (SVG)
 svg Scalable Vector Graphics  (SVG) svg Scalable Vector Graphics  (SVG)
svg Scalable Vector Graphics (SVG)
 
SVG
SVG SVG
SVG
 
101207 raphael
101207 raphael101207 raphael
101207 raphael
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
 
Html5 (games)
Html5 (games)Html5 (games)
Html5 (games)
 
W3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 gamesW3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 games
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVG
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Plunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s beginPlunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s begin
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Raphael.js

Notes de l'éditeur

  1. 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.
  2. How raphel merge SVG and VML? By using javascript merge both technology and make a amzing API which support mostly all the browser..
  3. 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]
  4. 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]
  5. 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.
  6. Responsive layout…