SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
JAVASCRIPT GRAPHIC LIBRARIES
ALENA KALTUNEVICH 10/11/2013
1
Summary
Introduction
Most Popular JS graphic libraries
HTML5 canvas element
KineticJs
Three.JS
External links
2
Introduction
JavaScript graphic libraries are free, easy to use and are based on html5
canvas element or svg technology.
They provide easy and efficient tool for creating:
2d elements: lines, curves, shapes
3d content: polygons , perspective
Styling: shades, filters
Graphs and charts,
Drag and drop interactive elements,
Animations without using Flash technology
http://www.html5canvastutorials.com/labs/html5-canvas-ultimate-flash-
killer/
3
Most popular JS graphic libraries
D3.js
Powerful library for manipulating data based documents, allows to bind arbitrary data to
DOM and create original effects to visualize them.
Does not support well IE earlier versions.
http://bl.ocks.org/mbostock/3943967
http://mbostock.github.io/d3/tutorial/circle.html
Processing.js
The code is written using Processing language and then it is included in HTML page, good
for creating interactive graphic elements.
http://mariuswatz.com/works/abstract01js/index_auto.html
Raphael
Draws graphics for web sites using SVG for most browsers, VML for older versions of IE.
http://raphaeljs.com/curver.html
http://raphaeljs.com/polar-clock.html 4
Most popular JS graphic libraries
KinetcJs
Used for rendering 2d content such as curves, lines , shapes in static or animated way
http://www.html5canvastutorials.com/labs/html5-canvas-wheel-of-fortune/
Three.js
Used for rendering 3d content
http://blackjk3.github.io/threefab/
BonsaiJS
Used for creating svg based graphics
http://demos.bonsaijs.org/demos/rainbow/index.html
5
HTML5 Canvas element
Tag similar to any other html tag
The contents of the tag is rendered with JavaScript
Context is an object used to render graphics inside the canvas element
The context can be 2d or webgl (3d)
6
HTML5 Canvas element
Within canvas element you can draw lines, curves, polygons
Line Quadratic curve
Polygon
7
http://www.html5canvastutorials.com/labs/html5-canvas-elastic-stars-with-kineticjs/
http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-brighten-or-
darken-image-tutorial/
KineticJs offers the possibility to use build-in 2d elements such as cercles, rectangles,
and other shapes .
You can make these elements draggable, place them on different layers, apply
transformation and styling features like scaling, shadowing etc.
When you are working with images, filters are available for inverting colors,
grayscaling and other similar effects.
8
Multiple possibilities exist for animating elements:
you can apply linear movement, oscillation movement, random direction
movement, rotation based on mathematical formulas :
http://www.html5canvastutorials.com/kineticjs/html5-
canvas-all-easing-functions-with-kineticjs/
http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-
animate-position-tutorial/
You have the possibility to make elements move only within the boundaries of
delimited area :
http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-shapes-
horizontally-or-vertically-tutorial/
9
Three.js
Three.js is used to render 3d content with renderer object
var renderer = new THREE.WebGLRenderer();
3d objects are represented by meshes
var plane = new THREE.Mesh(new THREE.PlaneGeometry(300, 300)
Then Meshes are added to the scene
scene.add(plane);
Scene is then rendered with camera, orthographic and perspective
var camera = new THREE.PerspectiveCamera(45,
window.innerWidth / window.innerHeight, 1, 1000);
http://www.html5canvastutorials.com/three/html5-canvas-webgl-plane-with-three-js/
10
Three.js
Different lights are available such as spot light, point light, ambient light etc
You apply different textures and materials to the meshes
var material = new THREE.MeshPhongMaterial({color: 0xe4e4e4});
Very impressive results can be achieved when rendering complex shape object
modeled with a 3d modeling program such as Blender.
You can also give to the user the possibility to interact with the scene and modify
dynamically the content of the scene.
http://threejs.org/examples/webgl_materials_cubemap_balls_reflection.html
http://carvisualizer.plus360degrees.com/threejs/
11
External links
http://bonsaijs.org/
http://raphaeljs.com/
http://mrdoob.github.io/three.js/
http://d3js.org/
http://kineticjs.com/
http://processingjs.org/
http://www.html5canvastutorials.com/
12
Find out more
• On https://techblog.betclicgroup.com/
About Betclic
• Betclic Everest Group, one of the world leaders in online gaming, has a unique portfolio
comprising various complementary international brands: Betclic, Everest Gaming, bet-at-
home.com, Expekt…
• Active in 100 countries with more than 12 million customers worldwide, the Group is
committed to promoting secure and responsible gaming and is a member of several
international professional associations including the EGBA (European Gaming and Betting
Association) and the ESSA (European Sports Security Association).
• Through our brands, Betclic Everest Group places expertise, technological know-how and
security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion
of our players.

Mais conteúdo relacionado

Destaque

Chameleon game engine
Chameleon game engineChameleon game engine
Chameleon game engineVictor Porof
 
Firefox WebGL developer tools
Firefox WebGL developer toolsFirefox WebGL developer tools
Firefox WebGL developer toolsVictor Porof
 
Introduction to 3D and shaders
Introduction to 3D and shadersIntroduction to 3D and shaders
Introduction to 3D and shadersVictor Porof
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017John Maeda
 

Destaque (6)

Chameleon game engine
Chameleon game engineChameleon game engine
Chameleon game engine
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Firefox WebGL developer tools
Firefox WebGL developer toolsFirefox WebGL developer tools
Firefox WebGL developer tools
 
User engagement in the digital world
User engagement in the digital worldUser engagement in the digital world
User engagement in the digital world
 
Introduction to 3D and shaders
Introduction to 3D and shadersIntroduction to 3D and shaders
Introduction to 3D and shaders
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017
 

Semelhante a Mini-Training: JS Graphical Libraries

WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO TimeTony Parisi
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3Binary Studio
 
From Zero to Hero – Web Performance
From Zero to Hero – Web PerformanceFrom Zero to Hero – Web Performance
From Zero to Hero – Web PerformanceSebastian Springer
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5Jamshid Hashimi
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsBinary Studio
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFIJERD Editor
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인Daum DNA
 
GraphTech Ecosystem - part 3: Graph Visualization
GraphTech Ecosystem - part 3: Graph VisualizationGraphTech Ecosystem - part 3: Graph Visualization
GraphTech Ecosystem - part 3: Graph VisualizationLinkurious
 
Migrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityMigrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityDenis Radin
 
Web development today
Web development todayWeb development today
Web development todayJaydev Gajera
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom componentsJeremy Grancher
 
Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Ireland & UK Moodlemoot 2012
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)Oleksii Prohonnyi
 

Semelhante a Mini-Training: JS Graphical Libraries (20)

Html5
Html5Html5
Html5
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO Time
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
 
From Zero to Hero – Web Performance
From Zero to Hero – Web PerformanceFrom Zero to Hero – Web Performance
From Zero to Hero – Web Performance
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Plunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s beginPlunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s begin
 
Academy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphicsAcademy PRO: HTML5 API graphics
Academy PRO: HTML5 API graphics
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPF
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
 
GraphTech Ecosystem - part 3: Graph Visualization
GraphTech Ecosystem - part 3: Graph VisualizationGraphTech Ecosystem - part 3: Graph Visualization
GraphTech Ecosystem - part 3: Graph Visualization
 
Migrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityMigrating your Web app to Virtual Reality
Migrating your Web app to Virtual Reality
 
Web development today
Web development todayWeb development today
Web development today
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
 
What is HTML5
What is HTML5What is HTML5
What is HTML5
 
Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...
 
Flash Web Development.pdf
Flash Web Development.pdfFlash Web Development.pdf
Flash Web Development.pdf
 
Volunteer.rb
Volunteer.rbVolunteer.rb
Volunteer.rb
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
HTML5 data attributes
HTML5 data attributes HTML5 data attributes
HTML5 data attributes
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
 

Mais de Betclic Everest Group Tech Team

Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedBetclic Everest Group Tech Team
 

Mais de Betclic Everest Group Tech Team (20)

Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)
 
Mini training - Moving to xUnit.net
Mini training - Moving to xUnit.netMini training - Moving to xUnit.net
Mini training - Moving to xUnit.net
 
Mini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure StorageMini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure Storage
 
Akka.Net
Akka.NetAkka.Net
Akka.Net
 
Mini training- Scenario Driven Design
Mini training- Scenario Driven DesignMini training- Scenario Driven Design
Mini training- Scenario Driven Design
 
Email Management in Outlook
Email Management in OutlookEmail Management in Outlook
Email Management in Outlook
 
Mini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity FoundationMini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity Foundation
 
Training - What is Performance ?
Training  - What is Performance ?Training  - What is Performance ?
Training - What is Performance ?
 
Mini-Training: Docker
Mini-Training: DockerMini-Training: Docker
Mini-Training: Docker
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
 
Mini-Training: NDepend
Mini-Training: NDependMini-Training: NDepend
Mini-Training: NDepend
 
Management 3.0 Workout
Management 3.0 WorkoutManagement 3.0 Workout
Management 3.0 Workout
 
Lean for Business
Lean for BusinessLean for Business
Lean for Business
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Training – Going Async
Training – Going AsyncTraining – Going Async
Training – Going Async
 
