Raphael

Dmitry Baranovskiy
Dmitry BaranovskiySenior Computer Scientist at Adobe Systems
Raphaël

JavaScript Library for Vector Graphics


               Dmitry Baranovskiy
                  WSG meeting
                 11 March 2009
Cool
Raphael
Cool Cool Cool WTF
Raphael
Raphaël
Raphael
What is it for?
Demo
What is it?
JavaScript
window.onload = function () {
   var hldr = document.getElementById(quot;holderquot;);
   var text = hldr.getElementsByTagName(quot;pquot;)[0].innerHTML;
   hldr.innerHTML = quot;quot;;
   var R = Raphael(quot;holderquot;, 640, 480),
        txt = R.set(),
        attr = {quot;fontquot;: '50px quot;Georgiaquot;', opacity: 0.5};
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#0f0quot;));
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#f00quot;));
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#00fquot;));
   txt.attr(attr);
   var mouse = null, rot = 0;
   document.onmousemove = function (e) {
      if (mouse === null) {
        mouse = e.pageX;
        return;
      }
      rot += e.pageX - mouse;
      txt[0].rotate(e.pageX - mouse);
      txt[1].rotate((e.pageX - mouse) /1.5);
      txt[2].rotate((e.pageX - mouse) /2);
      mouse = e.pageX;
   };
};
window.onload = function () {
   var hldr = document.getElementById(quot;holderquot;);
   var text = hldr.getElementsByTagName(quot;pquot;)[0].innerHTML;
   hldr.innerHTML = quot;quot;;
   var R = Raphael(quot;holderquot;, 640, 480)
                                    480),
        txt = R.set(),
        attr = {quot;fontquot;: '50px quot;Georgiaquot;', opacity: 0.5};
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#0f0quot;));
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#f00quot;));
   txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#00fquot;));
   txt.attr(attr);
   var mouse = null, rot = 0;
   document.onmousemove = function (e) {
      if (mouse === null) {
        mouse = e.pageX;
        return;
      }
      rot += e.pageX - mouse;
      txt[0].rotate(e.pageX - mouse);
      txt[1].rotate((e.pageX - mouse) /1.5);
      txt[2].rotate((e.pageX - mouse) /2);
      mouse = e.pageX;
   };
};
How does it work?
Canvas   SVG   VML
Canvas   SVG   VML
pixels   DOM   DOM
SVG   VML
DOM?
SVG   VML
API
circle
ellipse
image
path
rect
text
animate
        attr
        getBBox
        hide
circle insertAfter
ellipse insertBefore
image remove
path    rotate
        scale
rect
text    show
        stop
        toBack
        toFront
        translate
animate
        attr
        getBBox
        hide
circle insertAfter
ellipse insertBefore
image remove
path    rotate
        scale
rect
text    show
        stop
        toBack
        toFront
        translate
fill
        animate
                       fill-opacity
        attr           font
        getBBox        font-family
        hide           font-size
                       gradient
circle insertAfter
                       opacity
ellipse insertBefore
                       rotation
image remove
                       scale
path    rotate         stroke
        scale
rect                   stroke-dasharray
text    show           stroke-linecap
                       stroke-linejoin
        stop
                       stroke-miterlimit
        toBack
                       stroke-opacity
        toFront        stroke-width
        translate      translation
fill
        animate
                       fill-opacity
        attr           font                cx
        getBBox        font-family         cy
        hide           font-size
                                           height
                       gradient
circle insertAfter
                                           path
                       opacity
ellipse insertBefore
                                           r
                       rotation
image remove
                                           rx
                       scale
path    rotate         stroke              ry
        scale
rect                   stroke-dasharray    src
text    show           stroke-linecap
                                           width
                       stroke-linejoin
        stop
                                           x
                       stroke-miterlimit
        toBack
                                           y
                       stroke-opacity
        toFront        stroke-width
        translate      translation
Raphael
Raphael
Raphael
Element.node
Circle.node.onclick =
   function () {…};
$(Circle.node).click(…);
16 Kb
Raphael
Raphael
Raphael
Raphael
0.6.4
0.7
gRaphaël
Yet Another Demo
Raphaël could make you stand out of the crowd.
Using Raphaël could amaze your colleagues
http://RaphaelJS.com/
Thank You
1 of 44

Recommended

Loom & Functional Graphs in Clojure @ LambdaConf 2015 by
Loom & Functional Graphs in Clojure @ LambdaConf 2015Loom & Functional Graphs in Clojure @ LambdaConf 2015
Loom & Functional Graphs in Clojure @ LambdaConf 2015Aysylu Greenberg
3.1K views71 slides
Loom at Clojure/West by
Loom at Clojure/WestLoom at Clojure/West
Loom at Clojure/WestAysylu Greenberg
5.1K views69 slides
Loom and Graphs in Clojure by
Loom and Graphs in ClojureLoom and Graphs in Clojure
Loom and Graphs in ClojureAysylu Greenberg
8.6K views86 slides
DrawingML Subject: Shape Properties & Effects by
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsShawn Villaron
836 views32 slides
Raphaël JS Conf by
Raphaël JS ConfRaphaël JS Conf
Raphaël JS ConfDmitry Baranovskiy
7.9K views52 slides
RaphaëlJS magic by
RaphaëlJS magicRaphaëlJS magic
RaphaëlJS magicKseniya Redunova
970 views21 slides

More Related Content

Viewers also liked

Rembrandt, portraits and details (v.m.) by
Rembrandt, portraits and details (v.m.)Rembrandt, portraits and details (v.m.)
Rembrandt, portraits and details (v.m.)Valeriu Margescu
1.4K views63 slides
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detail by
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in DetailREMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detail
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detailguimera
1.1K views67 slides
What the Hell is the Internet Anyway? - A History of the Web by
What the Hell is the Internet Anyway? - A History of the Web What the Hell is the Internet Anyway? - A History of the Web
What the Hell is the Internet Anyway? - A History of the Web Vimi.co Ltd - Bangkok Web Agency
24K views104 slides
H ren through michelangelo by
H ren through michelangeloH ren through michelangelo
H ren through michelangeloNCS
1.6K views150 slides
Barroco III by
Barroco IIIBarroco III
Barroco IIIArquivos-arte
523 views159 slides
Vienna, Kunsthistorisches Museum: Picture Gallery, The Masterpieces by
Vienna, Kunsthistorisches Museum: Picture Gallery, The MasterpiecesVienna, Kunsthistorisches Museum: Picture Gallery, The Masterpieces
Vienna, Kunsthistorisches Museum: Picture Gallery, The Masterpiecesguimera
1.9K views66 slides

Viewers also liked(20)

Rembrandt, portraits and details (v.m.) by Valeriu Margescu
Rembrandt, portraits and details (v.m.)Rembrandt, portraits and details (v.m.)
Rembrandt, portraits and details (v.m.)
Valeriu Margescu1.4K views
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detail by guimera
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in DetailREMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detail
REMBRANDT Harmenszoon Van Rijn, Featured Paintings in Detail
guimera 1.1K views
H ren through michelangelo by NCS
H ren through michelangeloH ren through michelangelo
H ren through michelangelo
NCS1.6K views
Vienna, Kunsthistorisches Museum: Picture Gallery, The Masterpieces by guimera
Vienna, Kunsthistorisches Museum: Picture Gallery, The MasterpiecesVienna, Kunsthistorisches Museum: Picture Gallery, The Masterpieces
Vienna, Kunsthistorisches Museum: Picture Gallery, The Masterpieces
guimera 1.9K views
VERMEER, Johannes, Featured Paintings in Detail (1) by guimera
VERMEER, Johannes, Featured Paintings in Detail (1)VERMEER, Johannes, Featured Paintings in Detail (1)
VERMEER, Johannes, Featured Paintings in Detail (1)
guimera 911 views
Egyptian Paintingteam 10 by xmeowxmixx
Egyptian Paintingteam 10Egyptian Paintingteam 10
Egyptian Paintingteam 10
xmeowxmixx785 views
Modern World History: Chapter 1 by ldaill
Modern World History: Chapter 1Modern World History: Chapter 1
Modern World History: Chapter 1
ldaill5.3K views
Michelangelo - Cappella Sistina by Sotirios Raptis
Michelangelo -  Cappella SistinaMichelangelo -  Cappella Sistina
Michelangelo - Cappella Sistina
Sotirios Raptis19.7K views
History of painting by SFYC
History of paintingHistory of painting
History of painting
SFYC11.9K views
History of Internet Searching by Scott Lee
History of Internet SearchingHistory of Internet Searching
History of Internet Searching
Scott Lee688 views
DAVID, Jacques-Louis,Featured Paintings in Detail (1) by guimera
DAVID, Jacques-Louis,Featured Paintings in Detail (1)DAVID, Jacques-Louis,Featured Paintings in Detail (1)
DAVID, Jacques-Louis,Featured Paintings in Detail (1)
guimera 738 views

