Skip to content

Commit

Permalink
JSROOT 5.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
linev authored and bellenot committed Apr 21, 2017
1 parent e2e19d6 commit 43ed9f8
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 128 deletions.
228 changes: 118 additions & 110 deletions etc/http/changes.md

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions etc/http/scripts/JSRootCore.js
Expand Up @@ -57,7 +57,7 @@
'MathJax': {
exports: 'MathJax',
init: function () {
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }, SVG: { mtextFontInherit: true } });
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }, SVG: { mtextFontInherit: true, minScaleAdjust: 100, matchFontHeight: true, useFontCache: false } });
MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;
VARIANT["normal"].fonts.unshift("MathJax_SansSerif");
Expand Down Expand Up @@ -92,7 +92,7 @@
}
} (function(JSROOT) {

JSROOT.version = "5.1.1 23/03/2017";
JSROOT.version = "5.1.2 21/04/2017";

JSROOT.source_dir = "";
JSROOT.source_min = false;
Expand Down Expand Up @@ -1535,13 +1535,17 @@
m.evalPar = function(x, y) {
if (! ('_func' in this) || (this._title !== this.fTitle)) {

var _func = this.fTitle, isformula = false;
var _func = this.fTitle, isformula = false, pprefix = "[";
if (_func === "gaus") _func = "gaus(0)";
if (this.fFormula && typeof this.fFormula.fFormula == "string")
if (this.fFormula && typeof this.fFormula.fFormula == "string") {
if (this.fFormula.fFormula.indexOf("[](double*x,double*p)")==0) {
isformula = true;
isformula = true; pprefix = "p[";
_func = this.fFormula.fFormula.substr(21);
} else {
_func = this.fFormula.fFormula;
pprefix = "[p";
}
}

if ('formulas' in this)
for (var i=0;i<this.formulas.length;++i)
Expand All @@ -1563,7 +1567,7 @@
.replace(/ROOT::Math::/g, 'this._math.');
}
for (var i=0;i<this.fNpar;++i) {
var parname = (isformula ? "p[" : "[") + i + "]";
var parname = pprefix + i + "]";
while(_func.indexOf(parname) != -1)
_func = _func.replace(parname, '('+this.GetParValue(i)+')');
}
Expand Down Expand Up @@ -1898,7 +1902,7 @@
if (JSROOT.GetUrlOption('2d', src)!=null) prereq += "2d;";
if (JSROOT.GetUrlOption('jq2d', src)!=null) prereq += "jq2d;";
if (JSROOT.GetUrlOption('more2d', src)!=null) prereq += "more2d;";
if (JSROOT.GetUrlOption('geo', src)!=null) prereq += "geo;";
if (JSROOT.GetUrlOption('geom', src)!=null) prereq += "geom;";
if (JSROOT.GetUrlOption('3d', src)!=null) prereq += "3d;";
if (JSROOT.GetUrlOption('math', src)!=null) prereq += "math;";
if (JSROOT.GetUrlOption('mathjax', src)!=null) prereq += "mathjax;";
Expand Down
2 changes: 2 additions & 0 deletions etc/http/scripts/JSRootGeoBase.js
Expand Up @@ -2910,6 +2910,7 @@
JSROOT.GEO.ClonedNodes = function(obj, clones) {
this.toplevel = true; // indicate if object creates top-level structure with Nodes and Volumes folder
this.name_prefix = ""; // name prefix used for nodes names
this.maxdepth = 1; // maximal hierarchy depth, required for transparancy

if (obj) {
if (obj.$geoh) this.toplevel = false;
Expand Down Expand Up @@ -2970,6 +2971,7 @@

obj._refid = this.origin.length;
this.origin.push(obj);
if (sublevel>this.maxdepth) this.maxdepth = sublevel;

var chlds = null;
if (kind===0)
Expand Down
1 change: 1 addition & 0 deletions etc/http/scripts/JSRootGeoPainter.js
Expand Up @@ -1179,6 +1179,7 @@

// keep full stack of nodes
mesh.stack = entry.stack;
mesh.renderOrder = this._clones.maxdepth - entry.stack.length; // order of transparancy handling

obj3d.add(mesh);

Expand Down
7 changes: 4 additions & 3 deletions etc/http/scripts/JSRootPainter.jquery.js
Expand Up @@ -818,9 +818,10 @@
var jmain = $("#"+this.gui_div+" .jsroot_browser"), top = 7, left = 7;

if (this.browser_visible) {
var area = jmain.find(".jsroot_browser_area");
top = area.offset().top + 7;
left = area.offset().left + area.innerWidth() - 27;
var area = jmain.find(".jsroot_browser_area"),
off0 = jmain.offset(), off1 = area.offset();
top = off1.top - off0.top + 7;
left = off1.left - off0.left + area.innerWidth() - 27;
}

jmain.find(".jsroot_browser_btns")
Expand Down
8 changes: 4 additions & 4 deletions etc/http/scripts/JSRootPainter.js
Expand Up @@ -1384,8 +1384,8 @@

// set attributes for debugging
if (this.draw_object!==null) {
this.draw_g.attr('objname', this.draw_object.fName || "name");
this.draw_g.attr('objtype', this.draw_object._typename || "type");
this.draw_g.attr('objname', encodeURI(this.draw_object.fName || "name"));
this.draw_g.attr('objtype', encodeURI(this.draw_object._typename || "type"));
}

return this.draw_g;
Expand Down Expand Up @@ -1864,9 +1864,9 @@

var id = "pat_" + this.pattern + "_" + this.colorindx;

var defs = svg.select('defs');
var defs = svg.select('.canvas_defs');
if (defs.empty())
defs = svg.insert("svg:defs",":first-child");
defs = svg.insert("svg:defs",":first-child").attr("class","canvas_defs");

var line_color = this.color;
this.color = "url(#" + id + ")";
Expand Down
15 changes: 12 additions & 3 deletions etc/http/scripts/JSRootPainter.more.js
Expand Up @@ -975,8 +975,9 @@
var xx = xmin + dx*n;
// check if points need to be displayed at all, keep at least 4-5 points for Bezier curves
if ((gxmin !== gxmax) && ((xx + 2*dx < gxmin) || (xx - 2*dx > gxmax))) continue;
var yy = tf1.fSave[n];

res.push({ x: xx, y: tf1.fSave[n] });
if (!isNaN(yy)) res.push({ x : xx, y : yy });
}
return res;
}
Expand Down Expand Up @@ -1012,7 +1013,7 @@
var xmin = 0, xmax = 1, ymin = 0, ymax = 1,
bins = this.CreateBins(true);

if (bins!==null) {
if ((bins!==null) && (bins.length > 0)) {

xmin = xmax = bins[0].x;
ymin = ymax = bins[0].y;
Expand All @@ -1032,7 +1033,15 @@
tf1 = this.GetObject();

histo.fName = tf1.fName + "_hist";
histo.fTitle = tf1.fTitle;
if (tf1.fTitle.indexOf(';')!==0) {
var array = tf1.fTitle.split(';');
histo.fTitle = array[0];
if (array.length>1)
histo.fXaxis.fTitle = array[1];
if (array.length>2)
histo.fYaxis.fTitle = array[2];
}
else histo.fTitle = tf1.fTitle;

histo.fXaxis.fXmin = xmin;
histo.fXaxis.fXmax = xmax;
Expand Down
2 changes: 1 addition & 1 deletion etc/http/scripts/mathjax_config.js
@@ -1,4 +1,4 @@
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }, SVG: { mtextFontInherit: true, minScaleAdjust: 100, matchFontHeight: true } });
MathJax.Hub.Config({ TeX: { extensions: ["color.js"] }, SVG: { mtextFontInherit: true, minScaleAdjust: 100, matchFontHeight: true, useFontCache: false } });
MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;
VARIANT["normal"].fonts.unshift("MathJax_SansSerif");
Expand Down

0 comments on commit 43ed9f8

Please sign in to comment.