Visualizing Information with HTML5 @synodinos 35,000 years ago - - PowerPoint PPT Presentation

visualizing information with html5
SMART_READER_LITE
LIVE PREVIEW

Visualizing Information with HTML5 @synodinos 35,000 years ago - - PowerPoint PPT Presentation

Visualizing Information with HTML5 @synodinos 35,000 years ago Chauvet cave, southern France By far the oldest paintings ever discovered Hundreds of paintings At least 13 different species Viubk source @ImageThink Githubs Most Forked


slide-1
SLIDE 1

Visualizing Information with HTML5

@synodinos

slide-2
SLIDE 2

Chauvet cave, southern France 35,000 years ago

slide-3
SLIDE 3

By far the oldest paintings ever discovered

slide-4
SLIDE 4

At least 13 different species Hundreds of paintings

slide-5
SLIDE 5

Viubk

source @ImageThink

slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8

Github’s Most Forked

slide-9
SLIDE 9

Github’s Most Watched

slide-10
SLIDE 10

Why Visualize Data?

Understand relations Realize patterns Make sense of quantitative data Discover correlations between data sets Make “boring” data more appealing/engaging Maximum value, during short attention span

slide-11
SLIDE 11

CSS3

Backrounds & Borders Animations Transitions Transforms

slide-12
SLIDE 12

CSS3 Animations

#moves ¡{ ¡ ¡ ¡transition: ¡all ¡2s ¡ease-­‑out; ¡ } $('#moves').click(function() ¡{ ¡ ¡$('#moves').css({ ¡ ¡ ¡ ¡marginLeft:300 ¡ ¡}); });

Plain JS Animations

$('#moves').click(function() ¡{ ¡ ¡$('#moves').animate({ ¡ ¡ ¡ ¡marginLeft: ¡300, ¡ ¡}, ¡{ ¡ ¡ ¡ ¡ ¡duration: ¡2000, ¡ ¡ ¡ ¡ ¡easing: ¡"easeout" ¡ }, ¡function() ¡{ ¡ ¡ ¡ ¡console.log('Finished.') ¡ ¡}); });

slide-13
SLIDE 13

GPU Accelarated (potentially)

CSS3 transitions CSS3 3D transforms Canvas Drawing WebGL 3D Drawing

chrome://gpu/

slide-14
SLIDE 14

CSS3 Remote Demo

http://graphicpeel.com/cssiosicons

slide-15
SLIDE 15

SVG

XML format for 2D vector graphics Static, interactive or animated Google indexes SVG files Major browsers

  • ffer (varying)

support

Transformations Filter effects Alpha masks Template objects Clipping paths Interactivity (events)

slide-16
SLIDE 16

SVG Demo

[local demo]

slide-17
SLIDE 17

Canvas

Rendering of 2D shapes & images JS drawing funcs similar to

  • ther 2D APIs

Animation by redrawing Low level, procedural model

Basic lines & strokes Paths Pixel-based manipulation Scaling, rotation, transformations PNG representation as data URI Shadows, Gradients & Alpha transparancy Embedded Images

slide-18
SLIDE 18
  • Bitmap
  • Procedural
  • Only <canvas> accesible via DOM
  • Script
  • Developer friendly
  • Better performance
  • You redraw every pixel based on

timers and events

Canvas SVG

  • Vector
  • Declarative
  • Elements are identifiable via DOM
  • Inline
  • Designer friendly
  • Complexity -> slow rendering
  • “True” support for animations
slide-19
SLIDE 19

Canvas SVG

ctx.beginPath(); ctx.arc(centerX , centerY , radius , 0 , 2 * Math.PI , false); ctx.fillStyle = "red"; ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = "black"; ctx.stroke();

<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>

slide-20
SLIDE 20

Canvas Local Demo

[local demo]

slide-21
SLIDE 21

Canvas Remote Demo

http://browserquest.mozilla.org/

slide-22
SLIDE 22

WebGL

WebGL ctx instead of canvas 2D ctx Based on OpenGL ES JS API for 3D graphics JS control code + shader code (GPU) Access to 3D hardware Lots of 3rd- party libs

slide-23
SLIDE 23

WebGL Remote Demo

http://seeplan.bengler.no/planimator

slide-24
SLIDE 24

Raphaël

Shapes & paths

SVG

  • utput

JS vector graphics lib VML fallback

Gradients Transformations Animations Events

slide-25
SLIDE 25

Pure SVG Raphaël

<svg style="height="200" width="320"> <circle cx="50" cy="40" r="10" fill="#ff0000" stroke="#ffffff"> </circle> </svg>

var paper = Raphael(10, 50, 320, 200); var circle = paper.circle(50, 40, 10); circle.attr("fill", "#f00"); circle.attr("stroke", "#fff");

slide-26
SLIDE 26

Processing.js

Builds on Java but uses simplified syntax Port of the Processing visual programming lang Has a light-weight IDE (Java) Can combine Processing & JS Access DOM from Processing

slide-27
SLIDE 27

Processing.js modes

Programming Run Rendering

Basic: static images Continuous: loops, custom funcs, keyboard & mouse events Java: everything subclass of PApplet (not recommended) Import Processing code Compile Processing to JS Write pure JS 2D 3D PDF*

slide-28
SLIDE 28

Processing.js Dev Workflow

[local demo]

slide-29
SLIDE 29

Processing.js Remote Demos

http://sandropaganotti.com/wp- content/goodies/demos/twitter- stream/?q=2#pizza http://mattmckeon.com/facebook- privacy/

slide-30
SLIDE 30

D3.js

W3C Selectors API (Sizzle fallback)

Doesn’t directly bother with graphical representation* Binds data to DOM & then applies data-driven transforations Beautiful, ready to use layouts

Dynamic Properties Native Transitions Plugins You can still use CSS3, SVG, etc.

slide-31
SLIDE 31

D3.js Structure

[basic local demo]

slide-32
SLIDE 32

D3 Example #1: InfoQ Topics

Arbor.js vs. D3 Zoobable Partition Layout

slide-33
SLIDE 33

D3 Example #2: Chord Diagram

slide-34
SLIDE 34

D3.js Remote Demo

https://github.com/mbostock/d3/wiki/Gallery

slide-35
SLIDE 35

Fabric.js

Simple shapes & paths

Interactive object model

  • n top of Canvas

Scale, move, rotate, transform Dynamic manipulation of text Filters for images SVG -> Canvas parser Define classes Create/remove Obj Clone Obj Iterate over Obj Observe Obj Initialize Obj Serialize canvas into JSON string

slide-36
SLIDE 36

Fabric.js Structure

[local demo]

slide-37
SLIDE 37

Fabric.js Canvas

var myRect = new fabric.Rect({ width: 100, height: 50, fill: 'red', stroke: 'black' }); var canvas = new fabric.Canvas('my-canvas'); canvas.add(myRect); canvas.renderAll();

var canvas = document.getElementById('my-canvas'); var ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.rect(188, 50, 200, 100); ctx.fillStyle = 'red'; ctx.fill(); ctx.lineWidth = 5; ctx.strokeStyle = 'black'; ctx.stroke();

slide-38
SLIDE 38

Case Study

InfoQ Research: Community-driven insight into trends, behaviors and technologies

slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44

@synodinos

slide-45
SLIDE 45

Questions?

twitter.com/synodinos

slide-46
SLIDE 46

Yummy visualizations

Food as a means of data expression, aka edible diagrams:

http://data-cuisine.net/data-dishes/taste-of-migration/