Similar to Raphael

SVGo: a Go Library for SVG generation by
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationAnthony Starks
1.6K views46 slides
Building Windows 8 Metro Style casual games using HTML5 and JavaScript by
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptBuilding Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptDavid Isbitski
2.4K views49 slides
SVG by
SVGSVG
SVGDmitry Baranovskiy
1.8K views35 slides
SVGo workshop by
SVGo workshopSVGo workshop
SVGo workshopAnthony Starks
547 views66 slides
Intro to HTML5 Canvas by
Intro to HTML5 CanvasIntro to HTML5 Canvas
Intro to HTML5 CanvasJuho Vepsäläinen
2K views32 slides
Raphaël and You by
Raphaël and YouRaphaël and You
Raphaël and YouTrotter Cashion
2.3K views39 slides

Similar to Raphael(20)

SVGo: a Go Library for SVG generation by Anthony Starks
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
Anthony Starks1.6K views
Building Windows 8 Metro Style casual games using HTML5 and JavaScript by David Isbitski
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptBuilding Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
David Isbitski2.4K views
An Introduction to NV_path_rendering by Mark Kilgard
An Introduction to NV_path_renderingAn Introduction to NV_path_rendering
An Introduction to NV_path_rendering
Mark Kilgard1.8K views
Google I/O 2013 - Android Graphics Performance by DouO
Google I/O 2013 - Android Graphics PerformanceGoogle I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics Performance
DouO7.4K views
Google I/O 2013 - Android Graphics Performance by DouO
Google I/O 2013 - Android Graphics PerformanceGoogle I/O 2013 - Android Graphics Performance
Google I/O 2013 - Android Graphics Performance
DouO703 views
Html5 Canvas and Media by Suresh Balla
Html5 Canvas and MediaHtml5 Canvas and Media
Html5 Canvas and Media
Suresh Balla495 views
HTML5 Graphics - Canvas and SVG by David Isbitski
HTML5 Graphics - Canvas and SVGHTML5 Graphics - Canvas and SVG
HTML5 Graphics - Canvas and SVG
David Isbitski1.7K views
Understanding hardware acceleration on mobile browsers presentation by Justin Dorfman
Understanding hardware acceleration on mobile browsers presentationUnderstanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentation
Justin Dorfman1.1K views
Understanding Hardware Acceleration on Mobile Browsers by Ariya Hidayat
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat7K views
HTML5 Canvas - The Future of Graphics on the Web by Robin Hawkes
HTML5 Canvas - The Future of Graphics on the WebHTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the Web
Robin Hawkes42.4K views
楽々Scalaプログラミング by Tomoharu ASAMI
楽々Scalaプログラミング楽々Scalaプログラミング
楽々Scalaプログラミング
Tomoharu ASAMI2.4K views
Specs2, go functional by specs2
Specs2,  go functionalSpecs2,  go functional
Specs2, go functional
specs2281 views
MS TechDays 2011 - HTML 5 All the Awesome Bits by Spiffy
MS TechDays 2011 - HTML 5 All the Awesome BitsMS TechDays 2011 - HTML 5 All the Awesome Bits
MS TechDays 2011 - HTML 5 All the Awesome Bits
Spiffy691 views
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -... by Codemotion
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Codemotion153 views
Understanding Hardware Acceleration on Mobile Browsers by Ariya Hidayat
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat17.1K views

More from Dmitry Baranovskiy

The Origins of Magic by
The Origins of MagicThe Origins of Magic
The Origins of MagicDmitry Baranovskiy
1.5K views33 slides
Demystifying Prototypes by
Demystifying PrototypesDemystifying Prototypes
Demystifying PrototypesDmitry Baranovskiy
5.7K views30 slides
Type Recognition by
Type RecognitionType Recognition
Type RecognitionDmitry Baranovskiy
1.8K views11 slides
Obvious Secrets of JavaScript by
Obvious Secrets of JavaScriptObvious Secrets of JavaScript
Obvious Secrets of JavaScriptDmitry Baranovskiy
1.7K views52 slides
Your JavaScript Library by
Your JavaScript LibraryYour JavaScript Library
Your JavaScript LibraryDmitry Baranovskiy
37K views65 slides
Canvas by
CanvasCanvas
CanvasDmitry Baranovskiy
12.1K views63 slides

