A JavaScript Framework for Presentations and Animations on Computer Science

Similar documents
Web Development for Dinosaurs An Introduction to Modern Web Development

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Course 20480: Programming in HTML5 with JavaScript and CSS3

Index LICENSED PRODUCT NOT FOR RESALE

Frontend UI Training. Whats App :

Jim Jackson II Ian Gilman

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

Visual HTML5. Human Information Interaction for Knowledge Extraction, Interaction, Utilization, Decision making HI-I-KEIUD

Modern Web Application Development. Sam Hogarth

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

Content Visualization Issues

Programming in HTML5 with JavaScript and CSS3

HTML5 in Action ROB CROWTHER JOE LENNON ASH BLUE GREG WANISH MANNING SHELTER ISLAND

mgwt Cross platform development with Java

Pro ios Design and. Development. HTML5, CSS3, and JavaScript with Safari. Andrea Picchi. Apress*

grabattention The jquery Plug-in

Full Stack boot camp

HTML5 MOCK TEST HTML5 MOCK TEST I

Scalable Vector Graphics: SVG. The Little-Known Treasure of Document Viewing

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

Visualizing Information with

Webpack 2 The last bundler you would need in Vijay Dharap, Principal Architect, Infosys

Cisco Spark Widgets Technical drill down

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

Microsoft Programming in HTML5 with JavaScript and CSS3

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Programming in HTML5 with JavaScript and CSS3

Xerte. Guide to making responsive webpages with Bootstrap

Understanding the Web Design Environment. Principles of Web Design, Third Edition

IGME-330. Rich Media Web Application Development I Week 1

JavaScript Fundamentals_

EPHP a tool for learning the basics of PHP development. Nick Whitelegg School of Media Arts and Technology Southampton Solent University

Translating HornlogEq RuleML to Grailog for SVG Visualization. Leah Bidlake RuleML Webinar June 20, 2016

20480B: Programming in HTML5 with JavaScript and CSS3

An Automatic Internationalization and Localization Mechanism for Web Applications

HTML, XHTML, and CSS. Sixth Edition. Chapter 1. Introduction to HTML, XHTML, and

Introduction to Sencha Ext JS

Learn Web Development CodersTrust Polska course outline. Hello CodersTrust! Unit 1. HTML Structuring the Web Prerequisites Learning pathway.

Mobile Web Appplications Development with HTML5

Adventures with BaseX and web applications. Andy Feb 2013

Certificate in Web Designing

<Insert Picture Here> JavaFX Overview April 2010

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox

Index. Bootstrap framework ASP.NET MVC project set-up, default template, 223

React(.js) the Domino Way High-Performance Client for Domino. Knut Herrmann

DYNAMIC MATHEMATICS WITH GEONExT: NEW CONCEPTS

State of jquery Fall John Resig

Developer's HTML5. Cookbook. AAddison-Wesley. Chuck Hudson. Tom Leadbetter. Upper Saddle River, NJ Boston Indianapolis San Francisco

Homework 8: Ajax, JSON and Responsive Design Travel and Entertainment Search (Bootstrap/Angular/AJAX/JSON/jQuery /Cloud Exercise)

The Economist Apps. Advertising Specs

Tizen Framework (Tizen Ver. 2.3)

20480B - Version: 1. Programming in HTML5 with JavaScript and CSS3

WME MathEdit. An initial report on the WME tool for creating & editing mathematics. by K. Cem Karadeniz

Offline-first PWA con Firebase y Vue.js

Internet: An international network of connected computers. The purpose of connecting computers together, of course, is to share information.

Data Visualization on the Web with D3

Technical Architecture & Analysis

Qiufeng Zhu Advanced User Interface Spring 2017

CS474 MULTIMEDIA TECHNOLOGY

Etanova Enterprise Solutions

Extending Blue Ocean Keith Zantow

Platform-Independent UI Models: Extraction from UI Prototypes and rendering as W3C Web Components

Introduction to WEB PROGRAMMING

JSN EasySlider Configuration Manual

Webpack. What is Webpack? APPENDIX A. n n n

