3 if (typeof JSROOT !=
"object") {
4 var e1 =
new Error(
"httptextlog.js requires JSROOT to be already loaded");
5 e1.source =
"httptextlog.js";
9 function MakeMsgListRequest(hitem, item) {
13 var arg =
"&max=1000";
14 if (
'last-id' in item) arg+=
"&id="+item[
'last-id'];
15 return 'exe.json.gz?method=Select' + arg;
18 function AfterMsgListRequest(hitem, item,
obj) {
21 if (item==
null)
return;
24 delete item[
'last-id'];
28 if (
obj[
'_typename'] !=
'TList')
return;
31 obj[
'_typename'] =
"TMsgList";
33 if (
obj.arr.length>0) {
34 item[
'last-id'] =
obj.arr[0].fString;
37 if (!(
'clear' in item))
38 item[
'clear'] =
function() {
delete this[
'last-id']; }
43 function DrawMsgList(divid, lst, opt) {
45 var painter =
new JSROOT.TBasePainter();
46 painter.SetDivId(divid);
48 painter.
Draw =
function(lst) {
49 if (lst ==
null)
return;
51 var frame = d3.select(
"#" + this.divid);
53 var main = frame.select(
"div");
55 main = frame.append(
"div")
56 .style(
'max-width',
'100%')
57 .style(
'max-height',
'100%')
58 .style(
'overflow',
'auto');
60 var old = main.selectAll(
"pre");
61 var newsize = old.size() + lst.arr.length - 1;
65 old.select(
function(
d,i) {
return i < newsize - 1000 ?
this :
null; }).
remove();
67 for (var i=lst.arr.length-1;i>0;i--)
68 main.append(
"pre").html(lst.arr[i].fString);
71 this.SetDivId(this.divid);
74 painter.RedrawObject =
function(
obj) {
80 return painter.DrawingReady();
83 JSROOT.addDrawFunc({
name:
"TMsgList", icon:
"img_text", make_request:MakeMsgListRequest, after_request:AfterMsgListRequest,
func:DrawMsgList, opt:
"list"});
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
void Error(const char *location, const char *msgfmt,...)
double func(double *x, double *p)