Recently uploaded

The details of description: Techniques, tips, and tangents on alternative tex... by
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
126 views24 slides
Vertical User Stories by
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
12 views16 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
257 views86 slides
AMAZON PRODUCT RESEARCH.pdf by
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdfJerikkLaureta
19 views13 slides
Perth MeetUp November 2023 by
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023 Michael Price
19 views44 slides
handbook for web 3 adoption.pdf by
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
22 views16 slides

Recently uploaded(20)

The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada126 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta19 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price19 views
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex22 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet60 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn21 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291616 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views

Raphael

  • 1. Raphaël JavaScript Library for Vector Graphics Dmitry Baranovskiy WSG meeting 11 March 2009
  • 8. What is it for?
  • 12. window.onload = function () { var hldr = document.getElementById(quot;holderquot;); var text = hldr.getElementsByTagName(quot;pquot;)[0].innerHTML; hldr.innerHTML = quot;quot;; var R = Raphael(quot;holderquot;, 640, 480), txt = R.set(), attr = {quot;fontquot;: '50px quot;Georgiaquot;', opacity: 0.5}; txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#0f0quot;)); txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#f00quot;)); txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#00fquot;)); txt.attr(attr); var mouse = null, rot = 0; document.onmousemove = function (e) { if (mouse === null) { mouse = e.pageX; return; } rot += e.pageX - mouse; txt[0].rotate(e.pageX - mouse); txt[1].rotate((e.pageX - mouse) /1.5); txt[2].rotate((e.pageX - mouse) /2); mouse = e.pageX; }; };
  • 13. window.onload = function () { var hldr = document.getElementById(quot;holderquot;); var text = hldr.getElementsByTagName(quot;pquot;)[0].innerHTML; hldr.innerHTML = quot;quot;; var R = Raphael(quot;holderquot;, 640, 480) 480), txt = R.set(), attr = {quot;fontquot;: '50px quot;Georgiaquot;', opacity: 0.5}; txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#0f0quot;)); txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#f00quot;)); txt.push(R.text(320, 240, text).attr(quot;fillquot;, quot;#00fquot;)); txt.attr(attr); var mouse = null, rot = 0; document.onmousemove = function (e) { if (mouse === null) { mouse = e.pageX; return; } rot += e.pageX - mouse; txt[0].rotate(e.pageX - mouse); txt[1].rotate((e.pageX - mouse) /1.5); txt[2].rotate((e.pageX - mouse) /2); mouse = e.pageX; }; };
  • 14. How does it work?
  • 15. Canvas SVG VML
  • 16. Canvas SVG VML pixels DOM DOM
  • 17. SVG VML
  • 18. DOM?
  • 19. SVG VML
  • 20. API
  • 22. animate attr getBBox hide circle insertAfter ellipse insertBefore image remove path rotate scale rect text show stop toBack toFront translate
  • 23. animate attr getBBox hide circle insertAfter ellipse insertBefore image remove path rotate scale rect text show stop toBack toFront translate
  • 24. fill animate fill-opacity attr font getBBox font-family hide font-size gradient circle insertAfter opacity ellipse insertBefore rotation image remove scale path rotate stroke scale rect stroke-dasharray text show stroke-linecap stroke-linejoin stop stroke-miterlimit toBack stroke-opacity toFront stroke-width translate translation
  • 25. fill animate fill-opacity attr font cx getBBox font-family cy hide font-size height gradient circle insertAfter path opacity ellipse insertBefore r rotation image remove rx scale path rotate stroke ry scale rect stroke-dasharray src text show stroke-linecap width stroke-linejoin stop x stroke-miterlimit toBack y stroke-opacity toFront stroke-width translate translation
  • 30. Circle.node.onclick = function () {…};
  • 32. 16 Kb
  • 37. 0.6.4
  • 38. 0.7
  • 41. Raphaël could make you stand out of the crowd.
  • 42. Using Raphaël could amaze your colleagues