SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados (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!
 

Destaque

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
 

Destaque (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
 

Semelhante 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
 

Semelhante 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

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

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 do 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