HTML5 Canvas
DATA VISUALISATION
Antonio Fabregat Mundo
Hinxton Services Forum
May 30, 2013
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Overview
•  Aim
•  Web technologies for rich graphics creation
•  Dealing with the data
•  CANVASing the data
•  Interactivity in Canvas
•  Animation in Canvas
•  Some tips
•  Examples
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Aim
•  Data visualisation
•  Interactivity
•  Animation
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Web technologies for rich graphics creation
CANVAS SVG
High performance 2D surface for drawing. Resolution independence.
Constant performance because everything is a pixel.
Performance only degrades when the image resolution increases.
SVG has very good support for animations.
Elements can be animated using a declarative syntax, or via JavaScript.
Resulting image into the Canvas can be saved as PNG or JPEG. Full control over each element using the SVG DOM API in JavaScript.
Best suited for generating raster graphics, editing of images, and operations
requiring pixel-level manipulation.
Accessibility to the SVG objects can be much better than that of canvas elements.
CANVAS SVG
No DOM nodes for the represented objects. Slow rendering when document complexity increases. A use case is a large dataset to
be represented as an image.
Animation to be implemented manually. SVG might not be suited by itself for applications like games. Perhaps the best choice
would be a Canvas + SVG combination
Poor text rendering capabilities. Difficulties exporting the resulting image.
Advantages
Disadvantages
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Web technologies for rich graphics creation
•  Canvas
•  Interactive image editing
•  Generating raster graphics
•  Image analysis
•  Rendering game graphics, such
as sprites and backgrounds
•  SVG
•  Resolution-independent Web
application user interfaces
•  Highly interactive animated user
interfaces
•  Data charts and plots
•  Vector image editing
Each technology has its own uses
It is not like one can abandon Canvas in favor of SVG, or vice-versa.
Which one to pick?
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Dealing with the data
Data acquisition
Web services providing raw data (XML or JSON format)
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Dealing with the data
Splitting the view from the model
MV* keeps data and representation separated
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
CANVASing the data
Client side image generation
Objects in the data model are drawn into the canvas
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
CANVASing the data
Graphical projection
Calculating where to draw every object
Depends on the available area and number of objects
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
CANVASing the data
Mouse position
Bijective function to determine hovered objects
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Interactivity in Canvas
•  Interactivity is not animation
•  Refreshing canvas when mouse over
•  How to improve behavior?
•  Render screen differences only
•  Back Buffer (redraw a gradient à 5 times faster)
•  Layered canvases
•  Important:
Refreshing more than 24 times per second?
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Animation in Canvas
Full redrawing
Every object drawer defines how to proceed for a certain percentage
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Some tips
Always update the model
Actions over the canvas directly modify the model
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Some tips
Precalculate as much as possible
Calculations that can be done once have to be moved out from the drawing methods
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Some tips
Discrete time slots
Response improvement
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Some tips
Refreshing only when needed
Checking basic user actions before refreshing saves time
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Examples
PRIDE - Protein coverage viewer
PRIDE - Sequence viewer
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
METABOLIGHTS – Spectrum viewer
Examples
PRIDE – Spectrum viewer
Data Visualisation using HTML5 Canvas
Hinxton Services Forum
May 30, 2013
Examples
REACTOME – Pathway Diagram
Thank you! J
fabregat@ebi.ac.uk

More Related Content

PDF
BIMserver release party (25 Januari 2011)
PDF
Visualizing Data with JavaScript and Canvas
PPTX
Trafikensverige.se
PPTX
Knowit study group örnsköldsvik - Introduction to microsoft azure websites
PDF
QGIS UK: QGIS and Cartography (OS)
PPTX
Really Fast HTML5 Game Development with CreateJS
PDF
Visualization of Big Data in Web Apps
PPTX
Html5 canvas
BIMserver release party (25 Januari 2011)
Visualizing Data with JavaScript and Canvas
Trafikensverige.se
Knowit study group örnsköldsvik - Introduction to microsoft azure websites
QGIS UK: QGIS and Cartography (OS)
Really Fast HTML5 Game Development with CreateJS
Visualization of Big Data in Web Apps
Html5 canvas

Similar to Data Visualisation using HTML5 Canvas (20)

PPTX
chapter 6 data visualization ppt.pptx
PDF
Easy HTML5 Data Visualization with Kendo UI DataViz
PDF
Mini-Training: DataViz, data-driven documents and D3.js
PPTX
introduction of HTML canvas and styles .pptx
PDF
Zeroth review presentation
PPTX
Easy charting with
PDF
datadrivengraph
PPTX
Academy PRO: D3, part 3
KEY
Data Visualization Strategies & Open Source Tools
PDF
Pro Data Visualization using R and JavaScript 1st Edition Tom Barker
PPTX
importance of Data-Visualization-in-Data-Science. for mba studnts
PPT
Canvas in html5 - TungVD
KEY
Graphing without flash
PPTX
Canvas Based Presentation - Zeroth Review
PPTX
Html5 data viz
PDF
Canvas based presentation
PPTX
Data Visualization
PDF
Second review presentation
PPTX
Esteem chartgraph
PPTX
Design Principles in Data Visualization and Tools
chapter 6 data visualization ppt.pptx
Easy HTML5 Data Visualization with Kendo UI DataViz
Mini-Training: DataViz, data-driven documents and D3.js
introduction of HTML canvas and styles .pptx
Zeroth review presentation
Easy charting with
datadrivengraph
Academy PRO: D3, part 3
Data Visualization Strategies & Open Source Tools
Pro Data Visualization using R and JavaScript 1st Edition Tom Barker
importance of Data-Visualization-in-Data-Science. for mba studnts
Canvas in html5 - TungVD
Graphing without flash
Canvas Based Presentation - Zeroth Review
Html5 data viz
Canvas based presentation
Data Visualization
Second review presentation
Esteem chartgraph
Design Principles in Data Visualization and Tools
Ad

