Skip to content

Commit

Permalink
[jsroot] introduce modules-based code
Browse files Browse the repository at this point in the history
This is full redesign of internal JSROOT code,
using ES6 modules and classes.
  • Loading branch information
linev committed Mar 28, 2022
1 parent f8bcafc commit e4713b5
Show file tree
Hide file tree
Showing 112 changed files with 224,671 additions and 71,565 deletions.
2 changes: 1 addition & 1 deletion js/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright � 2013-2020 JavaScript ROOT authors
Copyright � 2013-2022 JavaScript ROOT authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
108,757 changes: 108,757 additions & 0 deletions js/build/jsroot.js

Large diffs are not rendered by default.

49 changes: 25 additions & 24 deletions js/changes.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# JSROOT changelog

## Changes in dev
1. Fully remove jQuery and jQueryUI from JSROOT, replace by plane HTML/JavaScript
2. Provide bootstrap-based menu - optionally
3. Make "col" default draw option for TH2 in default JSROOT GUI
4. Upgrade d3.js to 7.3.0, take only used components: "d3-selection", "d3-drag", "d3-scale", "d3-time-format", "d3-color", "d3-transition"
5. Upgrade three.js to r136, reduce number of components used in jsroot
6. Implement proper drawing of TEllipse
7. Support new TGraphMultiErrors class
8. Implement all variants of CANDLE and VIOLIN draw options (#194)
9. Implement "cjust" draw option when drawing color palette
10. Implement "colhz" draw option to plot horizontal color palette
11. Implement "pads" draw option for THStack
12. Improve drawing of TEfficiency, support 2D case
13. Let disable TGraph dragging via JSROOT.settings.DragGraphs flag (#224)
14. Use BigInt in I/O when 64bit integer can not be stored as plain Number
15. In TF1/TF2 always try to use formula, only when fail - apply saved buffer when exist
16. Add proper support of "Symbols" and "Wingdings" fonts
17. Add many standard functions to math like "crystalball_pdf", "gaussian_pdf", "tdistribution_pdf"
18. Correctly display extra data from TGraphQQ
19. Remove "collapsible" and "tabs" layouts which were implemented with jQuery - use "flex" instead
20. Improve flexible layout, provide context menu with cascading, tiling, selecting frames
21. Starting from Chrome 96, allow embedding WebGL into SVG - solving problem with lego plots in canvas
22. All internal JSROOT code rewritten as classes; one have to use class syntax to derive from it
23. Support drawing of TGeo and TAxis3D objects inside TPad
24. Implement "circular" and "chord" draw options for TH2
1. Use ES6 modules for code organization
2. Rewrite code with ES6 classes; one have to use class syntax to derive from it
3. Upgrade d3.js to 7.3.0, three.js to r138
4. Fully remove jQuery and jQueryUI, replace by plain HTML/JavaScript
5. Remove "collapsible" and "tabs" layouts which were implemented with jQuery - use "flex" instead
6. Improve flexible layout, provide context menu with cascading, tiling, selecting frames
7. Use `BigInt` in I/O with 64bit integer which can not be stored as plain `Number`
8. Starting from Chrome 96, allow embedding WebGL into SVG - solving problem with lego plots in canvas
9. Implement all variants of CANDLE and VIOLIN draw options (#194)
10. Implement "circular" and "chord" draw options for TH2
11. Implement "cjust" draw option when drawing color palette
12. Implement "colhz" draw option to plot horizontal color palette
13. Implement "pads" draw option for THStack
14. In TF1/TF2 always try to use formula, only when fail - apply saved buffer
15. Add many standard functions to math like "crystalball_pdf", "gaussian_pdf", "tdistribution_pdf"
16. Improve drawing of TEfficiency, support 2D case
17. Support new TGraphMultiErrors class
18. Let disable TGraph dragging via `settings.DragGraphs` flag (#224)
19. Correctly display extra data from TGraphQQ
20. Implement "3d" draw options for TMultiGraph
21. Support "A" hist option (do not draw axis) in lego/surf plots
22. Support drawing of TGeo and TAxis3D objects inside TPad
23. Implement proper drawing of TEllipse
24. Add proper support of "Symbols" and "Wingdings" fonts
25. Make "col" default draw option for TH2 in JSROOT gui


## Changes in 6.3.4
Expand Down
17 changes: 10 additions & 7 deletions js/files/draw.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>Draw of single element</title>
<script type="text/javascript" src="jsrootsys/scripts/JSRoot.core.js"></script>
<link rel="shortcut icon" href="jsrootsys/img/RootIcon.ico"/>
</head>

<body>
<div id="drawGUI">
loading scripts...
loading ...
</div>

<script type='text/javascript'>
function GetCachedHierarchy() { return "$$$h.json$$$"; }
function GetCachedObject() { return "$$$root.json$$$"; }
<script type='module'>

JSROOT.buildGUI("drawGUI", "draw");
import { buildGUI, internals } from './jsrootsys/modules/gui.mjs';

internals.GetCachedHierarchy = function() { return "$$$h.json$$$"; }
internals.GetCachedObject = function() { return "$$$root.json$$$"; }

buildGUI("drawGUI", "draw");
</script>
</body>

Expand Down
13 changes: 7 additions & 6 deletions js/files/online.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
<html lang="en">
<head>
<!-- this file used by THttpServer to display objects hierarchy -->
<meta charset="UTF-8">
<meta charset="utf-8">
<title>Online server</title>
<link rel="shortcut icon" href="jsrootsys/img/RootIcon.ico"/>
<script type="text/javascript" src="jsrootsys/scripts/JSRoot.core.js"></script>
</head>

<body>
<div id="onlineGUI">
loading scripts...
loading ...
</div>

<script type="text/javascript">
function GetCachedHierarchy() { return "$$$h.json$$$"; }
<script type="module">
import { buildGUI, internals } from './jsrootsys/modules/gui.mjs';

JSROOT.buildGUI("onlineGUI", "online");
internals.GetCachedHierarchy = function() { return "$$$h.json$$$"; }

buildGUI("onlineGUI", "online");
</script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion js/files/wslist.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>List of WS handlers</title>
</head>

Expand Down
12 changes: 5 additions & 7 deletions js/index.htm
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>Read a ROOT file</title>
<link rel="shortcut icon" href="img/RootIcon.ico"/>
<!-- To make use of RequireJS, replace following line with commented one -->
<!--script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="scripts/JSRoot.core.js"></script-->
<script type="text/javascript" src="scripts/JSRoot.core.js"></script>
</head>
<body>
<div id="simpleGUI" path="../files/" files="ct.root;exclusion.root;fillrandom.root;glbox.root;graph.root;hsimple.root;legends.root;rf107.root;stacks.root;zdemo.root">
loading scripts ...
</div>
<script type="text/javascript">
JSROOT.buildGUI("simpleGUI");
<script type="module">
import { buildGUI } from './modules/gui.mjs';
buildGUI("simpleGUI");
</script>
</body>
</html>
Expand Down Expand Up @@ -47,7 +45,7 @@
To avoid problem at all, one can copy only index.htm on the web server where data files are located.
And specify full path to the JSRoot.core.js script like
<script type="text/javascript" src="https://root.cern/js/latest/scripts/JSRoot.core.min.js"></script>
<script type="text/javascript" src="https://root.cern/js/latest/scripts/JSRoot.core.js"></script>
If necessary, complete JSROOT can be installed on the web server.
Project repository: https://github.com/root-project/jsroot.
Expand Down
Loading

0 comments on commit e4713b5

Please sign in to comment.