Skip to content

Commit 98b691d

Browse files
committed
Merge branch 'dev'
2 parents 12802b2 + 785a335 commit 98b691d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+32632
-22251
lines changed

changes.md

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
11
# JSROOT changelog
22

3-
## Changes in 5.3.5
4-
1. Fix - correctly show histogram with negative bins and fill attributes (#143)
5-
2. Fix - correct animation for status line (when visible)
6-
3. Fix - correctly set lin/log settings back top TPad object
7-
4. Fix - correctly use preloaded d3.js in notebooks/require.js environment
8-
5. Cached Latex regex to improve drawing speed (#145)
9-
10-
11-
## Changes in 5.3.4
12-
1. Fix - several problem in TLatex preprocessing for MathJax.js
13-
2. Fix - use "E" draw options for THStack only when no any other specified
14-
15-
16-
## Changes in 5.3.3
17-
1. Use latest jsdom and mathjax-node packages (Node.js only)
18-
19-
20-
## Changes in 5.3.2
21-
1. Fix - use FontSize when draw TLegend entries
22-
2. Fix - correctly show TH2 overflow stats
23-
3. Fix - tooltips handling for TH1 hbar drawings
24-
4. Implement JSROOT.toJSON() function to produce ROOT JSON string
25-
26-
27-
## Changes in 5.3.1
28-
1. Fix - show TH2 projections also when tooltip is disabled
29-
2. Fix - use z_handle to format Z-axis labels
30-
3. Fix - support labels on TH3 Z axis
31-
4. Fix - TH1 zooming in 3D mode
32-
5. Fix - suppress empty {} in TLatex
33-
6. Add several math symbols for TLatex
34-
7. Fix - font kind 1 is italic times roman
35-
8. Fix - do not let expand parent item in hierarchy
36-
9. Fix - use correct painter to check range
37-
10. Fix - change proper axis attributes in context menu
38-
11. Fix - correctly show axis labels on 3D plot
39-
12. Fix - correctly handle circle (#24) as marker kind
40-
13. Fix - correct circle drawing with coordinates rounding
41-
14. Fix - TLatex #frac and #splitline, adjust vertical position
42-
15. Fix - workaround for y range when fMinimum==fMaximum!=-1111
43-
16. Fix - correct tooltips for graph with marker drawing
3+
## Changes in dev
4+
1. Tooltips and zooming in TGraphPolar drawings
5+
2. Support border draws for TWbox
6+
3. Support TPavesText with multiple underlying paves
7+
4. Correctly draw filled TArrow endings
8+
5. Implement drawing of TDiamond, TArc, TCurlyLine, TCurlyArc, TCrown
9+
6. Implement most existing fill styles
10+
7. Support line option for TGraph2D
11+
8. Let enable/disable highlight of extra objects in geometry viewer
12+
9. Draw all objects from TList/TObjArray as they appear in list of primitives
13+
10. Draw axis labels on both sides when pad.fTick[x/y] > 1
14+
11. Disable automatic frame adjustment, can be enabled with "&adjframe" parameter in URL
15+
12. Fix - use same number of points to draw lines and markers on the TGraph
16+
13. Let disable TGraph drawing optimization with "noopt" draw option
17+
14. When drawing TH2/TH3 scatter plots, always generate same "random" pattern
18+
15. When use "CPN" draw option for TCanvas, create color palette from N last colors
19+
16. Fix - let combine "L" or "C" graph draw option with others
20+
17. Implement "RX", "RY" options for TGraph
21+
18. Make drawing of TCanvas with many primitives smoother
22+
19. Correct positioning of custom axis labels
23+
20. Correctly show histogram with negative bins and fill attributes (#143)
24+
21. Fix - correctly toggle lin/log axes in lego plot
25+
22. Fix - let correctly change marker attributes interactively
26+
23. Fix - correctly use preloaded d3.js in notebooks/require.js environment
27+
24. Use barwidth/baroffset parameters in lego plots
28+
25. Add fOptTitle, fOptLogx/y/z fields in JSROOT.gStyle
29+
26. Support LZ4 compression - future default compression algorithm starting from ROOT 6.14
4430

4531

4632
## Changes in 5.3.0
@@ -124,7 +110,7 @@
124110
3. Implement projection of geometry on given plane.
125111
One could reuse drawing of geometry in other div (should be drawn with main option).
126112
In control GUI one could change position of the projection plane
127-
4. On of the TGeo drawing can be assigned as main. When same object drawn next time,
113+
4. One of the TGeo drawing can be assigned as main. When same object drawn next time,
128114
its drawing will be derived from the main. Useful for geometry projections.
129115
Also all tracks and hits will be imported from main drawing.
130116
5. Let change background color of geo drawing.

demo/examples.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ examples_main = {
22
TH1 : [
33
{ opt: "", file: "hsimple.root", item: "hpx;1" },
44
{ opt: "P" },
5-
{ opt: "PO" },
6-
{ name: "star", opt:"*H", title: "draw stars on histogram bins" },
5+
{ opt: "P0" },
6+
{ name: "star", opt:"*", title: "draw stars on histogram bins" },
7+
{ name: "*H", opt:"*H", title: "draw stars and histogram itself" },
78
{ opt: "L", title: "draw histogram as line" },
89
{ name: "LF2", opt:"LF2,fill_blue", title: "draw histogram as line with filled area" },
910
{ name: "B", opt:"B,fill_red", title: "draw histogram as bar chart" },
@@ -136,13 +137,16 @@ examples_main = {
136137
TGraph : [
137138
{ opt: "", file: "graph.root", item: "Graph;1" },
138139
{ opt: "L" },
139-
{ opt: "AX+Y+L" },
140140
{ opt: "P" },
141141
{ name: "star", opt:"*" },
142142
{ opt: "LP" },
143143
{ opt: "B" },
144144
{ opt: "B1" },
145-
{ name: "docu", file: "graph.root", layout: "vert333", items: ['c1','c47','c4','c48','c41','c42','c43','c44','c45'], title:"several canvas from TGraph documentation page" },
145+
{ opt: "AX+Y+L", title: "move X/Y labels on other side" },
146+
{ opt: "IA", title: "hide (Invisible) axes drawing " },
147+
{ name: "RX", opt: "ARXL", title: "reverse X axis" },
148+
{ name: "RY", opt: "ARYL", title: "reverse Y axis" },
149+
{ name: "docu", file: "graph.root", layout: "vert333", items: ['c1','c47','c4','c48','c41','c42','c43','c44','c45'], title: "several canvas from TGraph documentation page" },
146150
{ name: "excl", file: "tutorials_graphs.root", item: "exclusiongraph2", title: "Exclusion draw exampl, output of tutorials/graphs/exclusiongraph2.C" },
147151
{ name: "plc", file: "tutorials_graphs.root", item: "graphpalettecolor", title: "Automatic set of graph colors, output of tutorials/graphs/graphpalettecolor.C" },
148152
{ name: "shade", file: "tutorials_graphs.root", item: "graphShade", title: "output of tutorials/graphs/graphShade.C" }
@@ -188,7 +192,8 @@ examples_main = {
188192
TGraph2D : [
189193
{ opt: "", file: "graph2d.root", item: "Graph2D", title: "example of TGraph2D" },
190194
{ name: "pcol", item: "pcol", title: "example of TGraph2D, color options" },
191-
{ opt: "err", item: "cerr", title: "example of TGraph2DErrors, errors drawing" }
195+
{ opt: "err", item: "cerr", title: "example of TGraph2DErrors, errors drawing" },
196+
{ opt: "line", item: "line", title: "line drawing with TGraph2D" }
192197
],
193198
TLatex : [
194199
{ name: "latex", file: "latex.root", layout: "grid2x2", items: ['lva','ex1','ex2','ex3'], title: "Internal TLatex processor" },
@@ -202,9 +207,12 @@ examples_main = {
202207
{ name: "sinfo", url: "?nobrowser&file=$$$hsimple.root&item=StreamerInfo", title: "List of streamer infos" },
203208
{ name: "3dmark", url: "?nobrowser&file=$$$mix2d3d.root&item=Canvas;1/pad4&opt=white", title: "TPloyMarker3D class" },
204209
{ name: "profile2d", file: "profile2d.root", item: "c1;1", title: "TProfile2D class" },
205-
{ name: "spline", file: "tutorials_graphs.root", item: 'splines_test', title: "TSpline3 and TSpline5 classes, Macro outputs from tutorials/graphs/splines_test.C" },
210+
{ name: "spline", file: "tutorials_graphs.root", item: 'splines_test', title: "TSpline3 and TSpline5 classes, tutorials/graphs/splines_test.C" },
206211
{ name: "polyline", file: "polyline.root", item: "can;1", title: "TPolyLine class (produced with graphics/triangles.C)" },
207-
{ name: "class", json: "draw_class.json.gz", title: "Canvas, produced with DrawClass() call" }
208-
212+
{ name: "class", json: "draw_class.json.gz", title: "Canvas, produced with DrawClass() call" },
213+
{ name: "archi", file: "tutorials_graphics.root", item: 'archi', title: "Usage of TPavesText, tutorials/graphics/archi.C" },
214+
{ name: "feynman", file: "tutorials_graphics.root", item: 'feynman', title: "Usage of TCulyLine/Arc, tutorials/graphics/feynman.C" },
215+
{ name: "pie", file: "tutorials_graphics.root", item: 'piechart', title: "TPie, tutorials/graphics/piechart.C" },
216+
{ name: "fill", file: "fillpatterns.root", item: 'patterns', title: "Different fill patterns" }
209217
]
210218
};

demo/examples_more.js

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/zoom_handler.htm

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,23 @@
1515
<script type='text/javascript'>
1616

1717
var h1painter = null,
18-
filename = "https://root.cern.ch/js/files/hsimple.root";
18+
filename = "https://root.cern/js/files/hsimple.root";
1919

2020
JSROOT.OpenFile(filename, function(file) {
2121
file.ReadObject("hpx;1", function(obj) {
22-
JSROOT.draw("drawth1", obj, "hist", function(painter) { h1painter = painter; });
22+
JSROOT.draw("drawth1", obj, "hist", function(painter) {
23+
h1painter = painter;
24+
});
2325
});
2426
file.ReadObject("hpxpy;1", function(obj) {
2527
JSROOT.draw("drawth2", obj, "col", function(painter) {
26-
painter.OldZoom = painter.Zoom;
28+
// zooming handled in frame painter now
29+
var fp = painter.frame_painter();
30+
// keep old function to be able invoke it again
31+
fp.OldZoom = fp.Zoom;
2732
// redefine zoom function of TH2 painter to make synchronous zooming of TH1 object
28-
painter.Zoom = function(xmin,xmax,ymin,ymax,zmin,zmax) {
29-
if (h1painter) h1painter.Zoom(xmin, xmax);
33+
fp.Zoom = function(xmin,xmax,ymin,ymax,zmin,zmax) {
34+
if (h1painter) h1painter.frame_painter().Zoom(xmin, xmax);
3035
this.OldZoom(xmin,xmax,ymin,ymax,zmin,zmax);
3136
}
3237
});

docs/HttpServer.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ One could specify several options when creating http server. They could be add a
2222

2323
Following parameters are supported:
2424

25-
- thrds=N - number of threads used by the civetweb (default is 5)
25+
- thrds=N - number of threads used by the civetweb (default is 10)
2626
- top=name - configure top name, visible in the web browser
2727
- auth_file=filename - authentication file name, created with htdigets utility
2828
- auth_domain=domain - authentication domain
2929
- loopback - bind specified port to loopback 127.0.0.1 address
3030
- debug - enable debug mode, server always returns html page with request info
31+
- websocket_timeout=tm - set web sockets timeout in seconds (default 300)
32+
- websocket_disable - disable web sockets handling (default enabled)
33+
- cors=domain - define value for CORS header "Access-Control-Allow-Origin" in server response
3134

3235
If necessary, one could bind http server to specific IP address like:
3336

3437
new THttpServer("http:192.168.1.17:8080")
3538

36-
One also can provide extra arguments for THttpServer itself
39+
One also can provide extra arguments for THttpServer itself:
3740

3841
- readonly, ro - use server in read-only mode (default)
3942
- readwrite, rw - use server in read-write mode
@@ -430,3 +433,68 @@ To use `multi.json` request from the JavaScript, one should create special 'POST
430433

431434
Here argument "multi" identifies, that server response should be parsed with `JSROOT.parse_multi()` function, which correctly interprets JSON code, produced by `multi.json` request. When sending such request to the server, one should provide list of objects names and not forget "?number=N" parameter in the request URL string.
432435

436+
437+
## Websockets supports
438+
439+
Websockets support available starting from ROOT v6.12.
440+
Minimal example provided in `$ROOTSYS/tutorials/http/ws.C` macro.
441+
442+
To work with websockets, subclass of THttpWSHandler should be created and registered to THttpServer:
443+
444+
#include "THttpWSHandler.h"
445+
446+
class TUserHandler : public THttpWSHandler {
447+
public:
448+
TUserHandler(const char *name, const char *title) : THttpWSHandler(name, title) {}
449+
450+
// provide custom HTML page when open correpondent address
451+
TString GetDefaultPageContent() { return ""; }
452+
453+
virtual Bool_t ProcessWS(THttpCallArg *arg);
454+
};
455+
456+
Central method is `TUserHandler::ProcessWS(THttpCallArg *arg)`, where four kinds of websockets events should be handled:
457+
458+
* WS_CONNECT - clients attempts to create websockets, return false when refusing connection
459+
* WS_READY - connection is ready to use, **wsid** can be obtained with `arg->GetWSId()` calls
460+
* WS_DATA - new portion of data received by webcosket
461+
* WS_CLOSE - connection closed by the client, **wsid** is no longer valid
462+
463+
These kinds are coded as method name of THttpCallArg class and can be used like:
464+
465+
Bool_t TUserHandler::ProcessWS(THttpCallArg *arg)
466+
{
467+
if (arg->IsMethod("WS_CONNECT")) {
468+
return kTRUE; // accept all connections
469+
}
470+
471+
if (arg->IsMethod("WS_READY")) {
472+
SendCharStartWS(arg->GetWSId(), "Init"); // immediately send message to the web socket
473+
return kTRUE;
474+
}
475+
476+
if (arg->IsMethod("WS_CLOSE")) {
477+
return kTRUE; // just confirm connection
478+
}
479+
480+
if (arg->IsMethod("WS_DATA")) {
481+
TString str = arg->GetPostDataAsString();
482+
printf("Client msg: %s\n", str.Data());
483+
SendCharStarWS(arg->GetWSId(), "Confirm");
484+
return kTRUE;
485+
}
486+
487+
return kFALSE; // ignore all other kind of requests
488+
}
489+
490+
Instance of **TUserHandler** should be registered to the THttpServer like:
491+
492+
THttpServer *serv = new THttpServer("http:8080");
493+
TUserHandler *handler = new TUserHandler("name1","title");
494+
serv->Register(handler);
495+
496+
After that web socket connection can be established with the address `ws://host_name:8080/name1/root.websocket`
497+
Example client code can be found in `$ROOTSYS/tutorials/http/ws.htm` file. Actually, custom HTML page for
498+
websocket handler can be specified with `TUserHandler::GetDefaultPageContent()` method returning `"file:ws.htm"`.
499+
500+

0 commit comments

Comments
 (0)