Recently uploaded (20)

PPT
What is a Computer? Input Devices /output devices
PDF
Unlock new opportunities with location data.pdf
PDF
Five Habits of High-Impact Board Members
PPT
Geologic Time for studying geology for geologist
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
Hybrid model detection and classification of lung cancer
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
Tartificialntelligence_presentation.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Chapter 5: Probability Theory and Statistics
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
What is a Computer? Input Devices /output devices
Unlock new opportunities with location data.pdf
Five Habits of High-Impact Board Members
Geologic Time for studying geology for geologist
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
1 - Historical Antecedents, Social Consideration.pdf
STKI Israel Market Study 2025 version august
Hybrid model detection and classification of lung cancer
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Getting Started with Data Integration: FME Form 101
A contest of sentiment analysis: k-nearest neighbor versus neural network
NewMind AI Weekly Chronicles – August ’25 Week III
WOOl fibre morphology and structure.pdf for textiles
DP Operators-handbook-extract for the Mautical Institute
Tartificialntelligence_presentation.pptx
Enhancing emotion recognition model for a student engagement use case through...
Chapter 5: Probability Theory and Statistics
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Module 1.ppt Iot fundamentals and Architecture
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Ad

Data Visualisation using HTML5 Canvas

  • 1. HTML5 Canvas DATA VISUALISATION Antonio Fabregat Mundo Hinxton Services Forum May 30, 2013
  • 2. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Overview •  Aim •  Web technologies for rich graphics creation •  Dealing with the data •  CANVASing the data •  Interactivity in Canvas •  Animation in Canvas •  Some tips •  Examples
  • 3. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Aim •  Data visualisation •  Interactivity •  Animation
  • 4. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Web technologies for rich graphics creation CANVAS SVG High performance 2D surface for drawing. Resolution independence. Constant performance because everything is a pixel. Performance only degrades when the image resolution increases. SVG has very good support for animations. Elements can be animated using a declarative syntax, or via JavaScript. Resulting image into the Canvas can be saved as PNG or JPEG. Full control over each element using the SVG DOM API in JavaScript. Best suited for generating raster graphics, editing of images, and operations requiring pixel-level manipulation. Accessibility to the SVG objects can be much better than that of canvas elements. CANVAS SVG No DOM nodes for the represented objects. Slow rendering when document complexity increases. A use case is a large dataset to be represented as an image. Animation to be implemented manually. SVG might not be suited by itself for applications like games. Perhaps the best choice would be a Canvas + SVG combination Poor text rendering capabilities. Difficulties exporting the resulting image. Advantages Disadvantages
  • 5. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Web technologies for rich graphics creation •  Canvas •  Interactive image editing •  Generating raster graphics •  Image analysis •  Rendering game graphics, such as sprites and backgrounds •  SVG •  Resolution-independent Web application user interfaces •  Highly interactive animated user interfaces •  Data charts and plots •  Vector image editing Each technology has its own uses It is not like one can abandon Canvas in favor of SVG, or vice-versa. Which one to pick?
  • 6. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Dealing with the data Data acquisition Web services providing raw data (XML or JSON format)
  • 7. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Dealing with the data Splitting the view from the model MV* keeps data and representation separated
  • 8. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 CANVASing the data Client side image generation Objects in the data model are drawn into the canvas
  • 9. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 CANVASing the data Graphical projection Calculating where to draw every object Depends on the available area and number of objects
  • 10. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 CANVASing the data Mouse position Bijective function to determine hovered objects
  • 11. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Interactivity in Canvas •  Interactivity is not animation •  Refreshing canvas when mouse over •  How to improve behavior? •  Render screen differences only •  Back Buffer (redraw a gradient à 5 times faster) •  Layered canvases •  Important: Refreshing more than 24 times per second?
  • 12. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Animation in Canvas Full redrawing Every object drawer defines how to proceed for a certain percentage
  • 13. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Some tips Always update the model Actions over the canvas directly modify the model
  • 14. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Some tips Precalculate as much as possible Calculations that can be done once have to be moved out from the drawing methods
  • 15. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Some tips Discrete time slots Response improvement
  • 16. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Some tips Refreshing only when needed Checking basic user actions before refreshing saves time
  • 17. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Examples PRIDE - Protein coverage viewer PRIDE - Sequence viewer
  • 18. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 METABOLIGHTS – Spectrum viewer Examples PRIDE – Spectrum viewer
  • 19. Data Visualisation using HTML5 Canvas Hinxton Services Forum May 30, 2013 Examples REACTOME – Pathway Diagram