visualizing information with html5
play

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


  1. Visualizing Information with HTML5 @synodinos

  2. 35,000 years ago Chauvet cave, southern France

  3. By far the oldest paintings ever discovered

  4. Hundreds of paintings At least 13 different species

  5. Viubk source @ImageThink

  6. Github’s Most Forked

  7. Github’s Most Watched

  8. 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

  9. Transitions CSS3 Backrounds Animations & Borders Transforms

  10. CSS3 Animations Plain JS Animations $('#moves').click(function() ¡{ #moves ¡{ ¡ ¡ ¡$('#moves').animate({ ¡ ¡transition: ¡all ¡2s ¡ease-­‑out; ¡ ¡ ¡ ¡ ¡marginLeft: ¡300, } ¡ ¡}, ¡{ ¡ ¡ ¡ ¡ ¡duration: ¡2000, ¡ ¡ ¡ ¡ ¡easing: ¡"easeout" ¡ }, ¡function() ¡{ $('#moves').click(function() ¡{ ¡ ¡ ¡ ¡console.log('Finished.') ¡ ¡$('#moves').css({ ¡ ¡}); ¡ ¡ ¡ ¡marginLeft:300 }); ¡ ¡}); });

  11. GPU Accelarated (potentially) CSS3 transitions CSS3 3D transforms Canvas Drawing WebGL 3D Drawing chrome://gpu/

  12. CSS3 Remote Demo http://graphicpeel.com/cssiosicons

  13. XML format for Transformations 2D vector graphics Filter effects Major browsers offer (varying) Alpha masks support SVG Template objects Static, interactive or animated Clipping paths Google indexes Interactivity (events) SVG files

  14. SVG Demo [local demo]

  15. Basic lines & strokes Rendering of 2D shapes & Paths images Pixel-based manipulation Low level, procedural Scaling, rotation, model Canvas transformations PNG representation JS drawing as data URI funcs similar to other 2D APIs Embedded Images Animation by Shadows, Gradients & redrawing Alpha transparancy

  16. Canvas SVG • Bitmap • Vector • Declarative • Procedural • Only <canvas> accesible via DOM • Elements are identifiable via DOM • Inline • Script • Designer friendly • Developer friendly • Complexity -> slow rendering • Better performance • “True” support for animations • You redraw every pixel based on timers and events

  17. Canvas SVG <circle ctx.beginPath(); ctx.arc(centerX cx="100" , centerY cy="50" , radius r="40" , 0 stroke="black" , 2 * Math.PI stroke-width="2" , false); fill="red"/> ctx.fillStyle = "red"; ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = "black"; ctx.stroke();

  18. Canvas Local Demo [local demo]

  19. Canvas Remote Demo http://browserquest.mozilla.org/

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

  21. WebGL Remote Demo http://seeplan.bengler.no/planimator

  22. JS vector Shapes & paths graphics lib Gradients Raphaël SVG Transformations output Animations VML Events fallback

  23. <svg style="height="200" width="320"> <circle cx="50" cy="40" r="10" fill="#ff0000" Pure SVG stroke="#ffffff"> </circle> </svg> var paper = Raphael(10, 50, 320, 200); Raphaël var circle = paper.circle(50, 40, 10); circle.attr("fill", "#f00"); circle.attr("stroke", "#fff");

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

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

  26. Processing.js Dev Workflow [local demo]

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

  28. Binds data to W3C Selectors DOM & then API (Sizzle applies data-driven fallback) transforations Dynamic Properties Doesn’t directly D3.js bother with Native graphical Transitions representation* Plugins You can still Beautiful, ready to use CSS3, use layouts SVG, etc.

  29. D3.js Structure [basic local demo]

  30. D3 Example #1: InfoQ Topics Arbor.js vs. D3 Zoobable Partition Layout

  31. D3 Example #2: Chord Diagram

  32. D3.js Remote Demo https://github.com/mbostock/d3/wiki/Gallery

  33. Define classes Observe Obj Interactive object model Create/remove Obj Iterate over Obj on top of Canvas Clone Obj Initialize Obj Fabric.js Simple shapes Scale, move, Dynamic & paths rotate, transform manipulation of text SVG -> Canvas Serialize canvas Filters for images parser into JSON string

  34. Fabric.js Structure [local demo]

  35. var myRect = new fabric.Rect({ width: 100, height: 50, fill: 'red', stroke: 'black' }); Fabric.js 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); Canvas ctx.fillStyle = 'red'; ctx.fill(); ctx.lineWidth = 5; ctx.strokeStyle = 'black'; ctx.stroke();

  36. Case Study InfoQ Research: Community-driven insight into trends, behaviors and technologies

  37. @synodinos

  38. Questions? twitter.com/ synodinos

  39. Yummy visualizations Food as a means of data expression, aka edible diagrams: http://data-cuisine.net/data-dishes/taste-of-migration/

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend