SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Dojo GFX
    SVG in the Real World™
 Eugene Lazutkin, DojoToolkit.org
SVG Open 2009, Mountain View, CA




                1
What Dojo GFX is

•   Cross-browser graphics package.

•   Written in JavaScript.

•   Supported backends: SVG,VML, Canvas, Silverlight.

•   Working on SVGWeb support.



                                    2
Underlying concepts

•   Loosely based on SVG concepts:

    •   Geometry represented by shapes and transformation matrices.

    •   Visuals are described by strokes, and fills.

    •   Special objects: fonts, groups to combine shapes, and a surface is a
        graphics container.


                                         3
Dojo GFX goals

•   Designed for client-side software development.

•   Emphasis on interactive graphics.

    •   Support for easy picture regeneration (even on Canvas!).

    •   Support for events.



                                      4
Code tour
 SVG in Dojo GFX




        5
SVG in Dojo GFX

•   SVG and VML were the first renderers shipped.

•   SVG is used as a benchmark baseline for other renderers.

•   SVG is used as the first choice for debugging graphic algorithms.

•   SVG is what I recommend as the first serious choice for our users.



                                     6
Dojo GFX code analysis
•
                                                     Renderer         Arc        Decompose
    Common code is not included
                                               50

•   Canvas renderer does not
    support text and events.                  37.5



•   Arc is a helper to approximate             25

    arcs with Bezier curves.
                                              12.5

•   Decompose splits matrix to
    rotations, scaling and translation.         0
                                                     SVG        VML         Canvas   Silverlight


                                          7
Dojo GFX SVG renderer


•   The most feature-rich.

•   It runs on wide variety of browsers.

•   ...yet it is the smallest one!




                                     8
Dojo GFX use study

•   VML is still big, especially on public-facing and corporate web sites.

    •   It looks like IE6 started to die off slowly in the corporate world.

•   SVG rules the desktop-oriented web applications.

    •   Typically both SVG and Canvas available and users go with SVG.

•   Canvas is the king of mobile applications.


                                        9
Dojo GFX support study


•   Vast majority of browser-specific tickets are for IE.

•   Vast majority of renderer-specific tickets are for VML.

•   Tickets for browser-specific differences for SVG are rare nowadays.




                                     10
SVG unification in browsers
•   When I am in doubt I consult SVG 1.1 spec (http://www.w3.org/TR/
    SVG/) and it works for me everywhere.

    •   Finally!

•   SVG renderer has exactly one browser-specific fragment:




                                   11
SVG? XML!
 Softer side of SVG




         12
SVG... It is just XML...

•   By design any Dojo GFX object can be (de)serialized as JSON.

    •   It can be used to transport scenes.

•   We have an experimental XSLT file to convert a subset of SVG to our
    JSON format.

    •   We can combine existing SVG pictures with dynamically generated
        content.

                                       13
XML in IE? You betcha!

•   It means we can generate SVG (as XML) in IE and other lame
    browsers!

    •   We can generate XML DOM in a hidden iframe.

    •   Who cares that we cannot see it on IE?

•   Jared Jurkiewicz needed to send client-generated graphics to servers,
    and he implemented it.

                                      14
In the wild
Take a walk on the wild side




             15
Dojo GFX (and SVG) in the wild

•   Various vector-based engineering drawings.

    •   Example: dojox.sketch (Tom Trenka).

    •   Example: dojox.drawing (Mike Wilcox).

•   DEMO.



                                     16
Dojo GFX (and SVG) in the wild

•   Mapping.

    •   Example: ESRI ArcGIS JavaScript API.

•   DEMO (geoprocessor: service area, population zonal stats; route: find
    a route).



                                      17
Dojo GFX (and SVG) in the wild

•   User interface.

    •   Example: balloon tooltips, rounded corner backgrounds.

    •   Example: analog gauge, bar gauge.

•   DEMO.



                                       18
Dojo GFX (and SVG) in the wild


•   Charts.

    •   Example: dojox.charting




                                  19
Charting results
   Making things pretty




            20
Dojo Charting

•   Supports most common plots:

    •   Lines, areas (including stacked).

    •   Bars and columns (including stacked and clustered).

    •   Scatter, bubble, candle sticks, pies.



                                            21
Dojo Charting

•   Supports shared axes, and multiple plots per chart.

•   Supports themes, legends.

•   Supports actions to make charts interactive.

•   DEMO.



                                    22

Weitere ähnliche Inhalte

Ähnlich wie Dojo GFX: SVG in the real world

Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Förderverein Technische Fakultät
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
Major Ye
 
Java Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.EasyJava Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.Easy
roialdaag
 

Ähnlich wie Dojo GFX: SVG in the real world (20)

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
 
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
 
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
Latest Developments of Scalable Vector Graphics (SVG) 2, With a Focus on Stre...
 
Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile Graphics
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
2011 05-jszurich
2011 05-jszurich2011 05-jszurich
2011 05-jszurich
 
Pulsar
PulsarPulsar
Pulsar
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Make your own Print & Play card game using SVG and JavaScript
Make your own Print & Play card game using SVG and JavaScriptMake your own Print & Play card game using SVG and JavaScript
Make your own Print & Play card game using SVG and JavaScript
 
Kick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debuggingKick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debugging
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Vector Tiles with GeoServer and OpenLayers
Vector Tiles with GeoServer and OpenLayersVector Tiles with GeoServer and OpenLayers
Vector Tiles with GeoServer and OpenLayers
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth Review
 
Learn svg
Learn svgLearn svg
Learn svg
 
Svcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobileSvcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobile
 
