Reading ROOT files in any browser ROOT I/O IN JAVASCRIPT Bertrand Bellenot CERN, PH-SFT.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

A Toolbox for Blackboard Tim Roberts
The GridBee Web Computing Framework Attila Szarvas BME IK 2012.
Web Visualization Technology Horner APG Ver 1.0.
SOFTWARE PRESENTATION ODMS (OPEN SOURCE DOCUMENT MANAGEMENT SYSTEM)
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Software to Manage EEP Vegetation Plot Data A design proposal Michael Lee January 31, 2011.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Servlets and a little bit of Web Services Russell Beale.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
From legacy desktop application to Single Page Application By Jens Munk Freelance consultant.
The OWASP Foundation Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under.
Development of mobile applications using PhoneGap and HTML 5
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Presented by…. Group 2 1. Programming language 2Introduction.
Bertrand Bellenot root.cern.ch ROOT I/O in JavaScript Reading ROOT files from any web browser ROOT Users Workshop
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Drag and Drop Display and Builder. Timofei B. Bolshakov, Andrey D. Petrov FermiLab.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
JavaScript ROOT Bertrand Bellenot (CERN) Sergey Linev (GSI)
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Linking electronic documents and standardisation of URL’s What can libraries do to enhance dynamic linking and bring related information within a distance.
Experiences, limitations and suggested improvements The ALICE DQM Software and ROOT ROOT Users Workshop Barthelemy von Haller & Adriana Telesca for the.
Axel Naumann University of Nijmegen / NIKHEF, NL ROOT 2004 Users Workshop The Future of THtml Plans and Status of ROOT’s documentation facility.
Are you getting the benefits from ASP.NET and AJAX? Introduction to the CTC ASP.NET Webforms Generator.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
THttpServer for ROOT Bertrand Bellenot, CERN Sergey Linev, GSI Darmstadt
What is Web Site Administration Tool ? WAT Allow you to Configure Web Site With Simple Interface –Manage Users –Manage Roles –Manage Access Rules.
CHEP 2013, Amsterdam Reading ROOT files in a browser ROOT I/O IN JAVASCRIPT B. Bellenot, CERN, PH-SFT B. Linev, GSI, CS-EE.
H.G.Essel: Go4 - J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel, S.Linev CHEP 2003 GSI Online Offline Object Oriented Go4.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
RIA and Web2.0 Development with no Coding Juan Camilo Ruiz Senior Product Manager Development Tools.
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
ROOT I/O in JavaScript Browsing ROOT Files on the Web For more information see: For any questions please use following address:
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Web-based Access to ROOT at D-Zero Joel Snow Langston University/D0 Collaboration CHEP 2001 Displaying histograms dynamically generated by ROOT in a Web.
Overview of Servlets and JSP
Web-based Access to ROOT at D-Zero Joel Snow Langston University/D0 Collaboration ROOT 2001 Displaying histograms generated by ROOT in a Web BrowserDisplaying.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
LCG AA Meeting 31 October 2007 The new dynamically and extensively customizable ROOT browser Bertrand Bellenot.
IE Developer Tools Jonathan Seitel Program Manager.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Reading ROOT files in (almost) any browser.  Use XMLHttpRequest JavaScript class to perform the HTTP HEAD and GET requests  This class is highly browser.
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
GROUP PresentsPresents. WEB CRAWLER A visualization of links in the World Wide Web Software Engineering C Semester Two Massey University - Palmerston.
WebScan: Implementing QueryServer 2.0 Karl Geiger, Amgen Inc. BRS NA UG August 1999.
Online Data Monitoring Framework Based on Histogram Packaging in Network Distributed Data Acquisition Systems Tomoyuki Konno 1, Anatael Cabrera 2, Masaki.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Ajax 101 for CF Programmers Randy Brown – Michigan State University
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
Go4 v2.2 Status & Overview CHEP 2003
JavaScript ROOT
GUI plans of work Revisit (reimplement) a new TreeViewer, possibly based on something like Viewpoints (see next slide) (
GeneXus 9.0: Web applications at their higher power
Application with Cross-Platform GUI
3D graphics in JavaScript ROOT
PHP / MySQL Introduction
Dynamic Web Pages (Flash, JavaScript)
DWR: Direct Web Remoting
CIS 133 mashup Javascript, jQuery and XML
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Reading ROOT files in any browser ROOT I/O IN JAVASCRIPT Bertrand Bellenot CERN, PH-SFT

INTRODUCTION BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US How to share thousands of histograms on the web, without having to generate picture files (gif, jpg, …)? How to easily share a ROOT file? How to browse & display the content of a ROOT file from any platform (even from a smartphone or tablet)? Online monitoring? And obviously, all that without having to install ROOT anywhere? 2

REQUIREMENTS BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US The solution should be: Portable: use available web browser Lightweight: no library or application to install Easy to use (user side) Easy to extend and maintain (developer side) Fast, with a small memory footprint 3

SOLUTION BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 4 HTML & JavaScript: JSROOTIO.js Copy the root file on any plain web server Data is transferred over the web Visualization happens on the client side User’s selection request Compressed object Client Root Files WEB SERVER

ROOT I/O BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 5

REMINDER: THE STREAMER INFO A TStreamerInfo object describes a persistent version of a class. A ROOT file contains the list of TStreamerInfo objects for all the class versions written to this file. A TStreamerInfo is a list of TStreamerElement objects (one per data member or base class) A TStreamerElement describe a data member or a base class (e.g. type, name) BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 6

READING THE FILE When opening the file: Read the list of streamer info Read the list of keys and display them in a list tree When the user select an item in the list tree (and only then) Read the compressed buffer from the file Inflate the buffer Stream the object from the inflated buffer using the streamer info BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 7

READING THE FILE Use the XMLHttpRequest AJAX API to perform the HTTP HEAD and GET requests This API is highly browser dependent: On IE, the binary data is in its responseBody data member (VBScript format), and has to be converted into a JavaScript string On other browsers, the data can be in response, mozResponse, mozResponseArrayBuffer, or responseText... Thanks to Ioannis Charalampidis, who kindly provided a working cross-browser solution BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 8

READING PARTIAL ROOT FILE Using HTTP byte range (available in HTTP/1.1) to download only a single compressed object when the user wants to read it Minimizes data transfer and memory usage Some browsers don’t support this feature yet (e.g. Opera) BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 9

HANDLING BINARY DATA Compressed (zipped) objects are in binary format JavaScript has very little support for raw binary data Avoid to use the “available soon” ArrayBuffers Binary data is simply stored in a JavaScript string Accessing a single byte is easy: byte = string.charCodeAt(index); BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 10

READING THE KEYS The keys are not compressed They contain basic information on the object they describe, like its name and its type First step was quite easy, starting from already working code written by Axel Naumann Formatting and displaying the keys is done with a JavaScript tree menu BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 11

Screenshot of the file header and the list of keys contained in hsimple.root The hpx key is open, showing the information describing the TH1F object in the file (displayed for debugging purpose only) FILE HEADER AND KEY INFORMATION BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 12

INFLATING & DECODING THE STREAMER INFO Inflating (unzipping) the buffers required: A JavaScript implementation of zlib’s inflate function from: Implementing the streamer info functionality in JavaScript involved: reverse engineering and parallel debugging of C++ and JavaScript valuable help from Philippe Canal Streamer info can be displayed for educational / informational purposes BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 13

STREAMER INFO VISUALISATION BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 14

READING OBJECTS, FIRST VERSION At the beginning, the classes’ streamers were hard-coded. This approach has several issues: Streamers must be updated with every change in the original class Add a new streamer for every new class The library is growing with every new streamer The only (partially) supported classes were TH1, TH2, TGraph, and TProfile BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 15

READING OBJECTS, ACTUAL STATUS One very nice feature of JavaScript is the possibility to dynamically (at runtime) create classes Allowed to implement dynamic streamers (automatically generated from the streamer info) Allows to potentially read any object from a ROOT file, as soon as we can read the streamer info of its class Navigation in (sub)directories inside a file is fully supported BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 16

GRAPHICS A JavaScript charting library (HighCharts) is used to display the histograms and graphs ( It is released under the Creative Commons Attribution-Non Commercial 3.0 License, allowing to adapt it to ROOT’s needs Some missing functionalities (e.g. error bars, lego plots) have to be implemented A summer student will start to work on it BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 17

DISPLAYING OBJECTS Traditional visualization of a local ROOT file in the ROOT browser BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 18

DISPLAYING OBJECTS (CONT.) JSROOTIO.js visualization of identical histogram BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 19

DISPLAYING OBJECTS (CONT.) Displaying a TH2F (“BOX” plot only) from hsimple.root BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 20

DISPLAYING OBJECTS (CONT.) Displaying a simple TGraph BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 21

DISPLAYING OBJECTS (CONT.) BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US Displaying the content of a TCanvas 22

DIRECTORY NAVIGATION BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 23

HOW TO USE IT? BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US Simply copy the ROOT file(s) anywhere on the web Create a simple html page next to the files Only two lines have to be added in the 24 Read a ROOT file in JavaScript (Demonstration)

SIMPLE HTML EXAMPLE BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US And a few lines in the. Here is a complete example: 25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " Read a ROOT file in Javascript (Demonstration)

JAVASCRIPT API Offering a very simple API: But could be internally complex: f = new JSROOTIO.RootFile(url); histo = f.ReadHistogram(histo_name); if (typeof(histo) != 'undefined') displayHistogram(histo); clRef = streamerInfo.ReadClass(str, o); histo = eval('new JSROOTIO.' + clRef['name'] + '()'); if (typeof histo != 'undefined' && typeof histo.Streamer == 'function') histo.Streamer(str, o); BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 26

AVAILABILITY The source code is available in svn: Remaining issues (non exhaustive list) Doesn’t work on Android prior to version 4.0 (doesn't allow byte range HTTP requests) Reading ROOT geometries is not implemented Missing option to superimpose (overlay) histograms lzma compression is not supported BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 27

WHAT NEXT Finalize the automatic streaming Implement custom streamers Investigate lzma decompression Implement missing parts of graphics in HighCharts and/or implement them in our own graphic library Possibly use WebGL for displaying 2D/3D objects (e.g. TH2, TH3, ROOT geometries) BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 28

CONCLUSION We are still in an early stage, and there is still quite some work in front of us Already working and usable, thanks to very valuable feedback from early users More features are coming Feel free to try and to send feedback & requests BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US 29

BERTRAND BELLENOT, CERN, PH-SFT CHEP’12, 24-MAY, 2012, NYC, US And don’t forget to pass by our (CERN PH-SFT) booth, located at the 4 th floor, here in Kimmel, to see a live demo or any other amazing development done in our group! 30