Web Design. Basic Concepts

When learning coding, be brave

Stencil: The Time for Vanilla Web Components has Arrived

MS_ Programming in HTML5 with JavaScript and CSS3.

Lecture Topic Projects

Lesson 5: Multimedia on the Web

Server-Side Graphics

The World In. Advertising specs

Table of contents. Sliding Panels DMXzone.com

WebKit ; FOR : DUMMIES. by Chris Minnick WILEY. John Wiley & Sons, Inc.

Charts Data Importer

welcome to BOILERCAMP HOW TO WEB DEV

Web Performance in

Manual Html Image Src Url Path Not Working

INF5750. Introduction to JavaScript and Node.js

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

CTI Short Learning Programme in Internet Development Specialist

State of the Open Web. Brad Neuberg, Google

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

HTML5 - INTERVIEW QUESTIONS

DICOM Structured Reporting: Implementation Experience

WebGL. Announcements. WebGL for Graphics Developers. WebGL for Web Developers. Homework 5 due Monday, 04/16. Final on Tuesday, 05/01

Linux desktop app guide Documentation. Thomas Kluyver & contributors

1. Setup a root folder for the website 2. Create a wireframe 3. Add content 4. Create hyperlinks between pages and to external websites

Ten interesting features of Google s Angular Project

Creating An MP3 Player With HTML5 By Mark Lassoff READ ONLINE


CTI Higher Certificate in Information Systems (Internet Development)

The Economist Apps. Advertising specs

Taking Fireworks Template and Applying it to Dreamweaver

A Closer Look at XPages in IBM Lotus Domino Designer 8.5 Ray Chan Advisory I/T Specialist Lotus, IBM Software Group

Web Architecture Review Sheet

HTML5 and CSS3: New Markup & Styles for the Emerging Web. Jason Clark Head of Digital Access & Web Services Montana State University Library

Exam : 9A Title : Adobe GoLive CS2 ACE Exam. Version : DEMO

Transcription:

A JavaScript Framework for Presentations and Animations on Computer Science Laszlo Korte Bachelor Thesis Technical Aspects of Multimodal Systems Department of Informatics University of Hamburg 1 / 76

Outline 1. Introduction 2. Web Platform The Browser NodeJS Workflow Graphical User Interface 3. Components Demos 4. Architecture 2 / 76

Introduction Motivation 3 / 76

Motivation Computer Science deals with abstract topics Hard to grasp without trying Short feedback cycle for building intuition Interactive learning experience 4 / 76

Matlab Components Boolean expression parsing and evaluation Binary number encoding and decoding Finate-state machine simulation Algorithm visualisation 5 / 76

Matlab Components - FSM finite-state machine simulator 6 / 76

Matlab Components - number encoding number circle 7 / 76

Matlab Components - base conversion visualisation of an algorithm for base conversion 8 / 76

Java Applets Karnaugh map editor Advanced FSM editor 9 / 76

Java Applets - Karnaugh map Karnaugh map editor 10 / 76

Java Applets - Karnaugh map Karnaugh map editor 11 / 76

Java Applets - FSM Finite-state machine editor 12 / 76

Java Applets - FSM Finite-state machine editor 13 / 76

Issues Matlab Not free, licensing restrictions Not trouble-free with current Matlab version Not on mobile devices 14 / 76

Issues Matlab Not free, licensing restrictions Not trouble-free with current Matlab version Not on mobile devices Java Applets Not on ios (ipad, iphone) Not usable on touch screens 15 / 76

Introduction Objective 16 / 76

Objective A new collection of components no licensing issues not limitted to a small set of devices The web as free and open platform Touch screen support Support a wide range of screen sizes 17 / 76

Objective - components Karnaugh map editor Finite-state machine editor Boolean expression editor Number circle... Expandable later on 18 / 76

Web Platform The Browser 19 / 76

The Browser Display HyperText Markup Language Documents (HTML) Documents can be styled via Stylehsheets (CSS) Documents may contain code to execute (JavaScript) 20 / 76

The Browser - example HTML document index.html 21 / 76

The Browser - example HTML document index.html 22 / 76

+ CSS index.html 23 / 76

+ CSS index.html 24 / 76

+ JS index.html 25 / 76

+ JS index.html 26 / 76

+ JS index.html 27 / 76

+ JS index.html 28 / 76

+ JS index.html 29 / 76

The Browser - example document index.html 30 / 76

The Browser HTML Document is the entry point links to/embeds stylesheets links to/embeds javascripts Most of the application is defined in JavaScript (JS) start with an almost empty document, build everything in JS 31 / 76

The Browser - Document Object Model DOM API allows querying and modifying the whole document 32 / 76

The Browser - JavaScript No module system difficult to split application into modules No static type system Weird semantics 5 + "5" === "55" 5 * "5" === 25 API differences across browsers 33 / 76

Web Platform NodeJS 34 / 76

NodeJS Source: https://nodejs.org/en/about/resources/ JavaScript runtime environment Based on Chrome s JavaScript engine V8 Run JavaScript outside the browser Large ecosystem of open source libraries and tools 35 / 76

NodeJS - Package Manager Source: https://www.npmjs.com/ Command line tool for managing dependencies Like maven for Java or easy_install for python Access to >250.000 libraries 36 / 76

Web Platform Workflow 37 / 76

Workflow - Tools Babel Logo: https://github.com/babel/babel ESLint Logo: http://eslint.org/ Webpack Logo: https://webpack.github.io/ BabelJS Access to future JS features (eg. module system) ESLint Check source code for common errors Webpack Module bundler combine multiple JS files and libraries into one file 38 / 76

Workflow - Babel Source: https://github.com/babel/babel ES6 module import syntax 39 / 76

Workflow - Tools modulea.js vendor/libx moduleb.js main.js 40 / 76

Workflow - ESLint Source: http://eslint.org/ modulea.js moduleb.js main.js 41 / 76

Workflow - Webpack Source: https://webpack.github.io/ modulea.js moduleb.js bundle application.js main.js 42 / 76

Workflow - Webpack layout.css moduleb.css Source: https://webpack.github.io/ modulea.js style.css application.js moduleb.js bundle main.js application.css 43 / 76

Workflow - Webpack Dev Server 44 / 76

Workflow - Webpack Dev Server No manual recompile Watches the file system for changes Pushes changes to browser (via websocket) 45 / 76

Workflow - Webpack Dev Server No manual recompile Watches the file system for changes Pushes changes to browser (via websocket) connect modulea.js watch Dev Server main.js notify browser http://127.0.0.1:3000 moduleb.js file system 46 / 76

Web Platform Graphical User Interface 47 / 76

GUI - Graphical User Interface JavaScript provides multiple APIs for building GUIs HTML / CSS Canvas (2D bitmap) Scalable Vector Graphics (SVG) 48 / 76

GUI - HTML / CSS Layout calculations are done by the browser text wrapping, adjusting height of elements Native support for responsive layouts API for user interactions Only rectangular shapes 49 / 76

GUI - Canvas (2D Bitmap) Fine grained control on a pixel level All kinds of shapes (arcs, bézier curves ) Hard to support multiple screen sizes Hittesting needs to be done manually 50 / 76

GUI - Scalable Vector Graphics (SVG) XML based format for vector graphics Embeddable into HTML All kinds of shapes (arcs, bézier curves ) Support for Stylesheets API for user interactions (event handling) sharp on all display sizes Manual layout (text wrapping, element height) 51 / 76

GUI HTML / CSS for base layout SVG for advanced visualisations and icons no Canvas 52 / 76

Components Demo Logic expression editor Logic expression checker Karnaugh map editor LED editor Number circle FSM editor https://thesis.laszlokorte.de/ 53 / 76

Demo - Logic expression editor Parse boolean expression In various dialects Generate a function table Generate an operator tree Color branches Enter multiple expressions thesis.laszlokorte.de/demo/logic-editor.html 54 / 76

