Data Visualization Fall 2015. What D3 is? Fall 2015Data Visualization2 JavaScript library for manipulating documents based on data Data-Driven Documents.

Slides:



Advertisements
Similar presentations
Molecular Biomedical Informatics Web Programming 1.
Advertisements

Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Review CSS.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
1 Dynamic HTML and Cascading Style Sheets (CSS) Dynamic HTML and Cascading Style Sheets (CSS) Electronic Commerce Prof. Sheizaf Rafaeli.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Learning & Development Telerik Software Academy.
Understanding CSS Essentials: Content Flow, Positioning, and Styling
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
UFCEWT-20-3 Advanced Topics in Web Development Lecture 4 : JavaScript, Browsers & the HTML DOM-API.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
CITS1231 Web Technologies JavaScript and Document Object Model.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
CM143Web Week 8 Review of Assignment 1 Revision & Elaboration.
WRT235: Writing in Electronic Environments Basic CSS.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
A Quick Introduction to d3.js & Reusable Charts Adam Pere Olin College, November 11 th 2014
Web Development 101 Presented by John Valance
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Browser scripting jQuery Edited by: Trần Thị Mỹ Dung Ref:w3schools.com.
LAB 03: VISUALIZATION WITH D3 September 30, 2015 SDS 235 Visual Analytics.
Data-Driven Document BY SIMA MEHRI. Voronoi Diagram
Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Introduction to jQuery. 2 Objectives When you complete this chapter, you will be able to: Select elements using jQuery syntax Use built-in jQuery functions.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
 An HTML, CSS, Javascript framework you can use as a basis for creating web sites  Uses CSS settings, fundamental HTML elements styled and enhanced.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
JQUERY AND AJAX
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
1 The Document Object Model. 2 Objectives You will be able to: Describe the structure of the W3C Document Object Model, or DOM. Use JavaScript to access.
Web Basics: HTML/CSS/JavaScript What are they?
HTML Elements with JavaScript and DOM Events
Programming Web Pages with JavaScript
SVG & DOM Manipulation via Javascript
Lab 03: Visualization with d3
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Human Computer Interaction
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
Cascading Style Sheets
Cascading Style Sheets (Layout)
Application with Cross-Platform GUI
Dynamic HTML.
Revision.
Lab 04: Interactive Visualization W/ d3
Introduction to D3.js and Bar Chart in D3.js
Skills learned in Lab 1 Web GUI framework HTML tags and attributes
JQuery with ASP.NET.
Cascading Style Sheets (Introduction)
Cascading Style Sheets (Introduction)
D3.js Tutorial (Hands on Session)
Some Stuff You Need to Know
D3.js Tutorial (Hands on Session)
Web Programming and Design
Lab 1: D3 Setup John Fallon
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Data Visualization Fall 2015

What D3 is? Fall 2015Data Visualization2 JavaScript library for manipulating documents based on data Data-Driven Documents (D3) Visualizing Data with commnon Web standards: HTML, CSS, SVG Constructing the DOM from Data Each data point has a corresponding element

What D3 is not? Fall 2015Data Visualization3 Not a chart library; it is a visualization library Not a compatibility layer Not only about SVG, HTML, or Canvas

Selection Fall 2015Data Visualization4 Modifying documents using W3C DOM API is tedious: var paragraphs = document.getElementsByTagName("p"); for (var i = 0; i < paragraphs.length; i++) { var paragraph = paragraphs.item(i); paragraph.style.setProperty("color", "white", null); }

Selection Fall 2015Data Visualization5 D3 employs a declarative approach: Operating on arbitrary sets of nodes: d3.selectAll("p").style("color", "white"); Manipulating individual nodes: d3.select("body").style("background-color", "black");

Selection Fall 2015Data Visualization6 D3 uses CSS Selectors Single selector #foo // foo //.foo // [foo=bar] // foo bar // Multiple selectors: foo.bar // foo#bar //

Select and Modifiy Element Properties Fall 2015Data Visualization7 var svg = d3.select("svg"); var rect = svg.select("rect"); rect.attr("width", 100); rect.attr("height", 100); rect.style("fill", "steelblue"); svg.select("rect").attr("width", 100).attr("height", 100).style("fill", "steelblue"); d3.select("svg").select("rect").attr({ "width": 100, "height": 100 }).style({ "fill": "steelblue" });

Transitions Fall 2015Data Visualization8 var svg = d3.select("svg"); svg.selectAll("rect").data([127, 61, 256]).transition().duration(1500) // 1.5 second.attr("x", 0).attr("y", function(d,i) { return i*90+50; }).attr("width", function(d,i) { return d; }).attr("height", 20).style("fill", "steelblue");

D3 Setup Fall 2015Data Visualization9 Create a new folder for your project Within that folder create a subfolder called d3 Download the latest version of D3 into that subfolder and decompress the ZIP file (notice both the minified and standard version) Or, download entire repository: Or, to link directly to the latest release, copy this snippet:

D3 Setup Fall 2015Data Visualization10 Create a simple HTML page within project folder named index.html: D3 Page Template // TODO

D3 Setup Fall 2015Data Visualization11 Running a Python mini web server: Python 2.x: python –m SimpleHTTPServer 8080 Python 3.x: python –m http.server 8080 You should get: [02/Dec/ :58:35] "GET / HTTP/1.1" [02/Dec/ :58:35] "GET /d3/d3.js HTTP/1.1" 200 -