Changeset 1469 in genappalpha


Ignore:
Timestamp:
May 7, 2018, 6:45:07 AM (2 years ago)
Author:
ehb
Message:

Added type "plotly"

Location:
languages
Files:
26 added
3 edited

Legend:

Unmodified
Added
Removed
  • languages/html5/add/js/ga.min.js

    r1468 r1469  
    101101ga.value.registerid=function(a,b,c,d){ga.value.types[a]=ga.value.types[a]||{};ga.value.types[a][b]={};ga.value.types[a][b].id=b;ga.value.types[a][b].label=c;ga.value.types[a][b].req=d||0};ga.value.setInputfromRFile=function(a,b,c,d){var f=c.split(",");a="results/users/"+$("#_state").data("_logon")+"/"+a;$.get(a,function(a){ga.value.processInputfromFiles(a,b,f,d)},"text")};
    102102ga.value.setInputfromFile=function(a,b,c,d){$(a).hide();var f=c.split(",");$(a).change(function(c){c=$(a)[0].files[0];var g=new FileReader;g.onload=function(a){ga.value.processInputfromFiles(a.target.result,b,f,d)};g.readAsText(c)})};
    103 ga.value.setLastValue=function(a,b,c){var d=a+":"+b+":last_value",f=a+":"+b+":default_value",e=$(b);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(d))switch(e.attr("type")){case "checkbox":case "radio":$("#global_data").data(d,e.is(":checked"));$("#global_data").data(f,e.is(":checked"));break;case "div":case "msgs":$("#global_data").data(d,e.html());$("#global_data").data(f,e.html());break;case "plot3d":console.log("PLOT3D: "+b);e=b.replace(/^#/,"");console.log("PLOT3D: "+e);Plotly.newPlot(e,
    104 [],{});Plotly.purge(e);break;case "plot2d":break;case "bokeh":ga.bokeh.renderdata(a,b.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(d,$(b+"_filelink").html());break;default:c&&e.val(c),$("#global_data").data(d,e.val()),$("#global_data").data(f,e.val())}else switch(e.attr("type")){case "checkbox":case "radio":e.prop("checked",$("#global_data").data(d));break;case "div":case "msgs":e.html($("#global_data").data(d));break;case "atomicstructure":b=b.replace(/^#/,"");
    105 $("#global_data").data(d)?(_jmol_info[b].script=$("#global_data").data(d),e.html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]))):e.empty();break;case "plot2d":d=gd.data(d);d.data?(ga.value.set.plot2d(b,d.options),e.plot(d.data,ga.value.get.plot2d.plot_options(b,d.options))):e.plot(d,ga.value.get.plot2d.plot_options(b));break;case "bokeh":break;case "filelink":case "filelinkm":$(b+"_filelink").html($("#global_data").data(d));break;default:e.val($("#global_data").data(d))}};
     103ga.value.setLastValue=function(a,b,c){var d=a+":"+b+":last_value",f=a+":"+b+":default_value",e=$(b);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(d))switch(e.attr("type")){case "checkbox":case "radio":$("#global_data").data(d,e.is(":checked"));$("#global_data").data(f,e.is(":checked"));break;case "div":case "msgs":$("#global_data").data(d,e.html());$("#global_data").data(f,e.html());break;case "plot3d":case "plotly":b=b.replace(/^#/,"");Plotly.newPlot(b,[],{});Plotly.purge(b);
     104break;case "plot2d":break;case "bokeh":ga.bokeh.renderdata(a,b.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(d,$(b+"_filelink").html());break;default:c&&e.val(c),$("#global_data").data(d,e.val()),$("#global_data").data(f,e.val())}else switch(e.attr("type")){case "checkbox":case "radio":e.prop("checked",$("#global_data").data(d));break;case "div":case "msgs":e.html($("#global_data").data(d));break;case "atomicstructure":b=b.replace(/^#/,"");$("#global_data").data(d)?
     105(_jmol_info[b].script=$("#global_data").data(d),e.html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]))):e.empty();break;case "plot2d":d=gd.data(d);d.data?(ga.value.set.plot2d(b,d.options),e.plot(d.data,ga.value.get.plot2d.plot_options(b,d.options))):e.plot(d,ga.value.get.plot2d.plot_options(b));break;case "plot3d":case "plotly":e=gd.data(d);e.data&&Plotly.plot(b.replace(/^#/,""),e.data,e.layout);break;case "bokeh":break;case "filelink":case "filelinkm":$(b+"_filelink").html($("#global_data").data(d));
     106break;default:e.val($("#global_data").data(d))}};
    106107ga.value.saveLastValue=function(a,b){var c=$(b);switch(c.attr("type")){case "file":break;case "checkbox":case "radio":$("#global_data").data(a+":"+b+":last_value",c.is(":checked"));break;case "div":case "msgs":$("#global_data").data(a+":"+b+":last_value",c.html());break;case "plot2d":break;case "bokeh":break;case "filelink":case "filelinkm":$("#global_data").data(a+":"+b+":last_value",$(b+"_filelink").html());break;case "atomicstructure":c=b.replace(/^#/,"");_jmol_info&&_jmol_info[c]&&_jmol_info[c].length?
    107108$("#global_data").data(a+":"+b+":last_value",_jmol_info[c].script):$("#global_data").data(a+":"+b+":last_value","");break;default:$("#global_data").data(a+":"+b+":last_value",c.val())}};ga.value.saveLastValues=function(a){$("#"+a+" :input").each(function(){ga.value.saveLastValue(a,"#"+$(this).attr("id"))})};
    108109ga.value.resetDefaultValue=function(a,b){var c=$(b);if("SELECT"==c.prop("tagName"))c.val($("#global_data").data(a+":"+b+":default_value"));else switch(c.attr("type")){case "file":return;case "checkbox":$("#global_data").removeData(a+":"+b+":repeat:count");case "radio":c.prop("checked",$("#global_data").data(a+":"+b+":default_value"));break;case "div":case "msgs":c.html($("#global_data").data(a+":"+b+":default_value"));break;case "filelink":case "filelinkm":$(b+"_filelink").html(" ");break;case "plot2d":console.log("ga.value.resetDefaultValue() plot2d, t is "+
    109110b);$("#global_data").data(a+":"+b+":last_value",[[]]);ga.value.clear.plot2d(b);c.plot([[]],ga.value.get.plot2d.plot_options(b));ga.showcollapse2d&&($(b+"_div").hide(),$(b+"_savetofile").length&&($(b+"_savetofile").hide(),$(b+"_savetofile_link").hide()),$(b+"_changescalex").length&&($(b+"_changescalex").hide(),$(b+"_changescalex_message").hide()),$(b+"_changescaley").length&&($(b+"_changescaley").hide(),$(b+"_changescaley_message").hide()),$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden"));
    110 break;case "bokeh":ga.bokeh.reset(a,b.replace(/^#/,""));break;case "plot3d":console.log("reset default value for plot3d: "+b);Plotly.purge(b.replace(/^#/,""));$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden");break;case "image":c.empty();break;case "video":c.empty();break;case "atomicstructure":b.replace(/^#/,"");$("#global_data").data(a+":"+b+":last_value","");$(b).empty();break;default:c.val(c.attr("value"))}ga.value.saveLastValue(a,b);$(b+"_msg").empty()};
     111break;case "bokeh":ga.bokeh.reset(a,b.replace(/^#/,""));break;case "plot3d":case "plotly":console.log("reset default value for plot3d: "+b);Plotly.purge(b.replace(/^#/,""));$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden");break;case "image":c.empty();break;case "video":c.empty();break;case "atomicstructure":b.replace(/^#/,"");$("#global_data").data(a+":"+b+":last_value","");$(b).empty();break;default:c.val(c.attr("value"))}ga.value.saveLastValue(a,b);$(b+"_msg").empty()};
    111112ga.value.resetDefaultValues=function(a,b){var c;if(!/_output$/.test(a))return!1;$("#"+a+" :input").each(function(){ga.value.resetDefaultValue(a,"#"+$(this).attr("id"))});ga.sync.reset(a);for(c in ga.value.extra_resets.data)ga.value.resetDefaultValue(a,"#"+c);b&&(ga.value.resetDefaultValue(a,"#"+a+"_msgs"),c="#"+a+"_textarea",ga.value.resetDefaultValue(a,c),$(c).hide(),$(c+"_label").hide())};
    112113ga.value.extra_resets=function(a){ga.value.extra_resets.data=ga.value.extra_resets.data||{};ga.value.extra_resets.data[a]=1};ga.value.extra_resets.clear=function(){ga.value.extra_resets.data={}};
     
    147148ga.data.create_image_htmltocanvas=function(a){if($("#"+a+"_savetofile").length){var b=$("#"+a+"_div");html2canvas(b.get(0),{background:"#ffffff",onrendered:function(b){b='<a href="'+b.toDataURL("image/png").replace("image/png","image/octet-stream")+'" target="_blank" download="plot.png">plot.png</a>';$("#"+a+"_savetofile_link").html(b)}})}};
    148149ga.data.create_image=function(a,b){if($("#"+a+"_savetofile").length){var c=document.getElementById(a+"_savetofile"),d=b.getCanvas().toDataURL("image/png").replace("image/png","image/octet-stream"),d=ga.data.dataURLtoFile(d,"plot.png");c.href=URL.createObjectURL(d);$("#"+a+"_savetofile").removeClass("hidden")}};
    149 ga.data.update=function(a,b,c,d){var f=0,e=0,g=0,h=0,q=0,k=a+"_output",r="#"+k,n=$(r),z={},u=r+"_msgs",x=$(u),m,v,y,B,w,C,A;c&&($("#"+a+"_progress").empty(),x.text(""));$.each(b,function(p,l){A=n.find("#"+p);if(A.length)switch(f||(x.text(""),f=1),A.attr("type")){case "plot3d":m="#"+p;l.layout=$.extend({},l.layout,{showlegend:!1});ga.plot3dglobal=l.layout;ga.dataplot3dglobal=l.data;ga.plotted3d=0;console.log("JSON Options: "+JSON.stringify(l.layout));$(m+"_showcollapse").length&&$(m+"_showcollapse").removeClass("hidden");
    150 Plotly.plot(p,l.data,l.layout);ga.showcollapse3d&&(ga.plotted3d=1,$(m+"_showcollapse").trigger("click"));break;case "plot2d":m="#"+p;ga.value.plot2d.zstack.reset(m);if(l.data){if(ga.value.set.plot2d(m,l.options),ga.plotglobal=l.options,ga.dataplotglobal=l.data,$.plot(m,l.data,ga.value.get.plot2d.plot_options(m,l.options)),ga.customtooltips){var u=null;$(m).bind("plothover",function(a,b,c){c?u!=c.dataIndex&&(u=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),c.datapoint[1].toFixed(2),
    151 c.series.tooltips.length&&showTooltip(c.pageX,c.pageY,c.series.tooltips[c.dataIndex],c.series.color)):($("#rtooltip").remove(),u=null)})}}else $.plot(m,l,ga.value.get.plot2d.plot_options(m));$(m+"_savetofile").length&&$(m+"_savetofile").removeClass("hidden");$(m+"_changescalex").length&&($(m+"_changescalex").removeClass("hidden"),"log"==l.options.xscale?$(m+"_changescalex_message").html("X-log"):$(m+"_changescalex_message").html("X-lin"));$(m+"_changescaley").length&&($(m+"_changescaley").removeClass("hidden"),
    152 "log"==l.options.yscale?$(m+"_changescaley_message").html("Y-log"):$(m+"_changescaley_message").html("Y-lin"));$(m+"_showcollapse").length&&($(m+"_showcollapse").removeClass("hidden"),$(m).show(),ga.plotted2d=1,$(m+"_showcollapse").trigger("click"));if(ga.value.settings[m].selzoom||l.options&&l.options.selection&&l.options.selection.mode&&"xy"==l.options.selection.mode)$(m).on("plotselected",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,l.options):ga.value.get.plot2d.plot_options(m)},
    153 function(a,b){1E-5>b.xaxis.to-b.xaxis.from&&(b.xaxis.to=b.xaxis.from+1E-5);1E-5>b.yaxis.to-b.yaxis.from&&(b.yaxis.to=b.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(a.data.htag,b);$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}}))}).on("contextmenu",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,l.options):ga.value.get.plot2d.plot_options(m)},function(a){a.preventDefault();
    154 var b=ga.value.plot2d.zstack.dopop(a.data.htag);b?$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}})):$.plot(a.data.htag,a.data.data,a.data.options)});y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "bokeh":ga.bokeh.render(a,p,l);break;case "atomicstructure":y=k+":#"+p+":last_value";C=l.file?l.file:l;_jmol_info[p].script="set background ["+ga.colors.background+"]; set zoomlarge false;set echo top center;echo loading "+
    155 C.split("/").pop()+';refresh;load "'+C+'";';ga.set(a+":jsmoladd")&&(_jmol_info[p].script+=ga.set(a+":jsmoladd"));l.script&&(_jmol_info[p].script+=";"+l.script);$("#global_data").data(y,_jmol_info[p].script);$("#"+p).html(Jmol.getAppletHtml("jmolApplet"+p,_jmol_info[p]));break;case "checkbox":case "radio":A.prop("checked",!0);break;case "div":A.html(l);break;case "video":v=$("#"+p);w="<video ";v.attr("data-width")&&(w+=' width="'+v.attr("data-width")+'"');v.attr("data-height")&&(w+=' height="'+v.attr("data-height")+
    156 '"');w+=" controls>";w+='<source src="'+l+'.mp4" type="video/mp4" /><source src="'+l+'.webm" type="video/webm" />';w+="</video>";v.html(w);break;case "image":v=$("#"+p);w="<img ";v.attr("data-width")&&(w+=' width="'+v.attr("data-width")+'"');v.attr("data-height")&&(w+=' height="'+v.attr("data-height")+'"');w+=' src="'+l+'">';v.html(w);break;case "filelink":B='<a href="'+l+'" target="_blank">'+l.split("/").pop()+"</a>";y=k+":#"+p+":last_value";$("#global_data").data(y,B);$("#"+p+"_filelink").html(B);
    157 break;case "filelinkm":y=k+":#"+p+":last_value";B="";$.each(l,function(a,b){B+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(y,B);$("#"+p+"_filelink").html(B);break;default:$("#global_data").data("_append:"+k+"_"+p)?(A.val(A.val()+"\n"+l),A.height(parseFloat(A.prop("scrollHeight")+parseFloat(A.css("borderTopWidth"))+parseFloat(A.css("borderBottomWidth"))))):A.val(l)}else c?"_"==p.charAt(0)?/^_fs_/.test(p)&&ga.data.nofcrefresh[a]||("_message"==p&&ga.msg.box(l),
    158 "_question"==p&&ga.qr.question(a,b),"_question_answered"==p&&ga.qr.answered(a,b),"_question_timeout"==p&&ga.qr.timeout(a,b),/^_getinput/.test(p)&&"_getinput"==p&&ga.valuen.input(a,l),"_textarea"==p&&ga.data.textarea(r,l),"_airavata"==p&&ga.data.airavata(r,l),"_status"==p&&"complete"==l&&c(d,0,0)):(e||(x.append("<p>Unexpected results:</p>"),e=1),x.append("<p>"+p+" => "+l+"</p>")):"_"==p.charAt(0)?/^_fs_/.test(p)&&ga.data.nofcrefresh[a]||($("#_state").data(p,l),g=1,"_status"==p&&(z.job_status=l),/^_getinput/.test(p)&&
    159 "_getinput"==p&&ga.valuen.input(a,l),"_textarea"==p&&ga.data.textarea(r,l),"_airavata"==p&&ga.data.airavata(r,l),"_loginverify"==p&&ga.login.verify(l),"_loginapprove"==p&&ga.login.approve(l)):"-close"==p?h=1:"-close2"==p?q=1:(e||(x.text(""),x.append("<p>Unexpected results:</p>"),f=e=1),x.append("<p>"+p+" => "+l+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,u);$(r+"_progress").empty();g&&syncState();h&&ga.msg.close(1);q&&ga.msg.close(2);return z};
     150ga.data.update=function(a,b,c,d){var f=0,e=0,g=0,h=0,q=0,k=a+"_output",r="#"+k,n=$(r),z={},u=r+"_msgs",x=$(u),m,v,y,B,w,C,A;c&&($("#"+a+"_progress").empty(),x.text(""));$.each(b,function(p,l){A=n.find("#"+p);if(A.length)switch(f||(x.text(""),f=1),A.attr("type")){case "plot3d":case "plotly":m="#"+p;l.layout=$.extend({},l.layout,{showlegend:!1});ga.plot3dglobal=l.layout;ga.dataplot3dglobal=l.data;ga.plotted3d=0;$(m+"_showcollapse").length&&$(m+"_showcollapse").removeClass("hidden");Plotly.plot(p,l.data,
     151l.layout);ga.showcollapse3d&&(ga.plotted3d=1,$(m+"_showcollapse").trigger("click"));y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "plot2d":m="#"+p;ga.value.plot2d.zstack.reset(m);if(l.data){if(ga.value.set.plot2d(m,l.options),ga.plotglobal=l.options,ga.dataplotglobal=l.data,$.plot(m,l.data,ga.value.get.plot2d.plot_options(m,l.options)),ga.customtooltips){var u=null;$(m).bind("plothover",function(a,b,c){c?u!=c.dataIndex&&(u=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),
     152c.datapoint[1].toFixed(2),c.series.tooltips.length&&showTooltip(c.pageX,c.pageY,c.series.tooltips[c.dataIndex],c.series.color)):($("#rtooltip").remove(),u=null)})}}else $.plot(m,l,ga.value.get.plot2d.plot_options(m));$(m+"_savetofile").length&&$(m+"_savetofile").removeClass("hidden");$(m+"_changescalex").length&&($(m+"_changescalex").removeClass("hidden"),"log"==l.options.xscale?$(m+"_changescalex_message").html("X-log"):$(m+"_changescalex_message").html("X-lin"));$(m+"_changescaley").length&&($(m+
     153"_changescaley").removeClass("hidden"),"log"==l.options.yscale?$(m+"_changescaley_message").html("Y-log"):$(m+"_changescaley_message").html("Y-lin"));$(m+"_showcollapse").length&&($(m+"_showcollapse").removeClass("hidden"),$(m).show(),ga.plotted2d=1,$(m+"_showcollapse").trigger("click"));if(ga.value.settings[m].selzoom||l.options&&l.options.selection&&l.options.selection.mode&&"xy"==l.options.selection.mode)$(m).on("plotselected",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,
     154l.options):ga.value.get.plot2d.plot_options(m)},function(a,b){1E-5>b.xaxis.to-b.xaxis.from&&(b.xaxis.to=b.xaxis.from+1E-5);1E-5>b.yaxis.to-b.yaxis.from&&(b.yaxis.to=b.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(a.data.htag,b);$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}}))}).on("contextmenu",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,l.options):ga.value.get.plot2d.plot_options(m)},
     155function(a){a.preventDefault();var b=ga.value.plot2d.zstack.dopop(a.data.htag);b?$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}})):$.plot(a.data.htag,a.data.data,a.data.options)});y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "bokeh":ga.bokeh.render(a,p,l);break;case "atomicstructure":y=k+":#"+p+":last_value";C=l.file?l.file:l;_jmol_info[p].script="set background ["+ga.colors.background+
     156"]; set zoomlarge false;set echo top center;echo loading "+C.split("/").pop()+';refresh;load "'+C+'";';ga.set(a+":jsmoladd")&&(_jmol_info[p].script+=ga.set(a+":jsmoladd"));l.script&&(_jmol_info[p].script+=";"+l.script);$("#global_data").data(y,_jmol_info[p].script);$("#"+p).html(Jmol.getAppletHtml("jmolApplet"+p,_jmol_info[p]));break;case "checkbox":case "radio":A.prop("checked",!0);break;case "div":A.html(l);break;case "video":v=$("#"+p);w="<video ";v.attr("data-width")&&(w+=' width="'+v.attr("data-width")+
     157'"');v.attr("data-height")&&(w+=' height="'+v.attr("data-height")+'"');w+=" controls>";w+='<source src="'+l+'.mp4" type="video/mp4" /><source src="'+l+'.webm" type="video/webm" />';w+="</video>";v.html(w);break;case "image":v=$("#"+p);w="<img ";v.attr("data-width")&&(w+=' width="'+v.attr("data-width")+'"');v.attr("data-height")&&(w+=' height="'+v.attr("data-height")+'"');w+=' src="'+l+'">';v.html(w);break;case "filelink":B='<a href="'+l+'" target="_blank">'+l.split("/").pop()+"</a>";y=k+":#"+p+":last_value";
     158$("#global_data").data(y,B);$("#"+p+"_filelink").html(B);break;case "filelinkm":y=k+":#"+p+":last_value";B="";$.each(l,function(a,b){B+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(y,B);$("#"+p+"_filelink").html(B);break;default:$("#global_data").data("_append:"+k+"_"+p)?(A.val(A.val()+"\n"+l),A.height(parseFloat(A.prop("scrollHeight")+parseFloat(A.css("borderTopWidth"))+parseFloat(A.css("borderBottomWidth"))))):A.val(l)}else c?"_"==p.charAt(0)?/^_fs_/.test(p)&&
     159ga.data.nofcrefresh[a]||("_message"==p&&ga.msg.box(l),"_question"==p&&ga.qr.question(a,b),"_question_answered"==p&&ga.qr.answered(a,b),"_question_timeout"==p&&ga.qr.timeout(a,b),/^_getinput/.test(p)&&"_getinput"==p&&ga.valuen.input(a,l),"_textarea"==p&&ga.data.textarea(r,l),"_airavata"==p&&ga.data.airavata(r,l),"_status"==p&&"complete"==l&&c(d,0,0)):(e||(x.append("<p>Unexpected results:</p>"),e=1),x.append("<p>"+p+" => "+l+"</p>")):"_"==p.charAt(0)?/^_fs_/.test(p)&&ga.data.nofcrefresh[a]||($("#_state").data(p,
     160l),g=1,"_status"==p&&(z.job_status=l),/^_getinput/.test(p)&&"_getinput"==p&&ga.valuen.input(a,l),"_textarea"==p&&ga.data.textarea(r,l),"_airavata"==p&&ga.data.airavata(r,l),"_loginverify"==p&&ga.login.verify(l),"_loginapprove"==p&&ga.login.approve(l)):"-close"==p?h=1:"-close2"==p?q=1:(e||(x.text(""),x.append("<p>Unexpected results:</p>"),f=e=1),x.append("<p>"+p+" => "+l+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,u);$(r+"_progress").empty();g&&syncState();h&&ga.msg.close(1);q&&
     161ga.msg.close(2);return z};
    160162ga.data.textarea=function(a,b){var c=a+"_textarea",d=$(c);isatend=d[0].scrollHeight-d[0].scrollTop===d[0].clientHeight;b||(b="");d.is(":hidden")&&(d.show(),$(c+"_label").show());"__reset__\n"==b.substr(0,10)?d.val(b.substr(10)):d.val(d.val()+b);ga.set("textarea:rows")?ga.data.textarea.h[a]?d.height(ga.data.textarea.h[a]):ga.data.textarea.h[a]=parseFloat(d.prop("clientHeight"))+parseFloat(d.css("borderTopWidth"))+parseFloat(d.css("borderBottomWidth")):d.height(parseFloat(d.prop("scrollHeight"))+parseFloat(d.css("borderTopWidth"))+
    161163parseFloat(d.css("borderBottomWidth")));isatend&&d.scrollTop(d[0].scrollHeight)};ga.data.textarea.h={};ga.data.airavata=function(a,b){var c=$(a+"_airavata");c.is(":hidden")&&c.show();c.html(b)};
  • languages/html5/js/data.js

    r1468 r1469  
    118118            {
    119119            case "plot3d" :
     120            case "plotly" :
    120121                htag = "#" + k;
     122                __~debug:plotly{console.log( "Plotly v:" + JSON.stringify( v ) );}
    121123                v.layout = $.extend( {}, v.layout, {showlegend: false } );
    122124               
     
    125127                ga.plotted3d        = 0;
    126128               
    127                 console.log("JSON Options: " + JSON.stringify(v.layout));
     129                __~debug:plotly{console.log("Plotly JSON Options: " + JSON.stringify(v.layout));}
     130                __~debug:plotly{console.log("plotly JSON Data: " + JSON.stringify(v.data));}
    128131
    129132                if ( $( htag  + "_showcollapse" ).length )
     
    141144                    $(  htag  + "_showcollapse" ).trigger( "click" );
    142145                }
     146                savekey = mod_out + ":#" + k + ":last_value";
     147                $( "#global_data" ).data( savekey , v );
    143148                break;
    144149            case "plot2d" :
  • languages/html5/js/value.js

    r1468 r1469  
    718718                break;
    719719            case "plot3d" :
    720                 console.log("PLOT3D: " + tag);
     720            case "plotly" :
     721            __~debug:plotly{console.log("PLOT3D: " + tag);}
    721722                var tag_s = tag;
    722723                tag_s = tag_s.replace(/^#/, "");
    723                 console.log("PLOT3D: " + tag_s);
     724            __~debug:plotly{console.log("PLOT3D: " + tag_s);}
    724725                Plotly.newPlot(tag_s,[],{});
    725726                Plotly.purge(tag_s);
     
    783784                     } else {
    784785                         t.plot( p2d, ga.value.get.plot2d.plot_options( tag ) );
     786                     }
     787                     break;
     788            case "plot3d" :
     789            case "plotly" :
     790            __~debug:values{console.log( "ga.value.setLastValue() on plotly trying" );}
     791                     var ptly = gd.data( tl );
     792                     if ( ptly.data ) {
     793                         Plotly.plot(tag.replace( /^#/, "" ), ptly.data, ptly.layout);
    785794                     }
    786795                     break;
     
    907916              break;
    908917          case "plot3d" :
     918          case "plotly" :
    909919              console.log( "reset default value for plot3d: " + tag );
    910920              Plotly.purge(tag.replace( /^#/, "" ));
Note: See TracChangeset for help on using the changeset viewer.