Giter Club home page Giter Club logo

jsroot's Introduction

JavaScript ROOT

JavaScript ROOT provides interactive ROOT-like graphics in the web browsers and in node.js. Data can be read and displayed from ROOT binary and JSON files. JSROOT implements user interface for THttpServer class.

Examples

Color draw for TH2 2-dimensional TTree::Draw with cut options Several variants of THStack drawing Drawing of TGeo model superimposed with tracks and hits

In web browser

...
   <body>
      <div id="drawing" style="width:800px; height:600px"></div>
   </body>
   <script type='module'>
      import { openFile, draw } from 'https://root.cern/js/latest/modules/main.mjs';
      let file = await openFile('https://root.cern/js/files/hsimple.root');
      let obj = await file.readObject('hpxpy;1');
      draw('drawing', obj, 'colz');
   </script>
...

In node.js

import { openFile, makeSVG } from 'jsroot';
import { writeFileSync } from 'fs';
let file = await openFile('https://root.cern/js/files/hsimple.root');
let obj = await file.readObject('hpxpy;1');
let svg = await makeSVG({ object: obj, option: 'lego2,pal50', width: 1200, height: 800 });
writeFileSync('lego2.svg', svg);

More examples

Supported classes/options

API examples

Install

npm install jsroot

Documentation

Tutorial

THttpServer

Changelog

Reference API

Links

https://root.cern/js/

https://jsroot.gsi.de

jsroot's People

Contributors

linev avatar bellenot avatar pwhiddy avatar couet avatar cozzyd avatar jordan-gillard avatar vladimirkosmala avatar alja avatar axel-naumann avatar dmarcos avatar ferdymercury avatar duesselbergadrian avatar 9inpachi avatar fonsrademakers avatar georgtroska avatar xkzl avatar aminnj avatar ilianabe avatar altavir avatar rbx avatar clelange avatar lobis avatar manrajgrover avatar ellert avatar mourtz avatar peercred avatar pcanal avatar aogaki avatar dependabot[bot] avatar mathpseudo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.