1 (
function(a){
if(typeof define===
"function"&&define.amd){define([
"JSRootCore",
"d3"],a)}
else{
if(typeof JSROOT==
"undefined"){
throw new Error(
"JSROOT is not defined",
"JSRootPainter.js")}
if(typeof d3!=
"object"){
throw new Error(
"d3 is not defined",
"JSRootPainter.js")}
if(typeof JSROOT.Painter==
"object"){
throw new Error(
"JSROOT.Painter already defined",
"JSRootPainter.js")}a(JSROOT,d3)}}(
function(a,b){
if(typeof define===
"function"&&define.amd){a.loadScript(
"$$$style/JSRootPainter.css")}a.DrawFuncs={lst:[],cache:{}};a.addDrawFunc=
function(c,d,e){
if((arguments.length==1)&&(typeof arguments[0]==
"object")){a.DrawFuncs.lst.push(arguments[0]);
return arguments[0]}var f={name:c,func:d,opt:e};a.DrawFuncs.lst.push(f);
return f};a.ToolbarIcons={camera:{path:
"M 152.00,304.00c0.00,57.438, 46.562,104.00, 104.00,104.00s 104.00-46.562, 104.00-104.00s-46.562-104.00-104.00-104.00S 152.00,246.562, 152.00,304.00z M 480.00,128.00L 368.00,128.00 c-8.00-32.00-16.00-64.00-48.00-64.00L 192.00,64.00 c-32.00,0.00-40.00,32.00-48.00,64.00L 32.00,128.00 c-17.60,0.00-32.00,14.40-32.00,32.00l0.00,288.00 c0.00,17.60, 14.40,32.00, 32.00,32.00l 448.00,0.00 c 17.60,0.00, 32.00-14.40, 32.00-32.00L 512.00,160.00 C 512.00,142.40, 497.60,128.00, 480.00,128.00z M 256.00,446.00c-78.425,0.00-142.00-63.574-142.00-142.00c0.00-78.425, 63.575-142.00, 142.00-142.00c 78.426,0.00, 142.00,63.575, 142.00,142.00 C 398.00,382.426, 334.427,446.00, 256.00,446.00z M 480.00,224.00l-64.00,0.00 l0.00-32.00 l 64.00,0.00 L 480.00,224.00 z"},disk:{path:
"M384,0H128H32C14.336,0,0,14.336,0,32v448c0,17.656,14.336,32,32,32h448c17.656,0,32-14.344,32-32V96L416,0H384z M352,160 V32h32v128c0,17.664-14.344,32-32,32H160c-17.664,0-32-14.336-32-32V32h128v128H352z M96,288c0-17.656,14.336-32,32-32h256 c17.656,0,32,14.344,32,32v192H96V288z"},question:{path:
"M256,512c141.375,0,256-114.625,256-256S397.375,0,256,0S0,114.625,0,256S114.625,512,256,512z M256,64 c63.719,0,128,36.484,128,118.016c0,47.453-23.531,84.516-69.891,110.016C300.672,299.422,288,314.047,288,320 c0,17.656-14.344,32-32,32c-17.664,0-32-14.344-32-32c0-40.609,37.25-71.938,59.266-84.031 C315.625,218.109,320,198.656,320,182.016C320,135.008,279.906,128,256,128c-30.812,0-64,20.227-64,64.672 c0,17.664-14.336,32-32,32s-32-14.336-32-32C128,109.086,193.953,64,256,64z M256,449.406c-18.211,0-32.961-14.75-32.961-32.969 c0-18.188,14.75-32.953,32.961-32.953c18.219,0,32.969,14.766,32.969,32.953C288.969,434.656,274.219,449.406,256,449.406z"},undo:{path:
"M450.159,48.042c8.791,9.032,16.983,18.898,24.59,29.604c7.594,10.706,14.146,22.207,19.668,34.489 c5.509,12.296,9.82,25.269,12.92,38.938c3.113,13.669,4.663,27.834,4.663,42.499c0,14.256-1.511,28.863-4.532,43.822 c-3.009,14.952-7.997,30.217-14.953,45.795c-6.955,15.577-16.202,31.52-27.755,47.826s-25.88,32.9-42.942,49.807 c-5.51,5.444-11.787,11.67-18.834,18.651c-7.033,6.98-14.496,14.366-22.39,22.168c-7.88,7.802-15.955,15.825-24.187,24.069 c-8.258,8.231-16.333,16.203-24.252,23.888c-18.3,18.13-37.354,37.016-57.191,56.65l-56.84-57.445 c19.596-19.472,38.54-38.279,56.84-56.41c7.75-7.685,15.772-15.604,24.108-23.757s16.438-16.163,24.33-24.057 c7.894-7.893,15.356-15.33,22.402-22.312c7.034-6.98,13.312-13.193,18.821-18.651c22.351-22.402,39.165-44.648,50.471-66.738 c11.279-22.09,16.932-43.567,16.932-64.446c0-15.785-3.217-31.005-9.638-45.671c-6.422-14.665-16.229-28.504-29.437-41.529 c-3.282-3.282-7.358-6.395-12.217-9.325c-4.871-2.938-10.381-5.503-16.516-7.697c-6.121-2.201-12.815-3.992-20.058-5.373 c-7.242-1.374-14.9-2.064-23.002-2.064c-8.218,0-16.802,0.834-25.788,2.507c-8.961,1.674-18.053,4.429-27.222,8.271 c-9.189,3.842-18.456,8.869-27.808,15.089c-9.358,6.219-18.521,13.819-27.502,22.793l-59.92,60.271l93.797,94.058H0V40.91 l93.27,91.597l60.181-60.532c13.376-15.018,27.222-27.248,41.536-36.697c14.308-9.443,28.608-16.776,42.89-21.992 c14.288-5.223,28.505-8.74,42.623-10.557C294.645,0.905,308.189,0,321.162,0c13.429,0,26.389,1.185,38.84,3.562 c12.478,2.377,24.2,5.718,35.192,10.029c11.006,4.311,21.126,9.404,30.374,15.265C434.79,34.724,442.995,41.119,450.159,48.042z"},arrow_right:{path:
"M30.796,226.318h377.533L294.938,339.682c-11.899,11.906-11.899,31.184,0,43.084c11.887,11.899,31.19,11.893,43.077,0 l165.393-165.386c5.725-5.712,8.924-13.453,8.924-21.539c0-8.092-3.213-15.84-8.924-21.551L338.016,8.925 C332.065,2.975,324.278,0,316.478,0c-7.802,0-15.603,2.968-21.539,8.918c-11.899,11.906-11.899,31.184,0,43.084l113.391,113.384 H30.796c-16.822,0-30.463,13.645-30.463,30.463C0.333,212.674,13.974,226.318,30.796,226.318z"},arrow_up:{path:
"M295.505,629.446V135.957l148.193,148.206c15.555,15.559,40.753,15.559,56.308,0c15.555-15.538,15.546-40.767,0-56.304 L283.83,11.662C276.372,4.204,266.236,0,255.68,0c-10.568,0-20.705,4.204-28.172,11.662L11.333,227.859 c-7.777,7.777-11.666,17.965-11.666,28.158c0,10.192,3.88,20.385,11.657,28.158c15.563,15.555,40.762,15.555,56.317,0 l148.201-148.219v493.489c0,21.993,17.837,39.82,39.82,39.82C277.669,669.267,295.505,651.439,295.505,629.446z"},arrow_diag:{path:
"M279.875,511.994c-1.292,0-2.607-0.102-3.924-0.312c-10.944-1.771-19.333-10.676-20.457-21.71L233.97,278.348 L22.345,256.823c-11.029-1.119-19.928-9.51-21.698-20.461c-1.776-10.944,4.031-21.716,14.145-26.262L477.792,2.149 c9.282-4.163,20.167-2.165,27.355,5.024c7.201,7.189,9.199,18.086,5.024,27.356L302.22,497.527 C298.224,506.426,289.397,511.994,279.875,511.994z M118.277,217.332l140.534,14.294c11.567,1.178,20.718,10.335,21.878,21.896 l14.294,140.519l144.09-320.792L118.277,217.332z"},auto_zoom:{path:
"M505.441,242.47l-78.303-78.291c-9.18-9.177-24.048-9.171-33.216,0c-9.169,9.172-9.169,24.045,0.006,33.217l38.193,38.188 H280.088V80.194l38.188,38.199c4.587,4.584,10.596,6.881,16.605,6.881c6.003,0,12.018-2.297,16.605-6.875 c9.174-9.172,9.174-24.039,0.011-33.217L273.219,6.881C268.803,2.471,262.834,0,256.596,0c-6.229,0-12.202,2.471-16.605,6.881 l-78.296,78.302c-9.178,9.172-9.178,24.045,0,33.217c9.177,9.171,24.051,9.171,33.21,0l38.205-38.205v155.4H80.521l38.2-38.188 c9.177-9.171,9.177-24.039,0.005-33.216c-9.171-9.172-24.039-9.178-33.216,0L7.208,242.464c-4.404,4.403-6.881,10.381-6.881,16.611 c0,6.227,2.477,12.207,6.881,16.61l78.302,78.291c4.587,4.581,10.599,6.875,16.605,6.875c6.006,0,12.023-2.294,16.61-6.881 c9.172-9.174,9.172-24.036-0.005-33.211l-38.205-38.199h152.593v152.063l-38.199-38.211c-9.171-9.18-24.039-9.18-33.216-0.022 c-9.178,9.18-9.178,24.059-0.006,33.222l78.284,78.302c4.41,4.404,10.382,6.881,16.611,6.881c6.233,0,12.208-2.477,16.611-6.881 l78.302-78.296c9.181-9.18,9.181-24.048,0-33.205c-9.174-9.174-24.054-9.174-33.21,0l-38.199,38.188v-152.04h152.051l-38.205,38.199 c-9.18,9.175-9.18,24.037-0.005,33.211c4.587,4.587,10.596,6.881,16.604,6.881c6.01,0,12.024-2.294,16.605-6.875l78.303-78.285 c4.403-4.403,6.887-10.378,6.887-16.611C512.328,252.851,509.845,246.873,505.441,242.47z"},statbox:{path:
"M28.782,56.902H483.88c15.707,0,28.451-12.74,28.451-28.451C512.331,12.741,499.599,0,483.885,0H28.782 C13.074,0,0.331,12.741,0.331,28.451C0.331,44.162,13.074,56.902,28.782,56.902zM483.885,136.845H28.782c-15.708,0-28.451,12.741-28.451,28.451c0,15.711,12.744,28.451,28.451,28.451H483.88 c15.707,0,28.451-12.74,28.451-28.451C512.331,149.586,499.599,136.845,483.885,136.845zM483.885,273.275H28.782c-15.708,0-28.451,12.731-28.451,28.452c0,15.707,12.744,28.451,28.451,28.451H483.88 c15.707,0,28.451-12.744,28.451-28.451C512.337,286.007,499.599,273.275,483.885,273.275zM256.065,409.704H30.492c-15.708,0-28.451,12.731-28.451,28.451c0,15.707,12.744,28.451,28.451,28.451h225.585 c15.707,0,28.451-12.744,28.451-28.451C284.516,422.436,271.785,409.704,256.065,409.704z"}};a.Toolbar=
function(c,d){
if((c!==undefined)&&(typeof c.append==
"function")){this.element=c.append(
"div").attr(
"class",
"jsroot");this.addButtons(d)}};a.Toolbar.prototype.addButtons=
function(d){var c=
this;this.buttonsNames=[];d.forEach(
function(e){var f=c.element.append(
"div").attr(
"class",
"toolbar-group");e.forEach(
function(h){var g=h.name;
if(!g){
throw new Error(
"must provide button 'name' in button config")}
if(c.buttonsNames.indexOf(g)!==-1){
throw new Error(
"button name '"+g+
"' is taken")}c.buttonsNames.push(g);c.createButton(f,h)})})};a.Toolbar.prototype.createButton=
function(e,c){var f=c.title;
if(f===undefined){f=c.name}
if(typeof c.click!==
"function"){
throw new Error(
"must provide button 'click' function in button config")}var d=e.append(
"a").attr(
"class",
"toolbar-btn").attr(
"rel",
"tooltip").attr(
"data-title",f).on(
"click",c.click);this.createIcon(d,c.icon||a.ToolbarIcons.question)};a.Toolbar.prototype.createIcon=
function(f,d){var e=d.size||512;var i=d.scale||1;var c=f.append(
"svg:svg").attr(
"height",
"1em").attr(
"width",
"1em").attr(
"viewBox",[0,0,e,e].join(
" "));
if(
"recs" in d){var h={};
for(var j=0;j<d.recs.length;++j){a.extend(h,d.recs[j]);c.append(
"rect").attr(
"x",h.x).attr(
"y",h.y).attr(
"width",h.w).attr(
"height",h.h).attr(
"fill",h.f)}}
else{var g=c.append(
"svg:path").attr(
"d",d.path);
if(i!==1){g.attr(
"transform",
"scale("+i+
" "+i+
")")}}};a.Toolbar.prototype.removeAllButtons=
function(){this.element.remove()};a.Painter={};a.Painter.createMenu=
function(c,d){document.body.style.cursor=
"wait";a.AssertPrerequisites(
"jq2d",
function(){document.body.style.cursor=
"auto";a.Painter.createMenu(c,d)})};a.Painter.closeMenu=
function(d){
if(!d){d=
"root_ctx_menu"}var c=document.getElementById(d);
if(c){c.parentNode.removeChild(c)}};a.Painter.readStyleFromURL=
function(e){var i=a.GetUrlOption(
"optimize",e);
if(i==
""){a.gStyle.OptimizeDraw=2}
else{
if(i!==null){a.gStyle.OptimizeDraw=parseInt(i);
if(isNaN(a.gStyle.OptimizeDraw)){a.gStyle.OptimizeDraw=2}}}var g=a.GetUrlOption(
"interactive",e);
if((g==
"")||(g==
"1")){g=
"11111"}
else{
if(g==
"0"){g=
"00000"}}
if((g!==null)&&(g.length==5)){a.gStyle.Tooltip=parseInt(g.charAt(0));a.gStyle.ContextMenu=(g.charAt(1)!=
"0");a.gStyle.Zooming=(g.charAt(2)!=
"0");a.gStyle.MoveResize=(g.charAt(3)!=
"0");a.gStyle.DragAndDrop=(g.charAt(4)!=
"0")}var h=a.GetUrlOption(
"tooltip",e);
if(h!==null){a.gStyle.Tooltip=parseInt(h)}var k=a.GetUrlOption(
"mathjax",e);
if((k!==null)&&(k!=
"0")){a.gStyle.MathJax=1}
if(a.GetUrlOption(
"nomenu",e)!=null){a.gStyle.ContextMenu=
false}
if(a.GetUrlOption(
"noprogress",e)!=null){a.gStyle.ProgressBox=
false}
if(a.GetUrlOption(
"notouch",e)!=null){a.touches=
false}a.gStyle.OptStat=a.GetUrlOption(
"optstat",e,a.gStyle.OptStat);a.gStyle.OptFit=a.GetUrlOption(
"optfit",e,a.gStyle.OptFit);a.gStyle.StatFormat=a.GetUrlOption(
"statfmt",e,a.gStyle.StatFormat);a.gStyle.FitFormat=a.GetUrlOption(
"fitfmt",e,a.gStyle.FitFormat);var j=a.GetUrlOption(
"toolbar",e);
if(j!==null){a.gStyle.ToolBar=(j!==
"0")&&(j!==
"false")}var f=a.GetUrlOption(
"palette",e);
if(f!==null){f=parseInt(f);
if(!isNaN(f)&&(f>0)&&(f<113)){a.gStyle.Palette=f}}var d=a.GetUrlOption(
"embed3d",e);
if(d!==null){a.gStyle.Embed3DinSVG=parseInt(d)}var c=a.GetUrlOption(
"webgl",e);
if((c===
"0")||(c===
"false")){a.gStyle.NoWebGL=
false}
else{
if(c===
"ie"){a.gStyle.NoWebGL=!a.browser.isIE}}};a.Painter.Coord={kCARTESIAN:1,kPOLAR:2,kCYLINDRICAL:3,kSPHERICAL:4,kRAPIDITY:5};a.Painter.root_colors=
function(){var d=[
"white",
"black",
"red",
"green",
"blue",
"yellow",
"magenta",
"cyan",
"rgb(89,212,84)",
"rgb(89,84,217)",
"white"];d[110]=
"white";var g=[{col:11,str:
"c1b7ad4d4d4d6666668080809a9a9ab3b3b3cdcdcde6e6e6f3f3f3cdc8accdc8acc3c0a9bbb6a4b3a697b8a49cae9a8d9c8f83886657b1cfc885c3a48aa9a1839f8daebdc87b8f9a768a926983976e7b857d9ad280809caca6c0d4cf88dfbb88bd9f83c89a7dc08378cf5f61ac8f94a6787b946971d45a549300ff7b00ff6300ff4b00ff3300ff1b00ff0300ff0014ff002cff0044ff005cff0074ff008cff00a4ff00bcff00d4ff00ecff00fffd00ffe500ffcd00ffb500ff9d00ff8500ff6d00ff5500ff3d00ff2600ff0e0aff0022ff003aff0052ff006aff0082ff009aff00b1ff00c9ff00e1ff00f9ff00ffef00ffd700ffbf00ffa700ff8f00ff7700ff6000ff4800ff3000ff1800ff0000"},{col:201,str:
"5c5c5c7b7b7bb8b8b8d7d7d78a0f0fb81414ec4848f176760f8a0f14b81448ec4876f1760f0f8a1414b84848ec7676f18a8a0fb8b814ecec48f1f1768a0f8ab814b8ec48ecf176f10f8a8a14b8b848ecec76f1f1"},{col:390,str:
"ffffcdffff9acdcd9affff66cdcd669a9a66ffff33cdcd339a9a33666633ffff00cdcd009a9a00666600333300"},{col:406,str:
"cdffcd9aff9a9acd9a66ff6666cd66669a6633ff3333cd33339a3333663300ff0000cd00009a00006600003300"},{col:422,str:
"cdffff9affff9acdcd66ffff66cdcd669a9a33ffff33cdcd339a9a33666600ffff00cdcd009a9a006666003333"},{col:590,str:
"cdcdff9a9aff9a9acd6666ff6666cd66669a3333ff3333cd33339a3333660000ff0000cd00009a000066000033"},{col:606,str:
"ffcdffff9affcd9acdff66ffcd66cd9a669aff33ffcd33cd9a339a663366ff00ffcd00cd9a009a660066330033"},{col:622,str:
"ffcdcdff9a9acd9a9aff6666cd66669a6666ff3333cd33339a3333663333ff0000cd00009a0000660000330000"},{col:791,str:
"ffcd9acd9a669a66339a6600cd9a33ffcd66ff9a00ffcd33cd9a00ffcd00ff9a33cd66006633009a3300cd6633ff9a66ff6600ff6633cd3300ff33009aff3366cd00336600339a0066cd339aff6666ff0066ff3333cd0033ff00cdff9a9acd66669a33669a009acd33cdff669aff00cdff339acd00cdff009affcd66cd9a339a66009a6633cd9a66ffcd00ff6633ffcd00cd9a00ffcd33ff9a00cd66006633009a3333cd6666ff9a00ff9a33ff6600cd3300ff339acdff669acd33669a00339a3366cd669aff0066ff3366ff0033cd0033ff339aff0066cd00336600669a339acd66cdff009aff33cdff009acd00cdffcd9aff9a66cd66339a66009a9a33cdcd66ff9a00ffcd33ff9a00cdcd00ff9a33ff6600cd33006633009a6633cd9a66ff6600ff6633ff3300cd3300ffff339acd00666600339a0033cd3366ff669aff0066ff3366cd0033ff0033ff9acdcd669a9a33669a0066cd339aff66cdff009acd009aff33cdff009a"},{col:920,str:
"cdcdcd9a9a9a666666333333"}];
for(var f=0;f<g.length;++f){var e=g[f];
for(var h=0;h<e.str.length;h+=6){var c=parseInt(e.col)+parseInt(h/6);d[c]=
"rgb("+parseInt(
"0x"+e.str.slice(h,h+2))+
","+parseInt(
"0x"+e.str.slice(h+2,h+4))+
","+parseInt(
"0x"+e.str.slice(h+4,h+6))+
")"}}
return d}();a.Painter.MakeColorRGB=
function(d){
if((d==null)||(d._typename!=
"TColor")){
return null}var c=Math.round(d.fRed*255)+
","+Math.round(d.fGreen*255)+
","+Math.round(d.fBlue*255);
if((d.fAlpha===undefined)||(d.fAlpha==1)){c=
"rgb("+c+
")"}
else{c=
"rgba("+c+
","+d.fAlpha.toFixed(3)+
")"}
switch(c){
case"rgb(255,255,255)":c=
"white";
break;
case"rgb(0,0,0)":c=
"black";
break;
case"rgb(255,0,0)":c=
"red";
break;
case"rgb(0,255,0)":c=
"green";
break;
case"rgb(0,0,255)":c=
"blue";
break;
case"rgb(255,255,0)":c=
"yellow";
break;
case"rgb(255,0,255)":c=
"magenta";
break;
case"rgb(0,255,255)":c=
"cyan";
break}
return c};a.Painter.adoptRootColors=
function(f){
if(!f||!f.arr){
return}
for(var g=0;g<f.arr.length;++g){var e=f.arr[g];
if((e==null)||(e._typename!=
"TColor")){
continue}var d=e.fNumber;
if((d<0)||(d>4096)){
continue}var c=a.Painter.MakeColorRGB(e);
if(c==null){
continue}
if(a.Painter.root_colors[d]!=c){a.Painter.root_colors[d]=c}}};a.Painter.root_line_styles=
new Array(
"",
"",
"3,3",
"1,2",
"3,4,1,4",
"5,3,1,3",
"5,3,1,3,1,3,1,3",
"5,5",
"5,3,1,3,1,3",
"20,5",
"20,10,1,10",
"1,3");a.Painter.root_markers=
new Array(0,100,8,7,0,9,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,103,105,104,0,3,4,2,1,106,6,7,5,102,101);a.Painter.createAttMarker=
function(f,d){var e=a.Painter.root_colors[f.fMarkerColor];
if((d===null)||(d===undefined)){d=f.fMarkerStyle}var c={x0:0,y0:0,color:e,style:d,size:8,stroke:
true,fill:
true,marker:
"",ndig:0,used:
true};c.Change=
function(h,k,j){
if(h!==undefined){this.color=h}
if(k!==undefined){this.style=k}
if(j!==undefined){this.size=j}
else{j=this.size}this.x0=this.y0=0;this.reset_pos=
function(){this.lastx=this.lasty=null};
if((this.style===1)||(this.style===777)){this.fill=
false;this.marker=
"h1";this.size=1;this.create=
function(o,t){var r=Math.round(o),s=Math.round(t),q=
"M"+r+
","+s+
"h1";var p=(this.lastx===null)?q:(
"m"+(r-this.lastx)+
","+(s-this.lasty)+
"h1");this.lastx=r+1;this.lasty=s;
return(p.length<q.length)?p:q};this.reset_pos();
return true}var l=((this.style>0)&&(this.style<a.Painter.root_markers.length))?a.Painter.root_markers[
this.style]:100;var g=l%100;
this.fill=(l>=100);
switch(this.style){
case 1:j=this.size=1;
break;
case 6:j=this.size=2;
break;
case 7:j=this.size=3;
break;
default:this.size=j;j*=8}this.ndig=(j>7)?0:((j>2)?1:2);
if(g==6){this.ndig++}var m=(j/2).toFixed(this.ndig),i=j.toFixed(this.ndig);
switch(g){
case 0:this.x0=-j/2;this.marker=
"a"+m+
","+m+
" 0 1,0 "+i+
",0a"+m+
","+m+
" 0 1,0 -"+i+
",0z";
break;
case 1:var n=(j/3).toFixed(c.ndig);this.x0=this.y0=j/6;this.marker=
"h"+n+
"v-"+n+
"h-"+n+
"v-"+n+
"h-"+n+
"v"+n+
"h-"+n+
"v"+n+
"h"+n+
"v"+n+
"h"+n+
"z";
break;
case 2:this.x0=-j/2;this.marker=
"l"+m+
",-"+m+
"l"+m+
","+m+
"l-"+m+
","+m+
"z";
break;
case 3:this.x0=this.y0=-j/2;this.marker=
"v"+i+
"h"+i+
"v-"+i+
"z";
break;
case 4:this.y0=j/2;this.marker=
"l-"+m+
",-"+i+
"h"+i+
"z";
break;
case 5:this.y0=-j/2;this.marker=
"l-"+m+
","+i+
"h"+i+
"z";
break;
case 6:this.y0=-j/2;this.marker=
"l"+(j/3).toFixed(c.ndig)+
","+i+
"l-"+(5/6*j).toFixed(c.ndig)+
",-"+(5/8*j).toFixed(c.ndig)+
"h"+i+
"l-"+(5/6*j).toFixed(c.ndig)+
","+(5/8*j).toFixed(c.ndig)+
"z";
break;
case 7:this.x0=this.y0=-j/2;this.marker=
"l"+i+
","+i+
"m0,-"+i+
"l-"+i+
","+i+
"m0,-"+m+
"h"+i+
"m-"+m+
",-"+m+
"v"+i;
break;
case 8:this.y0=-j/2;this.marker=
"v"+i+
"m-"+m+
",-"+m+
"h"+i;
break;
case 9:this.x0=this.y0=-j/2;this.marker=
"l"+i+
","+i+
"m0,-"+i+
"l-"+i+
","+i;
break;
default:this.x0=-j/2;this.marker=
"l"+m+
",-"+m+
"l"+m+
","+m+
"l-"+m+
","+m+
"z";
break}this.create=
function(o,p){
return"M"+(o+this.x0).toFixed(this.ndig)+
","+(p+this.y0).toFixed(this.ndig)+this.marker};
return true};c.Apply=
function(g){g.style(
"stroke",this.stroke?this.color:
"none");g.style(
"fill",this.fill?this.color:
"none")};c.func=c.Apply.bind(c);c.Change(e,d,f.fMarkerSize);
return c};a.Painter.createAttLine=
function(i,g,f){var e=0,c=0,h=0;
if(typeof i==
"string"){
if(i==
"black"){e=1;c=1}
else{
if(i==
"none"){c=0}}}
else{
if(typeof i==
"object"){
if(
"fLineColor" in i){e=i.fLineColor}
if(
"fLineWidth" in i){c=i.fLineWidth}
if(
"fLineStyle" in i){h=i.fLineStyle}}
else{
if((i!==undefined)&&!isNaN(i)){e=i}}}
if(g!==undefined){c=g}var d={used:
true,color:a.Painter.root_colors[e],width:c,dash:a.Painter.root_line_styles[h]};
if((c==0)||(e==0)){d.color=
"none"}
if(f){d.excl_side=0;d.excl_width=0;
if(Math.abs(d.width)>99){d.excl_side=(d.width<0)?-1:1;d.excl_width=Math.floor(d.width/100)*5;d.width=d.width%100}}
if((d.color===undefined)&&(e>0)){d.color=
"lightgrey"}d.Apply=
function(j){this.used=
true;
if(this.color==
"none"){j.style(
"stroke",null);j.style(
"stroke-width",null);j.style(
"stroke-dasharray",null)}
else{j.style(
"stroke",this.color);j.style(
"stroke-width",this.width);
if(this.dash&&(this.dash.length>0)){j.style(
"stroke-dasharray",this.dash)}}};d.func=d.Apply.bind(d);
return d};a.Painter.clearCuts=
function(c){var f=c.indexOf(
"[");var e=c.indexOf(
"]");
if((f>=0)&&(e>=0)&&(f<e)){
for(var d=f;d<=e;++d){c[d]=
" "}}
return c};a.Painter.root_fonts=
new Array(
"Arial",
"Times New Roman",
"bTimes New Roman",
"biTimes New Roman",
"Arial",
"oArial",
"bArial",
"boArial",
"Courier New",
"oCourier New",
"bCourier New",
"boCourier New",
"Symbol",
"Times New Roman",
"Wingdings",
"Symbol",
"Verdana");a.Painter.getFontDetails=
function(f,d){var e=a.Painter.root_fonts[Math.floor(f/10)];var c={name:
"Arial",size:11,weight:null,style:null};
if(d!=undefined){c.size=Math.round(d)}
if(typeof e!=
"string"){e=
""}
while(e.length>0){
if(e.charAt(0)===
"b"){c.weight=
"bold"}
else{
if(e.charAt(0)===
"i"){c.style=
"italic"}
else{
if(e.charAt(0)===
"o"){c.style=
"oblique"}
else{
break}}}e=e.substr(1)}
if(e==
"Symbol"){c.weight=null;c.style=null}c.name=e;c.SetFont=
function(g){g.attr(
"font-family",this.name).attr(
"font-size",this.size).attr(
"xml:space",
"preserve");
if(this.weight!=null){g.attr(
"font-weight",this.weight)}
if(this.style!=null){g.attr(
"font-style",this.style)}};c.asStyle=
function(g){
return((g!=null)?g:this.size)+
"px "+this.name};c.stringWidth=
function(i,h){var j=i.append(
"svg:text").attr(
"xml:space",
"preserve").style(
"opacity",0).text(h);this.SetFont(j);var g=j.node().getBBox().width;j.remove();
return g};c.func=c.SetFont.bind(c);
return c};a.Painter.chooseTimeFormat=
function(d,c){
if(d<0.5){
return c?
"%S.%L":
"%M:%S.%L"}
if(d<30){
return c?
"%Mm%S":
"%H:%M:%S"}d/=60;
if(d<30){
return c?
"%Hh%M":
"%d/%m %H:%M"}d/=60;
if(d<12){
return c?
"%d-%Hh":
"%d/%m/%y %Hh"}d/=24;
if(d<15.218425){
return c?
"%d/%m":
"%d/%m/%y"}d/=30.43685;
if(d<6){
return"%d/%m/%y"}d/=12;
if(d<2){
return c?
"%m/%y":
"%d/%m/%y"}
return"%Y"};a.Painter.getTimeFormat=
function(c){var d=c.fTimeFormat.indexOf(
"%F");
if(d>=0){
return c.fTimeFormat.substr(0,d)}
return c.fTimeFormat};a.Painter.getTimeOffset=
function(d){var f=d.fTimeFormat.indexOf(
"%F");
if(f<0){
return a.gStyle.TimeOffset}var c=d.fTimeFormat.substr(f+2);
if(c==
"1995-01-01 00:00:00s0"){
return 788918400000}
if((c==
"0")||(c==
"")){
return 0}var e=
new Date(0);var g=c.indexOf(
"-");e.setFullYear(c.substr(0,g));c=c.substr(g+1);g=c.indexOf(
"-");e.setMonth(parseInt(c.substr(0,g))-1);c=c.substr(g+1);g=c.indexOf(
" ");e.setDate(c.substr(0,g));c=c.substr(g+1);g=c.indexOf(
":");e.setHours(c.substr(0,g));c=c.substr(g+1);g=c.indexOf(
":");e.setMinutes(c.substr(0,g));c=c.substr(g+1);g=c.indexOf(
"s");e.setSeconds(c.substr(0,g));
if(g>0){c=c.substr(g+1);e.setMilliseconds(c)}
return e.getTime()};a.Painter.formatExp=
function(l){var k=l;
if(parseFloat(k)==1){
return"1"}
if(parseFloat(k)==10){
return"10"}var k=k.replace(
"e+",
"x10@");var k=k.replace(
"e-",
"x10@-");var f=k.substring(0,k.indexOf(
"@"));var g=k.substr(k.indexOf(
"@"));f=f.replace(
"@",
"");g=g.replace(
"@",
"");var m,n=g.length;
for(var d=0;d<n;++d){var m,i=g.charAt(d);
if(i==
"+"){m=
"\u207A"}
else{
if(i==
"-"){m=
"\u207B"}
else{var h=parseInt(i);
if(h==1){m=String.fromCharCode(185)}
else{
if(h>1&&h<4){m=String.fromCharCode(176+h)}
else{m=String.fromCharCode(8304+h)}}}}g=g.replace(i,m)}f=f.replace(
"1x",
"");
return f+g};a.Painter.translateExp=
function(m){var h=m.match(/\^{[0-9]*}/gi);
if(h!=null){var d=
"";
for(var g=0;g<h.length;++g){d=h[g].replace(
" ",
"");d=d.replace(
"^{",
"");d=d.replace(
"}",
"");var o=d.length;
for(var f=0;f<o;++f){var l=d.charAt(f);var n,k=parseInt(l);
if(k==1){n=String.fromCharCode(185)}
else{
if(k>1&&k<4){n=String.fromCharCode(176+k)}
else{n=String.fromCharCode(8304+k)}}d=d.replace(l,n)}m=m.replace(h[g],d)}}
return m};a.Painter.symbols_map={
"#alpha":
"\u03B1",
"#beta":
"\u03B2",
"#chi":
"\u03C7",
"#delta":
"\u03B4",
"#varepsilon":
"\u03B5",
"#phi":
"\u03C6",
"#gamma":
"\u03B3",
"#eta":
"\u03B7",
"#iota":
"\u03B9",
"#varphi":
"\u03C6",
"#kappa":
"\u03BA",
"#lambda":
"\u03BB",
"#mu":
"\u03BC",
"#nu":
"\u03BD",
"#omicron":
"\u03BF",
"#pi":
"\u03C0",
"#theta":
"\u03B8",
"#rho":
"\u03C1",
"#sigma":
"\u03C3",
"#tau":
"\u03C4",
"#upsilon":
"\u03C5",
"#varomega":
"\u03D6",
"#omega":
"\u03C9",
"#xi":
"\u03BE",
"#psi":
"\u03C8",
"#zeta":
"\u03B6",
"#Alpha":
"\u0391",
"#Beta":
"\u0392",
"#Chi":
"\u03A7",
"#Delta":
"\u0394",
"#Epsilon":
"\u0395",
"#Phi":
"\u03A6",
"#Gamma":
"\u0393",
"#Eta":
"\u0397",
"#Iota":
"\u0399",
"#vartheta":
"\u03D1",
"#Kappa":
"\u039A",
"#Lambda":
"\u039B",
"#Mu":
"\u039C",
"#Nu":
"\u039D",
"#Omicron":
"\u039F",
"#Pi":
"\u03A0",
"#Theta":
"\u0398",
"#Rho":
"\u03A1",
"#Sigma":
"\u03A3",
"#Tau":
"\u03A4",
"#Upsilon":
"\u03A5",
"#varsigma":
"\u03C2",
"#Omega":
"\u03A9",
"#Xi":
"\u039E",
"#Psi":
"\u03A8",
"#Zeta":
"\u0396",
"#varUpsilon":
"\u03D2",
"#epsilon":
"\u03B5",
"#sqrt":
"\u221A",
"#leq":
"\u2264",
"#/":
"\u2044",
"#infty":
"\u221E",
"#voidb":
"\u0192",
"#club":
"\u2663",
"#diamond":
"\u2666",
"#heart":
"\u2665",
"#spade":
"\u2660",
"#leftrightarrow":
"\u2194",
"#leftarrow":
"\u2190",
"#uparrow":
"\u2191",
"#rightarrow":
"\u2192",
"#downarrow":
"\u2193",
"#circ":
"\u02C6",
"#pm":
"\xB1",
"#doublequote":
"\u2033",
"#geq":
"\u2265",
"#times":
"\xD7",
"#propto":
"\u221D",
"#partial":
"\u2202",
"#bullet":
"\u2022",
"#divide":
"\xF7",
"#neq":
"\u2260",
"#equiv":
"\u2261",
"#approx":
"\u2248",
"#3dots":
"\u2026",
"#cbar":
"\u007C",
"#topbar":
"\xAF",
"#downleftarrow":
"\u21B5",
"#aleph":
"\u2135",
"#Jgothic":
"\u2111",
"#Rgothic":
"\u211C",
"#voidn":
"\u2118",
"#otimes":
"\u2297",
"#oplus":
"\u2295",
"#oslash":
"\u2205",
"#cap":
"\u2229",
"#cup":
"\u222A",
"#supseteq":
"\u2287",
"#supset":
"\u2283",
"#notsubset":
"\u2284",
"#subseteq":
"\u2286",
"#subset":
"\u2282",
"#int":
"\u222B",
"#in":
"\u2208",
"#notin":
"\u2209",
"#angle":
"\u2220",
"#nabla":
"\u2207",
"#oright":
"\xAE",
"#ocopyright":
"\xA9",
"#trademark":
"\u2122",
"#prod":
"\u220F",
"#surd":
"\u221A",
"#upoint":
"\u22C5",
"#corner":
"\xAC",
"#wedge":
"\u2227",
"#vee":
"\u2228",
"#Leftrightarrow":
"\u21D4",
"#Leftarrow":
"\u21D0",
"#Uparrow":
"\u21D1",
"#Rightarrow":
"\u21D2",
"#Downarrow":
"\u21D3",
"#LT":
"\x3C",
"#void1":
"\xAE",
"#copyright":
"\xA9",
"#void3":
"\u2122",
"#sum":
"\u2211",
"#arctop":
"",
"#lbar":
"",
"#arcbottom":
"",
"#void8":
"",
"#bottombar":
"\u230A",
"#arcbar":
"",
"#ltbar":
"",
"#AA":
"\u212B",
"#aa":
"\u00E5",
"#void06":
"",
"#GT":
"\x3E",
"#forall":
"\u2200",
"#exists":
"\u2203",
"#bar":
"",
"#vec":
"",
"#dot":
"\u22C5",
"#hat":
"\xB7",
"#ddot":
"",
"#acute":
"acute",
"#grave":
"",
"#check":
"\u2713",
"#tilde":
"\u02DC",
"#slash":
"\u2044",
"#hbar":
"\u0127",
"#box":
"",
"#Box":
"",
"#parallel":
"",
"#perp":
"\u22A5",
"#odot":
"",
"#left":
"",
"#right":
""};a.Painter.translateLaTeX=
function(d){var h=d;h=this.translateExp(h);
while(h.indexOf(
"^{o}")!=-1){h=h.replace(
"^{o}",
"\xBA")}var f=h.match(/\#sqrt{(.*?)}/gi);
if(f!=null){
for(var e=0;e<f.length;++e){var g=f[e].replace(
" ",
"");g=g.replace(
"#sqrt{",
"#sqrt");g=g.replace(
"}",
"");h=h.replace(f[e],g)}}f=h.match(/\_{(.*?)}/gi);
if(f!=null){
for(var e=0;e<f.length;++e){var g=f[e].replace(
" ",
"");g=g.replace(
"_{",
"");g=g.replace(
"}",
"");h=h.replace(f[e],g)}}f=h.match(/\^{(.*?)}/gi);
if(f!=null){
for(e=0;e<f.length;++e){var g=f[e].replace(
" ",
"");g=g.replace(
"^{",
"");g=g.replace(
"}",
"");h=h.replace(f[e],g)}}
while(h.indexOf(
"#/")!=-1){h=h.replace(
"#/",a.Painter.symbols_map[
"#/"])}
for(var c in a.Painter.symbols_map){
while(h.indexOf(c)!=-1){h=h.replace(c,a.Painter.symbols_map[c])}}
if((h.indexOf(
"#splitline{")==0)&&(h.charAt(h.length-1)==
"}")){var j=h.indexOf(
"}{");
if((j>0)&&(j==h.lastIndexOf(
"}{"))){h=h.replace(
"}{",
"\n");h=h.slice(11,h.length-1)}}
return h};a.Painter.isAnyLatex=
function(c){
return(c.indexOf(
"#")>=0)||(c.indexOf(
"\\")>=0)||(c.indexOf(
"{")>=0)};a.Painter.translateMath=
function(f,e,d){
if(e!=2){f=f.replace(/#LT/g,
"\\langle");f=f.replace(/#GT/g,
"\\rangle");f=f.replace(/#club/g,
"\\clubsuit");f=f.replace(/#spade/g,
"\\spadesuit");f=f.replace(/#heart/g,
"\\heartsuit");f=f.replace(/#diamond/g,
"\\diamondsuit");f=f.replace(/#voidn/g,
"\\wp");f=f.replace(/#voidb/g,
"f");f=f.replace(/#copyright/g,
"(c)");f=f.replace(/#ocopyright/g,
"(c)");f=f.replace(/#trademark/g,
"TM");f=f.replace(/#void3/g,
"TM");f=f.replace(/#oright/g,
"R");f=f.replace(/#void1/g,
"R");f=f.replace(/#3dots/g,
"\\ldots");f=f.replace(/#lbar/g,
"\\mid");f=f.replace(/#void8/g,
"\\mid");f=f.replace(/#divide/g,
"\\div");f=f.replace(/#Jgothic/g,
"\\Im");f=f.replace(/#Rgothic/g,
"\\Re");f=f.replace(/#doublequote/g,
'"');f=f.replace(/#plus/g,
"+");f=f.replace(/#diamond/g,
"\\diamondsuit");f=f.replace(/#voidn/g,
"\\wp");f=f.replace(/#voidb/g,
"f");f=f.replace(/#copyright/g,
"(c)");f=f.replace(/#ocopyright/g,
"(c)");f=f.replace(/#trademark/g,
"TM");f=f.replace(/#void3/g,
"TM");f=f.replace(/#oright/g,
"R");f=f.replace(/#void1/g,
"R");f=f.replace(/#3dots/g,
"\\ldots");f=f.replace(/#lbar/g,
"\\mid");f=f.replace(/#void8/g,
"\\mid");f=f.replace(/#divide/g,
"\\div");f=f.replace(/#Jgothic/g,
"\\Im");f=f.replace(/#Rgothic/g,
"\\Re");f=f.replace(/#doublequote/g,
'"');f=f.replace(/#plus/g,
"+");f=f.replace(/#minus/g,
"-");f=f.replace(/#\