Getting started with open gl es 2
Getting started with open gl es 2Getting started with open gl es 2
Getting started with open gl es 2
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
 
Java Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.EasyJava Edge.2009.Grails.Web.Dev.Made.Easy
Java Edge.2009.Grails.Web.Dev.Made.Easy
 

Mehr von Eugene Lazutkin

Mehr von Eugene Lazutkin (13)

Service workers
Service workersService workers
Service workers
 
Advanced I/O in browser
Advanced I/O in browserAdvanced I/O in browser
Advanced I/O in browser
 
Streams
StreamsStreams
Streams
 
Functional practices in JavaScript
Functional practices in JavaScriptFunctional practices in JavaScript
Functional practices in JavaScript
 
Express: the web server for node.js
Express: the web server for node.jsExpress: the web server for node.js
Express: the web server for node.js
 
TXJS 2013 in 10 minutes
TXJS 2013 in 10 minutesTXJS 2013 in 10 minutes
TXJS 2013 in 10 minutes
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
OOP in JS
OOP in JSOOP in JS
OOP in JS
 
Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)
 
RAD CRUD
RAD CRUDRAD CRUD
RAD CRUD
 
CRUD with Dojo
CRUD with DojoCRUD with Dojo
CRUD with Dojo
 
Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)
 
DojoX GFX Session Eugene Lazutkin SVG Open 2007
DojoX GFX Session Eugene Lazutkin SVG Open 2007DojoX GFX Session Eugene Lazutkin SVG Open 2007
DojoX GFX Session Eugene Lazutkin SVG Open 2007
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 

Dojo GFX: SVG in the real world

  • 1. Dojo GFX SVG in the Real World™ Eugene Lazutkin, DojoToolkit.org SVG Open 2009, Mountain View, CA 1
  • 2. What Dojo GFX is • Cross-browser graphics package. • Written in JavaScript. • Supported backends: SVG,VML, Canvas, Silverlight. • Working on SVGWeb support. 2
  • 3. Underlying concepts • Loosely based on SVG concepts: • Geometry represented by shapes and transformation matrices. • Visuals are described by strokes, and fills. • Special objects: fonts, groups to combine shapes, and a surface is a graphics container. 3
  • 4. Dojo GFX goals • Designed for client-side software development. • Emphasis on interactive graphics. • Support for easy picture regeneration (even on Canvas!). • Support for events. 4
  • 5. Code tour SVG in Dojo GFX 5
  • 6. SVG in Dojo GFX • SVG and VML were the first renderers shipped. • SVG is used as a benchmark baseline for other renderers. • SVG is used as the first choice for debugging graphic algorithms. • SVG is what I recommend as the first serious choice for our users. 6
  • 7. Dojo GFX code analysis • Renderer Arc Decompose Common code is not included 50 • Canvas renderer does not support text and events. 37.5 • Arc is a helper to approximate 25 arcs with Bezier curves. 12.5 • Decompose splits matrix to rotations, scaling and translation. 0 SVG VML Canvas Silverlight 7
  • 8. Dojo GFX SVG renderer • The most feature-rich. • It runs on wide variety of browsers. • ...yet it is the smallest one! 8
  • 9. Dojo GFX use study • VML is still big, especially on public-facing and corporate web sites. • It looks like IE6 started to die off slowly in the corporate world. • SVG rules the desktop-oriented web applications. • Typically both SVG and Canvas available and users go with SVG. • Canvas is the king of mobile applications. 9
  • 10. Dojo GFX support study • Vast majority of browser-specific tickets are for IE. • Vast majority of renderer-specific tickets are for VML. • Tickets for browser-specific differences for SVG are rare nowadays. 10
  • 11. SVG unification in browsers • When I am in doubt I consult SVG 1.1 spec (http://www.w3.org/TR/ SVG/) and it works for me everywhere. • Finally! • SVG renderer has exactly one browser-specific fragment: 11
  • 12. SVG? XML! Softer side of SVG 12
  • 13. SVG... It is just XML... • By design any Dojo GFX object can be (de)serialized as JSON. • It can be used to transport scenes. • We have an experimental XSLT file to convert a subset of SVG to our JSON format. • We can combine existing SVG pictures with dynamically generated content. 13
  • 14. XML in IE? You betcha! • It means we can generate SVG (as XML) in IE and other lame browsers! • We can generate XML DOM in a hidden iframe. • Who cares that we cannot see it on IE? • Jared Jurkiewicz needed to send client-generated graphics to servers, and he implemented it. 14
  • 15. In the wild Take a walk on the wild side 15
  • 16. Dojo GFX (and SVG) in the wild • Various vector-based engineering drawings. • Example: dojox.sketch (Tom Trenka). • Example: dojox.drawing (Mike Wilcox). • DEMO. 16
  • 17. Dojo GFX (and SVG) in the wild • Mapping. • Example: ESRI ArcGIS JavaScript API. • DEMO (geoprocessor: service area, population zonal stats; route: find a route). 17
  • 18. Dojo GFX (and SVG) in the wild • User interface. • Example: balloon tooltips, rounded corner backgrounds. • Example: analog gauge, bar gauge. • DEMO. 18
  • 19. Dojo GFX (and SVG) in the wild • Charts. • Example: dojox.charting 19
  • 20. Charting results Making things pretty 20
  • 21. Dojo Charting • Supports most common plots: • Lines, areas (including stacked). • Bars and columns (including stacked and clustered). • Scatter, bubble, candle sticks, pies. 21
  • 22. Dojo Charting • Supports shared axes, and multiple plots per chart. • Supports themes, legends. • Supports actions to make charts interactive. • DEMO. 22