Exercise 1 Modify some parameters in the histogram.js and see what would happen (one by one) 20 in Line 2  50 960 in Line 3  500 .1 in Line 15  .9.

Slides:



Advertisements
Similar presentations
Creating & Editing Tables Keyboarding 1A. To Create a Table: From the Menu Bar, select Table select Insert select Table Type in the number of columns.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
PowerPoint Scavenger Hunt Lauren Davis EDTD 3011 A Summer 2007.
Creating a Histogram using the Histogram Function.
UNESCO ICTLIP Module 4. Lesson 3 Database Design, and Information Storage and Retrieval Lesson 3. Information storage and retrieval using WinISIS.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Creating a Bar Chart On a Mac. Frequency Distribution Create a frequency distribution based on the classes Refer to creating a frequency distribution.
Creating a Bar Chart. Create a frequency distribution based on the classes.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are.
Introduction to TouchDevelop
THE BIG PICTURE. How does JavaScript interact with the browser?
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
Review For Test Chapter 4 & 5 Test is Wednesday, January 27th.
Animation & Effects Using JQuery. What is jQuery? jQuery is a lightweight, JavaScript library. The purpose of jQuery is to make it much easier to use.
PHP Form Introduction Getting User Information Text Input.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 12.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
How to Use Google Charts. Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 13.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
School of Computing and Information Systems RIA Animation, part I.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
Browser Compatibility Testing, using different browsers Conditional Statements.
Day 26 Arrays Episode 2. Array Lengths To determine the length of an array, use the command: array_Name.length.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
Creating a Google Site For a Digital Portfolio Purpose.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Example #7 Influence of core gap on the winding losses.
THE MOUSE Left Click THE MOUSE Right Click.
Histogram The data must be in Frequency Distribution (see presentation if needed) form for Excel to draw a histogram Make your Frequency Distribution active.
Dive Into® Visual Basic 2010 Express
Event-Driven Programming
Programming Web Pages with JavaScript
What is a Function Expression?
How to work with your sprite
Event loops 16-Jun-18.
WORKSHOP 9 BRAKE SYSTEM II
MANAGEMENT OF DASHBOARD MODELS
Microsoft Excel Chapter 3.
Microsoft Excel.
Web Development & Design Foundations with HTML5 7th Edition
Chrome Developer Tools
Introduction to Programming the WWW I
JavaScript and Events.
CIS 407 STUDY Lessons in Excellence-- cis407study.com.
Introduction to D3.js and Bar Chart in D3.js
Teacher Functions.
Parallel Coordinates and Scatter Plots
Your 1st Programming Assignment
Event Driven Programming & User Defined Functions
Lesson 17: Building an App: Canvas Painter
Event loops.
© 2015, Mike Murach & Associates, Inc.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Web Design and Development
Moving the Insertion Point
Event loops 8-Apr-19.
How to debug a website using IE F12 tools
Event loops.
Experiment #2 Resistor Statistics
Event loops 19-Aug-19.
[Zhu Chapter 7, Murray Chapter 11]
Presentation transcript:

Exercise 1 Modify some parameters in the histogram.js and see what would happen (one by one) 20 in Line 2  50 960 in Line 3  500 .1 in Line 15  .9 “height - y(d.value)” in Line 55 10 Change the column name in data.tsv value  number How to fix the problem?

Mouse Events in JS and Array Sorting

User Interaction Events What event happened and on what element? Keyboard, mouse events What event happened and on what element? General approach Specify which element can respond to an event Define what event to respond Define how to respond

Example http://www.w3schools.com/js/tryit.asp?filename=t ryjs_events_srcelement http://tutorials.jenkov.com/svg/scripting.html

In Our Case The element to respond event: SVG What event to respond: mouse click (mousedown) What to do: sort the data and redraw the chart Add this statement before the function type()

Exercise 2 Check the outputs and figure out how to obtain the x and y coordinates Modify the JS codes so that only responding clicking the areas left to Y or below X axis. Modify the JS codes so that bar color changes when the cursor is in and out.

Sorting Array Data in JavaScript See some examples http://www.w3schools.com/jsref/jsref_sort.asp

Exercise 3 Add three statements into JS codes. before the function to read data file. after the data file is read Reload the page and type the statements in the Console Check the values of arrays in the console (one by one)

More Tips for the Assignment Redraw the chart after sorting the array To redraw the chart, previous bars and axes have to be deleted.