Demo - Logic expression editor - Details Expressions are parsed by PEG.js via parsing expression grammar Tree is drawn via Buchheim algorithm (C. Buchheim, M. J Unger, and S. Leipert. Improving Walker's algorithm to run in linear time.) Labelled expressions are sorted topologically 55 / 76

Demo - Logic expression checker Simplified GUI for comparing two expressions Highlight differences in function table thesis.laszlokorte.de/demo/logic-checker.html 56 / 76

Demo - Karnaugh map editor Create Karnaugh maps of various sizes Creating loops on a touch screen Show Programmable Logic Array Import and export expressions thesis.laszlokorte.de/demo/kvd-editor.html 57 / 76

Demo - Karnaugh map editor - details PLA view is it s own component 58 / 76

Demo - LED editor Build function tables for 7-segment display or other displays thesis.laszlokorte.de/demo/led-editor.html 59 / 76

Demo - Number circle Arrange binary numbers in a circle Adjusting the circle size Compare various encodings Highlight overflows thesis.laszlokorte.de/demo/number-circle.html 60 / 76

Demo - Finite-state machine editor Edit Moore and Mealy machines Edit transition graph Not yet implemented: Accept logic expressions as transition conditions simulating the machine thesis.laszlokorte.de/demo/fsm-editor.html 61 / 76

Architecture 62 / 76

Architecture Based on Functional Reactive Programming Each component is a pure function, that transforms input to output Components do not modify any outside state inspired by Cycle.js library Source: http://cycle.js.org 63 / 76

Architecture - Functional Reactive Programming Events and state are modelled as streams Streams represent data over time A component takes stream of events (clicks, key presses ) as input A component produces a stream of state (document state) as output 64 / 76

Architecture - Functional Reactive Programming Stream<KeyPress> Stream<MouseClick> Logic Expression Field Stream<DocumentTree> Stream<AbstrSyntaxTree> 65 / 76

Architecture - Functional Reactive Programming time 23 16 42 8 filter((x) => x > 20) 23 42 66 / 76

Architecture - Functional Reactive Programming time 23 16 42 8 map((x) => x * 2) 46 32 84 16 67 / 76

Architecture - Functional Reactive Programming time 23 16 42 8 scan((acc, x) => acc + x, 0) 23 39 81 89 68 / 76

Architecture - Functional Reactive Programming many more operators available (reactivex.io) The whole GUI is built via stream transformation especially drag-drop and touch gestures are easy to build on top of event streams 69 / 76

Conclusion 70 / 76

Conclusion Componenents work across all major browsers: Chrome, Firefox, Opera, Safari, IE11, Edge usable on various screen sizes (sharp on retina screens) usable on touch screens 71 / 76

Conclusion Stats: ~12.000 lines of JavaScript 217 JavaScript files 610 Git Commits 72 / 76

Conclusion Potential improvements: Performance could be improved Printing support would be nice eg. export expression tree or function table as PDF Expression parser via command line Splitting component into separate projects 73 / 76

Conclusion Potential improvements (Cont.): Output file size could be further reduced by tree shaking vendor libraries currently ~500KB for Karnaugh maps For long term maintanance use a stronger language than JavaScript eg. PureScript or TypeScript 74 / 76

Conclusion Potential improvements (Cont.): No animations yet! easy to built via stream transformation or CSS animations 75 / 76

Thank you for your attention! Questions? Web Platform The Browser NodeJS, NPM Workflow (Babel, ESLint, Webpack) Graphical User Interface (HTML, Canvas, SVG) Components Logic Expression editor/checker Karnaugh Maps LED editor Number Circle FSM editor Architecture 76 / 76

Bonus - Karnaugh map recursion 77 / 76

Bonus - Karnaugh map recursion (Cont.) 78 / 76

Bonus - Karnaugh map recursion (Cont. 2) 79 / 76

Bonus - Karnaugh map drag- n-drop 80 / 76

Bonus - Karnaugh map layout #1 81 / 76

Bonus - Karnaugh map layout #2 82 / 76

Bonus - Karnaugh map layout #3 a 83 / 76

Bonus - Karnaugh map layout #3 b 84 / 76