CIS 467/602-01: Data Visualization

Similar documents
Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

ITNP43: HTML Lecture 4

Interactive Data Visualization for the Web Scott Murray

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Web Building Blocks. Joseph Gilbert User Experience Web Developer University of Virginia Library

FETAC Certificate in Multimedia Production. IBaT College Swords. FETAC Certificate in Multimedia Production Web Authoring Dreamweaver 3

Web Authoring CSS. Module Descriptor

Web Development 1 A4 Project Description Web Architecture

Contents. Downloading the Data Files Centering Page Elements... 6

Web Design and Databases WD: Class 7: HTML and CSS Part 3

Web Design Revision. AQA AS-Level Computing COMP2. 39 minutes. 39 marks. Page 1 of 17

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

{color:blue; font-size: 12px;}

Cascading Style Sheets (CSS)

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

ART 379 Web Design. HTML, XHTML & CSS: Introduction, 1-2

What is CSS? Official W3C standard for controlling presentation Style sheets rely on underlying markup structure

Selectors in Action LESSON 3

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

ICE: HTML, CSS, and Validation

Outline of CSS: Cascading Style Sheets

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Web Development I & II*

HTML TIPS FOR DESIGNING

HTML and CSS. Elliot Davies. April 10th,

JJY s Joomla 1.5 Template Design Tutorial:

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

Advanced Web Design. Zac Van Note.

Using Style Sheets for Consistency

HTML, CSS, XML, and XSL

Development Perspective: DIV and CSS HTML layout. Web Design. Lesson 2. Development Perspective: DIV/CSS

Script Handbook for Interactive Scientific Website Building

How to Properly Compose HTML Code : 1

Website Planning Checklist

Short notes on webpage programming languages

Web Design for Programmers. Brian Hogan NAPCS Slides and content 2008 Brian P. Hogan Do not reproduce in any form without permission

Creating a Resume Webpage with

Web Design with CSS and CSS3. Dr. Jan Stelovsky

How to code, test, and validate a web page

Last week we talked about creating your own tags: div tags and span tags. A div tag goes around other tags, e.g.,:

Cascading Style Sheet (CSS) Tutorial Using Notepad. Step by step instructions with full color screen shots

COMMONWEALTH OF PENNSYLVANIA DEPARTMENT S OF Human Services, INSURANCE, AND AGING

CST 150 Web Design I CSS Review - In-Class Lab

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Responsive Web Design Creative License

Web Design and Databases WD: Class 5: HTML and CSS Part 2

Introduction to XHTML. 2010, Robert K. Moniot 1

Web Publishing Basics 2

Fast track to HTML & CSS 101 (Web Design)

HTML5 and CSS3 Part 1: Using HTML and CSS to Create a Website Layout

WordPress and HTML Basics

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Web Design in Nvu Workbook 2

Introduction to Web Design Curriculum Sample

Mobile Web Site Style Guide

LAB MANUAL CS (22): Web Technology

Create Webpages using HTML and CSS

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

Style & Layout in the web: CSS and Bootstrap

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

Accessibility in e-learning. Accessible Content Authoring Practices

CS134 Web Site Design & Development. Quiz1

Campaign Guidelines and Best Practices

HTML5 and CSS3 Design with CSS Page 1

Cascading Style Sheets

JISIS and Web Technologies

MEAP Edition Manning Early Access Program D3.js in Action Version 5

WEB DEVELOPMENT IA & IB (893 & 894)

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

Introduction to Web Development

You can use percentages for both page elements and text. Ems are used for text,

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

^/ CS> KRIS. JAMSA, PhD, MBA. y» A- JONES & BARTLETT LEARNING

Level 1 - Clients and Markup

Lab 2: Visualization with d3.js

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Module 6 Web Page Concept and Design: Getting a Web Page Up and Running

Website Development. 2 Text. 2.1 Fonts. Terry Marris September We see how to format text and separate structure from content.

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

CSS - Cascading Style Sheets

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

WEB DESIGN COURSE CONTENT

Web layout guidelines for daughter sites of Scotland s Environment

Advanced Online Media Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

Website Login Integration

Single Page Web App Generator (SPWAG)

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE WEB EDITING

