Skip to content
Snippets Groups Projects
Commit 098dfcf9 authored by Sergey Linev's avatar Sergey Linev
Browse files

[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
parent d59c871f
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
(function(factory){ (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 = ""; var url = "";
if (requirejs.s.contexts.hasOwnProperty("_")) { if (requirejs.s.contexts.hasOwnProperty("_")) {
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
require.config({ require.config({
paths: { paths: {
'd3': JSROOT_source_dir+'d3.min', 'd3': JSROOT_source_dir+'d3.min',
'JsRootCore': JSROOT_source_dir+'JSRoot.core.min', 'JsRootCore': JSROOT_source_dir+'JSRootCore.min',
'nn': url+'NeuralNetwork.min', 'nn': url+'NeuralNetwork.min',
'dtree': url+'DecisionTree.min', 'dtree': url+'DecisionTree.min',
'NetworkDesigner': url+'NetworkDesigner.min' 'NetworkDesigner': url+'NetworkDesigner.min'
......
(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})); (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 \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment