Lab 1: D3 Setup John Fallon

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

© 2011 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
© 2010 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
HTML and Web Page Design Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 2: Working with Webpage Files.
Getting Started with Dreamweaver
 Using Microsoft Expression Web you can: › Create Web pages and Web sites › Set what you site will look like as you design it › Add text, images, multimedia.
Unit 1 – Web Concepts Instructor: Brent Presley. ASSIGNMENT Read Chapter 1 Complete lab 1 – Installing Portable Apps.
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
Styling and theming Build campaigns in style. What we'll look at... How a web document is structured How HTML and CSS fit together Tools you will need.
The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file names. File names ARE.
Scripting Language A scripting language or script language is a programming language that supports the writing of scripts. The term script is typically.
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
Presented by Graduate Design Group 2 Meredith, Jennifer, Cammay and Diane.
C#.NETASP.NETJavaPHPJavaScript PerlPythonOthersLiverpool FCMotorsports.
Web Development 101 Presented by John Valance
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
Chapter 1 Getting Started With Dreamweaver. Exploring the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
Data Visualization Fall What D3 is? Fall 2015Data Visualization2 JavaScript library for manipulating documents based on data Data-Driven Documents.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
Web Scraping with Python and Selenium. What is Web Scraping?  Software technique for extracting info from websites Get information programmatically that.
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…
Firefox Extensions Mike Takahashi Office of Instructional Development.
Getting Started With HTML
Advanced HTML Tags:.
Getting Started with Dreamweaver
4.01 How Web Pages Work.
Web Basics: HTML/CSS/JavaScript What are they?
4.01 How Web Pages Work.
2.2 Internet Basics.
Objective % Select and utilize tools to design and develop websites.
Getting Started with CSS
Javascript and Dynamic Web Pages: Client Side Processing
Programming Web Pages with JavaScript
CS7026: Authoring for Digital Media HTML Authoring
Bare boned notes.
Active Server Pages Computer Science 40S.
Web Standards Web Design – Sec 2-3
Human Computer Interaction
Web Languages What Is a Web Page?
Bare bones notes.
بسم الله الرحمن الرحيم.
Web UI Basics ITM 352.
Web Standards Web Design – Sec 2-3
Objective % Select and utilize tools to design and develop websites.
Getting Started with Dreamweaver
Revision.
Web Languages What Is a Web Page?
Essentials of Web Pages
Tutorial 6 Creating Dynamic Pages
WEB PAGE AUTHORINHG AND DESIGNING
D3.js Tutorial (Hands on Session)
Getting Started with Dreamweaver
Secure Web Programming
Bare bones notes.
Javascript and JQuery SRM DSC.
D3.js Tutorial (Hands on Session)
Please bookmark your URL
Web Development 101 Workshop
4.01 How Web Pages Work.
Web Client Side Technologies Raneem Qaddoura
4.01 How Web Pages Work.
Murach's JavaScript and jQuery (3rd Ed.)
Web Application Development Using PHP
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Lab 1: D3 Setup John Fallon 1-25-2019 Data Visualization & Exploration – COMPSCI 590 Lab 1: D3 Setup John Fallon 1-25-2019

Lab 1 Goals Understand what D3 is Be able to locally run D3 code on your machine Get an example D3 visualization showing in the web browser

What is D3?

What is D3? D3.js is a JavaScript library for manipulating documents based on data. (https://d3js.org/) At it’s core, D3 is a graphics library for the web D3 is a targeted library – data visualization D3 visualizations can be embedded into any web page D3 Links: Homepage: https://d3js.org/ Github: https://github.com/d3/d3 Latest Online Release: https://d3js.org/d3.v5.min.js

D3 Live Examples D3 Examples page: https://github.com/d3/d3/wiki/Gallery Can there be more content on web page than just a D3 visualization? Does D3 support interaction? Can there be multiple D3 visualizations on one web page? Linked Visualization: http://bl.ocks.org/mattykuch/40ba19de703632ea2afbbc5156b9471f

Running D3 What does D3 require to run? A web browser D3 source code Valid HTML document Server Most people probably have a web browser D3 source code can be added to any HTML file by including: <script src="https://d3js.org/d3.v5.min.js"></script> Server: Can use a remote setup like: https://bl.ocks.org/ Host a local server

Remote Server – Using bl.ocks Bl.ocks.org is the website of Mike Bostock Mike Bostock is the creator and maintainer of D3 Bl.ocks.org can point to a Gist on Github Gist is a one off mini-repo Bl.ocks.org is an easy way to share your visualization on the web without having to worry about hosting Bl.ocks.org has a great collection of D3 examples alongside their code. Reference it! Another good resource: https://blockbuilder.org/

Local Server - Python Running D3 locally requires a server I recommend Python, since it is easy and straightforward Mac comes pre-installed with Python 2.7. Windows will need to install Python Python 2.X or 3.X will work, but there are different commands to run a server Install Python from: https://www.python.org/downloads/

Python Server Commands In a command prompt, make sure you are in the same directory as your D3 code and files. Then run the command: Python 2 server command: python -m SimpleHTTPServer 8000 Python 3 server command: python3 -m http.server 8000 The 8000 number is the port number. This number can be any non- conflicting number with already existing ports. 8000 is a typical testing port. Valid URL should be: http://localhost:8000

Is My Server Working? If the previous command worked, going to localhost:8000 should either produce: Directory Listing Webpage if an index.html was present Using the Lab 1 Files you should see…:

Server Success If you see the visualization on the localhost webpage, Congratulations! You’ve now successfully run a D3 visualization using your local environment If you want to explore further/debug the example try opening the Developer Tools in the web browser. (F12 in Chrome and Firefox)

Digging Into Starting D3 We will examine the bare bones needed to start D3 development In the Lab 1 Files, there is a file called: simple.html

Simple.html If we want our server to display that page in our browser we can go to: localhost:8000/simple.html We could also change simple.html to be called index.html, and our localhost:8000 will default to that page Key components of this file: Valid HTML Included script tag for D3 source

Javascript Console Let’s test using D3 live: d3.select("body").append("p"); D3 Select The D3.js Select method uses CSS3 selectors to grab DOM elements D3 looks at the document and selects the first descendant DOM element that contains the tag body Once an element is selected, D3.js allows you to apply operators to the element you have selected These operators can get or set things like "attributes", "properties", "styles", "HTML", and "text content“ D3 Append The Append Operator appends a new element as the last child of the element in the current selection Since our current selection was d3.select("body"), the append operator added the "p" element last.

Questions? For Next Time… Playing around with SVG elements Start talking about groups for the term project Teams should have Undergraduates and Graduates Questions?