All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.dataexplorer-data.min.js Maven / Gradle / Ivy

(function(k,A){A.dataexplorer=A.dataexplorer||{};var u=A.dataexplorer.data=A.dataexplorer.data||{};u.createDataTable=j;u.createGenomeBrowser=B;u.doShowGenomeBrowser=m;u.setGenomeBrowserAttributes=n;u.setGenomeBrowserSettings=D;u.setGenomeBrowserTracks=o;var t=new A.RestClient();var s;var g;var q;var i;var d={};var c,a;function D(E){d=E}function o(E){g=E}function j(){var E=this.useDateEditRowPlugin;k.get("/permission/sys_FreemarkerTemplate/read").done(function(F){var G={entity:l().name,attrs:h(),query:y(),onRowAdd:z,onRowDelete:z,onRowEdit:z,onRowInspect:r,onRowClick:(m()&&w())?x:null,enableInspect:F,onSort:function(H){a={orders:[{attr:H.attr.name,direction:H.order==="desc"?"DESC":"ASC"}]}}};if(E){G.onEditClick=function(I,H){window.location.assign(window.location.origin+"/plugin/data-row-edit/"+I+"/"+H)},G.onAddClick=function(H){window.location.assign(window.location.origin+"/plugin/data-row-edit/"+H)}}c=React.render(A.ui.Table(G),k("#data-table-container")[0])})}function z(){k(document).trigger("dataChange.data")}function r(G){var E=G.id;var F=G.name;k("#entityReport").load("dataexplorer/details",{entityTypeId:F,entityId:E},function(I,H,J){if(H!=="error"){k("#entityReportModal").modal("show")}})}function x(E){var F=E[i.name];var G=E[q.name];if(F!==undefined&&F!==""&&G!==undefined&&G!==""){s.setLocation(F,G-50,G+50)}}function f(){k.download(A.getContextUrl()+"/download",{dataRequest:JSON.stringify(p())});k("#downloadModal").modal("hide")}function p(){var E=y();var F={entityTypeId:l().name,attributeNames:[],query:{rules:[E.q]},colNames:k("input[name=colNames]:checked").val(),entityValues:k("input[name=entityValues]:checked").val(),downloadType:k("input[name=downloadTypes]:checked").val()};F.query.sort=a;var G=A.getAtomicAttributes(v(),t);k.each(G,function(){var H=this;F.attributeNames.push(H.name)});return F}function m(){return A.ie9!==true&&A.ie10!==true&&q!==undefined&&i!==undefined&&A.dataexplorer.settings.data_genome_browser!==false}function w(){var E=A.dataexplorer.getSelectedAttributes();return(E.indexOf(i)!=-1)&&(E.indexOf(q)!=-1)}function C(H){var E;var F=l().attributes;var I=H.split(",");for(var G in I){E=F[I[G]];if(E!==undefined){break}}return E}function B(G){var H=false;if(G!==null){H=G.showHighlight}var F=k.extend(true,{},d,G||{});k("#genomebrowser").css("display","block");k("#genomebrowser").css("visibility","visible");for(var E in g){F.sources.push(g[E])}s=new Browser(F);if(H===true){s.highlightRegion(s.chr,(s.viewStart+9990),(s.viewEnd-9990))}return s}function b(){k.each(v(),function(E,F){if(F===q){e(F,Math.floor(s.viewStart).toString(),Math.floor(s.viewEnd).toString())}else{if(F===i){e(F,undefined,undefined,s.chr)}}})}function n(F,E){q=C(F);i=C(E)}function l(){return A.dataexplorer.getSelectedEntityMeta()}function v(){return A.dataexplorer.getSelectedAttributes()}function h(){return A.dataexplorer.getSelectedAttributesTree()}function y(){return A.dataexplorer.getEntityQuery()}function e(J,K,F,G){var E=new A.dataexplorer.filter.SimpleFilter(J,K,F,G);var I=new A.dataexplorer.filter.ComplexFilter(J);var H=new A.dataexplorer.filter.ComplexFilterElement(J);H.simpleFilter=E;H.operator=undefined;I.addComplexFilterElement(H);k(document).trigger("updateAttributeFilters",{filters:[I]})}k(function(){k(document).off(".data");k(document).on("changeModule.data",function(F,E){if(E==="data"){A.dataexplorer.data.createDataTable()}});k(document).on("changeAttributeSelection.data",function(H,F){if(c&&c.isMounted()&&(A.dataexplorer.getSelectedModule()=="data")){var I=c.state.attrs;var G=F.attributesTree;for(var E in G){if(I[E]!==undefined&&I[E]!==null){if(I[E].hasOwnProperty("*")&&G.hasOwnProperty(E)){G[E]=I[E]}}}c.setProps({attrs:G,onRowClick:(m()&&w())?x:null})}});k(document).on("updateAttributeFilters.data",function(G,F){function E(J,K,H){var I=999999999;if(J){K=K&&K>0?K:1;H=H&&H>0?H:K+I;s.setLocation(J,K,H)}}if(A.dataexplorer.getSelectedModule()=="data"){if(A.dataexplorer.settings.genomebrowser!=="false"){k.each(F.filters,function(){if(this.getComplexFilterElements&&this.getComplexFilterElements()[0]){if(this.attribute===q){E(s.chr,parseInt(this.getComplexFilterElements()[0].simpleFilter.fromValue),parseInt(this.getComplexFilterElements()[0].simpleFilter.toValue))}else{if(this.attribute===i){E(this.getComplexFilterElements()[0].simpleFilter.getValues()[0],s.viewStart,s.viewEnd)}}}})}}});k(document).on("changeQuery.data",function(F,E){if(c&&c.isMounted()&&(A.dataexplorer.getSelectedModule()=="data")){c.setProps({query:E})}});k("#download-button").click(function(){f()});k("#genomebrowser-filter-button").click(function(){b()})})}($,window.top.molgenis=window.top.molgenis||{}));




© 2015 - 2024 Weber Informatics LLC | Privacy Policy