
js.dataexplorer-charts.min.js Maven / Gradle / Ivy
(function(c,i){i.charts=i.charts||{};var g=i.charts.dataexplorer=i.charts.dataexplorer||{};var a=new i.RestClient();function h(q,v,t,r,n,p,w,u,s,o){return{entity:q,width:p,height:w,title:u,type:"SCATTER_CHART",query:s,x:v,y:t,xAxisLabel:r,yAxisLabel:n,split:o}}function e(p,r,o,u,q,n,s,t){return{entity:p,width:r,height:o,title:u,type:"BOXPLOT_CHART",observableFeature:q,split:n,query:s,scale:t}}function m(o,p){var n=[];n.push("");c.each(o,function(){n.push("")});return n.join("")}g.createScatterPlot=function(r,s,n,B,p){var q=1024;var C=576;var A=c("#scatterplot-title").val();var z,w,t,o,v,u;if(n){z=n.name;t=n.label;v=n.fieldType}if(B){w=B.name;o=B.label}if(p){u=p.name}c.ajax({type:"POST",url:"/charts/xydatachart",data:JSON.stringify(h(r.name,z,w,t,o,q,C,A,s,u)),contentType:"application/json; charset=utf-8",cache:false,async:true,success:function(x){c("#tabs a:last").tab("show");if(v==="DATE"||v==="DATE_TIME"){c("#chart-view").highcharts("StockChart",x)}else{c("#chart-view").highcharts(x)}}})};g.createBoxPlot=function(r,t,o,s){var v=c("#boxplot-title").val();var n=1024;var w=576;var p,u;var q;if(c("#boxplot-scale").val()===""){q=1.5}else{q=new Number(c("#boxplot-scale").val())}if(o){p=o.name}if(s){u=s.name}c.ajax({type:"POST",url:"/charts/boxplot",data:JSON.stringify(e(r.name,n,w,v,p,u,t,q)),contentType:"application/json; charset=utf-8",cache:false,async:true,success:function(x){c("#tabs a:last").tab("show");c("#chart-view").highcharts(x)}})};function b(){var o=true;var p=c("#scatterplot-select-yaxis-feature").val();var n=c("#scatterplot-select-xaxis-feature").val();if(p&&(p!=="-1")&&n&&(n!=="-1")){o=false}c("#scatterplot-designer-modal-create-button").prop("disabled",o)}function d(){var n=true;var o=c("#boxplot-select-feature").val();if(o&&(o!=="-1")){n=false}c("#boxplot-designer-modal-create-button").prop("disabled",n)}function j(){var n=i.dataexplorer.getSelectedAttributes();return i.getAtomicAttributes(n,a)}function l(){return i.dataexplorer.getSelectedEntityMeta()}function f(){var n=i.dataexplorer.getEntityQuery();return{rules:[n.q]}}function k(o){var n={};c.each(o,function(){n[this.href]=this});return n}c(function(){c(document).on("show.bs.modal.charts","#chart-designer-modal-scatterplot",function(){c("#scatterplot-designer-modal-create-button").prop("disabled",true);var n=j();var p=c.grep(n,function(q){return c.inArray(q.fieldType,["DECIMAL","LONG","INT","DATE","DATE_TIME"])!==-1});var o=c.grep(n,function(q){return c.inArray(q.fieldType,["DECIMAL","LONG","INT","DATE","DATE_TIME"])!==-1});c("#scatterplot-select-xaxis-feature").html(m(p,c("#scatterplot-select-xaxis-feature").val()));c("#scatterplot-select-yaxis-feature").html(m(o,c("#scatterplot-select-yaxis-feature").val()));c("#scatterplot-select-split-feature").html(m(j(),c("#scatterplot-select-split-feature").val()));c("#scatterplot-designer-modal-create-button").data("attributes",n);b()});c("#scatterplot-select-xaxis-feature").change(b);c("#scatterplot-select-yaxis-feature").change(b);c(document).on("show.bs.modal.charts","#chart-designer-modal-boxplot",function(){c("#boxplot-designer-modal-create-button").prop("disabled",true);var n=j();var o=c.grep(n,function(p){return c.inArray(p.fieldType,["DECIMAL","LONG","INT"])!==-1});c("#boxplot-select-feature").html(m(o,c("#boxplot-select-feature").val()));c("#boxplot-select-split-feature").html(m(n,c("#boxplot-select-split-feature").val()));c("#boxplot-designer-modal-create-button").data("attributes",n);d()});c("#scatterplot-designer-modal-create-button").click(function(){var n=k(c("#scatterplot-designer-modal-create-button").data("attributes"));var q=n[c("#scatterplot-select-xaxis-feature").val()];var p=n[c("#scatterplot-select-yaxis-feature").val()];var o=n[c("#scatterplot-select-split-feature").val()];g.createScatterPlot(l(),f(),q,p,o);c("#scatterplot-designer-modal-create-button").removeData()});c("#boxplot-designer-modal-create-button").click(function(){var n=k(c("#boxplot-designer-modal-create-button").data("attributes"));var o=n[c("#boxplot-select-feature").val()];var p=n[c("#boxplot-select-split-feature").val()];g.createBoxPlot(l(),f(),o,p);c("#boxplot-designer-modal-create-button").removeData()});c("#boxplot-select-feature").change(d)})})($,window.top.molgenis=window.top.molgenis||{});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy