Skip to content

Commit fa09598

Browse files
committed
Sync with ROOT, add changes info
git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2696 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent 7eae80e commit fa09598

File tree

6 files changed

+77
-64
lines changed

6 files changed

+77
-64
lines changed

changes.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ project of Bertrand Bellenot, but provides same functionality in default mode.
66
Main motivation for changes - fix different errors,
77
make JavaScript code more flexible and applicable for online environment.
88

9+
November 2014:
10+
1. Better font size and position in pave stats
11+
2. Resize/move of element only inside correspondent pad
12+
3. Adjust of frame size when Y-axis exceed pad limits
13+
4. Correct values in tooltip for THStack
14+
5. Exclude drawing of markers from TGraph outside visible range
15+
6. Drawing of canvas without TFrame object
16+
7. Many other small bug fixes and improvements, thanks to Maximilian Dietrich
17+
18+
919
October 2014:
1020
1. Add "shortcut icon"
1121
2. Add demo of online THttpServer - shell script copies data from

files/draw.htm

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,44 @@
99
</head>
1010

1111
<script type='text/javascript'>
12-
12+
1313
function CreateDrawGui() {
1414
// analyze URL options
1515
var drawopt = JSROOT.GetUrlOption("opt");
16-
16+
1717
var monitor = JSROOT.GetUrlOption("monitoring");
1818
if (monitor == "") monitor = 3000; else
19-
if (monitor != null) monitor = parseInt(monitor);
20-
19+
if (monitor != null) monitor = parseInt(monitor);
20+
2121
var objpainter = null;
22-
22+
2323
function drawfunction() {
24-
24+
2525
var req = JSROOT.NewHttpRequest("root.json.gz?compact=3", 'text', function(result) {
2626
var obj = JSROOT.parse(result);
2727
if (!obj) {
28-
if (!objpainter) $('#drawing').append("<h3>Can not get object from the server</h3>");
28+
if (!objpainter) $('#drawing').append("<h3>Can not get object from the server</h3>");
2929
return;
3030
}
31-
31+
3232
document.body.style.cursor = 'wait';
33-
objpainter = JSROOT.redraw('drawing', obj, drawopt);
33+
objpainter = JSROOT.redraw('drawing', obj, drawopt);
3434
document.body.style.cursor = 'auto';
35-
35+
3636
});
37-
38-
// submit request
37+
38+
// submit request
3939
req.send(null);
4040
}
41-
41+
4242
drawfunction();
43-
43+
4444
if (monitor!=null)
4545
setInterval(drawfunction, monitor);
46-
46+
4747
JSROOT.RegisterForResize(function() { if (objpainter) objpainter.CheckResize(); });
4848
}
49-
49+
5050
</script>
5151

5252
<body onload="JSROOT.AssertPrerequisites('2d', CreateDrawGui, 'drawing')">

files/example.htm

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=Edge; text/html">
66

77
<title>JSROOT drawing inside HTML page</title>
8-
8+
99
<script src="../scripts/JSRootCore.js" type="text/javascript"></script>
10-
10+
1111
<script type='text/javascript'>
1212

1313
cnt = 0;
14-
14+
1515
function updateGUI() {
1616
// if getting histogram from THttpServer as JSON string, one should parse it like:
1717
// var histo = JSROOT.parse(your_json_string);
1818

19-
// this is just generation of histogram
19+
// this is just generation of histogram
2020
var histo = JSROOT.CreateTH2(20, 20);
2121
for (var iy=0;iy<20;iy++)
2222
for (var ix=0;ix<20;ix++) {
@@ -29,26 +29,26 @@
2929
}
3030
histo.setBinContent(bin, val);
3131
}
32-
32+
3333
cnt++;
34-
34+
3535
JSROOT.redraw('object_draw', histo, "colz");
36-
36+
3737
if (cnt==1) setInterval(updateGUI, 3000);
3838
}
39-
39+
4040
</script>
4141

42-
42+
4343
</head>
4444

4545
<body onload="JSROOT.AssertPrerequisites('2d', updateGUI, 'object_draw')">
46-
<h3>Text Before </h3>
47-
46+
<h3>Text Before </h3>
47+
4848
<div id="object_draw" style="width: 800px; height:600px"></div>
4949

50-
<h3>Text After</h3>
51-
50+
<h3>Text After</h3>
51+
5252
</body>
5353
</html>
5454

index.htm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@
1515
</body>
1616
</html>
1717

18-
<!--
18+
<!--
1919
2020
This is main page of JSROOT project, which aims to display content of ROOT files.
2121
Several parameters could be specified when opening page:
2222
file - name of the file, which will be automatically open with page loading
2323
item - object name in the file to display
24-
opt - draw option for the item
24+
opt - draw option for the item
2525
items - array of objects to display like ['hpx;1', 'hpxpy;1']
2626
opts - array of options ['any', 'colz']
2727
layout - can be 'collapsible', 'tabs' or gridNxM where N and M are integer values
2828
nobrowser - only file item(s) will be displayed, browser will be disabled
29-
Example:
29+
Example:
3030
http://web-docs.gsi.de/~linev/js/3.0/index.htm?file=files/hsimple.root&layout=grid2x2&items=["hpx;1", "hpxpy;1"]&opts=["", "colz"]
3131
3232
Page can be used to open files from other web servers like:
3333
3434
http://web-docs.gsi.de/~linev/js/3.0/index.htm?file=http://root.cern.ch/js/files/hsimple.root
3535
36-
But one should be aware about Cross-Origin Request blocking.
36+
But one should be aware about Cross-Origin Request blocking.
3737
Read https://developer.mozilla.org/en/http_access_control for more details.
3838
3939
To avoid problem at all, one can copy only index.htm on the web server where data files are located.
4040
And specify full path to the JSRootCore.js script like
4141
<script type="text/javascript" src="http://web-docs.gsi.de/~linev/js/3.0/scripts/JSRootCore.js"></script>
4242
4343
If necessary, complete JSROOT can be installed on the web server.
44-
Sources can be found in ROOT repository, etc/http/ subdirectory.
45-
44+
Sources can be found in ROOT repository, etc/http/ subdirectory.
45+
4646
-->

style/JSRootInterface.css

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ p { margin-top: 6px; padding: 0 10px 1em; }
2828

2929
#left-div { left: 2px; width: 300px; margin-right: 1px; overflow: auto; }
3030

31-
#separator-div { left: 304px; width: 4px; width: 2px; background-color: white; cursor: ew-resize }
31+
#separator-div { left: 304px; width: 4px; width: 2px; background-color: white; cursor: ew-resize }
3232

3333
#right-div {
3434
left: 310px;
@@ -57,28 +57,28 @@ input.tb {
5757
background-color: #eee;
5858
}
5959

60-
.ui-accordion-icons .ui-accordion-header a {
61-
padding-left: 2.2em;
60+
.ui-accordion-icons .ui-accordion-header a {
61+
padding-left: 2.2em;
6262
}
6363

64-
.ui-accordion .ui-accordion-header .ui-icon {
65-
left: .5em;
66-
margin-top: -8px;
67-
position: absolute;
68-
top: 50%;
64+
.ui-accordion .ui-accordion-header .ui-icon {
65+
left: .5em;
66+
margin-top: -8px;
67+
position: absolute;
68+
top: 50%;
6969
}
7070

7171

7272
.ui-accordion .ui-accordion-content {
7373
border: 1px solid #aaaaaa;
7474
border-top: 0;
75-
margin-top: -2px;
75+
margin-top: -2px;
7676
margin-bottom: 2px;
7777
overflow:hidden;
7878
padding: 3px 0px 3px 0px;
7979
}
8080

81-
.ui-state-active {
81+
.ui-state-active {
8282
background: #ffffff;
8383
border-bottom: 0;
8484
color: #3a3a3a;
@@ -89,8 +89,8 @@ input.tb {
8989
}
9090

9191
button.closeButton {
92-
margin-top: -3px;
93-
margin-right: -2px;
92+
margin-top: -3px;
93+
margin-right: -2px;
9494
float: right;
9595
}
9696

@@ -102,6 +102,7 @@ button.closeButton {
102102
left:3px;
103103
background:#ddddff;
104104
opacity:0.6;
105+
-moz-opacity:0.6;
105106
}
106107

107108
.ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }

style/JSRootPainter.css

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@
77
|--------------------------------------------------*/
88

99
.dtree {
10-
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
11-
font-size: 11px;
12-
color: #666;
13-
white-space: nowrap;
10+
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
11+
font-size: 11px;
12+
color: #666;
13+
white-space: nowrap;
1414
}
1515
.dtree img {
16-
border: 0px;
17-
vertical-align: middle;
16+
border: 0px;
17+
vertical-align: middle;
1818
}
1919
.dtree a {
20-
color: #333;
21-
text-decoration: none;
20+
color: #333;
21+
text-decoration: none;
2222
}
2323
.dtree a.node, .dtree a.nodeSel {
24-
white-space: nowrap;
25-
padding: 1px 2px 1px 2px;
24+
white-space: nowrap;
25+
padding: 1px 2px 1px 2px;
2626
}
2727
.dtree a.node:hover, .dtree a.nodeSel:hover {
28-
color: #333;
29-
text-decoration: underline;
28+
color: #333;
29+
text-decoration: underline;
3030
}
3131
.dtree a.nodeSel {
32-
background-color: #c0d2ec;
32+
background-color: #c0d2ec;
3333
}
3434
.dtree .clip {
35-
overflow: hidden;
35+
overflow: hidden;
3636
}
3737

3838
/*--------------------------------------------------|
@@ -91,7 +91,7 @@ svg:not(:root) { overflow: hidden; }
9191

9292
.ctxmenu
9393
{
94-
position:absolute;
94+
position:absolute;
9595
min-width:64px;
9696
height:auto;
9797
padding: 4px;
@@ -121,12 +121,14 @@ svg:not(:root) { overflow: hidden; }
121121
background-color: #F0F0F0;
122122
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
123123
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
124-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
124+
background-image: -webkit-gradient(linear, 0 0, 0 100%,
125+
from(#ffffff), to(#e6e6e6));
125126
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
126127
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
127128
background-image: linear-gradient(top, #ffffff, #e6e6e6);
128129
background-repeat: repeat-x;
129-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
130+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
131+
endColorstr='#e6e6e6', GradientType=0);
130132
}
131133

132134

0 commit comments

Comments
 (0)