Skip to content

Commit 3d7f8dc

Browse files
committed
Update docu
1 parent a17c880 commit 3d7f8dc

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
7. Upgrade three.js to r121:
1818
- SoftwareRenderer was deprecated
1919
- WebGL used both for browser and node.js (via headless-gl)
20-
- Keep use of SVGRendered as backup solution
20+
- Keep support of SVGRendered as backup solution
2121
- support r3d_gl, r3d_img, r3d_svg rendering options for TGeo and histos
2222
8. Deprecate bower package manager
2323
9. Upgrade MathJax.js to version 3.1.1, reliably works in browser and node.js!

docs/JSROOT.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ In principle, one could open any ROOT file placed in the web, providing the full
425425

426426
- <https://jsroot.gsi.de/latest/?file=https://root.cern/js/files/hsimple.root&item=hpx>
427427

428-
But one should be aware of [Same-origin policy](https://en.wikipedia.org/wiki/Same-origin_policy), when the browser blocks requests to files from domains other than current web page.
428+
But one should be aware of [Same-origin policy](https://en.wikipedia.org/wiki/Same-origin_policy),
429+
when the browser blocks requests to files from domains other than current web page.
429430
To enable CORS on Apache web server, hosting ROOT files, one should add following lines to `.htaccess` file:
430431

431432
<IfModule mod_headers.c>
@@ -474,7 +475,7 @@ For debuging purposes one can install JSROOT on local file system and let read R
474475

475476
- <file:///home/user/jsroot/index.htm?file=hsimple.root&item=hpx>
476477

477-
But this works only with Firefox.
478+
But this worked only with earlier Firefox versions.
478479

479480

480481

@@ -587,7 +588,7 @@ to change stat format using to display value in stats box:
587588
JSROOT.gStyle.fStatFormat = "7.5g"
588589

589590
There is also `JSROOT.settings` object which contains all other JSROOT settings. For instance,
590-
one can configure custom values format for different axes:
591+
one can configure custom format for different axes:
591592

592593
JSROOT.settings.XValuesFormat = "4.2g"
593594
JSROOT.settings.YValuesFormat = "6.1f"
@@ -606,8 +607,8 @@ Such JSON representation generated using the [TBufferJSON](https://root.cern/doc
606607
obj->SaveAs("file.json");
607608
...
608609

609-
To access data from a remote web server, it is recommended to use the [XMLHttpRequest](http://en.wikipedia.org/wiki/XMLHttpRequest) class. JSROOT provides a special method to create such object and properly handle it in different browsers.
610-
For receiving JSON from a server one could use following code:
610+
To access data from a remote web server, it is recommended to use the `JSROOT.httpRequest` method.
611+
For instance to recieve object from a THttpServer server one could do:
611612

612613
JSROOT.httpRequest("http://your_root_server:8080/Canvases/c1/root.json", "object").then(obj => {
613614
console.log('Read object of type ', obj._typename);
@@ -637,10 +638,9 @@ The first argument is the id of the HTML div element, where drawing will be perf
637638

638639
Here is complete [running example](https://root.cern/js/latest/api.htm#custom_html_read_json) ans [source code](https://github.com/root-project/jsroot/blob/master/demo/read_json.htm):
639640

640-
var filename = "https://root.cern/js/files/th2ul.json.gz";
641-
JSROOT.httpRequest(filename, 'object').then(obj => {
642-
JSROOT.draw("drawing", obj, "lego");
643-
});
641+
let filename = "https://root.cern/js/files/th2ul.json.gz";
642+
JSROOT.httpRequest(filename, 'object')
643+
.then(obj => JSROOT.draw("drawing", obj, "lego"));
644644

645645
In very seldom cases one need to access painter object, created in JSROOT.draw() function. This can be done via
646646
handling Promise results like:
@@ -748,7 +748,7 @@ will be called.
748748

749749
As second parameter of tree.Process() function one could provide object with arguments
750750

751-
var args = { numentries: 1000, firstentry: 500 };
751+
let args = { numentries: 1000, firstentry: 500 };
752752
tree.Process(selector, args);
753753

754754

@@ -759,8 +759,8 @@ Any supported TGeo object can be drawn with normal JSROOR.draw() function.
759759
If necessary, one can create three.js model for supported object directly and use such model
760760
separately. This can be done with the function:
761761

762-
var opt = { numfaces: 100000 };
763-
var obj3d = JSROOT.GEO.build(obj, opt);
762+
let opt = { numfaces: 100000 };
763+
let obj3d = JSROOT.GEO.build(obj, opt);
764764
scene.add( obj3d );
765765

766766
Following options can be specified:
@@ -819,14 +819,9 @@ Such JSON string could be parsed by any other JSROOT-based application.
819819

820820
[OpenUI5](http://openui5.org/) is a web toolkit for developers to ease and speed up the development of full-blown HTML5 web applications. Since version 5.3.0 JSROOT provides possibility to use OpenUI5 functionality together with JSROOT.
821821

822-
First problem is bootstraping of OpenUI5. Most easy solution - specify openui5 URL parameter when loading JSROOT:
823-
824-
825-
<script type="text/javascript"
826-
src="https://root.cern/js/latest/scripts/JSRoot.core.min.js">
827-
</script>
828-
829-
JSROOT uses https://openui5.hana.ondemand.com to load latest stable version of OpenUI5. After loading is completed, one can use `sap` to access openui5 functionality. Like:
822+
First problem is bootstraping of OpenUI5. Most easy solution - use `JSROOT.require('openui5')`.
823+
JSROOT uses https://openui5.hana.ondemand.com to load latest stable version of OpenUI5.
824+
After loading is completed, one can use `sap` to access openui5 functionality like:
830825

831826
<script type="text/javascript">
832827
JSROOT.require('openui5').then(() => {
@@ -842,7 +837,7 @@ JSROOT uses https://openui5.hana.ondemand.com to load latest stable version of O
842837
})
843838
]
844839
}).placeAt("content");
845-
}
840+
});
846841
</script>
847842

848843
There are small details when using OpenUI5 with THttpServer. First of all, location of JSROOT scripts should be specified
@@ -856,7 +851,7 @@ JSROOT provides [example](https://root.cern/js/latest/demo/openui5/) showing usa
856851

857852
### Migration v5 -> v6
858853

859-
In JSROOT v6 release some many incompatible changes where done.
854+
In JSROOT v6 release some many incompatible changes were done.
860855

861856
Main script was renamed to `JSRoot.core.js`. Old `JSRootCore.js` script left to provide partial compatibility
862857
with old applications, but will be removed in future JSROOT v6.2. All URL parameters for main script will be
@@ -875,7 +870,7 @@ Painter classes were renamed and made public:
875870
- `JSROOT.TBasePainter` -> `JSROOT.BasePainter`
876871
- `JSROOT.TObjectPainter` -> `JSROOT.ObjectPainter`
877872

878-
Internal `ObjectPainter.DrawingReady` api was deprecated. Draw function has to return `Promise` if object drawing postponded.
873+
Internal `ObjectPainter.DrawingReady` api was deprecated. Draw function has to return `Promise` if object drawing postponed.
879874
As argument of returned promise object painter has to be used.
880875

881876
Many function names where adjusted to naming conventions. Like:

0 commit comments

Comments
 (0)