SlideShare una empresa de Scribd logo
1 de 34
HTML5 and SVG Nuno Rosa [Developer  | Byclosure] [nuno.rosa@byclosure.com] [@yarcub]
WHo
WHere
Agenda HTML5 & SVG Adoption SVG 101 Why & where? Q & A
SVG is not HTML5...
SVG is not HTML5... ...but they get along.
Are we there yet? Real world examples
Bing Maps Route paths
Google Visualization API On demand charts (e.g. Google Docs)
Vexflow Music notation rendering (http://vexflow.com)
PepsiCo SXSW 2011 Zeitgeist Twitter stream visualization (http://pepsicozeitgeist.com/)
SVG 101 The basics
Describes 2D vector images Static Animation XML Full DOM support Scripting Open standard (W3C) Modern browsers support (no plugins) Fallback options available In a nutshell
Standalone <object data="myfile.svg" 		type="image/svg+xml" width="100" 			height="100"/> <embedsrc="myfile.svg" width="100" 			height="100"/> <iframesrc="myfile.svg" width="100" 			height="100"/> <imagesrc="myfile.svg" width="100" 			height="100"/> No scripting {background-image: url('myfile.svg');} No scripting SVG on web pages
Standalone (scripting) HTML Document SVG Document SVG on web pages <object id="svgContainer" data="myfile.svg" 		type="image/svg+xml" width="100" 			height="100"/> SVGDoc = document.getElementById("#svgContainer")		.getSVGDocument();var element = SVGDoc.querySelector("#elementId");element.setAttribute("x", 100); <svgxmlns="http://www.w3.org/2000/svg">	<rect id="elementId" width="10" height="10"/></svg>
XHTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> 	<html 	xmlns="http://www.w3.org/1999/xhtml" 			xmlns:svg="http://www.w3.org/2000/svg"> 	<head></head> 	<body> 	<div id="container"> <svg:svg width="100" height="100" > 		<svg:rect y="10" X="10" width="20" height="20"/> 	 </svg:svg> 	</div> 	</body> 	</html> Inline
HTML5<!DOCTYPE HTML><html><head></head><body> <div id="container"><svg width="100" height="100" >	<rect y="10" X="10" width="20" height="20"/>   </svg>  </div></body></html> Inline
Inline  (scripting) <div id="container">	  <svg width="100" height="100" >	    <rect id="myShape" y="10" X="10" 				width="20" height="20"/>   </svg>  </div> Core DOM  (HTML and SVG documents)var shape = document.querySelector("#myShape");shape.setAttribute("width", 100);  SVG DOM (SVG documents specific)var shape = document.querySelector("#myShape");shape.width.baseVal.value = 100; //Faster SVG on web pages
2D x-y plane viewBox defines visible area in IE9 default overflow != hidden <svgviewBox="0 0 343 501" > All element coordinates are absolute SVG viewport
SVG capabilities overview Primitive shapes Text Fill/Strokes Gradients Patterns Filters Scripting Metadata SMIL(SynchronizedMultimediaIntegrated Language) Styling (CSS2) Links Groups Transformations Clipping Paths Masking Foreign Objects Conditionals DOM events
SVG primitive shapes <circle /> <rect /> <ellipse /> <line /> <polyline /> <polygon />  <path /> Linear Quad Cubic
Selectable and searchable Even when following paths Just another element Fill  Border Transformations SVG text
Group elements, treat them as one <g id="aGroup"fill="orange"><rect x="20" y="30" width="40" height="40"/><circle cx="100" cy="100" r="10" /> </g> Group
Element property, transform="…" Rotation, revolves element around point 	transform="rotate(degrees, cx, cy)" Scale, multiply all (x,y) coordinates 	transform="scale(xfactor, yfactor)" Translation, add (x,y) positions 	transform="translate(dx, dy)" Transform
Elements declared inside definitions are not rendered.  Ideal for reusing elements Gradients Text paths Clipping paths Repeated elements <defs> 	<circle id="dot"cx="10" cy="10" r="5"> </defs> <use xlink:href="#dot" transform="translate(120,0)" /> <use xlink:href="#dot" transform="translate(120,100)" /> Reuse
SVG capabilities overview Primitive shapes Text Fill/Strokes Gradients Patterns Filters Scripting Metadata SMIL(SynchronizedMultimediaIntegrated Language) Styling (CSS2) Links Groups Transformations Clipping Paths Masking Foreign Objects Conditionals DOM events http://caniuse.com/#search=svg
Why SVG? Some advantages
Scale factor Multiscreen applications High fidelity graphics Text Format Accessibility  Version Control Semantic
Bandwith Small filesize Changes can be done in browser avoiding server round-trip Gzip encoded .svgz Server must send reponse headerContent-Enconding: gzip
An SVG Primer for Today's Browsers http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html Byclosuregithub account  http://github.com/Byclosure/SVG101 RaphaelJS http://raphaeljs.com/ jQuery SVG http://keith-wood.name/svg.html Inkscape http://inkscape.org/ Visual Studio SVG schema Intelisense plugin http://visualstudiogallery.msdn.microsoft.com/22479d6b-42d5-499f-b501-18e90e579540 SVGWeb (cross-browser support) http://code.google.com/p/svgweb/ References
Market is adopting SVG Different ways to place SVG on HTML SVG basic concepts Tools & Frameworks Recap
Check the demos.(http://github.com/Byclosure/SVG101)Go out and play!
Thank you.Questions? nuno.rosa@byclosure.com @yarcub

Más contenido relacionado

La actualidad más candente (20)

Css3
Css3Css3
Css3
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
 
Css3
Css3Css3
Css3
 
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
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector Graphics
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Svcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobileSvcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobile
 
Html5
Html5Html5
Html5
 
Getting started with html5
Getting started with html5Getting started with html5
Getting started with html5
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Css3
Css3Css3
Css3
 
Drupal Backbone.js in the Frontend
Drupal Backbone.js in the FrontendDrupal Backbone.js in the Frontend
Drupal Backbone.js in the Frontend
 
Html5
Html5Html5
Html5
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Css3
Css3Css3
Css3
 
D3 Basic Tutorial
D3 Basic TutorialD3 Basic Tutorial
D3 Basic Tutorial
 
Css3 Presetation
Css3 PresetationCss3 Presetation
Css3 Presetation
 
An in-depth look at jQuery
An in-depth look at jQueryAn in-depth look at jQuery
An in-depth look at jQuery
 
Svghtml5 Meetup
Svghtml5 MeetupSvghtml5 Meetup
Svghtml5 Meetup
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!
 

Destacado

Dive Into SVG
Dive Into SVGDive Into SVG
Dive Into SVGyomotsu
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics APdgmit2009
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)zahid-mian
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examplesAlfredo Torre
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 

Destacado (11)

Dive Into SVG
Dive Into SVGDive Into SVG
Dive Into SVG
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 
ES6
ES6ES6
ES6
 
HTML 5_Canvas
HTML 5_CanvasHTML 5_Canvas
HTML 5_Canvas
 
Canvas - HTML 5
Canvas - HTML 5Canvas - HTML 5
Canvas - HTML 5
 
HTML 5 Canvas & SVG
HTML 5 Canvas & SVGHTML 5 Canvas & SVG
HTML 5 Canvas & SVG
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 

Similar a HTML5 and SVG

[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 RefresherIvano Malavolta
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsIvano Malavolta
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3Helder da Rocha
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookScottperrone
 
HTML5 - Future of Web
HTML5 - Future of WebHTML5 - Future of Web
HTML5 - Future of WebMirza Asif
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5Jamshid Hashimi
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebGeorge Kanellopoulos
 
Repaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares webRepaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares webPablo Garaizar
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Librariesseamusjr
 

Similar a HTML5 and SVG (20)

Web Vector Graphics
Web Vector GraphicsWeb Vector Graphics
Web Vector Graphics
 
SVG introduction
SVG   introductionSVG   introduction
SVG introduction
 
SVGD3Angular2React
SVGD3Angular2ReactSVGD3Angular2React
SVGD3Angular2React
 
[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Html5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicHtml5 CSS3 jQuery Basic
Html5 CSS3 jQuery Basic
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
HTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile appsHTML5 & CSS3 refresher for mobile apps
HTML5 & CSS3 refresher for mobile apps
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Html 5 svg
Html 5 svgHtml 5 svg
Html 5 svg
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
HTML5 - Future of Web
HTML5 - Future of WebHTML5 - Future of Web
HTML5 - Future of Web
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The Nextweb
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5
 
html5
html5html5
html5
 
Repaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares webRepaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares web
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Libraries
 
Hardboiled Web Design
Hardboiled Web DesignHardboiled Web Design
Hardboiled Web Design
 

Último

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.pdfUK Journal
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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...Martijn de Jong
 
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 organizationRadu Cotescu
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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...
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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 future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

HTML5 and SVG

  • 1.
  • 2. HTML5 and SVG Nuno Rosa [Developer | Byclosure] [nuno.rosa@byclosure.com] [@yarcub]
  • 3. WHo
  • 5. Agenda HTML5 & SVG Adoption SVG 101 Why & where? Q & A
  • 6. SVG is not HTML5...
  • 7. SVG is not HTML5... ...but they get along.
  • 8. Are we there yet? Real world examples
  • 10. Google Visualization API On demand charts (e.g. Google Docs)
  • 11. Vexflow Music notation rendering (http://vexflow.com)
  • 12. PepsiCo SXSW 2011 Zeitgeist Twitter stream visualization (http://pepsicozeitgeist.com/)
  • 13. SVG 101 The basics
  • 14. Describes 2D vector images Static Animation XML Full DOM support Scripting Open standard (W3C) Modern browsers support (no plugins) Fallback options available In a nutshell
  • 15. Standalone <object data="myfile.svg" type="image/svg+xml" width="100" height="100"/> <embedsrc="myfile.svg" width="100" height="100"/> <iframesrc="myfile.svg" width="100" height="100"/> <imagesrc="myfile.svg" width="100" height="100"/> No scripting {background-image: url('myfile.svg');} No scripting SVG on web pages
  • 16. Standalone (scripting) HTML Document SVG Document SVG on web pages <object id="svgContainer" data="myfile.svg" type="image/svg+xml" width="100" height="100"/> SVGDoc = document.getElementById("#svgContainer") .getSVGDocument();var element = SVGDoc.querySelector("#elementId");element.setAttribute("x", 100); <svgxmlns="http://www.w3.org/2000/svg"> <rect id="elementId" width="10" height="10"/></svg>
  • 17. XHTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head></head> <body> <div id="container"> <svg:svg width="100" height="100" > <svg:rect y="10" X="10" width="20" height="20"/> </svg:svg> </div> </body> </html> Inline
  • 18. HTML5<!DOCTYPE HTML><html><head></head><body> <div id="container"><svg width="100" height="100" > <rect y="10" X="10" width="20" height="20"/> </svg> </div></body></html> Inline
  • 19. Inline (scripting) <div id="container"> <svg width="100" height="100" > <rect id="myShape" y="10" X="10" width="20" height="20"/> </svg> </div> Core DOM (HTML and SVG documents)var shape = document.querySelector("#myShape");shape.setAttribute("width", 100); SVG DOM (SVG documents specific)var shape = document.querySelector("#myShape");shape.width.baseVal.value = 100; //Faster SVG on web pages
  • 20. 2D x-y plane viewBox defines visible area in IE9 default overflow != hidden <svgviewBox="0 0 343 501" > All element coordinates are absolute SVG viewport
  • 21. SVG capabilities overview Primitive shapes Text Fill/Strokes Gradients Patterns Filters Scripting Metadata SMIL(SynchronizedMultimediaIntegrated Language) Styling (CSS2) Links Groups Transformations Clipping Paths Masking Foreign Objects Conditionals DOM events
  • 22. SVG primitive shapes <circle /> <rect /> <ellipse /> <line /> <polyline /> <polygon /> <path /> Linear Quad Cubic
  • 23. Selectable and searchable Even when following paths Just another element Fill Border Transformations SVG text
  • 24. Group elements, treat them as one <g id="aGroup"fill="orange"><rect x="20" y="30" width="40" height="40"/><circle cx="100" cy="100" r="10" /> </g> Group
  • 25. Element property, transform="…" Rotation, revolves element around point transform="rotate(degrees, cx, cy)" Scale, multiply all (x,y) coordinates transform="scale(xfactor, yfactor)" Translation, add (x,y) positions transform="translate(dx, dy)" Transform
  • 26. Elements declared inside definitions are not rendered. Ideal for reusing elements Gradients Text paths Clipping paths Repeated elements <defs> <circle id="dot"cx="10" cy="10" r="5"> </defs> <use xlink:href="#dot" transform="translate(120,0)" /> <use xlink:href="#dot" transform="translate(120,100)" /> Reuse
  • 27. SVG capabilities overview Primitive shapes Text Fill/Strokes Gradients Patterns Filters Scripting Metadata SMIL(SynchronizedMultimediaIntegrated Language) Styling (CSS2) Links Groups Transformations Clipping Paths Masking Foreign Objects Conditionals DOM events http://caniuse.com/#search=svg
  • 28. Why SVG? Some advantages
  • 29. Scale factor Multiscreen applications High fidelity graphics Text Format Accessibility Version Control Semantic
  • 30. Bandwith Small filesize Changes can be done in browser avoiding server round-trip Gzip encoded .svgz Server must send reponse headerContent-Enconding: gzip
  • 31. An SVG Primer for Today's Browsers http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html Byclosuregithub account http://github.com/Byclosure/SVG101 RaphaelJS http://raphaeljs.com/ jQuery SVG http://keith-wood.name/svg.html Inkscape http://inkscape.org/ Visual Studio SVG schema Intelisense plugin http://visualstudiogallery.msdn.microsoft.com/22479d6b-42d5-499f-b501-18e90e579540 SVGWeb (cross-browser support) http://code.google.com/p/svgweb/ References
  • 32. Market is adopting SVG Different ways to place SVG on HTML SVG basic concepts Tools & Frameworks Recap

Notas del editor

  1. Primeiros minutos muito importantes
  2. Separar documentos.
  3. For example, if an HTML implementation also supports SVG, then the Document object implements both HTMLDocument and SVGDocument.
  4. Same file with “sprite sheet” containing multiple elements.Embed the same object in several web page locations but with different viewboxs.SHOW SVG FILE DEMO (change viewport)
  5. SHOW DEMO: 01_primitives.htmlpoint-in-polygon: uma linha horizontal se cruzar um múmero de fronteiras impar(dentro) ou par(fora)
  6. Mostrar exemplo do texto
  7. SHOW REUSE EXAMPLE.In retrospective, recap code for TEXT EXAMPLE