Web Authoring. Module Descriptor

Using HTML5 Pack for ADOBE ILLUSTRATOR CS5

Interactive Visualization

Creating the Surf Shop website Part3 REVISED

Web Designing with UI Designing

8 STEPS TO CODE KILLER RESPONSIVE S

IE Class Web Design Curriculum

Introduction to web development using XHTML and CSS. Lars Larsson. Today. Course introduction and information XHTML. CSS crash course.

Chapter 2 HTML Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

MCH Strategic Data Best Practices Review

HTML5 & CSS3. ( What about SharePoint? ) presented

Transcription:

CIS 467/602-01: Data Visualization HTML, CSS, SVG, (& JavaScript) Dr. David Koop

Assignment 1 Posted on the course web site Due Friday, Feb. 13 Get started soon! Submission information will be posted Useful reference: Interactive Data Visualization for the Web by Scott Murray mycourses Page Registration Issues? 2

Hyper Text Markup Language (HTML) Markup languages allow users to encode the semantics of text Tags define the boundaries of the structures of the content - Tags are enclosed in angle brackets (e.g. <html>) - Most of the time, you have a start and end tag - End tags are just like start tags except that they have forward slash after the open bracket (e.g. </html>) - Tags may be nested but not mismatched <p>a <strong><em>very</em></strong> cool example</p> <p>a <strong>very <em>cool</strong></em> example</p> - What about <img src= mypicture.png alt= My Image >? 3

HTML Elements and Attributes Tags denote elements of the content (e.g. sections, paragraphs, images) Each element may have attributes which define other information about the element - An attribute has a key and value (key= value ) - e.g. <img src= mypicture.png alt= My Image > Many different elements available - Common: headers (h1,, h6), paragraph (p), lists (ul, ol, li), emphasis (em, strong), link (a), spans & divisions (span, div) - Lots more (e.g. abbr): see MDN Documentation Many different attributes available - See MDN Documentation: note that some are legacy due to CSS 4

HTML Element Structure & Naming Elements structure a document - Document Object Model (DOM) - We can visualize this information - More importantly, we can navigate this tree Identifying and Classifying elements: id and class attributes - id identifies a single element use for a unique case - class may identify multiple elements use for common cases - Each element may have multiple classes, separate by spaces - Use normal identifiers: don t start the name with a number 5

Other HTML Trivia <, >, &, and " are special characters, escape with <, >, &, and " (note the semi-colon) Comments are enclosed by <!-- and > - <!-- This is a comment --> HTML Documents begin with a DOCTYPE declaration - For HTML5, this is easier <!DOCTYPE html> meta tag: <meta charset="utf-8"/> HTML has audio and video tags, math equation support, and more 6

Basic HTML File <!DOCTYPE html> <html> <head> <title>a Basic Web Page</title> </head> <body> <h1>my Wicked Awesome Web Page</h1> <p><em>this is <strong>cool</strong>. What about <u><strong>this?</strong></u></em></p> <img src="patriots.jpg"/> </body> </html> 7

How to write HTML Use a standard text editor Use a web site like jsfiddle, jsbox, etc. Use an IDE like WebStorm 8

Cascading Style Sheets (CSS) Separate from content, just specifies how to style the content Style information can appear in three places: - External file - In a style element at the beginning of the HTML file - In a specific element in the body of a document (least preferable) Why Cascading? - Don t want to have to specify everything over and over - Often want to use the same characteristics in a region of the DOM - Use inheritance: properties that apply to children cascade down 9

CSS Selectors How do we specify what part(s) of the page we want to style? The element types themselves (the HTML tag) - strong { color: red; } Classes of elements (ties to HTML class attribute) -.cool { color: blue; } A specific element (ties to HTML id attribute) - #main-section { color: green; } Relationships - Descendant: p em { color: yellow; } - Child: p > em { color: orange; } Pseudo-classes: a:hover { color: purple; } 10

