From 098dfcf94a3939597488fef9ee128b3d2e1e591f Mon Sep 17 00:00:00 2001 From: Sergey Linev <S.Linev@gsi.de> Date: Tue, 11 May 2021 10:10:29 +0200 Subject: [PATCH] [jsmva] use fixed JSROOT version for JsMVA.js Referencing notebook version is dangerous, while it may be changed to JSROOT v6.x and older code will not work --- etc/notebook/JsMVA/js/JsMVA.js | 4 ++-- etc/notebook/JsMVA/js/JsMVA.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/notebook/JsMVA/js/JsMVA.js b/etc/notebook/JsMVA/js/JsMVA.js index de1e87e8d3d..cc23ad7629b 100644 --- a/etc/notebook/JsMVA/js/JsMVA.js +++ b/etc/notebook/JsMVA/js/JsMVA.js @@ -16,7 +16,7 @@ (function(factory){ - var JSROOT_source_dir = "https://root.cern.ch/js/notebook/scripts/"; + var JSROOT_source_dir = "https://root.cern/js/5.9.1/scripts/"; var url = ""; if (requirejs.s.contexts.hasOwnProperty("_")) { @@ -33,7 +33,7 @@ require.config({ paths: { 'd3': JSROOT_source_dir+'d3.min', - 'JsRootCore': JSROOT_source_dir+'JSRoot.core.min', + 'JsRootCore': JSROOT_source_dir+'JSRootCore.min', 'nn': url+'NeuralNetwork.min', 'dtree': url+'DecisionTree.min', 'NetworkDesigner': url+'NetworkDesigner.min' diff --git a/etc/notebook/JsMVA/js/JsMVA.min.js b/etc/notebook/JsMVA/js/JsMVA.min.js index 9c7be8a9f64..b053183db85 100644 --- a/etc/notebook/JsMVA/js/JsMVA.min.js +++ b/etc/notebook/JsMVA/js/JsMVA.min.js @@ -1 +1 @@ -(function(b){var a="https://root.cern.ch/js/notebook/scripts/";var c="";if(requirejs.s.contexts.hasOwnProperty("_")){c=requirejs.s.contexts._.config.paths.JsMVA.replace("JsMVA.min","")}if((console!==undefined)&&(typeof console.log=="function")){if(c!=""){console.log("JsMVA source dir:"+c.substring(0,c.length-1))}else{console.log("JsMVA source dir can't be resolved, requireJS doesn't have context '_', this will be a problem!")}}require.config({paths:{d3:a+"d3.min",JsRootCore:a+"JSRootCore.min",nn:c+"NeuralNetwork.min",dtree:c+"DecisionTree.min",NetworkDesigner:c+"NetworkDesigner.min"}});define(["JsRootCore"],function(d){return b({},d)})}(function(c,b){c.drawTH2=function(f,d){var e=b.parse(d);b.draw(f,e,"colz;PAL50;text")};c.drawDNNMap=function(f,d){var e=b.parse(d);b.draw(f,e,"colz;PAL50")};c.draw=function(f,d){var e=b.parse(d);b.draw(f,e)};c.drawNeuralNetwork=function(f,d){var e=JSON.parse(d);require(["nn"],function(g){g.draw(f,e)})};c.drawDecisionTree=function(e,d){require(["dtree"],function(f){var g=JSON.parse(d);f.draw(e,g)})};var a=function(e,d){require(["d3"],function(j){var i=j.select("#"+e+">.interactivePlot_Labels")[0][0];if(i!=null){return}var k=j.select("#"+e).style("position","relative");var h=k.append("svg").attr("class","interactivePlot_Labels").attr("width","200px").attr("height","50px").style({position:"absolute",top:"8px",right:"8px"});var f={pos:{x:150,y:0},rect:{width:10,height:10},dy:20,padding:10};canvas={width:160,height:70};var g=h.append("g").attr("id","legend");g.selectAll("g").data(d.fGraphs.arr).enter().append("g").each(function(n,l){var m=j.select(this);m.append("rect").attr("x",canvas.width-f.pos.x).attr("y",f.pos.y+l*f.dy).attr("width",f.rect.width).attr("height",f.rect.height).style("fill",function(o){return b.Painter.root_colors[o.fFillColor]});m.append("text").attr("x",canvas.width-f.pos.x+f.rect.width+f.padding).attr("y",f.pos.y+l*f.dy+f.rect.height).text(function(o){return o.fTitle}).style("fill",function(o){return b.Painter.root_colors[o.fFillColor]})});k.append("svg").attr("width","55px").attr("height","20px").style({position:"absolute",bottom:"15px",right:"40px"}).append("text").attr("x","5px").attr("y","15px").text(d.fGraphs.arr[0].fTitle.indexOf("Error on training set")!=-1?"Epoch":"#tree").style({"font-size":"16px"})})};c.drawTrainingTestingErrors=function(f,d){var e=b.parse(d);b.draw(f,e);a(f,e)};c.updateTrainingTestingErrors=function(f,d){var e=b.parse(d);b.redraw(f,e);a(f,e)};c.NetworkDesigner=function(e,d){require(["NetworkDesigner"],function(f){f.draw(e)})};c.outputShowCorrelationMatrix=function(d){require(["jquery","jquery-ui"],function(f){var e=b.parse(f("#"+d).html());if(!f("#dialog_"+d).length||f("#dialog_"+d).length<1){f("#"+d).parent().append("<div id='dialog_"+d+"' title='"+e.fTitle+"' style='width: 600px; height: 340px; z-index: 99;'></div>");b.draw("dialog_"+d,e,"colz;PAL50;text")}f("#dialog_"+d).dialog({autoOpen:true,width:600,show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:500}})})};return c})); \ No newline at end of file +(function(b){var a="https://root.cern/js/5.9.1/scripts/";var c="";if(requirejs.s.contexts.hasOwnProperty("_")){c=requirejs.s.contexts._.config.paths.JsMVA.replace("JsMVA.min","")}if((console!==undefined)&&(typeof console.log=="function")){if(c!=""){console.log("JsMVA source dir:"+c.substring(0,c.length-1))}else{console.log("JsMVA source dir can't be resolved, requireJS doesn't have context '_', this will be a problem!")}}require.config({paths:{d3:a+"d3.min",JsRootCore:a+"JSRootCore.min",nn:c+"NeuralNetwork.min",dtree:c+"DecisionTree.min",NetworkDesigner:c+"NetworkDesigner.min"}});define(["JsRootCore"],function(d){return b({},d)})}(function(c,b){c.drawTH2=function(f,d){var e=b.parse(d);b.draw(f,e,"colz;PAL50;text")};c.drawDNNMap=function(f,d){var e=b.parse(d);b.draw(f,e,"colz;PAL50")};c.draw=function(f,d){var e=b.parse(d);b.draw(f,e)};c.drawNeuralNetwork=function(f,d){var e=JSON.parse(d);require(["nn"],function(g){g.draw(f,e)})};c.drawDecisionTree=function(e,d){require(["dtree"],function(f){var g=JSON.parse(d);f.draw(e,g)})};var a=function(e,d){require(["d3"],function(j){var i=j.select("#"+e+">.interactivePlot_Labels")[0][0];if(i!=null){return}var k=j.select("#"+e).style("position","relative");var h=k.append("svg").attr("class","interactivePlot_Labels").attr("width","200px").attr("height","50px").style({position:"absolute",top:"8px",right:"8px"});var f={pos:{x:150,y:0},rect:{width:10,height:10},dy:20,padding:10};canvas={width:160,height:70};var g=h.append("g").attr("id","legend");g.selectAll("g").data(d.fGraphs.arr).enter().append("g").each(function(n,l){var m=j.select(this);m.append("rect").attr("x",canvas.width-f.pos.x).attr("y",f.pos.y+l*f.dy).attr("width",f.rect.width).attr("height",f.rect.height).style("fill",function(o){return b.Painter.root_colors[o.fFillColor]});m.append("text").attr("x",canvas.width-f.pos.x+f.rect.width+f.padding).attr("y",f.pos.y+l*f.dy+f.rect.height).text(function(o){return o.fTitle}).style("fill",function(o){return b.Painter.root_colors[o.fFillColor]})});k.append("svg").attr("width","55px").attr("height","20px").style({position:"absolute",bottom:"15px",right:"40px"}).append("text").attr("x","5px").attr("y","15px").text(d.fGraphs.arr[0].fTitle.indexOf("Error on training set")!=-1?"Epoch":"#tree").style({"font-size":"16px"})})};c.drawTrainingTestingErrors=function(f,d){var e=b.parse(d);b.draw(f,e);a(f,e)};c.updateTrainingTestingErrors=function(f,d){var e=b.parse(d);b.redraw(f,e);a(f,e)};c.NetworkDesigner=function(e,d){require(["NetworkDesigner"],function(f){f.draw(e)})};c.outputShowCorrelationMatrix=function(d){require(["jquery","jquery-ui"],function(f){var e=b.parse(f("#"+d).html());if(!f("#dialog_"+d).length||f("#dialog_"+d).length<1){f("#"+d).parent().append("<div id='dialog_"+d+"' title='"+e.fTitle+"' style='width: 600px; height: 340px; z-index: 99;'></div>");b.draw("dialog_"+d,e,"colz;PAL50;text")}f("#dialog_"+d).dialog({autoOpen:true,width:600,show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:500}})})};return c})); \ No newline at end of file -- GitLab