Skip to content

Commit 62f0268

Browse files
committed
Support DABC histogram in JavaScript. At the moment when histogram
requested, DABC record converted into JSROOT.TH1 class git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2919 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent e5c4a61 commit 62f0268

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

scripts/JSRootPainter.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7641,6 +7641,26 @@
76417641
// one can load extra scripts here or assign draw functions
76427642
ready_callback();
76437643
}
7644+
7645+
JSROOT.HierarchyPainter.prototype.GetOnlineItem = function(item, callback) {
7646+
// method used to request object from the http server
7647+
7648+
var url = this.itemFullName(item);
7649+
if (url.length > 0) url += "/";
7650+
var h_get = ('_more' in item) || ('_doing_expand' in item);
7651+
url += h_get ? 'h.json?compact=3' : 'root.json.gz?compact=3';
7652+
7653+
var itemreq = JSROOT.NewHttpRequest(url, 'object', function(obj) {
7654+
if ((obj != null) && !h_get && (item._name === "StreamerInfo")
7655+
&& (obj['_typename'] === 'TList'))
7656+
obj['_typename'] = 'TStreamerInfoList';
7657+
7658+
if (typeof callback == 'function')
7659+
callback(item, obj);
7660+
});
7661+
7662+
itemreq.send(null);
7663+
}
76447664

76457665
JSROOT.HierarchyPainter.prototype.OpenOnline = function(server_address, user_callback) {
76467666
var painter = this;
@@ -7653,22 +7673,7 @@
76537673
painter.h['_online'] = server_address;
76547674

76557675
painter.h['_get'] = function(item, callback) {
7656-
7657-
var url = painter.itemFullName(item);
7658-
if (url.length > 0) url += "/";
7659-
var h_get = ('_more' in item) || ('_doing_expand' in item);
7660-
url += h_get ? 'h.json?compact=3' : 'root.json.gz?compact=3';
7661-
7662-
var itemreq = JSROOT.NewHttpRequest(url, 'object', function(obj) {
7663-
if ((obj != null) && !h_get && (item._name === "StreamerInfo")
7664-
&& (obj['_typename'] === 'TList'))
7665-
obj['_typename'] = 'TStreamerInfoList';
7666-
7667-
if (typeof callback == 'function')
7668-
callback(item, obj);
7669-
});
7670-
7671-
itemreq.send(null);
7676+
painter.GetOnlineItem(item, callback);
76727677
}
76737678

76747679
painter.h['_expand'] = function(node, obj) {

0 commit comments

Comments
 (0)