Other CSS Bits Comments: /* This is a comment in CSS */ Grouping Selectors: p, li { font-size: 12pt; } Multiple Classes:.cool.temp { color: blue; } Colors: - Names (Level 1, 2, & 3): red, orange, antiquewhite - Dash notation (3- & 6-character): #fff, #00ff00 - Integer or % RGB and HSL Functions: rgb( 255, 0, 0), rgb(50%, 50%, 0%), hsl(120, 100% 50%) - Also background-color Watch out for multiple rules (look at how a web browser parses) Again, much more documentation at MDN 11

Sample CSS body { font-face: sans-serif; font-size: 12pt; } em { color: green; } em u { color: red; } em > strong { color: blue; } img { border: 4px solid red; } What colors are displayed for this HTML (with the above stylesheet)? - <em>this is <strong>cool</strong>. What about <u><strong>this?</strong></u></em> 12

How to add CSS to HTML External: a separate file via a link element (in the <head> section): - <link rel= stylesheet href= styles.css > Embedded: in the header: - <style type= text/css > </style> Inline: for a specific element: (Discouraged!) - <p style= font-weight: bold; >Some text</p> 13

Scalable Vector Graphics (SVG) Vector graphics vs. Raster graphics Drawing commands versus a grid of pixels Why vector graphics? Raster Vector 14

SVG Background Another markup language: - Describe the shapes and paths by their endpoints, characteristics SVG can be embedded into HTML5 documents! Pixel Coordinates: Top-left origin (0,0) (width,0) (width,height) 15

SVG Elements Drawing primitives: - Lines, Circles, Rects, Ellipses, Text, Polylines, Paths - Work by specifying information about how to draw the shape - Lots more: see MDN Documentation Ordering/Stacking: - SVG Elements are drawn in the order they are specified 16

SVG Grouping Very powerful, useful for animations and transformations <g> <circle /> <circle /> <circle /></g> Can add transforms to the group: - <g transform="translate(0, 50) scale(1, -1) > </g> [SVG Example, Scheidegger, 2015] 17

SVG Example <svg id="mysvg" width="400" height="300"> <circle cx="50" cy="50" r="50" style="fill:green; stroke:black; stroke-width:4px"/> <rect x="150" y="150" width="50" height="20" style="fill:red; stroke: blue; stroke-width: 2px;"/> <path d="m 200 10 L 300 10 L 300 50 Z" style="fill: none; stroke: red; stroke-width:3px; /> </svg> Note that the style is separate Paths are raw drawing commands (ever see Logo?) What does this look like? 18

SVG Styles Can specify styles via CSS, too <style type="text/css"> circle { fill: green; stroke: black; stroke-width: 4px; }.normal { fill: red; stroke: blue; stroke-width: 2px; } #p1 { fill: none; stroke: red; stroke-width: 3px; } </style> <svg id="mysvg" width="400" height="300"> <circle cx="50" cy="50" r="50"/> <rect class="normal" x="150" y="150" width="50" height="20"/> <path id="p1" d="m 200 10 L 300 10 L 300 50 Z"/> </svg> 19

JavaScript in one slide Interpreted and Dynamically-typed Programming Language Statements end with semi-colons, normal blocking Variables: var a = 0; Operators: +, -, *, /, [ ] Control Statements: if, else Loops: for, while, do-while Arrays: var a = [1,2,3]; a[99] = 100; console.log(a.length); Functions: function myfunction(a,b) { return a + b; } Objects: var obj; obj.x = 3; obj.y = 5; - Protoypes for instance functions Comments are /* Comment */ or // Single-line Comment 20

JavaScript: Interacting with the DOM window: global namespace document document.getelementbyid( ) 21

JavaScipt and SVG SVG can be navigated just like the DOM We can create SVG elements dynamically using JavaScript! Example: function addelttosvg(svg, name, attrs) { var element = document.createelementns( "http://www.w3.org/2000/svg", name); if (attrs === undefined) attrs = {}; for (var key in attrs) { element.setattributens(null, key, attrs[key]); } svg.appendchild(element); } mysvg = document.getelementbyid("mysvg"); addelttosvg(mysvg, "rect", {"x": 50, "y": 50, "width": 40,"height": 40, "fill": "blue"}); 22

Tools Text Editor Chrome DevTools MDN Documentation Web Environments (jsfiddle, jsbox) IDEs (e.g. WebStorm) 23