Mini-Training: Mobile UX Trends
Mini-Training: Mobile UX TrendsMini-Training: Mobile UX Trends
Mini-Training: Mobile UX Trends
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation Demystified
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Mini-Training: JS Graphical Libraries

  • 1. JAVASCRIPT GRAPHIC LIBRARIES ALENA KALTUNEVICH 10/11/2013 1
  • 2. Summary Introduction Most Popular JS graphic libraries HTML5 canvas element KineticJs Three.JS External links 2
  • 3. Introduction JavaScript graphic libraries are free, easy to use and are based on html5 canvas element or svg technology. They provide easy and efficient tool for creating: 2d elements: lines, curves, shapes 3d content: polygons , perspective Styling: shades, filters Graphs and charts, Drag and drop interactive elements, Animations without using Flash technology http://www.html5canvastutorials.com/labs/html5-canvas-ultimate-flash- killer/ 3
  • 4. Most popular JS graphic libraries D3.js Powerful library for manipulating data based documents, allows to bind arbitrary data to DOM and create original effects to visualize them. Does not support well IE earlier versions. http://bl.ocks.org/mbostock/3943967 http://mbostock.github.io/d3/tutorial/circle.html Processing.js The code is written using Processing language and then it is included in HTML page, good for creating interactive graphic elements. http://mariuswatz.com/works/abstract01js/index_auto.html Raphael Draws graphics for web sites using SVG for most browsers, VML for older versions of IE. http://raphaeljs.com/curver.html http://raphaeljs.com/polar-clock.html 4
  • 5. Most popular JS graphic libraries KinetcJs Used for rendering 2d content such as curves, lines , shapes in static or animated way http://www.html5canvastutorials.com/labs/html5-canvas-wheel-of-fortune/ Three.js Used for rendering 3d content http://blackjk3.github.io/threefab/ BonsaiJS Used for creating svg based graphics http://demos.bonsaijs.org/demos/rainbow/index.html 5
  • 6. HTML5 Canvas element Tag similar to any other html tag The contents of the tag is rendered with JavaScript Context is an object used to render graphics inside the canvas element The context can be 2d or webgl (3d) 6
  • 7. HTML5 Canvas element Within canvas element you can draw lines, curves, polygons Line Quadratic curve Polygon 7
  • 8. http://www.html5canvastutorials.com/labs/html5-canvas-elastic-stars-with-kineticjs/ http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-brighten-or- darken-image-tutorial/ KineticJs offers the possibility to use build-in 2d elements such as cercles, rectangles, and other shapes . You can make these elements draggable, place them on different layers, apply transformation and styling features like scaling, shadowing etc. When you are working with images, filters are available for inverting colors, grayscaling and other similar effects. 8
  • 9. Multiple possibilities exist for animating elements: you can apply linear movement, oscillation movement, random direction movement, rotation based on mathematical formulas : http://www.html5canvastutorials.com/kineticjs/html5- canvas-all-easing-functions-with-kineticjs/ http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs- animate-position-tutorial/ You have the possibility to make elements move only within the boundaries of delimited area : http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-shapes- horizontally-or-vertically-tutorial/ 9
  • 10. Three.js Three.js is used to render 3d content with renderer object var renderer = new THREE.WebGLRenderer(); 3d objects are represented by meshes var plane = new THREE.Mesh(new THREE.PlaneGeometry(300, 300) Then Meshes are added to the scene scene.add(plane); Scene is then rendered with camera, orthographic and perspective var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000); http://www.html5canvastutorials.com/three/html5-canvas-webgl-plane-with-three-js/ 10
  • 11. Three.js Different lights are available such as spot light, point light, ambient light etc You apply different textures and materials to the meshes var material = new THREE.MeshPhongMaterial({color: 0xe4e4e4}); Very impressive results can be achieved when rendering complex shape object modeled with a 3d modeling program such as Blender. You can also give to the user the possibility to interact with the scene and modify dynamically the content of the scene. http://threejs.org/examples/webgl_materials_cubemap_balls_reflection.html http://carvisualizer.plus360degrees.com/threejs/ 11
  • 13. Find out more • On https://techblog.betclicgroup.com/
  • 14. About Betclic • Betclic Everest Group, one of the world leaders in online gaming, has a unique portfolio comprising various complementary international brands: Betclic, Everest Gaming, bet-at- home.com, Expekt… • Active in 100 countries with more than 12 million customers worldwide, the Group is committed to promoting secure and responsible gaming and is a member of several international professional associations including the EGBA (European Gaming and Betting Association) and the ESSA (European Sports Security Association). • Through our brands, Betclic Everest Group places expertise, technological know-how and security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion of our players.