From 8e0eaf2427a99f093a35d686532214534c1bb043 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 24 Aug 2016 22:19:10 -0400 Subject: [PATCH 01/27] Add biojs multiple sequence viewer --- .../visualizations/charts/config/charts.xml | 3 ++- .../charts/static/charts/biojs/msa/config.js | 9 ++++++++ .../charts/static/charts/biojs/msa/logo.png | Bin 0 -> 28113 bytes .../charts/static/charts/biojs/msa/wrapper.js | 18 +++++++++++++++ .../charts/static/charts/overview.js | 3 +++ .../charts/static/charts/types.js | 9 +++++--- .../charts/static/plugins/biojs/biojs.msa.js | 21 ++++++++++++++++++ .../charts/static/views/editor.js | 2 +- .../charts/static/views/groups.js | 2 +- .../charts/static/views/settings.js | 4 +++- .../charts/static/views/viewport.js | 9 +++++++- .../charts/templates/charts.mako | 3 +++ 12 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 config/plugins/visualizations/charts/static/charts/biojs/msa/config.js create mode 100644 config/plugins/visualizations/charts/static/charts/biojs/msa/logo.png create mode 100644 config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js create mode 100755 config/plugins/visualizations/charts/static/plugins/biojs/biojs.msa.js diff --git a/config/plugins/visualizations/charts/config/charts.xml b/config/plugins/visualizations/charts/config/charts.xml index 8356fc32d5f2..caae65f8a12d 100644 --- a/config/plugins/visualizations/charts/config/charts.xml +++ b/config/plugins/visualizations/charts/config/charts.xml @@ -6,6 +6,7 @@ HistoryDatasetAssociation tabular.Tabular tabular.CSV + data.Text dataset_id @@ -13,4 +14,4 @@ dataset_id charts.mako - + \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js new file mode 100644 index 000000000000..ca99220105a5 --- /dev/null +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js @@ -0,0 +1,9 @@ +define( [], function() { + return { + title : 'Multiple Sequence Alignment', + category : 'Sequence', + library : 'BioJS', + datatype : 'txt', + keywords : 'biojs' + } +}); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/logo.png b/config/plugins/visualizations/charts/static/charts/biojs/msa/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ad87f32b3b47982acf1feca24e72e3270ae307a4 GIT binary patch literal 28113 zcmZ^K1ymgGvL^)h;4Z=4b+918-QC?~a1Rg|G`K@>cXxMpcY?b+%l+T`-rL=?JLk+y zebwdNr@!g?)qoV_#F60f;K9JakR&BUl|H{OKi@;J(4U_R-Zq~ML`+K&5d}#R5fTL_ zdoxQLQ!p?IP(l)nO58Bk-~k;?P!LwAfBaM$NxRg=kMDpbSV?~cVOU5^FHIE(hN4h| zAL`$2tieqbQ59{%4KA2Mi^|Hvq3Da+B)=RwZ)Un}?2RSqpRaix2*#ycjDh{Jm_&oE zQJ?^;d3x$8`c7;nY=jm^4h{QS^u^R*)aU@Njf||fOE58ebqYHXKQUJ4cz3kAbK?Ows6my~z*+ z8BUa?I7BsxJQ+bw@}cO67|UMAuh8BB#0Fnb%V-=yVM=}#hR9Cb}B8MO+Nz8Xsn_$j=g>)BU zmo+r8owH&Mst}wc9LnF4L8C&1n(YFX6kM>%gu7l^&$P+6akIlOgB-$1DAypes}c|f z=@o~Fi8Tq_X~$Wgy*TYtE@A%4Fk^-q>U13*Dj5JblTqvtRe84rnt10>>UR-!&^31M z9mqGDs0h*^>U=8|*eiBcb>5e9`|GByblmc+c;Qu{JOELm@gv{BHZy z3 zKe&btCdQL&U^fZ6`MxnR@Mj$%Z4T*}F=yFwfGn+TcVYea-Wa`n+Ds)jS7CRrxwP#N zz!>|dlJCa{Si!dT*uV}&Hf^Box9+u2x{Bo*Bs55Bw_{*wo9%GX3jrwi`oKge2cybtioT; z0fEooIv2YQ62br$kqlN?*aDVt`a2MntnW+pk91U&K4LhLoZq74xRN4|p|G0%^x{&# zmGZtUN6wLUl2XOg4pHPGG=~7me1`D%(8ID-R50hoBBzIo*p4HA<**#eup^ECK$yln z)T$#W7e@JWcc^&_?}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){;sxVXT)uG!bpW46)9ihC{ z9-B@f1LPp9AoIXLXtUD^O97i+4z+dnyJqG@qwkKl#^r!!tH%g-&C=vh z>Hou?-Fh{Dxn=2`M=VDfx}I)hletA>^#My>k5GD=hdn;kw)%WaA8}Q60(>Ut@u6*U z5pB24G$EM$5f9h>n4XR<+c2E#6n$%$4X>EZD0yG?SVS3-us+!}2wHB#xL-prnpQv0 z%7@T6mdB#4x*j<$F#3Ze#Bh!p2iJ6OUYzHXjr;tnCVKY;`Re0G)K=w;JJ(Bf?T08d zTbCFvR`i**q_jxA9s6%2T)l35eMhR8kV`r82%e7e!XGl3F{NvJ>=7a2*e>$21T(zn zuq}@EaZ>3fS>1vhe@Fw=9{C`#?s&GopDuimciS=5`<0TGFf8JWEPDAUTZj%9@Uoj%r`%p#_d}uG@&<6YLWbR*0d0*ss=3^h zIvzg`m6Bj3JL!ZuOS5(YYo}pnQU*b(&h4mfKNG0nDkR;dFd+l$zxNi7O?j@bEb^9k z-^rDB(=2{%D|PI`Ng6fHR*b@MF{{#i7$SUVPY+k@ZPn|EB@oxV?QFqZzV!25j8v$| zPRgXSLa-vQQIDw@`I;~%y}6kN4m==PL(H7Mnh+rin?m2=yJI5>ltz)Gi9V(h{yF+5 sEl^j~L_P0A-sR-&PbjW6qs}*Nc*y424h_41|7bx%L{_*$P|yE=0jrT8NB{r; literal 0 HcmV?d00001 diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js new file mode 100644 index 000000000000..15998703aef8 --- /dev/null +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js @@ -0,0 +1,18 @@ +define( [ 'utils/utils' ], function( Utils ) { + return Backbone.Model.extend({ + initialize: function( app, options ) { + var chart = app.chart; + var m = new msa.msa({ + el: $( '#' + options.canvas_list[ 0 ] ), + vis: { conserv: false, overviewbox: false }, + menu: 'small', + bootstrapMenu: true + }); + m.u.file.importURL( options.dataset.download_url, function() { + m.render(); + app.chart.state( 'ok', 'Chart drawn.' ); + options.process.resolve(); + }); + } + }); +}); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/overview.js b/config/plugins/visualizations/charts/static/charts/overview.js index df07c21ca70d..fd2fac444920 100644 --- a/config/plugins/visualizations/charts/static/charts/overview.js +++ b/config/plugins/visualizations/charts/static/charts/overview.js @@ -8,6 +8,9 @@ define( [], function() { help : 'jqPlot is a canvas-based library hosted at www.jqplot.com. It is a plotting and charting plugin for the jQuery Javascript framework. Since based on canvas it is capable of rendering many thousand data points without adverse effects.' }, { label : 'Others', value: 'others', help : 'These visualizations were developed by the Galaxy team.' + }, + { label : 'BioJS', value: 'biojs', + help : 'BioJS plugins.' } ]; }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/types.js b/config/plugins/visualizations/charts/static/charts/types.js index 07b17cc443aa..55f1ca1b5543 100644 --- a/config/plugins/visualizations/charts/static/charts/types.js +++ b/config/plugins/visualizations/charts/static/charts/types.js @@ -18,7 +18,8 @@ define(['plugin/charts/nvd3/bar/config', 'plugin/charts/jqplot/histogram_discrete/config', 'plugin/charts/others/heatmap/config', 'plugin/charts/others/heatmap_cluster/config', - 'plugin/charts/others/example/config' ], + 'plugin/charts/others/example/config', + 'plugin/charts/biojs/msa/config' ], function(nvd3_bar, nvd3_bar_stacked, nvd3_bar_horizontal, @@ -39,7 +40,8 @@ define(['plugin/charts/nvd3/bar/config', jqplot_histogram_discrete, others_heatmap, others_heatmap_cluster, - others_example) { + others_example, + biojs_msa) { return { 'nvd3_bar' : nvd3_bar, 'nvd3_bar_stacked' : nvd3_bar_stacked, @@ -61,6 +63,7 @@ define(['plugin/charts/nvd3/bar/config', 'jqplot_boxplot' : jqplot_boxplot, 'others_heatmap' : others_heatmap, 'others_heatmap_cluster' : others_heatmap_cluster, - 'others_example' : others_example + 'others_example' : others_example, + 'biojs_msa' : biojs_msa } }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/plugins/biojs/biojs.msa.js b/config/plugins/visualizations/charts/static/plugins/biojs/biojs.msa.js new file mode 100755 index 000000000000..e44545e56d0f --- /dev/null +++ b/config/plugins/visualizations/charts/static/plugins/biojs/biojs.msa.js @@ -0,0 +1,21 @@ +!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}var i=n(111),o=r(i);n(154);var s=o["default"];for(var u in o)o.hasOwnProperty(u)&&(s[u]=o[u]);window&&(window.msa=s),t.exports=s},function(t,e,n){"use strict";t.exports.Model=n(41),t.exports.Collection=n(55),t.exports.Events=n(22),t.exports.extend=n(23)},function(t,e,n){"use strict";var r=n(60),i=n(58),o=n(59),s=n(5),u=function(t){this.cid=r.uniqueId("view"),t||(t={}),r.extend(this,r.pick(t,l)),this._ensureElement(),this.initialize.apply(this,arguments)},a=/^(\S+)\s*(.*)$/,l=["model","collection","el","id","attributes","className","tagName","events"];r.extend(u.prototype,i,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof s?t:s(t),this.el=this.$el[0]},delegateEvents:function(t){if(!t&&!(t=r.result(this,"events")))return this;this.undelegateEvents();for(var e in t){var n=t[e];if(r.isFunction(n)||(n=this[t[e]]),n){var i=e.match(a);this.delegate(i[1],i[2],r.bind(n,this))}}return this},delegate:function(t,e,n){this.$el.on(t+".delegateEvents"+this.cid,e,n)},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){this.$el.off(t+".delegateEvents"+this.cid,e,n)},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(r.result(this,"el"));else{var t=r.extend({},r.result(this,"attributes"));this.id&&(t.id=r.result(this,"id")),this.className&&(t["class"]=r.result(this,"className")),this.setElement(this._createElement(r.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),u.extend=o,t.exports=u},function(t,e,n){var r;(function(t,i){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};(function(){function s(t,e){return t.set(e[0],e[1]),t}function u(t,e){return t.add(e),t}function a(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function l(t,e,n,r){for(var i=-1,o=t?t.length:0;++i-1}function g(t,e,n){for(var r=-1,i=t?t.length:0;++r-1;);return n}function L(t,e){for(var n=t.length;n--&&S(e,t[n],0)>-1;);return n}function R(t){return t&&t.Object===Object?t:null}function q(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&r++;return r}function F(t){return An[t]}function P(t){return Cn[t]}function B(t){return"\\"+In[t]}function W(t,e){return null==t?Q:t[e]}function D(t,e,n){for(var r=t.length,i=e+(n?1:-1);n?i--:++i-1}function Xe(t,e){var n=this.__data__,r=gn(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function Ze(t){var e=-1,n=t?t.length:0;for(this.clear();++e=e?t:e)),t}function wn(t,e,n,r,i,o,s){var u;if(r&&(u=o?r(t,i,o,s):r(t)),u!==Q)return u;if(!yu(t))return t;var a=yf(t);if(a){if(u=Vi(t),!e)return ri(t,u)}else{var l=Di(t),f=l==Rt||l==qt;if(_f(t))return Vr(t,e);if(l==Bt||l==Ct||f&&!o){if(H(t))return o?t:{};if(u=$i(f?{}:t),!e)return oi(t,mn(u,t))}else{if(!zn[l])return o?t:{};u=Gi(t,l,wn,e)}}s||(s=new sn);var h=s.get(t);if(h)return h;if(s.set(t,u),!a)var d=n?Ti(t):ia(t);return c(d||t,function(i,o){d&&(o=i,i=t[o]),pn(u,o,wn(i,e,n,r,o,t,s))}),u}function An(t){var e=ia(t),n=e.length;return function(r){if(null==r)return!n;for(var i=n;i--;){var o=e[i],s=t[o],u=r[o];if(u===Q&&!(o in Object(r))||!s(u))return!1}return!0}}function Cn(t){return yu(t)?Hl(t):{}}function Tn(t,e,n){if("function"!=typeof t)throw new Sl(nt);return $l(function(){t.apply(Q,n)},e)}function In(t,e,n,r){var i=-1,o=p,s=!0,u=t.length,a=[],l=e.length;if(!u)return a;n&&(e=v(e,C(n))),r?(o=g,s=!1):e.length>=et&&(o=I,s=!1,e=new nn(e));t:for(;++ii?0:i+n),r=r===Q||r>i?i:Bu(r),r<0&&(r+=i),r=n>r?0:Wu(r);n0&&n(u)?e>1?Wn(u,e-1,n,r,i):m(i,u):r||(i[i.length]=u)}return i}function Un(t,e){return t&&jc(t,e,ia)}function Vn(t,e){return t&&Oc(t,e,ia)}function $n(t,e){return d(e,function(e){return gu(t[e])})}function Gn(t,e){e=Qi(e,t)?[e]:Hr(e);for(var n=0,r=e.length;null!=t&&ne}function Zn(t,e){return null!=t&&(Al.call(t,e)||"object"==("undefined"==typeof t?"undefined":o(t))&&e in t&&null===Bi(t))}function Jn(t,e){return null!=t&&e in Object(t)}function Yn(t,e,n){return t>=tc(e,n)&&t=120&&c.length>=120)?new nn(s&&c):Q}c=t[0];var f=-1,h=u[0];t:for(;++f-1;)u!==t&&Vl.call(u,a,1),Vl.call(t,a,1);return t}function wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;if(Ji(i))Vl.call(t,i,1);else if(Qi(i,t))delete t[co(i)];else{var s=Hr(i),u=ao(t,s);null!=u&&delete u[co(To(s))]}}}return t}function Sr(t,e){return t+Kl(nc()*(e-t+1))}function kr(t,e,n,r){for(var i=-1,o=Ql(Gl((e-t)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=t,t+=n;return s}function jr(t,e){var n="";if(!t||e<1||e>jt)return n;do e%2&&(n+=t),e=Kl(e/2),e&&(t+=t);while(e);return n}function Or(t,e,n,r){e=Qi(e,t)?[e]:Hr(e);for(var i=-1,o=e.length,s=o-1,u=t;null!=u&&++ii?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r>>1,s=t[o];null!==s&&!Iu(s)&&(n?s<=e:s=et){var l=e?null:Mc(t);if(l)return G(l);s=!1,i=I,a=new nn}else a=e?[]:u;t:for(;++r=r?t:Er(t,e,n)}function Vr(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function $r(t){var e=new t.constructor(t.byteLength);return new Pl(e).set(new Pl(t)),e}function Gr(t,e){var n=e?$r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Kr(t,e,n){return y(e?n(V(t),!0):V(t),s,new t.constructor)}function Xr(t){var e=new t.constructor(t.source,Oe.exec(t));return e.lastIndex=t.lastIndex,e}function Zr(t,e,n){return y(e?n(G(t),!0):G(t),u,new t.constructor)}function Jr(t){return xc?Object(xc.call(t)):{}}function Yr(t,e){var n=e?$r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Qr(t,e){if(t!==e){var n=t!==Q,r=null===t,i=t===t,o=Iu(t),s=e!==Q,u=null===e,a=e===e,l=Iu(e);if(!u&&!l&&!o&&t>e||o&&s&&a&&!u&&!l||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!l&&t=u?a:a*("desc"==n[r]?-1:1)}return t.index-e.index}function ei(t,e,n,r){for(var i=-1,o=t.length,s=n.length,u=-1,a=e.length,l=Ql(o-s,0),c=Array(a+l),f=!r;++u1?n[i-1]:Q,s=i>2?n[2]:Q;for(o=t.length>3&&"function"==typeof o?(i--,o):Q,s&&Yi(n[0],n[1],s)&&(o=i<3?Q:o,i=1),e=Object(e);++r-1?e[o?o[s]:s]:Q}}function vi(t){return $s(function(e){e=Wn(e,1);var n=e.length,i=n,o=r.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new Sl(nt);if(o&&!u&&"wrapper"==Ni(s))var u=new r([],(!0))}for(i=u?i:n;++i=et)return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i1&&y.reverse(),f&&au))return!1;var l=o.get(t);if(l)return l==e;var c=-1,f=!0,h=i>?new nn:Q;for(o.set(t,e);++c-1&&t%1==0&&t=this.__values__.length;return{done:t,value:t?Q:this.__values__[this.__index__++]}}function ds(){return this}function ps(t){for(var e,r=this;r instanceof n;){var i=ho(r);i.__index__=0,i.__values__=Q,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e}function gs(){var t=this.__wrapped__;if(t instanceof i){var e=t;return this.__actions__.length&&(e=new i(this)),e=e.reverse(),e.__actions__.push({func:ls,args:[Po],thisArg:Q}),new r(e,this.__chain__)}return this.thru(Po)}function vs(){return Fr(this.__wrapped__,this.__actions__)}function ms(t,e,n){var r=yf(t)?h:Rn;return n&&Yi(t,e,n)&&(e=Q),r(t,Ri(e,3))}function ys(t,e){return(yf(t)?d:Bn)(t,Ri(e,3))}function _s(t,e){return Wn(js(t,e),1)}function bs(t,e){return Wn(js(t,e),kt)}function xs(t,e,n){return n=n===Q?1:Bu(n),Wn(js(t,e),n)}function ws(t,e){return(yf(t)?c:Sc)(t,Ri(e,3))}function Ss(t,e){return(yf(t)?f:kc)(t,Ri(e,3))}function ks(t,e,n,r){t=ou(t)?t:ma(t),n=n&&!r?Bu(n):0;var i=t.length;return n<0&&(n=Ql(i+n,0)),Tu(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&S(t,e,n)>-1}function js(t,e){return(yf(t)?v:cr)(t,Ri(e,3))}function Os(t,e,n,r){return null==t?[]:(yf(e)||(e=null==e?[]:[e]),n=r?Q:n,yf(n)||(n=null==n?[]:[n]),vr(t,e,n))}function Es(t,e,n){var r=yf(t)?y:O,i=arguments.length<3;return r(t,Ri(e,4),n,i,Sc)}function Ms(t,e,n){var r=yf(t)?_:O,i=arguments.length<3;return r(t,Ri(e,4),n,i,kc)}function zs(t,e){var n=yf(t)?d:Bn;return e=Ri(e,3),n(t,function(t,n,r){return!e(t,n,r)})}function As(t){var e=ou(t)?t:ma(t),n=e.length;return n>0?e[Sr(0,n-1)]:Q}function Cs(t,e,n){var r=-1,i=Fu(t),o=i.length,s=o-1;for(e=(n?Yi(t,e,n):e===Q)?1:_n(Bu(e),0,o);++r0&&(n=e.apply(this,arguments)),t<=1&&(e=Q),n}}function Ps(t,e,n){e=n?Q:e;var r=Mi(t,at,Q,Q,Q,Q,Q,e);return r.placeholder=Ps.placeholder,r}function Bs(t,e,n){e=n?Q:e;var r=Mi(t,lt,Q,Q,Q,Q,Q,e);return r.placeholder=Bs.placeholder,r}function Ws(t,e,n){function r(e){var n=h,r=d;return h=d=Q,y=e,g=t.apply(r,n)}function i(t){return y=t,v=$l(u,e),_?r(t):g}function o(t){var n=t-m,r=t-y,i=e-n;return b?tc(i,p-r):i}function s(t){var n=t-m,r=t-y;return m===Q||n>=e||n<0||b&&r>=p}function u(){var t=Ls();return s(t)?a(t):void(v=$l(u,o(t)))}function a(t){return v=Q,x&&h?r(t):(h=d=Q,g)}function l(){y=0,h=m=d=v=Q}function c(){return v===Q?g:a(Ls())}function f(){var t=Ls(),n=s(t);if(h=arguments,d=this,m=t,n){if(v===Q)return i(m);if(b)return v=$l(u,e),r(m)}return v===Q&&(v=$l(u,e)),g}var h,d,p,g,v,m,y=0,_=!1,b=!1,x=!0;if("function"!=typeof t)throw new Sl(nt);return e=Du(e)||0,yu(n)&&(_=!!n.leading,b="maxWait"in n,p=b?Ql(Du(n.maxWait)||0,e):p,x="trailing"in n?!!n.trailing:x),f.cancel=l,f.flush=c,f}function Ds(t){return Mi(t,pt)}function Hs(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Sl(nt);var n=function r(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return n.cache=new(Hs.Cache||Ze),n}function Us(t){if("function"!=typeof t)throw new Sl(nt);return function(){return!t.apply(this,arguments)}}function Vs(t){return Fs(2,t)}function $s(t,e){if("function"!=typeof t)throw new Sl(nt);return e=Ql(e===Q?t.length-1:Bu(e),0),function(){for(var n=arguments,r=-1,i=Ql(n.length-e,0),o=Array(i);++r-1&&t%1==0&&t<=jt}function yu(t){var e="undefined"==typeof t?"undefined":o(t);return!!t&&("object"==e||"function"==e)}function _u(t){return!!t&&"object"==("undefined"==typeof t?"undefined":o(t))}function bu(t){return _u(t)&&Di(t)==Ft}function xu(t,e){return t===e||ir(t,e,Fi(e))}function wu(t,e,n){return n="function"==typeof n?n:Q,ir(t,e,Fi(e),n)}function Su(t){return Eu(t)&&t!=+t}function ku(t){if(Tc(t))throw new bl("This method is not supported with `core-js`. Try https://github.com/es-shims.");return or(t)}function ju(t){return null===t}function Ou(t){return null==t}function Eu(t){return"number"==typeof t||_u(t)&&Il.call(t)==Pt}function Mu(t){if(!_u(t)||Il.call(t)!=Bt||H(t))return!1;var e=Bi(t);if(null===e)return!0;var n=Al.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&zl.call(n)==Tl}function zu(t){return yu(t)&&Il.call(t)==Dt}function Au(t){return vu(t)&&t>=-jt&&t<=jt}function Cu(t){return _u(t)&&Di(t)==Ht}function Tu(t){return"string"==typeof t||!yf(t)&&_u(t)&&Il.call(t)==Ut}function Iu(t){return"symbol"==("undefined"==typeof t?"undefined":o(t))||_u(t)&&Il.call(t)==Vt}function Nu(t){return _u(t)&&mu(t.length)&&!!Mn[Il.call(t)]}function Lu(t){return t===Q}function Ru(t){return _u(t)&&Di(t)==$t}function qu(t){return _u(t)&&Il.call(t)==Gt}function Fu(t){if(!t)return[];if(ou(t))return Tu(t)?Z(t):ri(t);if(Dl&&t[Dl])return U(t[Dl]());var e=Di(t);return(e==Ft?V:e==Ht?G:ma)(t)}function Pu(t){return t?(t=Du(t),t===kt||t===-kt?(t<0?-1:1)*Ot:t===t?t:0):0===t?t:0}function Bu(t){var e=Pu(t),n=e%1;return e===e?n?e-n:e:0}function Wu(t){return t?_n(Bu(t),0,Mt):0}function Du(t){if("number"==typeof t)return t;if(Iu(t))return Et;if(yu(t)){var e=gu(t.valueOf)?t.valueOf():t;t=yu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(be,"");var n=ze.test(t);return n||Ce.test(t)?Ln(t.slice(2),n?2:8):Me.test(t)?Et:+t}function Hu(t){return ii(t,oa(t))}function Uu(t){return _n(Bu(t),-jt,jt)}function Vu(t){return null==t?"":Ir(t)}function $u(t,e){var n=Cn(t);return e?mn(n,e):n}function Gu(t,e){return x(t,Ri(e,3),Un)}function Ku(t,e){return x(t,Ri(e,3),Vn)}function Xu(t,e){return null==t?t:jc(t,Ri(e,3),oa)}function Zu(t,e){return null==t?t:Oc(t,Ri(e,3),oa)}function Ju(t,e){return t&&Un(t,Ri(e,3))}function Yu(t,e){return t&&Vn(t,Ri(e,3))}function Qu(t){return null==t?[]:$n(t,ia(t))}function ta(t){return null==t?[]:$n(t,oa(t))}function ea(t,e,n){var r=null==t?Q:Gn(t,e);return r===Q?n:r}function na(t,e){return null!=t&&Ui(t,e,Zn)}function ra(t,e){return null!=t&&Ui(t,e,Jn)}function ia(t){var e=ro(t);if(!e&&!ou(t))return ur(t);var n=Ki(t),r=!!n,i=n||[],o=i.length;for(var s in t)!Zn(t,s)||r&&("length"==s||Ji(s,o))||e&&"constructor"==s||i.push(s);return i}function oa(t){for(var e=-1,n=ro(t),r=ar(t),i=r.length,o=Ki(t),s=!!o,u=o||[],a=u.length;++ee){var r=t;t=e,e=r}if(n||t%1||e%1){var i=nc();return tc(t+i*(e-t+Nn("1e-"+((i+"").length-1))),e)}return Sr(t,e)}function wa(t){return Vf(Vu(t).toLowerCase())}function Sa(t){return t=Vu(t),t&&t.replace(Ie,F).replace(xn,"")}function ka(t,e,n){t=Vu(t),e=Ir(e);var r=t.length;return n=n===Q?r:_n(Bu(n),0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function ja(t){return t=Vu(t),t&&fe.test(t)?t.replace(le,P):t}function Oa(t){return t=Vu(t),t&&_e.test(t)?t.replace(ye,"\\$&"):t}function Ea(t,e,n){t=Vu(t),e=Bu(e);var r=e?X(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return xi(Kl(i),n)+t+xi(Gl(i),n)}function Ma(t,e,n){t=Vu(t),e=Bu(e);var r=e?X(t):0;return e&&r>>0)?(t=Vu(t),t&&("string"==typeof e||null!=e&&!zu(e))&&(e=Ir(e),""==e&&kn.test(t))?Ur(Z(t),0,n):oc.call(t,e,n)):[]}function Na(t,e,n){return t=Vu(t),n=_n(Bu(n),0,t.length),t.lastIndexOf(Ir(e),n)==n}function La(t,n,r){var i=e.templateSettings;r&&Yi(t,n,r)&&(n=Q),t=Vu(t),n=kf({},n,i,hn);var o,s,u=kf({},n.imports,i.imports,hn),a=ia(u),l=T(u,a),c=0,f=n.interpolate||Ne,h="__p += '",d=wl((n.escape||Ne).source+"|"+f.source+"|"+(f===pe?je:Ne).source+"|"+(n.evaluate||Ne).source+"|$","g"),p="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++En+"]")+"\n";t.replace(d,function(e,n,r,i,u,a){return r||(r=i),h+=t.slice(c,a).replace(Le,B),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),u&&(s=!0,h+="';\n"+u+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=a+e.length,e}),h+="';\n";var g=n.variable;g||(h="with (obj) {\n"+h+"\n}\n"),h=(s?h.replace(oe,""):h).replace(se,"$1").replace(ue,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=$f(function(){return Function(a,p+"return "+h).apply(Q,l)});if(v.source=h,du(v))throw v;return v}function Ra(t){return Vu(t).toLowerCase()}function qa(t){return Vu(t).toUpperCase()}function Fa(t,e,n){if(t=Vu(t),t&&(n||e===Q))return t.replace(be,"");if(!t||!(e=Ir(e)))return t;var r=Z(t),i=Z(e);return Ur(r,N(r,i),L(r,i)+1).join("")}function Pa(t,e,n){if(t=Vu(t),t&&(n||e===Q))return t.replace(we,"");if(!t||!(e=Ir(e)))return t;var r=Z(t);return Ur(r,0,L(r,Z(e))+1).join("")}function Ba(t,e,n){if(t=Vu(t),t&&(n||e===Q))return t.replace(xe,"");if(!t||!(e=Ir(e)))return t;var r=Z(t);return Ur(r,N(r,Z(e))).join("")}function Wa(t,e){var n=mt,r=yt;if(yu(e)){var i="separator"in e?e.separator:i;n="length"in e?Bu(e.length):n,r="omission"in e?Ir(e.omission):r}t=Vu(t);var o=t.length;if(kn.test(t)){var s=Z(t);o=s.length}if(n>=o)return t;var u=n-X(r);if(u<1)return r;var a=s?Ur(s,0,u).join(""):t.slice(0,u);if(i===Q)return a+r;if(s&&(u+=a.length-u),zu(i)){if(t.slice(u).search(i)){var l,c=a;for(i.global||(i=wl(i.source,Vu(Oe.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var f=l.index;a=a.slice(0,f===Q?u:f)}}else if(t.indexOf(Ir(i),u)!=u){var h=a.lastIndexOf(i);h>-1&&(a=a.slice(0,h))}return a+r}function Da(t){return t=Vu(t),t&&ce.test(t)?t.replace(ae,J):t}function Ha(t,e,n){return t=Vu(t),e=n?Q:e,e===Q&&(e=jn.test(t)?Sn:Se),t.match(e)||[]}function Ua(t){var e=t?t.length:0,n=Ri();return t=e?v(t,function(t){if("function"!=typeof t[1])throw new Sl(nt);return[n(t[0]),t[1]]}):[],$s(function(n){for(var r=-1;++rjt)return[];var n=Mt,r=tc(t,Mt);e=Ri(e),t-=Mt;for(var i=z(r,e);++n0){if(++t>=_t)return n}else t=0;return Ec(n,r)}}(),Nc=Hs(function(t){var e=[];return Vu(t).replace(me,function(t,n,r,i){e.push(r?i.replace(ke,"$1"):n||t)}),e}),Lc=$s(function(t,e){return su(t)?In(t,Wn(e,1,su,!0)):[]}),Rc=$s(function(t,e){var n=To(e);return su(n)&&(n=Q),su(t)?In(t,Wn(e,1,su,!0),Ri(n)):[]}),qc=$s(function(t,e){var n=To(e);return su(n)&&(n=Q),su(t)?In(t,Wn(e,1,su,!0),Q,n):[]}),Fc=$s(function(t){var e=v(t,Wr);return e.length&&e[0]===t[0]?Qn(e):[]}),Pc=$s(function(t){var e=To(t),n=v(t,Wr);return e===To(n)?e=Q:n.pop(),n.length&&n[0]===t[0]?Qn(n,Ri(e)):[]}),Bc=$s(function(t){var e=To(t),n=v(t,Wr);return e===To(n)?e=Q:n.pop(),n.length&&n[0]===t[0]?Qn(n,Q,e):[]}),Wc=$s(Lo),Dc=$s(function(t,e){e=Wn(e,1);var n=t?t.length:0,r=yn(t,e);return wr(t,v(e,function(t){return Ji(t,n)?+t:t}).sort(Qr)),r}),Hc=$s(function(t){return Nr(Wn(t,1,su,!0))}),Uc=$s(function(t){var e=To(t);return su(e)&&(e=Q),Nr(Wn(t,1,su,!0),Ri(e))}),Vc=$s(function(t){var e=To(t);return su(e)&&(e=Q),Nr(Wn(t,1,su,!0),Q,e)}),$c=$s(function(t,e){return su(t)?In(t,e):[]}),Gc=$s(function(t){return Pr(d(t,su))}),Kc=$s(function(t){var e=To(t);return su(e)&&(e=Q),Pr(d(t,su),Ri(e))}),Xc=$s(function(t){var e=To(t);return su(e)&&(e=Q),Pr(d(t,su),Q,e)}),Zc=$s(rs),Jc=$s(function(t){var e=t.length,n=e>1?t[e-1]:Q;return n="function"==typeof n?(t.pop(),n):Q,is(t,n)}),Yc=$s(function(t){t=Wn(t,1);var e=t.length,n=e?t[0]:0,o=this.__wrapped__,s=function(e){return yn(e,t)};return!(e>1||this.__actions__.length)&&o instanceof i&&Ji(n)?(o=o.slice(n,+n+(e?1:0)),o.__actions__.push({func:ls,args:[s],thisArg:Q}),new r(o,this.__chain__).thru(function(t){return e&&!t.length&&t.push(Q),t})):this.thru(s)}),Qc=si(function(t,e,n){Al.call(t,n)?++t[n]:t[n]=1}),tf=gi(wo),ef=gi(So),nf=si(function(t,e,n){Al.call(t,n)?t[n].push(e):t[n]=[e]}),rf=$s(function(t,e,n){var r=-1,i="function"==typeof e,o=Qi(e),s=ou(t)?Array(t.length):[];return Sc(t,function(t){var u=i?e:o&&null!=t?t[e]:Q;s[++r]=u?a(u,t,n):er(t,e,n)}),s}),of=si(function(t,e,n){t[n]=e}),sf=si(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),uf=$s(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Yi(t,e[0],e[1])?e=[]:n>2&&Yi(e[0],e[1],e[2])&&(e=[e[0]]),e=1==e.length&&yf(e[0])?e[0]:Wn(e,1,Zi),vr(t,e,[])}),af=$s(function(t,e,n){var r=ot;if(n.length){var i=$(n,Li(af));r|=ct}return Mi(t,r,e,n,i)}),lf=$s(function(t,e,n){var r=ot|st;if(n.length){var i=$(n,Li(lf));r|=ct}return Mi(e,r,t,n,i)}),cf=$s(function(t,e){return Tn(t,1,e)}),ff=$s(function(t,e,n){return Tn(t,Du(e)||0,n)});Hs.Cache=Ze;var hf=$s(function(t,e){e=1==e.length&&yf(e[0])?v(e[0],C(Ri())):v(Wn(e,1,Zi),C(Ri()));var n=e.length;return $s(function(r){for(var i=-1,o=tc(r.length,n);++i=e}),yf=Array.isArray,_f=Rl?function(t){return t instanceof Rl}:il,bf=ki(lr),xf=ki(function(t,e){return t<=e}),wf=ui(function(t,e){if(dc||ro(e)||ou(e))return void ii(e,ia(e),t);for(var n in e)Al.call(e,n)&&pn(t,n,e[n])}),Sf=ui(function(t,e){if(dc||ro(e)||ou(e))return void ii(e,oa(e),t);for(var n in e)pn(t,n,e[n])}),kf=ui(function(t,e,n,r){ii(e,oa(e),t,r)}),jf=ui(function(t,e,n,r){ii(e,ia(e),t,r)}),Of=$s(function(t,e){return yn(t,Wn(e,1))}),Ef=$s(function(t){return t.push(Q,hn),a(kf,Q,t)}),Mf=$s(function(t){return t.push(Q,uo),a(If,Q,t)}),zf=yi(function(t,e,n){t[e]=n},$a(Ga)),Af=yi(function(t,e,n){Al.call(t,e)?t[e].push(n):t[e]=[n]},Ri),Cf=$s(er),Tf=ui(function(t,e,n){dr(t,e,n)}),If=ui(function(t,e,n,r){dr(t,e,n,r)}),Nf=$s(function(t,e){return null==t?{}:(e=v(Wn(e,1),co),mr(t,In(Ii(t),e)))}),Lf=$s(function(t,e){return null==t?{}:mr(t,v(Wn(e,1),co))}),Rf=Ei(ia),qf=Ei(oa),Ff=hi(function(t,e,n){return e=e.toLowerCase(),t+(n?wa(e):e)}),Pf=hi(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Bf=hi(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Wf=fi("toLowerCase"),Df=hi(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Hf=hi(function(t,e,n){return t+(n?" ":"")+Vf(e)}),Uf=hi(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Vf=fi("toUpperCase"),$f=$s(function(t,e){try{return a(t,Q,e)}catch(n){return du(n)?n:new bl(n)}}),Gf=$s(function(t,e){return c(Wn(e,1),function(e){e=co(e),t[e]=af(t[e],t)}),t}),Kf=vi(),Xf=vi(!0),Zf=$s(function(t,e){return function(n){return er(n,t,e)}}),Jf=$s(function(t,e){return function(n){return er(t,n,e)}}),Yf=bi(v),Qf=bi(h),th=bi(b),eh=Si(),nh=Si(!0),rh=_i(function(t,e){return t+e}),ih=Oi("ceil"),oh=_i(function(t,e){return t/e}),sh=Oi("floor"),uh=_i(function(t,e){return t*e}),ah=Oi("round"),lh=_i(function(t,e){return t-e});return e.after=Rs,e.ary=qs,e.assign=wf,e.assignIn=Sf,e.assignInWith=kf,e.assignWith=jf,e.at=Of,e.before=Fs,e.bind=af,e.bindAll=Gf,e.bindKey=lf,e.castArray=Js,e.chain=us,e.chunk=po,e.compact=go,e.concat=vo,e.cond=Ua,e.conforms=Va,e.constant=$a,e.countBy=Qc,e.create=$u,e.curry=Ps,e.curryRight=Bs,e.debounce=Ws,e.defaults=Ef,e.defaultsDeep=Mf,e.defer=cf,e.delay=ff,e.difference=Lc,e.differenceBy=Rc,e.differenceWith=qc,e.drop=mo,e.dropRight=yo,e.dropRightWhile=_o,e.dropWhile=bo,e.fill=xo,e.filter=ys,e.flatMap=_s,e.flatMapDeep=bs,e.flatMapDepth=xs,e.flatten=ko,e.flattenDeep=jo,e.flattenDepth=Oo,e.flip=Ds,e.flow=Kf,e.flowRight=Xf,e.fromPairs=Eo,e.functions=Qu,e.functionsIn=ta,e.groupBy=nf,e.initial=Ao,e.intersection=Fc,e.intersectionBy=Pc,e.intersectionWith=Bc,e.invert=zf,e.invertBy=Af,e.invokeMap=rf,e.iteratee=Ka,e.keyBy=of,e.keys=ia,e.keysIn=oa,e.map=js,e.mapKeys=sa,e.mapValues=ua,e.matches=Xa,e.matchesProperty=Za,e.memoize=Hs,e.merge=Tf,e.mergeWith=If,e.method=Zf,e.methodOf=Jf,e.mixin=Ja,e.negate=Us,e.nthArg=tl,e.omit=Nf,e.omitBy=aa,e.once=Vs,e.orderBy=Os,e.over=Yf,e.overArgs=hf,e.overEvery=Qf,e.overSome=th,e.partial=df,e.partialRight=pf,e.partition=sf,e.pick=Lf,e.pickBy=la,e.property=el,e.propertyOf=nl,e.pull=Wc,e.pullAll=Lo,e.pullAllBy=Ro,e.pullAllWith=qo,e.pullAt=Dc,e.range=eh,e.rangeRight=nh,e.rearg=gf,e.reject=zs,e.remove=Fo,e.rest=$s,e.reverse=Po,e.sampleSize=Cs,e.set=fa,e.setWith=ha,e.shuffle=Ts,e.slice=Bo,e.sortBy=uf,e.sortedUniq=Go,e.sortedUniqBy=Ko,e.split=Ia,e.spread=Gs,e.tail=Xo,e.take=Zo,e.takeRight=Jo,e.takeRightWhile=Yo,e.takeWhile=Qo,e.tap=as,e.throttle=Ks,e.thru=ls,e.toArray=Fu,e.toPairs=Rf,e.toPairsIn=qf,e.toPath=ll,e.toPlainObject=Hu,e.transform=da,e.unary=Xs,e.union=Hc,e.unionBy=Uc,e.unionWith=Vc,e.uniq=ts,e.uniqBy=es,e.uniqWith=ns,e.unset=pa,e.unzip=rs,e.unzipWith=is,e.update=ga,e.updateWith=va,e.values=ma,e.valuesIn=ya,e.without=$c,e.words=Ha,e.wrap=Zs,e.xor=Gc,e.xorBy=Kc,e.xorWith=Xc,e.zip=Zc,e.zipObject=os,e.zipObjectDeep=ss,e.zipWith=Jc,e.entries=Rf,e.entriesIn=qf,e.extend=Sf,e.extendWith=kf,Ja(e,e),e.add=rh,e.attempt=$f,e.camelCase=Ff,e.capitalize=wa,e.ceil=ih,e.clamp=_a,e.clone=Ys,e.cloneDeep=tu,e.cloneDeepWith=eu,e.cloneWith=Qs,e.deburr=Sa,e.divide=oh,e.endsWith=ka,e.eq=nu,e.escape=ja,e.escapeRegExp=Oa,e.every=ms,e.find=tf,e.findIndex=wo,e.findKey=Gu,e.findLast=ef,e.findLastIndex=So,e.findLastKey=Ku,e.floor=sh,e.forEach=ws,e.forEachRight=Ss,e.forIn=Xu,e.forInRight=Zu,e.forOwn=Ju,e.forOwnRight=Yu,e.get=ea,e.gt=vf,e.gte=mf,e.has=na,e.hasIn=ra,e.head=Mo,e.identity=Ga,e.includes=ks,e.indexOf=zo,e.inRange=ba,e.invoke=Cf,e.isArguments=ru,e.isArray=yf,e.isArrayBuffer=iu,e.isArrayLike=ou,e.isArrayLikeObject=su,e.isBoolean=uu,e.isBuffer=_f,e.isDate=au,e.isElement=lu,e.isEmpty=cu,e.isEqual=fu,e.isEqualWith=hu,e.isError=du,e.isFinite=pu,e.isFunction=gu,e.isInteger=vu,e.isLength=mu,e.isMap=bu,e.isMatch=xu,e.isMatchWith=wu,e.isNaN=Su,e.isNative=ku,e.isNil=Ou,e.isNull=ju,e.isNumber=Eu,e.isObject=yu,e.isObjectLike=_u,e.isPlainObject=Mu,e.isRegExp=zu,e.isSafeInteger=Au,e.isSet=Cu,e.isString=Tu,e.isSymbol=Iu,e.isTypedArray=Nu,e.isUndefined=Lu,e.isWeakMap=Ru,e.isWeakSet=qu,e.join=Co,e.kebabCase=Pf,e.last=To,e.lastIndexOf=Io,e.lowerCase=Bf,e.lowerFirst=Wf,e.lt=bf,e.lte=xf,e.max=fl,e.maxBy=hl,e.mean=dl,e.meanBy=pl,e.min=gl,e.minBy=vl,e.stubArray=rl,e.stubFalse=il,e.stubObject=ol,e.stubString=sl,e.stubTrue=ul,e.multiply=uh,e.nth=No,e.noConflict=Ya,e.noop=Qa,e.now=Ls,e.pad=Ea,e.padEnd=Ma,e.padStart=za,e.parseInt=Aa,e.random=xa,e.reduce=Es,e.reduceRight=Ms,e.repeat=Ca,e.replace=Ta,e.result=ca,e.round=ah,e.runInContext=Y,e.sample=As,e.size=Is,e.snakeCase=Df,e.some=Ns,e.sortedIndex=Wo,e.sortedIndexBy=Do,e.sortedIndexOf=Ho,e.sortedLastIndex=Uo,e.sortedLastIndexBy=Vo,e.sortedLastIndexOf=$o,e.startCase=Hf,e.startsWith=Na,e.subtract=lh,e.sum=ml,e.sumBy=yl,e.template=La,e.times=al,e.toFinite=Pu,e.toInteger=Bu,e.toLength=Wu,e.toLower=Ra,e.toNumber=Du,e.toSafeInteger=Uu,e.toString=Vu,e.toUpper=qa,e.trim=Fa,e.trimEnd=Pa,e.trimStart=Ba,e.truncate=Wa,e.unescape=Da,e.uniqueId=cl,e.upperCase=Uf,e.upperFirst=Vf,e.each=ws,e.eachRight=Ss,e.first=Mo,Ja(e,function(){var t={};return Un(e,function(n,r){Al.call(e.prototype,r)||(t[r]=n)}),t}(),{chain:!1}),e.VERSION=tt,c(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),c(["drop","take"],function(t,e){i.prototype[t]=function(n){var r=this.__filtered__;if(r&&!e)return new i(this);n=n===Q?1:Ql(Bu(n),0);var o=this.clone();return r?o.__takeCount__=tc(n,o.__takeCount__):o.__views__.push({size:tc(n,Mt),type:t+(o.__dir__<0?"Right":"")}),o},i.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),c(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==xt||n==St;i.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ri(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),c(["head","last"],function(t,e){var n="take"+(e?"Right":"");i.prototype[t]=function(){return this[n](1).value()[0]}}),c(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");i.prototype[t]=function(){return this.__filtered__?new i(this):this[n](1)}}),i.prototype.compact=function(){return this.filter(Ga)},i.prototype.find=function(t){return this.filter(t).head()},i.prototype.findLast=function(t){return this.reverse().find(t)},i.prototype.invokeMap=$s(function(t,e){return"function"==typeof t?new i(this):this.map(function(n){return er(n,t,e)})}),i.prototype.reject=function(t){return t=Ri(t,3),this.filter(function(e){return!t(e)})},i.prototype.slice=function(t,e){t=Bu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new i(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==Q&&(e=Bu(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},i.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},i.prototype.toArray=function(){return this.take(Mt)},Un(i.prototype,function(t,n){var o=/^(?:filter|find|map|reject)|While$/.test(n),s=/^(?:head|last)$/.test(n),u=e[s?"take"+("last"==n?"Right":""):n],a=s||/^find/.test(n);u&&(e.prototype[n]=function(){var n=this.__wrapped__,l=s?[1]:arguments,c=n instanceof i,f=l[0],h=c||yf(n),d=function(t){var n=u.apply(e,m([t],l));return s&&p?n[0]:n};h&&o&&"function"==typeof f&&1!=f.length&&(c=h=!1);var p=this.__chain__,g=!!this.__actions__.length,v=a&&!p,y=c&&!g;if(!a&&h){n=y?n:new i(this);var _=t.apply(n,l);return _.__actions__.push({func:ls,args:[d],thisArg:Q}),new r(_,p)}return v&&y?t.apply(this,l):(_=this.thru(d),v?s?_.value()[0]:_.value():_)})}),c(["pop","push","shift","sort","splice","unshift"],function(t){var n=kl[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var e=this.value();return n.apply(yf(e)?e:[],t)}return this[r](function(e){return n.apply(yf(e)?e:[],t)})}}),Un(i.prototype,function(t,n){var r=e[n];if(r){var i=r.name+"";(pc[i]||(pc[i]=[])).push({name:n,func:r})}}),pc[mi(Q,st).name]=[{name:"wrapper",func:Q}],i.prototype.clone=R,i.prototype.reverse=Re,i.prototype.value=qe,e.prototype.at=Yc,e.prototype.chain=cs,e.prototype.commit=fs,e.prototype.next=hs,e.prototype.plant=ps,e.prototype.reverse=gs,e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=vs,Dl&&(e.prototype[Dl]=ds),e}var Q,tt="4.13.1",et=200,nt="Expected a function",rt="__lodash_hash_undefined__",it="__lodash_placeholder__",ot=1,st=2,ut=4,at=8,lt=16,ct=32,ft=64,ht=128,dt=256,pt=512,gt=1,vt=2,mt=30,yt="...",_t=150,bt=16,xt=1,wt=2,St=3,kt=1/0,jt=9007199254740991,Ot=1.7976931348623157e308,Et=NaN,Mt=4294967295,zt=Mt-1,At=Mt>>>1,Ct="[object Arguments]",Tt="[object Array]",It="[object Boolean]",Nt="[object Date]",Lt="[object Error]",Rt="[object Function]",qt="[object GeneratorFunction]",Ft="[object Map]",Pt="[object Number]",Bt="[object Object]",Wt="[object Promise]",Dt="[object RegExp]",Ht="[object Set]",Ut="[object String]",Vt="[object Symbol]",$t="[object WeakMap]",Gt="[object WeakSet]",Kt="[object ArrayBuffer]",Xt="[object DataView]",Zt="[object Float32Array]",Jt="[object Float64Array]",Yt="[object Int8Array]",Qt="[object Int16Array]",te="[object Int32Array]",ee="[object Uint8Array]",ne="[object Uint8ClampedArray]",re="[object Uint16Array]",ie="[object Uint32Array]",oe=/\b__p \+= '';/g,se=/\b(__p \+=) '' \+/g,ue=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ae=/&(?:amp|lt|gt|quot|#39|#96);/g,le=/[&<>"'`]/g,ce=RegExp(ae.source),fe=RegExp(le.source),he=/<%-([\s\S]+?)%>/g,de=/<%([\s\S]+?)%>/g,pe=/<%=([\s\S]+?)%>/g,ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ve=/^\w*$/,me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,ye=/[\\^$.*+?()[\]{}|]/g,_e=RegExp(ye.source),be=/^\s+|\s+$/g,xe=/^\s+/,we=/\s+$/,Se=/[a-zA-Z0-9]+/g,ke=/\\(\\)?/g,je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oe=/\w*$/,Ee=/^0x/i,Me=/^[-+]0x[0-9a-f]+$/i,ze=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,Ce=/^0o[0-7]+$/i,Te=/^(?:0|[1-9]\d*)$/,Ie=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ne=/($^)/,Le=/['\n\r\u2028\u2029\\]/g,Re="\\ud800-\\udfff",qe="\\u0300-\\u036f\\ufe20-\\ufe23",Fe="\\u20d0-\\u20f0",Pe="\\u2700-\\u27bf",Be="a-z\\xdf-\\xf6\\xf8-\\xff",We="\\xac\\xb1\\xd7\\xf7",De="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",He="\\u2000-\\u206f",Ue=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ve="A-Z\\xc0-\\xd6\\xd8-\\xde",$e="\\ufe0e\\ufe0f",Ge=We+De+He+Ue,Ke="['’]",Xe="["+Re+"]",Ze="["+Ge+"]",Je="["+qe+Fe+"]",Ye="\\d+",Qe="["+Pe+"]",tn="["+Be+"]",en="[^"+Re+Ge+Ye+Pe+Be+Ve+"]",nn="\\ud83c[\\udffb-\\udfff]",rn="(?:"+Je+"|"+nn+")",on="[^"+Re+"]",sn="(?:\\ud83c[\\udde6-\\uddff]){2}",un="[\\ud800-\\udbff][\\udc00-\\udfff]",an="["+Ve+"]",ln="\\u200d",cn="(?:"+tn+"|"+en+")",fn="(?:"+an+"|"+en+")",hn="(?:"+Ke+"(?:d|ll|m|re|s|t|ve))?",dn="(?:"+Ke+"(?:D|LL|M|RE|S|T|VE))?",pn=rn+"?",gn="["+$e+"]?",vn="(?:"+ln+"(?:"+[on,sn,un].join("|")+")"+gn+pn+")*",mn=gn+pn+vn,yn="(?:"+[Qe,sn,un].join("|")+")"+mn,_n="(?:"+[on+Je+"?",Je,sn,un,Xe].join("|")+")",bn=RegExp(Ke,"g"),xn=RegExp(Je,"g"),wn=RegExp(nn+"(?="+nn+")|"+_n+mn,"g"),Sn=RegExp([an+"?"+tn+"+"+hn+"(?="+[Ze,an,"$"].join("|")+")",fn+"+"+dn+"(?="+[Ze,an+cn,"$"].join("|")+")",an+"?"+cn+"+"+hn,an+"+"+dn,Ye,yn].join("|"),"g"),kn=RegExp("["+ln+Re+qe+Fe+$e+"]"),jn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,On=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","Reflect","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","isFinite","parseInt","setTimeout"],En=-1,Mn={}; +Mn[Zt]=Mn[Jt]=Mn[Yt]=Mn[Qt]=Mn[te]=Mn[ee]=Mn[ne]=Mn[re]=Mn[ie]=!0,Mn[Ct]=Mn[Tt]=Mn[Kt]=Mn[It]=Mn[Xt]=Mn[Nt]=Mn[Lt]=Mn[Rt]=Mn[Ft]=Mn[Pt]=Mn[Bt]=Mn[Dt]=Mn[Ht]=Mn[Ut]=Mn[$t]=!1;var zn={};zn[Ct]=zn[Tt]=zn[Kt]=zn[Xt]=zn[It]=zn[Nt]=zn[Zt]=zn[Jt]=zn[Yt]=zn[Qt]=zn[te]=zn[Ft]=zn[Pt]=zn[Bt]=zn[Dt]=zn[Ht]=zn[Ut]=zn[Vt]=zn[ee]=zn[ne]=zn[re]=zn[ie]=!0,zn[Lt]=zn[Rt]=zn[$t]=!1;var An={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à ":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Cn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Tn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},In={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Nn=parseFloat,Ln=parseInt,Rn="object"==o(e)&&e,qn=Rn&&"object"==o(t)&&t,Fn=qn&&qn.exports===Rn,Pn=R("object"==("undefined"==typeof i?"undefined":o(i))&&i),Bn=R("object"==("undefined"==typeof self?"undefined":o(self))&&self),Wn=R("object"==o(this)&&this),Dn=Pn||Bn||Wn||Function("return this")(),Hn=Y();(Bn||{})._=Hn,"object"==o(n(53))&&n(53)?(r=function(){return Hn}.call(e,n,e,t),!(r!==Q&&(t.exports=r))):qn?((qn.exports=Hn)._=Hn,Rn._=Hn):Dn._=Hn}).call(void 0)}).call(e,n(20)(t),function(){return this}())},function(t,e,n){"use strict";function r(t){var e=t.parentNode,n=t.nextSibling;return e.removeChild(t),function(){n?e.insertBefore(t,n):e.appendChild(t)}}var i,o=n(54),s=n(2),u=function(t){for(var e;e=t.lastChild;)t.removeChild(e)};t.exports=i=s.extend({renderSubviews:function(){var t=this.el,e=void 0!=t.parentNode;if(e)var n=r(t);u(t);for(var i,s,a=document.createDocumentFragment(),l=this._views(),c=o.sortBy(l,function(t){return t.ordering}),f=0;f0&&e-1 in t)}function u(t,e){var n,r;this.originalEvent=t,r=function(t,e){"preventDefault"===t?this[t]=function(){return this.defaultPrevented=!0,e[t]()}:"stopImmediatePropagation"===t?this[t]=function(){return this.immediatePropagationStopped=!0,e[t]()}:_(e[t])?this[t]=function(){return e[t]()}:this[t]=e[t]};for(n in t)(t[n]||"function"==typeof t[n])&&r.call(this,n,t);x.extend(this,e,{isImmediatePropagationStopped:function(){return!!this.immediatePropagationStopped}})}var a,l=o.$,c=o.jBone,f=/^<(\w+)\s*\/?>$/,h=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,d=[].slice,p=[].splice,g=Object.keys,v=document,m=function(t){return"string"==typeof t},y=function(t){return t instanceof Object},_=function(t){return"[object Function]"==={}.toString.call(t)},b=function(t){return Array.isArray(t)},x=function(t,e){return new a.init(t,e)};x.noConflict=function(){return o.$=l,o.jBone=c,x},a=x.fn=x.prototype={init:function(t,e){var n,r,i,o;if(!t)return this;if(m(t)){if(r=f.exec(t))return this[0]=v.createElement(r[1]),this.length=1,y(e)&&this.attr(e),this;if((r=h.exec(t))&&r[1]){for(o=v.createDocumentFragment(),i=v.createElement("div"),i.innerHTML=t;i.lastChild;)o.appendChild(i.firstChild);return n=d.call(o.childNodes),x.merge(this,n)}if(x.isElement(e))return x(e).find(t);try{return n=v.querySelectorAll(t),x.merge(this,n)}catch(s){return this}}return t.nodeType?(this[0]=t,this.length=1,this):_(t)?t():t instanceof x?t:x.makeArray(t,this)},pop:[].pop,push:[].push,reverse:[].reverse,shift:[].shift,sort:[].sort,splice:[].splice,slice:[].slice,indexOf:[].indexOf,forEach:[].forEach,unshift:[].unshift,concat:[].concat,join:[].join,every:[].every,some:[].some,filter:[].filter,map:[].map,reduce:[].reduce,reduceRight:[].reduceRight,length:0},a.constructor=x,a.init.prototype=a,x.setId=function(t){var e=t.jid;t===o?e="window":void 0===t.jid&&(t.jid=e=++x._cache.jid),x._cache.events[e]||(x._cache.events[e]={})},x.getData=function(t){t=t instanceof x?t[0]:t;var e=t===o?"window":t.jid;return{jid:e,events:x._cache.events[e]}},x.isElement=function(t){return t&&t instanceof x||t instanceof HTMLElement||m(t)},x._cache={events:{},jid:0},a.pushStack=function(t){return x.merge(this.constructor(),t)},x.merge=function(t,e){for(var n=e.length,r=t.length,i=0;i=e;)t.push(n--);return t}(),"break"):void(i=i.concat(function(){var t=[],e=n.attributes.xStart;if(n.attributes.xStart<=n.attributes.xEnd)for(;e<=n.attributes.xEnd;)t.push(e++);else for(;e>=n.attributes.xEnd;)t.push(e--);return t}()))},s=0;s=r.attributes.xEnd;)t.push(e--);return t}())},s=0;s=0)}),s=[],u=0;u=e.attributes.xEnd;)t.push(n--);return t}())},[]),n=(0,i.filter)(t,function(t){return!(e.indexOf(t)>=0)});if(0!==n.length){for(var o,s=[],u=n[0],a=u,l=0;l0||l.length>0)return t.collection.remove(t)})}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.xhr=e.seqs=e.parser=e.newick=e.matrix=e.gff=e.fasta=e.clustal=void 0;var i=n(61),o=r(i),s=n(62),u=r(s),a=n(63),l=r(a),c=n(65),f=r(c),h=n(67),d=r(h),p=n(11),g=r(p),v=n(24),m=r(v);e.clustal=o["default"],e.fasta=u["default"],e.gff=l["default"],e.matrix=f["default"],e.newick=d["default"],e.parser=g["default"],e.seqs=m["default"];var y=n(21);e.xhr=y;var _="imported";"undefined"!=typeof IO_VERSION&&(_=IO_VERSION),e.version=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=n(21),o={};e["default"]=o,o.read=function(t,e){var n=function(t){return function(n,r,i){return o._onRetrieval(n,i,e,t)}}(this);return"undefined"==typeof e?new Promise(function(r,o){e=function(t,e){t?o(t):r(e)},i(t,n)}):i(t,n)},o._onRetrieval=function(t,e,n,r){var i=void 0;return"undefined"!=typeof t&&(i=r.parse(e)),n.call(r,t,i)},o.extend=function(t,e){return extend(o,t,e)},o.mixin=function(t){var e=["read"];return"object"!==("undefined"==typeof t?"undefined":r(t))&&(t=t.prototype),e.forEach(function(e){t[e]=o[e]},this),t}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="http://www.w3.org/2000/svg",r=function(t,e){for(var n in e){var r=e[n];t.setAttributeNS(null,n,r)}return t},i=function(t){var e=document.createElementNS(n,"svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e},o=function(t){return r(document.createElementNS(n,"rect"),t)},s=function(t){return r(document.createElementNS(n,"line"),t)},u=function(t){return r(document.createElementNS(n,"polygon"),t)};e.base=i,e.line=s,e.rect=o,e.polygon=u},function(t,e,n){"use strict";var r=n(71);r.onAll=function(t,e){return this.on("all",t,e),this},r.oldMixin=r.mixin,r.mixin=function(t){r.oldMixin(t);for(var e=["onAll"],n=0;ne){var r=[e,t];t=r[0],e=r[1]}return Math.floor(Math.random()*(e-t+1)+t)}},{key:"uniqueId",value:function(){for(var t=arguments.length<=0||void 0===arguments[0]?8:arguments[0],e="";e.length0){n=t.seqs.filter(function(t){return n.indexOf(t.get("id"))>=0});for(var i=n.length-1,o=0;0=i;0=r;0=0&&t.apply(e,arguments),o()}},o=function(){if(r++,r===e)return t.call(n)};return i}};e["default"]=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(t){return this.g=t.g,this},o={corsURL:function(t){return document.URL.indexOf("localhost")>=0&&"/"===t[0]?t:"."===t.charAt(0)||"/"===t.charAt(0)?t:(this.g.config.get("importProxyStripHttp")&&(t=t.replace("http://",""),t=t.replace("https://","")),t=this.g.config.get("importProxy")+t)}};(0,r.extend)(i.prototype,o),e["default"]=i},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n0&&(g=setTimeout(function(){p=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",r(t)},t.timeout)),f.setRequestHeader)for(d in _)_.hasOwnProperty(d)&&f.setRequestHeader(d,_[d]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(y),f}function a(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function l(){}var c=n(147),f=n(52),h=n(150),d=n(151);t.exports=s,s.XMLHttpRequest=c.XMLHttpRequest||l,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:c.XDomainRequest,r(["get","put","post","patch","head","delete"],function(t){s["delete"===t?"del":t]=function(e,n,r){return n=o(e,n,r),n.method=t.toUpperCase(),u(n)}})},function(t,e,n){"use strict";t.exports=n(56)},function(t,e,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(s){"object"===o(e)?t.exports=s():(r=s,i="function"==typeof r?r.call(e,n,e,t):r,!(void 0!==i&&(t.exports=i)))}(function(){"use strict";var t={has:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=1;e=1?(r=u.shift(),i=u.join(" ")):r=t,r){var a=r.split("|");for(e=a.pop(),s.en=e;0!=a.length;){var l=a.shift(),c=a.shift();o[l]=c}}else e=r;if(i){var f=i.split("=");if(f.length>1){var h,d;f.length-1,f.forEach(function(t){t=t.trim();var e,r=t.split(" ");r.length>1?(d=r.pop(),e=r.join(" ")):e=t,h?s[h.toLowerCase()]=e:n=e,h=d})}else n=f.shift()}var p={name:e,ids:o,details:s};return n&&(p.desc=n),p};var r={sp:{link:"http://www.uniprot.org/%s",name:"Uniprot"},tr:{link:"http://www.uniprot.org/%s",name:"Trembl"},gb:{link:"http://www.ncbi.nlm.nih.gov/nuccore/%s",name:"Genbank"},pdb:{link:"http://www.rcsb.org/pdb/explore/explore.do?structureId=%s",name:"PDB"}};n.buildLinks=function(t){var e={};return t=t||{},Object.keys(t).forEach(function(n){if(n in r){var i=r[n],o=i.link.replace("%s",t[n]);e[i.name]=o}}),e},n.contains=function(t,e){return"".indexOf.call(t,e,0)!==-1},n.splitNChars=function(t,e){var n,r;e=e||80;var i=[];for(n=0,r=t.length-1;n<=r;n+=e)i.push(t.substr(n,e));return i},n.reverse=function(t){return t.split("").reverse().join("")},n.complement=function(t){var e=t+"",n=[[/g/g,"0"],[/c/g,"1"],[/0/g,"c"],[/1/g,"g"],[/G/g,"0"],[/C/g,"1"],[/0/g,"C"],[/1/g,"G"],[/a/g,"0"],[/t/g,"1"],[/0/g,"t"],[/1/g,"a"],[/A/g,"0"],[/T/g,"1"],[/0/g,"T"],[/1/g,"A"]];for(var r in n)e=e.replace(n[r][0],n[r][1]);return e},n.reverseComplement=function(t){return n.reverse(n.complement(t))},n.model=function(t,e,n){this.seq=t,this.name=e,this.id=n,this.ids={}}},function(t,e,n){"use strict";var r,i=n(1).Model;n(90),t.exports=r=i.extend({constructor:function(t,e){return this.g=e.g,i.apply(this,arguments),this},defaults:{currentSize:5,step:1,originalSize:!1,scaleCategories:[{columnWidth:1,markerStepSize:20,stepSize:0},{columnWidth:3,markerStepSize:20,stepSize:0},{columnWidth:5,markerStepSize:10,stepSize:0},{columnWidth:9,markerStepSize:5,stepSize:1},{columnWidth:15,markerStepSize:2,stepSize:1},{columnWidth:20,markerStepSize:1,stepSize:1},{columnWidth:30,markerStepSize:1,stepSize:1},{columnWidth:45,markerStepSize:1,stepSize:1}]},initialize:function(t){var e=this.get("scaleCategories"),n=this.g.zoomer.get("columnWidth")||this._getScaleInfo().columnWidth,r=_.find(e,{columnWidth:n});if(!r){var i=this._insertScaleCategory(n);r=e[i],this.set("currentSize",i+1)}var o=this.get("currentSize");return this.set("originalSize",o),this.setSize(o),this},_insertScaleCategory:function(t){var e=this.get("scaleCategories"),n=_.findLastIndex(e,function(e){return e.columnWidthe[1]?e[1]:t,this.set("currentSize",t);var n=this._getScaleInfo();return this.g.zoomer.set({columnWidth:n.columnWidth,stepSize:n.stepSize,markerStepSize:n.markerStepSize}),this},getSize:function(){return this.get("currentSize")},_getScaleInfo:function(){var t=this.getSize(),e=this.get("scaleCategories");return t>0&&t<=e.length?e[t-1]:void console.error("out of bounds")}})},function(t,e,n){"use strict";var r,i=n(99),o=n(1).Model;t.exports=r=o.extend({defaults:{scheme:"taylor",colorBackground:!0,showLowerCase:!0,opacity:.6},initialize:function(t,e,n){return this.colors=new i({seqs:e,conservation:function(){return n.scale(n.conservation())}}),n.on("reset",function(){if("dyn"===this.getSelectedScheme().type){var t;if(t="reset",this.getSelectedScheme().indexOf(t)>=0)return this.getSelectedScheme().reset()}},this)},addStaticScheme:function(t,e){return this.colors.addStaticScheme(t,e)},addDynScheme:function(t,e){return this.colors.addDynScheme(t,e)},getScheme:function(t){return this.colors.getScheme(t)},getSelectedScheme:function(){return this.colors.getScheme(this.get("scheme"))}})},function(t,e,n){"use strict";var r,i=n(1).Model;t.exports=r=i.extend({initialize:function(t,e){return null==this.get("hidden")&&this.set("hidden",[]),this.stats=e},calcHiddenColumns:function(t){for(var e,n=this.get("hidden"),r=t,i=0;i0){var e=t.at(0),n=e.get("ids");if(void 0!==n&&0===Object.keys(n).length)return this.defaults.metaLinks=!1}}})},function(t,e,n){"use strict";var r,i=n(1).Model;t.exports=r=i.extend({constructor:function(t,e){return this.calcDefaults(e.model),i.apply(this,arguments),this.g=e.g,this.listenTo(this,"change:labelIdLength change:labelNameLength change:labelPartLength change:labelCheckLength",function(){return this.trigger("change:labelWidth",this.getLabelWidth())},this),this.listenTo(this,"change:metaLinksWidth change:metaIdentWidth change:metaGapWidth",function(){return this.trigger("change:metaWidth",this.getMetaWidth())},this),this},defaults:{alignmentWidth:"auto",alignmentHeight:225,columnWidth:15,rowHeight:15,autoResize:!0,labelIdLength:20,labelNameLength:100,labelPartLength:15,labelCheckLength:15,labelFontsize:13,labelLineHeight:"13px",markerFontsize:"10px",stepSize:1,markerStepSize:2,markerHeight:20,residueFont:"13",canvasEventScale:1,minLetterDrawSize:11,boxRectHeight:2,boxRectWidth:2,overviewboxPaddingTop:10,metaGapWidth:35,metaIdentWidth:40,_alignmentScrollLeft:0,_alignmentScrollTop:0},calcDefaults:function(t){return t.getMaxLength()<200&&t.length<30&&(this.defaults.boxRectWidth=this.defaults.boxRectHeight=5),this},getAlignmentWidth:function(t){return this.get("autoResize")&&void 0!==t?this.get("columnWidth")*t:void 0===this.get("alignmentWidth")||"auto"===this.get("alignmentWidth")||0===this.get("alignmentWidth")?this._adjustWidth():this.get("alignmentWidth")},setLeftOffset:function(t){var e=t;return e=Math.max(0,e),e-=this.g.columns.calcHiddenColumns(e),this.set("_alignmentScrollLeft",e*this.get("columnWidth"))},setTopOffset:function(t){for(var e=Math.max(0,t-1),n=0,r=0;0=e;00&&(e=Math.min(e,t)),this.set("alignmentHeight",e)},setEl:function(t,e){return this.el=t,this.model=e},_checkScrolling:function(t,e){var n=t[0],r=t[1];return this.set("_alignmentScrollLeft",n,e),this.set("_alignmentScrollTop",r,e)},getMaxAlignmentHeight:function(){var t=0;return this.model.each(function(e){return t+=e.attributes.height||1}),t*this.get("rowHeight")},getMaxAlignmentWidth:function(){return this.model.getMaxLength()*this.get("columnWidth")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(50),s=r(o),u=n(1).Collection,a=u.extend({model:s["default"],constructor:function(){return this.startOnCache=[],this.on("all",function(){return this.startOnCache=[]},this),u.apply(this,arguments)},startOn:function(t){return null==this.startOnCache[t]&&(this.startOnCache[t]=this.where({xStart:t})),this.startOnCache[t]},contains:function(t){return this.reduce(function(e,n){return n||e.contains(t)},!1)},getFeatureOnRow:function(t,e){return this.filter(function(n){return n.get("row")===t&&n.get("xStart")<=e&&e<=n.get("xEnd")})},assignRows:function(){var t=this.max(function(t){return t.get("xEnd")}).attributes.xEnd,e=function(){for(var e=[],n=0;0=t;0=i;rn&&(n=e[o]),e[o]++;return t.set("row",n)}),(0,i.max)(e)},getCurrentHeight:function(){return this.max(function(t){return t.get("row")}).attributes.row+1},getMinRows:function(){var t=this.max(function(t){return t.get("xEnd")}).attributes.xEnd,e=function(){for(var e=[],n=0;0=t;0=i;r=e;00)return this.at(0).set("ref",!0)},setRef:function(t){var e=this.get(t);return this.each(function(n){if(t.cid)return e.cid===n.cid?n.set("ref",!0):n.set("ref",!1)}),this.g.config.set("hasRef",!0),this.trigger("change:reference",t)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(34),o=r(i),s=n(1).Model,u=s.extend({defaults:{name:"",id:"",seq:"",height:1,ref:!1},initialize:function(){if(this.set("grey",[]),null==this.get("features"))return this.set("features",new o["default"])}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.exporter=e.file=e.seqgen=e.proxy=e.bmath=void 0;var i=n(15),o=r(i),s=n(19),u=r(s),a=n(39),l=r(a),c=n(17),f=r(c),h=n(16),d=r(h);e.bmath=o["default"],e.proxy=u["default"],e.seqgen=l["default"],e.file=f["default"],e.exporter=d["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t,e){for(var n=e.name||e.url||"",r=n.split("."),i=r[r.length-1]||"",o=0;o"===t.substring(0,1)||"fasta"==e||"fa"==e)&&"fasta"},i=function(t,e){return("("===t.substring(0,1)||"nwk"==e)&&"newick"},o=function(t,e){if(t.length<=10)return!1;var n=t.split("\n");return n[0].indexOf("gff")>=0||e.indexOf("gff")>=0?"gff":n[0].indexOf("#")<0&&2===n[0].split("\t").length&&"gff"},s=[n,r,i,o]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),o=r(i),s=n(72).seq,u=n(48),a={_generateSequence:function(t){for(var e="",n=t-1,r=0;0=n;0=t;1=t;1=f;0=p;0=t;1=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"), +e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e){"use strict";function n(t){var e={};return t.split(";").forEach(function(t){var n,r,i;t.indexOf("=")>0?(n=t.split("="),r=n[0],i=n[1],e[r]=i):t.indexOf(" ")>0&&(n=t.split(" "),r=n[0],i=n[1].replace(/"/g,""),e[r]=i)}),e}function r(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function i(t,e,n){return 3===t.length?i(t[0],t[1],t[2]):"#"+r(t)+r(e)+r(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.extractKeys=n,e.rgbToHex=i,e["default"]={extractKeys:n,rgbToHex:i}},function(t,e){"use strict";t.exports=function(t,e,n){t.beginPath(),t.moveTo(0,e),t.lineTo(n,e),t.lineWidth=1,t.strokeStyle="#999999",t.stroke()}},function(t,e){"use strict";t.exports=function(t,e,n,r,i,o,s){t.font=o+"px Arial",t.textAlign=s?"right":"center",t.fillStyle="#666666",t.fillText(i,e+r/2,n)}},function(t,e){"use strict";t.exports=function(t,e,n,r,i){i=i||"#999999",t.beginPath(),t.moveTo(e,n),t.lineTo(e,n+r),t.lineWidth=1,t.strokeStyle=i,t.stroke()}},function(t,e){"use strict";var n;t.exports=n={rel:function(t){var e,n,r,i;return e=t.offsetX,n=t.offsetY,void 0==e&&(r=i.getBoundingClientRect(),i=t.target||t.srcElement,void 0==e&&(e=t.clientX-r.left,n=t.clientY-r.top),void 0==e&&(e=t.pageX-i.offsetLeft,n=t.pageY-i.offsetTop),void 0==e)?void console.log(t,"no mouse event defined. your browser sucks"):[e,n]},abs:function(t){var e,n;return e=t.pageX,n=t.pageY,void 0==e&&(e=t.layerX,n=t.layerY),void 0==e&&(e=t.clientX,n=t.clientY),void 0==e&&(e=t.x,n=t.y),[e,n]},wheelDelta:function(t){var e;return e=[t.deltaX,t.deltaY],void 0==e[0]&&t.mozMovementX&&(e=[0,t.mozMovementX]),isNaN(e[0])&&(e[0]=0),isNaN(e[1])&&(e[1]=0),e}}},function(t,e,n){"use strict";var r=n(110),i=function s(t,e){if(!this||this.constructor!==s)return new s(t);if(void 0===t||"string"==typeof t)throw new TypeError("you need to give the seq stat an array");this.resetSeqs(t),this.alphabetSize=4,this._useBackground=!1,this.useGaps=!1,this.ignoredChars=["-","*"],r.extend(this,e)};i.prototype.addSeq=function(t){this.seqs.push(t),this._reset()},i.prototype.removeSeq=function(t){"number"==typeof t?this.seqs.splice(t,1):r.each(this.seqs,function(e,n){t===e&&this.seqs.splice(n,1)}.bind(this)),this._reset()},i.prototype.addSeqs=function(t){t.forEach(function(t){this.addSeq(t)}.bind(this))},i.prototype.resetSeqs=function(t){if(this.seqs=[],!t instanceof Array||"at"in t){this.mseqs=t;var e=function(){var t=this.mseqs.pluck("seq");this.resetSeqs(t)};t.on("add change reset ",e,this),e.call(this)}else this.addSeqs(t),this._reset(),this.trigger("reset")};var o=["consensus","frequency","maxLength","ic","gaps"];i.prototype._reset=function(){for(var t=0;t=0||(void 0===e[r]&&(e[r]={}),void 0===e[r][t]&&(e[r][t]=0),e[r][t]++,void 0===n[r]&&(n[r]=0),n[r]++)})}),r.each(e,function(t,i){return r.each(t,function(t,r){return e[i][r]=t/n[i]})}),this._frequency=e,e},i.prototype.backgroundCalc=function(){var t={},e=0;return r.each(this.seqs,function(n){r.each(n,function(n){return void 0===t[n]&&(t[n]=0),t[n]++,e++})}),t=r.mapValues(t,function(t){return t/e}),this._background=t,t},i.prototype.icCalc=function(){var t=this.frequency();if(this._useBackground)var e=this.background();var n=this.ignoredChars,i=this._useBackground,o=r.map(t,function(t){return r.reduce(t,function(t,r,o){return n.indexOf(o)>=0?t:(i&&(r/=e[o]),t-r*(Math.log(r)/Math.log(2)))},0)});return this._ic=o,o},i.prototype.conservation=function(t){var e=this.ic(),n=this.gaps(),i=this;t=t||this.alphabetSize;var o=Math.log(t)/Math.log(2),s=0;return r.map(e,function(t){var e=o-t;return i.useGaps&&(e*=1-n[s++]),e})},i.prototype.conservResidue=function(t){var e,n=t?t.alphabetSize:void 0,i=this.ignoredChars;e=void 0!==t&&t.scaled?this.scale(this.conservation(n)):this.conservation(n);var o,s=this.frequency();return r.map(s,function(t,n){o=r.reject(r.keys(t),function(t){return i.indexOf(t)>=0});var s={};return r.each(o,function(r){s[r]=t[r]*e[n]}),s})},i.prototype.conservResidue2=function(t){var e=this.frequency(),n=this.conservation(t),i=this.background();return r.map(e,function(t,o){return r.map(t,function(t){var s=r.reduce(e[o],function(t,e){return t+e/i[o]},0);return t/i[o]/s*n[o]},0)})},i.prototype.scale=function(t,e){e=e||this.alphabetSize;var n=Math.log(e)/Math.log(2);return r.map(t,function(t){return t/n})},i.prototype.maxLengthCalc=function(){return 0===this.seqs.length?0:r.max(this.seqs,function(t){return t.length}).length},i.prototype.consensusCalc=function(){var t=new Array(this.maxLength());return r.each(this.seqs,function(e){r.each(e,function(e,n){void 0===t[n]&&(t[n]={}),void 0===t[n][e]&&(t[n][e]=0),t[n][e]++})}),this._consensus=r.reduce(t,function(t,e){var n;return n=r.keys(e),t+=r.max(n,function(t){return e[t]})},""),this._consensus},i.prototype.identityCalc=function(t){var e=t||this.consensus();return this._identity=this.seqs.map(function(t){for(var n=0,r=0,i=0;i=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";var r=n(22),i=n(23),o=n(42),s=n(41),u=[],a=u.slice,l=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,o.extend({silent:!0},e))},c={add:!0,remove:!0,merge:!0},f={add:!0,remove:!1};o.extend(l.prototype,r,{model:s,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return Backbone.sync.apply(this,arguments)},add:function(t,e){return this.set(t,o.extend({merge:!1},e,f))},remove:function(t,e){var n=!o.isArray(t);t=n?[t]:o.clone(t),e||(e={});for(var r=0,i=t.length;r=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),o=r(i),s=n(24),u=r(s),a=void 0;e["default"]=a={parse:function(t){var e=[];if("[object Array]"===Object.prototype.toString.call(t))var n=t;else var n=t.split("\n");if(n[0].slice(0,6)===!1)throw new Error("Invalid CLUSTAL Header");for(var r=0,i=1,o=0;r=e.length){var h=u["default"].getMeta(c.trim());c=h.name;var d=new u["default"].model(f,c,o);d.ids=h.ids||{},d.details=h.details||{};var p=Object.keys(d.ids);p.length>0&&(d.id=d.ids[p[0]]),e.push(d)}else e[o].seq+=f;o++}else console.log("parse error",s)}}else i=1;else i=1}return e}},o["default"].mixin(a)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(24),o=r(i),s=n(69),u=r(s),a=n(11),l=r(a),c=void 0;e["default"]=c={getMeta:o["default"].getMeta,extend:function(t){var e=(0,u["default"])(c);return c.getMeta=t,e},parse:function(t){var e=[];if(!t||0===t.length)return[];"[object Array]"!==Object.prototype.toString.call(t)&&(t=t.split("\n"));for(var n=c,r=n.getMeta,i=0;i"===s[0]||";"===s[0]){var u=s.slice(1).trim(),a=r(u.trim());u=a.name;var l=a.id||e.length,f=new o["default"].model("",a.name,l);f.ids=a.ids||{},f.details=a.details||{},e.push(f)}else f.seq+=s}return e},write:function(t,e){for(var n="",r=0;r"+i.name+"\n",n+=o["default"].splitNChars(i.seq,80).join("\n"),n+="\n"}return n}},l["default"].mixin(c)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),o=r(i),s=n(43),u=r(s),a=n(64),l=r(a),c=function(){};o["default"].mixin(c),e["default"]=c,c.parseLines=function(t){var e=t.split("\n"),n={},r=[];n.type=c._guessType(e);var i=0;if("jalview"===n.type){var o=l["default"].readHeader(e);i=o.offset,n.colors=o.colors,r=o.features}for(var s=i;s=0)break;var u=s.split(/\t/),a=u[0].trim();if("GFF"===a)break;if(2===u.length)if("startgroup"===a)e=u[1].trim();else{if("endgroup"===a){e="";continue}n[u[0]]=i.parseColor(u[1])}else if(u.length>=5){var l=i.parseLine(u);e&&(l.attributes.Parent=e),o.push(l)}}return{offset:r,colors:n,features:o}},i.parseColor=function(t){return t.indexOf(",")>=0?(0,r.rgbToHex)(t.split(",").map(function(t){return parseInt(t)})):6===t.length&&parseInt(t.charAt(0),16)<=16&&"bisque"!==t?"#"+t:t},i.parseLine=function(t){var e={attributes:{}};return e.attributes.Name=t[0].trim(),e.seqname=t[1].trim(),e.start=parseInt(t[3]),e.end=parseInt(t[4]),e.feature=t[5].trim(),"ID_NOT_SPECIFIED"===e.seqname&&(e.seqname=t[2].trim()),e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(11),o=r(i),s=function u(t){return this.constructor!=u?new u(t):(this.matrix={},this.parsingOrder=[],void 0!=t&&this.parse(t),this)};o["default"].mixin(s),t.exports=s,s.prototype.parse=function(t){return t.split("\n").forEach(function(t){this.parseLine(t)}.bind(this)),this.buildMatrix(),this.matrix},s.read=function(t,e){return(new s).read(t,e)},s.parse=function(t){return(new s).parse(t)},s.prototype.parseLine=function(t){var e=t.charAt(0);if("#"!==e){this.parsingOrder.push(e);for(var n=t.substring(1),r=n.split(/\s+/).filter(function(t){return t.length>0}).map(function(t){return parseInt(t)}),i={},o=0;o=0;t--){var e=this.parsingOrder[t],n=this.matrix[e];for(var r in n)this.matrix[r][e]=n[r]}}},function(t,e){"use strict";function n(t){for(var e=[],n={},i=t.split(/\s*(;|\(|\)|\[|\]|,|:|=)\s*/),o=0;oo;i?s++:s--)r.push(s);return r}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){t=t||{};for(var e=n(0,arguments.length,!1),r=0;r=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e){"use strict";t.exports={render_x_axis_label:function(){var t="Model Position";this.display_ali_map&&(t="Alignment Column"),this.called_on.find(".logo_xaxis").remove(),this.called_on.prepend('

'+t+"

")},render_y_axis_label:function(){this.dom_element.parent().before('');var t=this.called_on.find(".logo_yaxis"),e=(Math.abs(this.data.max_height),isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),null),n="Information Content (bits)";e=t[0].getContext("2d"),e.beginPath(),e.moveTo(55,1),e.lineTo(40,1),e.moveTo(55,this.info_content_height),e.lineTo(40,this.info_content_height),e.moveTo(55,this.info_content_height/2),e.lineTo(40,this.info_content_height/2),e.lineWidth=1,e.strokeStyle="#666666",e.stroke(),e.fillStyle="#666666",e.textAlign="right",e.font="bold 10px Arial",e.textBaseline="top",e.fillText(parseFloat(this.data.max_height).toFixed(1),38,0),e.textBaseline="middle",e.fillText(parseFloat(this.data.max_height/2).toFixed(1),38,this.info_content_height/2),e.fillText("0",38,this.info_content_height),"score"===this.data.height_calc&&(n="Score (bits)"),e.save(),e.translate(5,this.height/2-20),e.rotate(-Math.PI/2),e.textAlign="center",e.font="normal 12px Arial",e.fillText(n,1,0),e.restore(),e.fillText("occupancy",55,this.info_content_height+7),this.show_inserts&&(e.fillText("ins. prob.",50,280),e.fillText("ins. len.",46,296))}}},function(t,e){"use strict";var n=null;t.exports=function(){if(!n){var t=document.createElement("canvas");n=!(!t.getContext||!t.getContext("2d"))}return n}},function(t,e){"use strict";t.exports={A:"#FF9966",C:"#009999",D:"#FF0000",E:"#CC0033",F:"#00FF00",G:"#f2f20c",H:"#660033",I:"#CC9933",K:"#663300",L:"#FF9933",M:"#CC99CC",N:"#336666",P:"#0099FF",Q:"#6666CC",R:"#990000",S:"#0000FF",T:"#00FFFF",V:"#FFCC33",W:"#66CC66",Y:"#006600"}},function(t,e){"use strict";t.exports={A:"#cbf751",C:"#5ec0cc",G:"#ffdf59",T:"#b51f16",U:"#b51f16"}},function(t,e,n){"use strict";var r=n(5);t.exports=function(t,e,n){t.find(".logo_settings_switch, .logo_settings .close").on("click",function(t){t.preventDefault(),r(".logo_settings").toggle()}),t.find(".logo_reset").on("click",function(t){t.preventDefault(),e.changeZoom({target:e.default_zoom})}),t.find(".logo_change").on("click",function(t){t.preventDefault()}),t.find(".logo_zoomin").on("click",function(t){t.preventDefault(),e.changeZoom({distance:.1,direction:"+"})}),t.find(".logo_zoomout").on("click",function(t){t.preventDefault(),e.changeZoom({distance:.1,direction:"-"})}),t.find(".logo_scale").on("change",function(t){e.toggleScale(this.value)}),t.find(".logo_color").on("change",function(t){e.toggleColorscheme(this.value)}),t.find(".logo_ali_map").on("change",function(t){e.toggleAliMap(this.value)}),t.find(".logo_position").on("change",function(){this.value.match(/^\d+$/m)&&e.scrollToColumn(this.value,1)}),n.on("dblclick",function(n){console.log("dblclick",e),offset=e.logo_graphic.offset(),x=parseInt(n.pageX-offset.left,10),window_position=n.pageX-t.parent().offset().left,col=e.columnFromCoordinates(x),console.log("col",col),current=e.zoom,current<1?e.changeZoom({target:1,offset:window_position,column:col}):e.changeZoom({target:.3,offset:window_position,column:col})}),r(document).on(t.attr("id")+".scrolledTo",function(t,n,r,i){e.render({target:n})}),r(document).on("keydown",function(t){t.ctrlKey||(61!==t.which&&107!==t.which||(zoom+=.1,e.changeZoom({distance:.1,direction:"+"})),109!==t.which&&0!==t.which||(zoom-=.1,e.changeZoom({distance:.1,direction:"-"})))})}},function(t,e,n){"use strict";_=n(75);var r=n(77),i=n(84),o=n(83),s=n(2),u=n(76),a=n(80),l=n(82),c=n(5);t.exports=s.extend({options:{xaxis:!0,yaxis:!0,height:300,column_width:34,debug:!0,scale_height_enabled:!0,scaled_max:!0,zoom_buttons:!0,colorscheme:"default",data:void 0,start:1,end:void 0,zoom:.4,colors:void 0,divider:!1,show_probs:!1,divider_step:5,show_divider:!1,border:!1,settings:!1,scroller:!0,positionMarker:!0},loadDefault:function(t){this.data=t.data,this.display_ali_map=0,this.alphabet=t.data.alphabet||"dna",this.start=t.start,this.zoom=parseFloat(t.zoom)||.4,this.default_zoom=this.zoom,this.column_width=t.column_width,this.height=t.height,this.canvas_width=5e3,this.scale_height_enabled=t.scale_height_enabled,this.scrollme=null,this.previous_target=0,this.rendered=[],this.previous_zoom=0,void 0==this.data.max_height&&(this.data.max_height=this.calcMaxHeight(this.data.heightArr)),this.data.insert_probs&&this.data.delete_probs||(this.options.show_probs=!1),t.scaled_max?this.data.max_height=t.data.max_height_obs||this.data.max_height||2:this.data.max_height=t.data.max_height_theory||this.data.max_height||2,t.colors?this.changeColors(t.colors):"aa"===this.alphabet?(this.aa_colors=n(78),this.changeColors(this.aa_colors)):(this.dna_colors=n(79),this.changeColors(this.dna_colors))},initialize:function(t){if(!r())return void(this.el.textContent="Your browser doesn't support canvas.");void 0==t.data&&(this.el.textContent="No data added."),_.extend(this.options,t);var e=this.options;if(this.loadDefault(e),this.options.show_probs?this.data.processing&&/^observed|weighted/.test(this.data.processing)?(this.show_inserts=0,this.info_content_height=this.height-14):(this.show_inserts=1,this.info_content_height=this.height-44):this.info_content_height=this.height,this.$el=c(this.el),this.initDivs(),this.options.settings){var n=l(this,e);this.$el.append(n)}a(this.$el,this,this.logo_graphic)},initDivs:function(){var t=f("div");t.className="logo_graphic",this.logo_graphic=c(t);var e=f("div");if(e.className="logo_container",e.style.height=this.height,this.container=c(e),this.container.append(t),this.$el.append(e),this.options.divider){var n=f("div");n.className="logo_divider",this.$el.append(n)}this.dom_element=c(t),this.called_on=this.$el,this.options.xaxis&&u.render_x_axis_label.call(this),this.options.yaxis?u.render_y_axis_label.call(this):this.container[0].style.marginLeft="0px"},render:function(){return i.call(this),this},changeColors:function(t){this.colors=t,void 0!=t&&void 0!=t.type&&(this.colorscheme="dynamic"),this.buildAlphabet()},buildAlphabet:function(){this.letters={};var t=this.colors;if("dynamic"==this.colorscheme){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");t={},e.forEach(function(e){t[e]=""})}for(var n in t)if(t.hasOwnProperty(n)){var r={color:t[n]};this.letters[n]=new o(n,r)}},toggleColorscheme:function(t){var e=this.currentColumn();t?"default"===t?this.colorscheme="default":this.colorscheme="consensus":"default"===this.colorscheme?this.colorscheme="consensus":this.colorscheme="default",this.rendered=[],this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},toggleScale:function(t){var e=this.currentColumn();t?"obs"===t?this.data.max_height=this.data.max_height_obs:this.data.max_height=this.data.max_height_theory:this.data.max_height===this.data.max_height_obs?this.data.max_height=this.data.max_height_theory:this.data.max_height=this.data.max_height_obs,this.rendered=[],this.logoYAxis&&this.logoYAxis.remove(),u.render_y_axis_label.call(this),this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},toggleAliMap:function(t){var e=this.currentColumn();t?"model"===t?this.display_ali_map=0:this.display_ali_map=1:1===this.display_ali_map?this.display_ali_map=0:this.display_ali_map=1,u.render_x_axis_label(this),this.rendered=[],this.scrollme.reflow(),this.scrollToColumn(e+1),this.scrollToColumn(e)},currentColumn:function(){var t=this.scrollme.scroller.getValues().left,e=this.column_width*this.zoom,n=t/e,r=this.container.width()/e/2;return Math.ceil(n+r)},changeZoom:function(t){var e=.3,n=null;if(t.target?e=t.target:t.distance&&(e=(parseFloat(this.zoom)-parseFloat(t.distance)).toFixed(1),"+"===t.direction&&(e=(parseFloat(this.zoom)+parseFloat(t.distance)).toFixed(1))),e>1?e=1:e<.1&&(e=.1),n=this.logo_graphic.width()*e/this.zoom,n>this.container.width())if(t.column){this.zoom=e,this.render({zoom:this.zoom}),this.scrollme.reflow();var r=this.coordinatesFromColumn(t.column);this.scrollme.scroller.scrollTo(r-t.offset)}else{var i=this.currentColumn();this.zoom=e,this.render({zoom:this.zoom}),this.scrollme.reflow(),this.scrollToColumn(i)}return this.zoom},columnFromCoordinates:function(t){return Math.ceil(t/(this.column_width*this.zoom))},coordinatesFromColumn:function(t){return(t-1)*(this.column_width*this.zoom)+this.column_width*this.zoom/2},scrollToColumn:function(t,e){var n=this.logo_container.width()/2,r=this.coordinatesFromColumn(t);this.scrollme.scroller.scrollTo(r-n,0,e)},calcMaxHeight:function(t){return t.reduce(function(t,e){var n=0;for(var r in e)n+=e[r];return n>t?n:t},0)}});var f=function(t){return document.createElement(t)}},function(t,e,n){"use strict";var r=n(5);t.exports=function(t,e){var n=r('
'),i=r('
');if(i.append('x'),t.scale_height_enabled&&t.data.max_height_obsMaximum Observed "+a+'
";if(i.append(l),"score"!==t.data.height_calc&&"aa"===t.data.alphabet&&t.data.probs_arr){var c=null,f=null,h="",d="";"default"===t.colorscheme?c="checked":f="checked",e.help&&(h='
help',d='help');var p='
Color Scheme
";i.append(p)}if(t.data.ali_map){var g=null,v=null,m="",y="";0===t.display_ali_map?g="checked":v="checked",e.help&&(m='help',y='help');var _='
Coordinates
";i.append(_)}var b=r('
');return t.zoom_enabled&&b.append(''),i.children().length>0&&(b.append(''),b.append(i)),n.append(b),n}},function(t,e){"use strict";t.exports=function(t,e){e=e||{},this.value=t,this.width=parseInt(e.width,10)||100,"W"===this.value&&(this.width+=30*this.width/100),this.height=parseInt(e.height,10)||100,this.color=e.color||"#000000",this.fontSize=e.fontSize||138,this.scaled=function(){},this.draw=function(t,e,n,r,i,o){var s=e/this.height,u=n/this.width,a=t.font;t.transform(u,0,0,s,r,i),t.fillStyle=o||this.color,t.textAlign="center",t.font="bold "+this.fontSize+"px Arial",t.fillText(this.value,0,0),t.setTransform(1,0,0,1,0,0),t.fillStyle="#000000",t.font=a}}},function(t,e,n){"use strict";function r(t,e,n,r,i){var o=s(t).find("#canv_"+r);return o.length||(s(t).append(''), +o=s(t).find("#canv_"+r)),s(o).attr("width",n).attr("height",e),o[0]}var i=n(86),o=n(85),s=n(5);t.exports=function(t){if(this.data){t=t||{};var e=t.zoom||this.zoom,n=t.target||1,s=(t.scaled||null,this.dom_element.parent().attr("width")),u=1,a=null,l=null,c=0;if(this.previous_target=n,t.start&&(this.start=t.start),t.end&&(this.end=t.end),e<=.1?e=.1:e>=1&&(e=1),this.zoom=e,a=this.end||this.data.heightArr.length,l=this.start||1,a=a>this.data.heightArr.length?this.data.heightArr.length:a,a=aa?a:l,l=l>1?l:1,this.y=this.height-20,this.max_width=this.column_width*(a-l+1),s>this.max_width&&(e=1,this.zoom_enabled=!1),this.zoom=e,this.zoomed_column=this.column_width*e,this.total_width=this.zoomed_column*(a-l+1),e<1)for(;this.total_width=1)););n>this.total_width&&(n=this.total_width),this.dom_element.attr({width:this.total_width+"px"}).css({width:this.total_width+"px"}),this.canvas_width=this.total_width;var f=Math.ceil(this.total_width/this.canvas_width);for(this.columns_per_canvas=Math.ceil(this.canvas_width/this.zoomed_column),this.previous_zoom!==this.zoom&&(this.dom_element.find("canvas").remove(),this.previous_zoom=this.zoom,this.rendered=[]),this.canvases=[],this.contexts=[],c=0;ca&&(d=a);var p=(d-h+1)*this.zoomed_column;p>u&&(u=p);var g=u*c,v=g+p;if(ng-g/2)if(this.canvases[c]=r(this.dom_element,this.height,p,c,u),this.contexts[c]=this.canvases[c].getContext("2d"),this.contexts[c].setTransform(1,0,0,1,0,0),this.contexts[c].clearRect(0,0,p,this.height),this.contexts[c].fillStyle="#ffffff",this.contexts[c].fillRect(0,0,v,this.height),this.zoomed_column>12){var m=parseInt(10*e,10);m=m>10?10:m,this.debug&&o.call(this,h,d,c,1),i.call(this,h,d,c,m)}else o.call(this,h,d,c)}!this.scrollme&&this.options.scroller&&(this.scrollme=new EasyScroller(this.dom_element[0],{scrollingX:1,scrollingY:0,eventTarget:this.called_on})),1!==n&&this.scrollme.reflow()}}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,u){var a="#ffffff";u?(i>.1?a="#d7301f":i>.05?a="#fc8d59":i>.03&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+15,r,10),a="#ffffff",o>9?a="#d7301f":o>7?a="#fc8d59":o>4&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+30,r,10)):n+=30,a="#ffffff",s<.75?a="#2171b5":s<.85?a="#6baed6":s<.95&&(a="#bdd7e7"),t.fillStyle=a,t.fillRect(e,n,r,10)}var i=n(44),o=n(46),s=n(45);t.exports=function(t,e,n,u){var a=0,l=t,c=null,f=0,h=Math.abs(this.data.max_height),d=Math.abs(this.data.min_height_obs),p=h+d,g=Math.round(100*Math.abs(this.data.max_height)/p),v=Math.round(this.info_content_height*g/100),m=(this.info_content_height-v,10);for(f=t;f<=e;f++){if(this.data.mmline&&1===this.data.mmline[f-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(a,10,this.zoomed_column,this.height-40);else{var y=this.data.heightArr[f-1],_=0,b=(y.length,0);for(var b in y){var x=[b,y[b]];if(x[1]>.01){var w=parseFloat(x[1])/this.data.max_height,S=a,k=(this.info_content_height-2)*w,j=this.info_content_height-2-_-k,O=null;O="dynamic"===this.colorscheme?this.colors.getColor(x[0],{pos:f-1}):"consensus"===this.colorscheme?this.cmap[f-1][x[0]]||"#7a7a7a":this.colors[x[0]],u?(this.contexts[n].strokeStyle=O,this.contexts[n].strokeRect(S,j,this.zoomed_column,k)):(this.contexts[n].fillStyle=O,this.contexts[n].fillRect(S,j,this.zoomed_column,k)),_+=k}}}this.zoom<.2?m=20:this.zoom<.3&&(m=10),this.options.positionMarker&&f%m===0&&(this.options.show_probs&&o(this.contexts[n],a+this.zoomed_column,this.height-30,parseFloat(this.height),"#dddddd"),o(this.contexts[n],a+this.zoomed_column,0,5),c=this.display_ali_map?this.data.ali_map[f-1]:l,s(this.contexts[n],a-2,10,this.zoomed_column,c,10,!0)),this.options.show_probs&&r(this.contexts[n],a,this.height-42,this.zoomed_column,this.data.insert_probs[f-1],this.data.insert_lengths[f-1],this.data.delete_probs[f-1],this.show_inserts),this.options.show_probs&&(this.show_inserts?i(this.contexts[n],this.height-45,this.total_width):i(this.contexts[n],this.height-15,this.total_width)),this.options.border&&i(this.contexts[n],0,this.total_width),a+=this.zoomed_column,l++}}},function(t,e,n){"use strict";function r(t,e,n,r,o,s,u){var a=n-4,l="#ffffff",c="#555555";u&&(a=n-35),o<.75?(l="#2171b5",c="#ffffff"):o<.85?l="#6baed6":o<.95&&(l="#bdd7e7"),i(t,e,a,o,s,r,l,c)}function i(t,e,n,r,i,o,s,u){t.font=i+"px Arial",t.fillStyle=s,t.fillRect(e,n-10,o,14),t.textAlign="center",t.fillStyle=u,t.fillText(r,e+o/2,n)}function o(t,e){var n=e.ralign?e.x+t.zoomed_column:e.x,r=e.ralign?e.x+2:e.x;l(t.contexts[e.context_num],n,t.height-30,-30-t.height,"#dddddd"),l(t.contexts[e.context_num],n,0,5),c(t.contexts[e.context_num],r,10,t.zoomed_column,e.column_num,e.fontsize,e.ralign)}function s(t,e,n,r,o,s){var u=n-20,a="#ffffff",c="#555555";o>.1?(a="#d7301f",c="#ffffff"):o>.05?a="#fc8d59":o>.03&&(a="#fdcc8a"),i(t,e,u,o,s,r,a,c),o>.03&&l(t,e+r,n-30,-30-n,a)}function u(t,e,n,r,o,s){var u="#ffffff",a="#555555";o>9?(u="#d7301f",a="#ffffff"):o>7?u="#fc8d59":o>4&&(u="#fdcc8a"),i(t,e,n,o,s,r,u,a)}var a=n(44),l=n(46),c=n(45);t.exports=function(t,e,n,i){var c=0,f=t,h=null,d=0,p=Math.abs(this.data.max_height),g=isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),v=p+Math.abs(g),m=Math.round(100*Math.abs(this.data.max_height)/v),y=Math.round(this.info_content_height*m/100),_=this.info_content_height-y;for(y/this.info_content_height,_/this.info_content_height,e+3<=this.end&&(e+=3),d=t;d<=e;d++){if(this.data.mmline&&1===this.data.mmline[d-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(c,10,this.zoomed_column,this.height-40);else{var b=this.data.heightArr[d-1],x=[];if(b){var w=0,S=(b.length,0),k=null;for(var S in b){var j=b[S],O=[S,j],E=c+this.zoomed_column/2,M=null;if(O[1]>.01){M=parseFloat(O[1])/this.data.max_height;var z=this.info_content_height-2-w,A=(this.info_content_height-2)*M;x[S]=[A,this.zoomed_column,E,z],w+=A}}for(var S in b)x[S]&&this.letters[S]&&(k="dynamic"===this.colorscheme?this.colors.getColor(S,{pos:d-1}):"consensus"===this.colorscheme?this.cmap[d-1][S]||"#7a7a7a":null,this.letters[S].draw(this.contexts[n],x[S][0],x[S][1],x[S][2],x[S][3],k))}}h=this.display_ali_map?this.data.ali_map[d-1]:f,this.options.show_divider&&(this.zoom<.7?d%this.options.divider_step===0&&o(this,{context_num:n,x:c,fontsize:10,column_num:h,ralign:!0}):o(this,{context_num:n,x:c,fontsize:i,column_num:h})),this.options.show_probs&&(r(this.contexts[n],c,this.height,this.zoomed_column,this.data.delete_probs[d-1],i,this.show_inserts),l(this.contexts[n],c,this.height-15,5),this.show_inserts&&(s(this.contexts[n],c,this.height,this.zoomed_column,this.data.insert_probs[d-1],i),u(this.contexts[n],c,this.height-5,this.zoomed_column,this.data.insert_lengths[d-1],i),l(this.contexts[n],c,this.height-45,5),l(this.contexts[n],c,this.height-30,5))),c+=this.zoomed_column,f++}this.options.show_probs&&(this.show_inserts&&(a(this.contexts[n],this.height-30,this.total_width),a(this.contexts[n],this.height-45,this.total_width)),a(this.contexts[n],this.height-15,this.total_width)),this.options.border&&a(this.contexts[n],0,this.total_width)}},function(t,e){"use strict";var n=window.HTMLCanvasElement&&window.HTMLCanvasElement.prototype,r=window.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),i=r&&window.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=(r||o)&&window.atob&&window.ArrayBuffer&&window.Uint8Array&&function(t){var e,n,s,u,a,l;for(e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):decodeURIComponent(t.split(",")[1]),n=new ArrayBuffer(e.length),s=new Uint8Array(n),u=0;u.8?"#6464ff":n>.6?"#9da5ff":n>.4?"#cccccc":"#ffffff"}},function(t,e){"use strict";t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},function(t,e){"use strict";var n=function(t){this.defaultColor="#ffffff",this.type="static",this.map=t,this.getColor=function(t){return void 0!==this.map[t]?this.map[t]:this.defaultColor}},r=function(t,e){this.type="dyn",this.opt=e,void 0!==t.init?(t.init.call(this),this.getColor=t.run,this.reset=t.init):this.getColor=t};t.exports.stat=n,t.exports.dyn=r},function(t,e){"use strict";t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},function(t,e){"use strict";t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e){"use strict";t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},function(t,e){"use strict";t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};(function(){function n(t){function e(e,n,r,i,o,s){for(;o>=0&&o0?0:u-1;return arguments.length<3&&(i=n[s?s[a]:a],a+=t),e(n,r,i,s,a,u)}}function s(t){return function(e,n,r){n=j(n,r);for(var i=A(e),o=t>0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(g.call(r,s,u),S.isNaN),o>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=z};S.each=S.forEach=function(t,e,n){e=k(e,n);var r,i;if(C(t))for(r=0,i=t.length;r=0},S.invoke=function(t,e){var n=g.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},S.pluck=function(t,e){return S.map(t,S.property(e))},S.where=function(t,e){return S.filter(t,S.matcher(e))},S.findWhere=function(t,e){return S.find(t,S.matcher(e))},S.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;uo&&(o=r)}else e=j(e,n),S.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},S.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=C(t)?t:S.values(t);for(var u=0,a=t.length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i,o,s,u,a=function l(){var a=S.now()-s;a=0?r=setTimeout(l,e-a):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=S.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},S.wrap=function(t,e){return S.partial(e,t)},S.negate=function(t){return function(){return!t.apply(this,arguments)}},S.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},S.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},S.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},S.once=S.partial(S.before,2);var L=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];S.keys=function(t){if(!S.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)S.has(t,n)&&e.push(n);return L&&a(t,e),e},S.allKeys=function(t){if(!S.isObject(t))return[];var e=[];for(var n in t)e.push(n);return L&&a(t,e),e},S.values=function(t){for(var e=S.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},P=S.invert(F),B=function(t){var e=function(e){return t[e]},n="(?:"+S.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};S.escape=B(F),S.unescape=B(P),S.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),S.isFunction(r)?r.call(t):r};var W=0;S.uniqueId=function(t){var e=++W+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(t){return"\\"+H[t]};S.template=function(t,e,n){!e&&n&&(e=n),e=S.defaults({},e,S.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(U,V),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var a=function(t){return s.call(this,t,S)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},S.chain=function(t){var e=S(t);return e._chain=!0,e};var $=function(t,e){return t._chain?S(e).chain():e};S.mixin=function(t){S.each(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return p.apply(t,arguments),$(this,n.apply(S,t))}})},S.mixin(S),S.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=f[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),S.each(["concat","join","slice"],function(t){var e=f[t];S.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),S.prototype.value=function(){return this._wrapped},S.prototype.valueOf=S.prototype.toJSON=S.prototype.value,S.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return S}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(void 0)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.io=e.$=e.boneView=e.view=e.selcol=e.selection=e.utils=e.menu=e.model=e.msa=void 0;var o=n(8);Object.defineProperty(e,"selection",{enumerable:!0,get:function(){return i(o)["default"]}});var s=n(9);Object.defineProperty(e,"selcol",{enumerable:!0,get:function(){return i(s)["default"]}});var u=n(2);Object.defineProperty(e,"view",{enumerable:!0,get:function(){return i(u)["default"]}});var a=n(4);Object.defineProperty(e,"boneView",{enumerable:!0,get:function(){return i(a)["default"]}});var l=n(5);Object.defineProperty(e,"$",{enumerable:!0,get:function(){return i(l)["default"]}});var c=n(125),f=i(c),h=n(51),d=r(h),p=n(113),g=r(p),v=n(37),m=r(v),y=n(10),_=function(){var t=function(t){return f["default"].apply(this,t)};return t.prototype=f["default"].prototype,new t(arguments)};e["default"]=_,e.msa=f["default"],e.model=d,e.menu=g,e.utils=m;var b={xhr:n(21),fasta:y.fasta,clustal:y.clustal,gff:y.gff};e.io=b;var x="imported";x="1.0.3",e.version=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(121),o=r(i),s=n(119),u=r(s),a=n(123),l=r(a),c=n(124),f=r(c),h=n(115),d=r(h),p=n(122),g=r(p),v=n(118),m=r(v),y=n(117),_=r(y),b=n(120),x=r(b),w=n(116),S=r(w),k=n(114),j=r(k),O=n(4),E=O.extend({initialize:function(t){if(!t.msa)throw new Error("No msa instance provided. Please provide .msa");if(this.msa=t.msa,this.msa.g.menuconfig=new j["default"](t.menu),this.addView("10_import",new o["default"]({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("15_ordering",new g["default"]({model:this.msa.seqs,g:this.msa.g})),this.addView("20_filter",new u["default"]({model:this.msa.seqs,g:this.msa.g})),this.addView("30_selection",new l["default"]({model:this.msa.seqs,g:this.msa.g})),this.addView("40_vis",new f["default"]({model:this.msa.seqs,g:this.msa.g})),this.addView("50_color",new d["default"]({model:this.msa.seqs,g:this.msa.g})),this.addView("70_extra",new m["default"]({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("80_export",new _["default"]({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("90_help",new x["default"]({g:this.msa.g})),this.msa.g.config.get("debug"))return this.addView("95_debug",new S["default"]({g:this.msa.g}))},render:function(){return this.renderSubviews(),this.el.setAttribute("class","smenubar"),this.el.appendChild(document.createElement("p"))}});e["default"]=E},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(112);Object.defineProperty(e,"defaultmenu",{enumerable:!0,get:function(){return r(i)["default"]}});var o=n(6);Object.defineProperty(e,"menubuilder",{enumerable:!0,get:function(){return r(o)["default"]}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1).Model,i=r.extend({constructor:function(t,e){return"small"==t&&(t=this.small),r.apply(this,[t])},small:{menuFontsize:"12px"},defaults:{menuFontsize:"14px",menuItemFontsize:"14px",menuItemLineHeight:"14px",menuMarginLeft:"3px",menuPadding:"3px 4px 3px 4px"}});e["default"]=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=n(7),u=o["default"].extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block", +this.listenTo(this.g.colorscheme,"change",function(){return this.render()})},render:function(){var t=this.setName("Color scheme");this.removeAllNodes();for(var e,n=this.getColorschemes(),r=0;rt.model.getMaxLength()||isNaN(e)?void alert("invalid column"):t.g.zoomer.setLeftOffset(e)}),this.el.appendChild(this.buildDOM()),this}}));e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=o["default"].extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block"},render:function(){var t=this;return this.setName("Filter"),this.addNode("Hide columns by threshold",function(e){var n=prompt("Enter threshold (in percent)",20);n/=100;for(var r=t.model.getMaxLength(),i=[],o=t.g.stats.scale(t.g.stats.conservation()),s=r-1,u=0;0=s;0=i;0e&&r.push(o)}return t.g.columns.set("hidden",r)}),this.addNode("Hide seqs by identity",function(){var e=prompt("Enter threshold (in percent)",20);return e/=100,t.model.each(function(t){if(t.get("identity")=0)return t.set("hidden",!0)})}),this.addNode("Hide seqs by gaps",function(){var e=prompt("Enter threshold (in percent)",40);return t.model.each(function(t,n){if(t.get("seq").reduce(function(t,e){return"-"===e?++t:void 0},0)>e)return t.set("hidden",!0)})}),this.addNode("Reset",function(){return t.g.columns.set("hidden",[]),t.model.each(function(t){if(t.get("hidden"))return t.set("hidden",!1)})}),this.el.appendChild(this.buildDOM()),this}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=o["default"].extend({initialize:function(t){return this.g=t.g},render:function(){return this.setName("Help"),this.addNode("About the project",function(){return window.open("https://github.com/wilzbach/msa")}),this.addNode("Report issues",function(){return window.open("https://github.com/wilzbach/msa/issues")}),this.addNode("User manual",function(){return window.open("https://github.com/wilzbach/msa/wiki/User-manual")}),this.el.style.display="inline-block",this.el.appendChild(this.buildDOM()),this}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=n(14),u=o["default"].extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block",this.msa=t.msa},render:function(){var t=this,e=this.msa,n=s.mk("input");n.type="file",n.style.display="none",n.multiple=!0,n.addEventListener("change",function(){var t=n.files||[];return e.u.file.importFiles(t)}),this.el.appendChild(n);var r="(Fasta, Clustal, GFF, Jalview features, Newick)";return this.setName("Import"),this.addNode("URL",function(e){var n=prompt("URL "+r,"http://rostlab.org/~goldberg/clustalw2-I20140818-215249-0556-53699878-pg.clustalw");if(n.length>5)return t.msa.u.file.importURL(n,function(){})}),this.addNode("From file "+r,function(){return n.click()}),this.addNode("Drag & Drop",function(){return alert("Yep. Just drag & drop your file "+r)}),this.el.appendChild(this.buildDOM()),this}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=n(7),u="↑",a="↓",l=o["default"].extend({initialize:function(t){return this.g=t.g,this.order="ID",this.el.style.display="inline-block"},setOrder:function(t){return this.order=t,this.render()},render:function(){this.setName("Sorting"),this.removeAllNodes();for(var t,e=this.getComparators(),n=0;n0?1:r<0?-1:0},precode:n}),e.push({text:"Identity "+a,comparator:function(e,n){var r=t.ident[e.id]-t.ident[n.id];return r>0?-1:r<0?1:0},precode:n}),e.push({text:"Gaps "+u,comparator:function(e,n){var r=t.gaps[e.id]-t.gaps[n.id];return r>0?1:r<0?-1:0},precode:r}),e.push({text:"Gaps "+a,comparator:function(e,n){var r=t.gaps[e.id]-t.gaps[n.id];return r<0?1:r>0?-1:0},precode:r}),e.push({text:"Consensus to top",comparator:function(t){return!t.get("ref")}}),e}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=o["default"].extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block"},render:function(){var t=this;return this.setName("Selection"),this.addNode("Find Motif (supports RegEx)",function(){var e=prompt("your search","D");return t.g.user.set("searchText",e)}),this.addNode("Invert columns",function(){return t.g.selcol.invertCol(function(){var e=[],n=t.model.getMaxLength(),r=0;if(0<=n)for(;r<=n;)e.push(r++);else for(;r>=n;)e.push(r--);return e}())}),this.addNode("Invert rows",function(){return t.g.selcol.invertRow(t.model.pluck("id"))}),this.addNode("Reset",function(){return t.g.selcol.reset()}),this.el.appendChild(this.buildDOM()),this}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),s=n(7),u=o["default"].extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block",this.listenTo(this.g.vis,"change",this.render)},render:function(){var t=this;this.removeAllNodes(),this.setName("Vis.elements");for(var e,n=this.getVisElements(),r=0;r=0&&(f="grey"),"undefined"!=typeof f&&null!==f&&(this.ctx.fillStyle=f,this.ctx.fillRect(a,i,t,e)),a+=t}}return this._drawSelection()},_drawSelection:function(){var t=this;if(!(this.dragStart.length>0)||this.prolongSelection){var e=this.g.zoomer.get("boxRectWidth"),n=this.g.zoomer.get("boxRectHeight"),r=n*this.model.length;this.ctx.fillStyle="#666666",this.ctx.globalAlpha=.9;for(var i=this.g.selcol.length,o=function(i){var o=t.g.selcol.at(i);if(!o)return"continue";var s=void 0,u=void 0;"column"===o.get("type")?t.ctx.fillRect(e*o.get("xStart"),0,e*(o.get("xEnd")-o.get("xStart")+1),r):"row"===o.get("type")?(s=t.model.filter(function(t){return t.get("id")===o.get("seqId")})[0],u=t.model.indexOf(s),t.ctx.fillRect(0,n*u,e*s.get("seq").length,n)):"pos"===o.get("type")&&(s=t.model.filter(function(t){return t.get("id")===o.get("seqId")})[0],u=t.model.indexOf(s),t.ctx.fillRect(e*o.get("xStart"),n*u,e*(o.get("xEnd")-o.get("xStart")+1),n))},s=0;s\t \t\t
\t \t
\t \t
\t
\t \t \t \t
\t
\t'),render:function(){var t=this.model.getSizeRange(),e={value:this.model.getSize(),min:t[0],max:t[1],step:this.model.step||1};return this.$el.html(this.template(e)),this.isVisible?this.show():this.hide(),this},updateSlider:function(t){var e=t.target,n=parseInt(o(e).val());this.model.setSize(n)},clickButton:function(t){var e=t.target,n=o(e).data("action");return this.model[n],"function"==typeof this.model[n]&&this.model[n](),this},hide:function(){this.isVisible=!1,this.$el.find(".msa-scale-minimised").removeClass(this.toggleClass),this.$el.find(".msa-scale-maximised").addClass(this.toggleClass)},show:function(){this.isVisible=!1,this.$el.find(".msa-scale-minimised").addClass(this.toggleClass),this.$el.find(".msa-scale-maximised").removeClass(this.toggleClass)}});e["default"]=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(4),o=n(14),s=(n(7),i.extend({initialize:function(t){return this.g=t.g,this.listenTo(this.g.user,"change:searchText",function(t,e){return this.search(e),this.render()}),this.sel=[],this.selPos=0},events:{scroll:"_sendScrollEvent"},render:function(){this.renderSubviews(),this.el.className="biojs_msa_searchresult";var t=this.g.user.get("searchText");return"undefined"!=typeof t&&null!==t&&t.length>0&&(0===this.sel.length?this.el.textContent="no selection found":(this.resultBox=o.mk("div"),this.resultBox.className="biojs_msa_searchresult_ovbox",this.updateResult(),this.el.appendChild(this.resultBox),this.el.appendChild(this.buildBtns()))),this},updateResult:function(){var t="search pattern: "+this.g.user.get("searchText");t+=", selection: "+(this.selPos+1);var e=this.sel[this.selPos];return t+=" (",t+=e.get("xStart")+" - "+e.get("xEnd"),t+=", id: "+e.get("seqId"),t+=")",this.resultBox.textContent=t},buildBtns:function(){var t=this,e=o.mk("button");e.textContent="Prev",e.addEventListener("click",function(){return t.moveSel(-1)});var n=o.mk("button");n.textContent="Next",n.addEventListener("click",function(){return t.moveSel(1)});var r=o.mk("button");r.textContent="All",r.addEventListener("click",function(){return t.g.selcol.reset(t.sel)});var i=o.mk("div");return i.appendChild(e),i.appendChild(n),i.appendChild(r),i.className="biojs_msa_searchresult_row",i},moveSel:function(t){var e=this.selPos+t;return e<0||e>=this.sel.length?-1:(this.focus(e),this.selPos=e,this.updateResult())},focus:function(t){var e=this.sel[t],n=e.get("xStart");return this.g.zoomer.setLeftOffset(n),this.g.selcol.reset([e])},search:function u(t){var e,u=new RegExp(t,"gi"),n=[],i=e=100042;return this.model.each(function(t){var e=t.get("seq");return function(){for(var o,s=[];o=u.exec(e);){var a=o.index,l={xStart:a,xEnd:a+o[0].length-1,seqId:t.get("id")};n.push(new r.possel(l)),s.push(i=Math.min(a,i))}return s}()}),this.g.selcol.reset(n),i===e&&(i=0),this.g.zoomer.setLeftOffset(i),this.sel=n}}));e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(126),s=r(o),u=n(138),a=r(u),l=n(127),c=r(l),f=n(129),h=r(f),d=n(128),p=r(d),g=n(4),v=g.extend({initialize:function(t){return this.g=t.g,this.draw(),this.listenTo(this.g.stats,"reset",function(){return this.rerender()}),this.listenTo(this.model,"change:hidden",(0,i.debounce)(this.rerender,10)),this.listenTo(this.model,"sort",this.rerender),this.listenTo(this.model,"add",function(){return console.log("seq add")}),this.listenTo(this.g.vis,"change:sequences",this.rerender),this.listenTo(this.g.vis,"change:overviewbox",this.rerender),this.listenTo(this.g.visorder,"change",this.rerender),this.listenTo(this.g.zoomer,"change:columnWidth",this.rerender),this.listenTo(this.g.vis,"change:scaleslider",this.rerender),this},draw:function(){if(this.removeViews(),this.g.vis.get("overviewbox")){var t=new c["default"]({model:this.model,g:this.g});t.ordering=this.g.visorder.get("overviewBox"),this.addView("overviewBox",t)}var e=new a["default"]({model:this.model,g:this.g});e.ordering=this.g.visorder.get("headerBox"),this.addView("headerBox",e);var n=new h["default"]({model:this.model,g:this.g});n.ordering=this.g.visorder.get("searchBox"),this.addView("searchbox",n);var r=new s["default"]({model:this.model,g:this.g});if(r.ordering=this.g.visorder.get("alignmentBody"),this.addView("body",r),this.g.vis.get("scaleslider")){var i=new p["default"]({model:this.g.scale,g:this.g});i.ordering=this.g.visorder.get("scaleSlider"),this.addView("scaleSlider",i)}return this},render:function(t){return this.renderSubviews(),this.el.className="biojs_msa_stage",this},rerender:function(){if(!this.g.config.get("manualRendering"))return this.draw(),this.render()}});e["default"]=v},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n0)for(var a,l=0;l=0)return u++;var i=n-u;return r.indexOf(n)>=0&&(0===i||r.indexOf(n-1)<0)?e._renderSelection({n:n,k:i,selection:r,mPrevSel:o,mNextSel:s,xZero:t.xZero,yZero:t.yZero,model:t.model}):void 0}())},c=0;0=a;0=l)&&o.indexOf(c)>=0;r=y;0=0||("undefined"!=typeof s&&null!==s&&s.indexOf(b)>=0||(this.ctx.moveTo(e+m,n), +this.ctx.lineTo(m+f+e,n)),"undefined"!=typeof u&&null!==u&&u.indexOf(b)>=0||(this.ctx.moveTo(m+e,h+n),this.ctx.lineTo(m+f+e,h+n)),m+=f)}return this.ctx.moveTo(e,n),this.ctx.lineTo(e,h+n),this.ctx.moveTo(e+d,n),this.ctx.lineTo(e+d,h+n),this.ctx.stroke(),this.ctx.strokeStyle=v,this.ctx.lineWidth=g},_getPrevNextSelection:function(t){var e=t.collection.prev(t),n=t.collection.next(t),r=void 0,i=void 0;return"undefined"!=typeof e&&null!==e&&(r=this._getSelection(e)),"undefined"!=typeof n&&null!==n&&(i=this._getSelection(n)),[r,i]}}),e["default"]=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(a){i=!0,o=a}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=n(3),u=n(131),a=r(u),l=n(133),c=r(l),f=n(135),h=r(f),d=n(132),p=r(d),g=n(4),v=n(47),m=n(5),y=g.extend({tagName:"canvas",initialize:function(t){return this.g=t.g,this.listenTo(this.g.zoomer,"change:_alignmentScrollLeft change:_alignmentScrollTop",function(t,e,n){if(null==("undefined"!=typeof n&&null!==n?n.origin:void 0)||"canvasseq"!==n.origin)return this.render()}),this.listenTo(this.g.columns,"change:hidden",this.render),this.listenTo(this.g.zoomer,"change:alignmentWidth change:alignmentHeight",this.render),this.listenTo(this.g.colorscheme,"change",this.render),this.listenTo(this.g.selcol,"reset add",this.render),this.listenTo(this.model,"reset add",this.render),this.el.style.display="inline-block",this.el.style.overflowX="hidden",this.el.style.overflowY="hidden",this.el.className="biojs_msa_seqblock",this.ctx=this.el.getContext("2d"),this.cache=new a["default"](this.g),this.coordsCache=new p["default"](this.g,this.model),this.listenTo(this.g.zoomer,"change:residueFont",function(){return this.cache=new a["default"](this.g),this.render()}),this.sel=new c["default"](this.g,this.ctx),this._setColor(),this.throttleTime=0,this.throttleCounts=0,null!=document.documentElement.style.webkitAppearance?this.throttledDraw=function(){var t=+new Date;if(this.draw(),this.throttleTime+=+new Date-t,this.throttleCounts++,this.throttleCounts>15)return Math.ceil(this.throttleTime/this.throttleCounts),this.throttledDraw=this.draw}:this.throttledDraw=(0,s.throttle)(this.throttledDraw,30),this.manageEvents()},throttledDraw:function(){var t=+new Date;if(this.draw(),this.throttleTime+=+new Date-t,this.throttleCounts++,this.throttleCounts>15){var e=Math.ceil(this.throttleTime/this.throttleCounts);return e*=1.2,e=Math.max(20,e),this.throttledDraw=_.throttle(this.draw,e)}},manageEvents:function(){var t={};return t.mousedown="_onmousedown",t.touchstart="_ontouchstart",this.g.config.get("registerMouseClicks")&&(t.dblclick="_onclick"),this.g.config.get("registerMouseHover")&&(t.mousein="_onmousein",t.mouseout="_onmouseout"),t.mousewheel="_onmousewheel",t.DOMMouseScroll="_onmousewheel",this.delegateEvents(t),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.dragStart=[]},_setColor:function(){return this.color=this.g.colorscheme.getSelectedScheme()},draw:function(){if(this.el.width=this.el.width,null!=this.seqDrawer&&this.model.length>0)return this.seqDrawer.drawLetters(),this.seqDrawer.drawRows(this.sel._appendSelection,this.sel),this.seqDrawer.drawRows(this.drawFeatures,this)},drawFeatures:function(t){var e=this,n=this.g.zoomer.get("columnWidth"),r=this.g.zoomer.get("rowHeight");if(t.model.attributes.height>1){var i=function(){var i=e.ctx;return t.model.attributes.features.each(function(e){i.fillStyle=e.attributes.fillColor||"red";var o=e.attributes.xEnd-e.attributes.xStart+1,s=(e.attributes.row+1)*r;return i.fillRect(e.attributes.xStart*n+t.xZero,s+t.yZero,n*o,r)}),i.fillStyle="black",i.font=e.g.zoomer.get("residueFont")+"px mono",i.textBaseline="middle",i.textAlign="center",{v:t.model.attributes.features.each(function(e){var o=e.attributes.xEnd-e.attributes.xStart+1,s=(e.attributes.row+1)*r;return i.fillText(e.attributes.text,t.xZero+e.attributes.xStart*n+o/2*n,t.yZero+.5*r+s)})}}();if("object"===("undefined"==typeof i?"undefined":o(i)))return i.v}},render:function(){return this.el.setAttribute("height",this.g.zoomer.get("alignmentHeight")+"px"),this.el.setAttribute("width",this.g.zoomer.getAlignmentWidth()+"px"),this.g.zoomer._checkScrolling(this._checkScrolling([this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")]),{header:"canvasseq"}),this._setColor(),this.seqDrawer=new h["default"](this.g,this.ctx,this.model,{width:this.el.width,height:this.el.height,color:this.color,cache:this.cache}),this.throttledDraw(),this},_onmousemove:function(t,e){if(0!==this.dragStart.length){var n=v.abs(t),r=[n[0]-this.dragStart[0],n[1]-this.dragStart[1]],i=this.g.zoomer.get("canvasEventScale");e&&(i=3);for(var o=0;o<=1;o++)r[o]=r[o]*i;for(var s=[this.dragStartScroll[0]-r[0],this.dragStartScroll[1]-r[1]],u=0;u<=1;u++)s[u]=Math.round(s[u]);var a=this._checkScrolling(s);this.g.zoomer._checkScrolling(a,{origin:"canvasseq"});for(var l=0;l<=1;l++)a[l]!==s[l]&&(0===a[l]?(this.dragStart[l]=n[l],this.dragStartScroll[l]=0):this.dragStart[l]=n[l]-a[l]);return this.throttledDraw(),null!=t.preventDefault?(t.preventDefault(),t.stopPropagation()):void 0}},_ontouchmove:function(t){return this._onmousemove(t.changedTouches[0],!0),t.preventDefault(),t.stopPropagation()},_onmousedown:function(t){var e=this;return this.dragStart=v.abs(t),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],m(document.body).on("mousemove.overmove",function(t){return e._onmousemove(t)}),m(document.body).on("mouseup.overup",function(){return e._cleanup()}),t.preventDefault()},_ontouchstart:function(t){var e=this;return this.dragStart=v.abs(t.changedTouches[0]),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],m(document.body).on("touchmove.overtmove",function(t){return e._ontouchmove(t)}),m(document.body).on("touchend.overtend touchleave.overtleave touchcancel.overtcanel",function(t){return e._touchCleanup(t)})},_onmousewinout:function(t){if(t.toElement===document.body.parentNode)return this._cleanup()},_cleanup:function(){return this.dragStart=[],m(document.body).off(".overmove"),m(document.body).off(".overup"),m(document.body).off(".overout")},_touchCleanup:function(t){return t.changedTouches.length>0&&this._onmousemove(t.changedTouches[0],!0),this.dragStart=[],m(document.body).off(".overtmove"),m(document.body).off(".overtend"),m(document.body).off(".overtleave"),m(document.body).off(".overtcancel")},_onmousewheel:function(t){var e=v.wheelDelta(t);return this.g.zoomer.set("_alignmentScrollLeft",this.g.zoomer.get("_alignmentScrollLeft")+e[0]),this.g.zoomer.set("_alignmentScrollTop",this.g.zoomer.get("_alignmentScrollTop")+e[1]),t.preventDefault()},_onclick:function(t){var e=this._getClickPos(t);return"undefined"!=typeof e&&null!==e&&(null!=e.feature?this.g.trigger("feature:click",e):this.g.trigger("residue:click",e)),this.throttledDraw()},_onmousein:function(t){var e=this._getClickPos(t);return"undefined"!=typeof e&&null!==e&&(null!=e.feature?this.g.trigger("feature:mousein",e):this.g.trigger("residue:mousein",e)),this.throttledDraw()},_onmouseout:function(t){var e=this._getClickPos(t);return"undefined"!=typeof e&&null!==e&&(null!=e.feature?this.g.trigger("feature:mouseout",e):this.g.trigger("residue:mouseout",e)),this.throttledDraw()},_getClickPos:function(t){var e=v.rel(t);e[0]+=this.g.zoomer.get("_alignmentScrollLeft");var n=Math.floor(e[0]/this.g.zoomer.get("columnWidth")),r=this.seqDrawer._getSeqForYClick(e[1]),o=i(r,2),s=o[0],u=o[1];n+=this.g.columns.calcHiddenColumns(n),s+=this.model.calcHiddenSeqs(s),n=Math.max(0,n),s=Math.max(0,s);var a=this.model.at(s).get("id");if(!(u>0))return{seqId:a,rowPos:n,evt:t};var l=this.model.at(s).get("features").getFeatureOnRow(u-1,n);return 0!==l.length?{seqId:a,feature:l[0],rowPos:n,evt:t}:void 0},_checkScrolling:function(t){for(var e=[this.coordsCache.maxScrollWidth,this.coordsCache.maxScrollHeight],n=0;n<=1;n++)t[n]>e[n]&&(t[n]=e[n]),t[n]<0&&(t[n]=0);return t}});e["default"]=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(a){i=!0,o=a}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(3),o={updateConfig:function(){this.rectWidth=this.g.zoomer.get("columnWidth"),this.rectHeight=this.g.zoomer.get("rowHeight")},drawLetters:function(){return this.updateConfig(),this.ctx.globalAlpha=this.g.colorscheme.get("opacity"),this.drawSeqs(function(t){return this.drawSeq(t,this._drawRect)}),this.ctx.globalAlpha=1,this.rectWidth>=this.g.zoomer.get("minLetterDrawSize")&&this.drawSeqs(function(t){return this.drawSeq(t,this._drawLetter)}),this},drawSeqs:function(t,e){var n=this.g.columns.get("hidden");e=e||this;for(var i=this.getStartSeq(),o=r(i,2),s=o[0],u=o[1],a=s;athis.height))break}},drawRows:function(t,e){return this.drawSeqs(function(n){return this.drawRow(n,t,e)})},drawRow:function(t,e,n){var r=this.g.zoomer.get("columnWidth"),i=Math.max(0,Math.abs(Math.ceil(-this.g.zoomer.get("_alignmentScrollLeft")/r))),o=-Math.abs(-this.g.zoomer.get("_alignmentScrollLeft")%r),s=o-i*r,u=t.yPos;return e.call(n,{model:t.model,xZero:s,yZero:u,hidden:t.hidden})},getStartSeq:function(){for(var t=Math.max(0,Math.floor(this.g.zoomer.get("_alignmentScrollTop")/this.rectHeight))+1,e=0,n=0;el))break}},_drawRect:function(t,e){var n=t.color.getColor(e.c,{pos:e.x,y:e.y});if("undefined"!=typeof n&&null!==n)return t.ctx.fillStyle=n,t.ctx.fillRect(e.xPos,e.yPos,e.rectWidth,e.rectHeight)},_drawLetter:function(t,e){return t.ctx.drawImage(t.cache.getFontTile(e.c,e.rectWidth,e.rectHeight),e.xPos,e.yPos,e.rectWidth,e.rectHeight)}},s=function(t,e,n,r){return this.g=t,this.ctx=e,this.model=n,this.width=r.width,this.height=r.height,this.color=r.color,this.cache=r.cache,this.rectHeight=this.g.zoomer.get("rowHeight"),this.rectWidth=this.g.zoomer.get("columnWidth"),this};(0,i.extend)(s.prototype,o),e["default"]=s},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=n(12),s=r(o),u=n(2),a=n(7),l=u.extend({className:"biojs_msa_conserv",initialize:function(t){this.g=t.g,this.listenTo(this.g.zoomer,"change:stepSize change:labelWidth change:columnWidth",this.render),this.listenTo(this.g.vis,"change:labels change:metacell",this.render),this.listenTo(this.g.columns,"change:scaling",this.render),this.listenTo(this.g.stats,"reset",this.render);var e=_.extend({},{fillColor:["#660","#ff0"],strokeColor:"#330",maxHeight:20,rectStyler:function(t,e){return t}},this.g.conservationConfig);return this.fillColor=e.fillColor,this.strokeColor=e.strokeColor,this.maxHeight=e.maxHeight,this.rectStyler=e.rectStyler,this.manageEvents()},colorer:function c(t){var e=this,c=function(){return"none"};if("string"==typeof t)c=function(){return t};else if(Array.isArray(t)){2!=t.length&&console.error("ERROR: colorRange array should have exactly two elements",t);var n="undefined"!=typeof d3&&!!d3.scale,r="undefined"!=typeof d3_scale;n||r?!function(){var r=n?d3.scale.linear():d3_scale.scaleLinear(),i=r.domain([0,e.maxHeight]).range(t);c=function(t){return i(t.height)}}():(console.warn("providing a [min/max] range as input requires d3 to be included - only using the first color"),c=function(e){return t[0]})}else console.warn("expected colorRange to be '#rgb' or ['#rgb', '#rgb']",t,"("+("undefined"==typeof t?"undefined":i(t))+")");return c},render:function(){var t=this.g.stats.scale(this.g.stats.conservation());a.removeAllChilds(this.el);var e=this.model.getMaxLength(),n=this.g.zoomer.get("columnWidth"),r=this.maxHeight,i=n*(e-this.g.columns.get("hidden").length),o=s.base({height:r,width:i});o.style.display="inline-block",o.style.cursor="pointer";for(var u=(this.rectData,this.colorer(this.fillColor)),l=this.colorer(this.strokeColor),c=this.rectStyler,f=this.g.zoomer.get("stepSize"),h=this.g.columns.get("hidden"),d=0,p=0;p=0)p+=f;else{i=n*f;for(var g=0,v=f-1,m=0;0=v;0=o;0=0)f+=a;else{i=n*a;for(var h=0,d=a-1,p=0;0=d;0=o;0=0)this.markerHidden(l,s,n),s+=n;else{var l=document.createElement("span");l.className="msa-col-header",l.style.width=e+"px",l.style.display="inline-block",(s+1)%r===0?l.textContent=s+1:(s+1)%n===0?l.textContent=".":l.textContent=" ",l.rowPos=s,o.appendChild(l)}return this.el.appendChild(o),this},markerHidden:function(t,e,n){for(var r=this,i=this.g.columns.get("hidden").slice(0),s=Math.max(0,e-n),u=!0,l=s;s=e;s=0;if(!u){for(var c=this.model.getMaxLength(),f=0,h=-1,e=e;(e=c)&&(h>=0||(h=i.indexOf(e)),i.indexOf(e)>=0);e0?this.el.style.fontWeight="bold":this.el.style.fontWeight="normal"}});e["default"]=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(7),o=r.extend({initialize:function(t){return this.seq=t.seq,this.g=t.g,this.manageEvents()},manageEvents:function(){var t={};return this.g.config.get("registerMouseClicks")&&(t.click="_onclick"),this.g.config.get("registerMouseHover")&&(t.mousein="_onmousein",t.mouseout="_onmouseout"),this.delegateEvents(t),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.listenTo(this.g.vis,"change:labelName change:labelId change:labelPartition change:labelCheckbox",this.render),this.listenTo(this.g.zoomer,"change:labelIdLength change:labelNameLength change:labelPartLength change:labelCheckLength",this.render),this.listenTo(this.g.zoomer,"change:labelFontSize change:labelLineHeight change:labelWidth change:rowHeight",this.render)},render:function(){if(i.removeAllChilds(this.el),this.el.style.width=this.g.zoomer.getLabelWidth()+"px",this.el.setAttribute("class","biojs_msa_labels"),this.g.vis.get("labelCheckbox")){var t=document.createElement("input");t.setAttribute("type","checkbox"),t.value=this.model.get("id"),t.name="seq",t.style.width=this.g.zoomer.get("labelCheckLength")+"px",this.el.appendChild(t)}if(this.g.vis.get("labelId")){var e=document.createElement("span"),n=this.model.get("id");isNaN(n)||n++,e.textContent=n,e.style.width=this.g.zoomer.get("labelIdLength")+"px",e.style.display="inline-block",this.el.appendChild(e)}if(this.g.vis.get("labelPartition")){var r=document.createElement("span");r.style.width=this.g.zoomer.get("labelPartLength")+"px",r.textContent=this.model.get("partition"),r.style.display="inline-block",this.el.appendChild(e),this.el.appendChild(r)}if(this.g.vis.get("labelName")){var o=document.createElement("span");o.textContent=this.model.get("name"),this.model.get("ref")&&this.g.config.get("hasRef")&&(o.style.fontWeight="bold"),o.style.width=this.g.zoomer.get("labelNameLength")+"px",this.el.appendChild(o)}return this.el.style.overflow=scroll,this.el.style.fontSize=this.g.zoomer.get("labelFontsize")+"px",this},_onclick:function(t){var e=this.model.get("id");return this.g.trigger("row:click",{seqId:e,evt:t})},_onmousein:function(t){var e=this.model.get("id");return this.g.trigger("row:mouseout",{seqId:e,evt:t})},_onmouseout:function(t){var e=this.model.get("id");return this.g.trigger("row:mouseout",{seqId:e,evt:t})}});e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=n(6),s=r(o),u=n(3),a=n(2),l=n(7),c=a.extend({className:"biojs_msa_metaview",initialize:function(t){return this.g=t.g,this.listenTo(this.g.vis,"change:metacell",this.render),this.listenTo(this.g.zoomer,"change:metaWidth",this.render)},events:{click:"_onclick",mousein:"_onmousein",mouseout:"_onmouseout"},render:function(){l.removeAllChilds(this.el),this.el.style.display="inline-block";var t=this.g.zoomer.getMetaWidth();if(this.el.style.width=t-10,this.el.style.paddingRight=5,this.el.style.paddingLeft=5,this.el.style.fontSize=this.g.zoomer.get("labelFontsize")-2+"px",this.g.vis.get("metaGaps")){var e=this.model.get("seq"),n=(0,u.reduce)(e,function(t,e){return"-"===e?++t:void 0; +},0);n=(100*n/e.length).toFixed(0)+"%";var r=document.createElement("span");r.textContent=n,r.style.display="inline-block",r.style.width=35,this.el.appendChild(r)}if(this.g.vis.get("metaIdentity")){var o=this.g.stats.identity()[this.model.id],a=document.createElement("span");this.model.get("ref")&&this.g.config.get("hasRef")?a.textContent="ref.":"undefined"!=typeof o&&null!==o&&(a.textContent=o.toFixed(2)),a.style.display="inline-block",a.style.width=40,this.el.appendChild(a)}if(this.g.vis.get("metaLinks")&&this.model.attributes.ids){var c=i.seqs.buildLinks(this.model.attributes.ids);if(Object.keys(c).length>0){var f=new s["default"]({name:"↗"});c.forEach(function(t,e){return f.addNode(e,function(e){return window.open(t)})});var h=f.buildDOM();return h.style.cursor="pointer",this.el.appendChild(h)}}},_onclick:function(t){return this.g.trigger("meta:click",{seqId:this.model.get("id",{evt:t})})},_onmousein:function(t){return this.g.trigger("meta:mousein",{seqId:this.model.get("id",{evt:t})})},_onmouseout:function(t){return this.g.trigger("meta:mouseout",{seqId:this.model.get("id",{evt:t})})}});e["default"]=c},function(t,e){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t,e,n){if(!u(e))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===a.call(t)?i(t,e,n):"string"==typeof t?o(t,e,n):s(t,e,n)}function i(t,e,n){for(var r=0,i=t.length;r=0&&_.splice(e,1)}function u(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function a(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function l(t,e){var n,r,i;if(e.singleton){var o=y++;n=m||(m=u(e)),r=c.bind(null,n,o,!1),i=c.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(e),r=h.bind(null,n),i=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=u(e),r=f.bind(null,n),i=function(){s(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function c(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var o=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function f(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function h(t,e){var n=e.css,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}var d={},p=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},g=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),v=p(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,y=0,_=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=g()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=i(t);return r(n,e),function(t){for(var o=[],s=0;s' ).append( this.description.$el ).append( this.message.$el ).append( this.$form = $( '
' ) ) ); + this.setElement( $( '
' ).append( this.description.$el ) + .append( this.message.$el.addClass( 'ui-margin-bottom' ) ) + .append( this.$form = $( '
' ).addClass( 'ui-margin-bottom' ) ) ); this.listenTo( this.chart, 'change', function() { self.render() } ); }, render: function() { diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index 9bf1245899a1..32ed1f618bb7 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -86,6 +86,7 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port /** A chart may contain multiple sub charts/containers which are created here */ _createContainer: function( tag, n ) { + tag = tag || 'div'; n = n || 1; for ( var i in this.container_list ) { this.container_list[ i ].remove(); @@ -111,7 +112,13 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port this._createContainer( chart.definition.tag, n_panels ); chart.state( 'wait', 'Please wait...' ); require( [ 'plugin/charts/' + this.app.split( chart.get( 'type' ) ) + '/wrapper' ], function( ChartView ) { - new ChartView( self.app, { process : process, chart : chart, canvas_list : self.canvas_list } ); + Utils.get({ + url : Galaxy.root + 'api/datasets/' + chart.get( 'dataset_id' ), + cache : true, + success : function( dataset ) { + new ChartView( self.app, { process: process, canvas_list: self.canvas_list, dataset: dataset } ); + } + }); }); } }); diff --git a/config/plugins/visualizations/charts/templates/charts.mako b/config/plugins/visualizations/charts/templates/charts.mako index 9d3108990981..44021108cdc7 100644 --- a/config/plugins/visualizations/charts/templates/charts.mako +++ b/config/plugins/visualizations/charts/templates/charts.mako @@ -30,6 +30,9 @@ ${h.javascript_link( app_root + "plugins/canvg/rgbcolor.js" )} ${h.javascript_link( app_root + "plugins/canvg/canvg.js" )} + ## biojs + ${h.javascript_link( app_root + "plugins/biojs/biojs.msa.js" )} + ## nvd3 ${h.stylesheet_link( app_root + "plugins/nvd3/nv.d3.css" )} From 97519231e536ab689d5285ce328c46e19fa2566b Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 24 Aug 2016 22:25:06 -0400 Subject: [PATCH 02/27] Fix style --- config/plugins/visualizations/charts/static/app.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/plugins/visualizations/charts/static/app.css b/config/plugins/visualizations/charts/static/app.css index 483fd737a30b..19e85e5210c2 100644 --- a/config/plugins/visualizations/charts/static/app.css +++ b/config/plugins/visualizations/charts/static/app.css @@ -1,3 +1,7 @@ +.charts-viewer { + overflow: hidden; +} + .charts-viewer .ui-message { position: absolute; width: calc(100% - 20px); From 6a450b9a06a81a58875297af7832f1d5a2cab8a5 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 24 Aug 2016 22:42:07 -0400 Subject: [PATCH 03/27] Add basic options to configure msa viewer --- .../charts/static/charts/biojs/msa/config.js | 7 ++++++- .../charts/static/charts/biojs/msa/wrapper.js | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js index ca99220105a5..dcae41733e66 100644 --- a/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/config.js @@ -4,6 +4,11 @@ define( [], function() { category : 'Sequence', library : 'BioJS', datatype : 'txt', - keywords : 'biojs' + keywords : 'biojs', + settings : { + conserv: { label :'Show conservation', help : 'Do you want to display a bar diagram indicating sequence conservation?', type : 'boolean', value: 'true' }, + overviewbox: { label :'Show overview box', help : 'Do you want to display the overview box below the sequence alignments?', type : 'boolean', value: 'true' }, + menu: { label :'Show interactive menu', help : 'Do you want to show a menu for interactive configuration?', type : 'boolean', value: 'true' } + } } }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js index 15998703aef8..0e9a7b6632cb 100644 --- a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js @@ -2,11 +2,13 @@ define( [ 'utils/utils' ], function( Utils ) { return Backbone.Model.extend({ initialize: function( app, options ) { var chart = app.chart; + var settings = chart.settings; var m = new msa.msa({ el: $( '#' + options.canvas_list[ 0 ] ), - vis: { conserv: false, overviewbox: false }, + vis: { conserv: settings.get( 'conserv' ) == 'true', + overviewbox: settings.get( 'overviewbox' ) == 'true' }, menu: 'small', - bootstrapMenu: true + bootstrapMenu: settings.get( 'menu' ) == 'true' }); m.u.file.importURL( options.dataset.download_url, function() { m.render(); From 72ea2b030242cf448829f82d02e77a10ef7ce75d Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 04:49:47 -0400 Subject: [PATCH 04/27] Avoid parsing app to chart wrappers --- .../visualizations/charts/static/app.js | 18 +++++- .../charts/static/charts/biojs/msa/wrapper.js | 9 +-- .../static/charts/jqplot/bar/wrapper.js | 4 +- .../static/charts/jqplot/boxplot/wrapper.js | 8 +-- .../static/charts/jqplot/common/wrapper.js | 2 +- .../jqplot/histogram_discrete/wrapper.js | 8 +-- .../static/charts/jqplot/line/wrapper.js | 4 +- .../static/charts/jqplot/scatter/wrapper.js | 4 +- .../charts/static/charts/nvd3/bar/wrapper.js | 4 +- .../charts/nvd3/bar_horizontal/wrapper.js | 4 +- .../nvd3/bar_horizontal_stacked/wrapper.js | 4 +- .../static/charts/nvd3/bar_stacked/wrapper.js | 4 +- .../static/charts/nvd3/common/wrapper.js | 2 +- .../static/charts/nvd3/histogram/wrapper.js | 8 +-- .../charts/nvd3/histogram_discrete/wrapper.js | 8 +-- .../charts/static/charts/nvd3/line/wrapper.js | 4 +- .../static/charts/nvd3/line_focus/wrapper.js | 4 +- .../charts/static/charts/nvd3/pie/wrapper.js | 6 +- .../static/charts/nvd3/scatter/wrapper.js | 4 +- .../static/charts/nvd3/stackedarea/wrapper.js | 4 +- .../charts/nvd3/stackedarea_full/wrapper.js | 4 +- .../charts/nvd3/stackedarea_stream/wrapper.js | 4 +- .../charts/others/heatmap/heatmap-plugin.js | 3 +- .../static/charts/others/heatmap/wrapper.js | 4 +- .../charts/others/heatmap_cluster/wrapper.js | 8 +-- .../charts/static/components/jobs.js | 4 +- .../charts/static/components/model.js | 10 ++-- .../charts/static/views/types.js | 55 +++++++++++-------- .../charts/static/views/viewport.js | 8 +-- 29 files changed, 114 insertions(+), 99 deletions(-) diff --git a/config/plugins/visualizations/charts/static/app.js b/config/plugins/visualizations/charts/static/app.js index be38bf36b1c4..e00f8ce5926e 100644 --- a/config/plugins/visualizations/charts/static/app.js +++ b/config/plugins/visualizations/charts/static/app.js @@ -4,7 +4,19 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils', 'plugin/components/storage', 'plugin/components/model', 'utils/deferred', 'plugin/views/viewer', 'plugin/views/editor', 'plugin/charts/types' ], function( Modal, Portlet, Ui, Utils, Storage, Chart, Deferred, Viewer, Editor, Types ) { return Backbone.View.extend({ - initialize: function(options){ + initialize: function( options ){ + var self = this; + Utils.get({ + url : Galaxy.root + 'api/datasets/' + options.config.dataset_id, + cache : true, + success : function( dataset ) { + self.dataset = dataset; + self._build( options ); + } + }); + }, + + _build: function( options ){ this.options = options; this.modal = parent.Galaxy && parent.Galaxy.modal || new Modal.View(); this.types = Types; @@ -18,13 +30,15 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils this.$el.append( this.viewer.$el ); this.$el.append( this.editor.$el ); - // pick start screen + // load dataset and pick start screen if ( !this.storage.load() ) { this.go( 'editor' ); } else { this.go( 'viewer' ); this.chart.trigger( 'redraw' ); } + var self = this; + this.chart.on( 'change:dataset_id_job', function() { self.storage.save() } ); }, /** Loads a view and makes sure that all others are hidden */ diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js index 0e9a7b6632cb..b61c5835e156 100644 --- a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js @@ -1,7 +1,8 @@ define( [ 'utils/utils' ], function( Utils ) { return Backbone.Model.extend({ - initialize: function( app, options ) { - var chart = app.chart; + initialize: function( options ) { + var chart = options.chart; + var dataset = options.dataset; var settings = chart.settings; var m = new msa.msa({ el: $( '#' + options.canvas_list[ 0 ] ), @@ -10,9 +11,9 @@ define( [ 'utils/utils' ], function( Utils ) { menu: 'small', bootstrapMenu: settings.get( 'menu' ) == 'true' }); - m.u.file.importURL( options.dataset.download_url, function() { + m.u.file.importURL( dataset.download_url, function() { m.render(); - app.chart.state( 'ok', 'Chart drawn.' ); + chart.state( 'ok', 'Chart drawn.' ); options.process.resolve(); }); } diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js index 55c8dc3f8da8..bf1d0525fff8 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js @@ -1,6 +1,6 @@ define( [ 'plugin/charts/jqplot/common/wrapper' ], function( Plot ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.makeConfig = function( groups, plot_config ){ $.extend( true, plot_config, { seriesDefaults: { @@ -16,7 +16,7 @@ define( [ 'plugin/charts/jqplot/common/wrapper' ], function( Plot ) { } }); }; - new Plot( app, options ); + new Plot( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js index df096f88dc0b..dce642c87dc4 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js @@ -1,14 +1,14 @@ define( [ 'plugin/charts/jqplot/common/wrapper', 'plugin/components/jobs', 'plugin/charts/utilities/tabular-utilities' ], function( Plot, Jobs, Utilities ) { return Backbone.View.extend({ - initialize: function( app, options ) { - Jobs.request( app, Utilities.buildJobDictionary( 'boxplot', app.chart ), function( dataset ) { - var request_dictionary = Utilities.buildRequestDictionary( app.chart, dataset.id ); + initialize: function( options ) { + Jobs.request( options.chart, Utilities.buildJobDictionary( 'boxplot', options.chart ), function( dataset ) { + var request_dictionary = Utilities.buildRequestDictionary( options.chart, dataset.id ); var chart = options.chart; var index = 0; _.each( request_dictionary.groups, function( group ) { group.columns = { x: { index : index++ } }; }); - var plot = new Plot( app, { + var plot = new Plot( { process : options.process, chart : options.chart, request_dictionary : request_dictionary, diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js index 7e0bf6b71b4b..8f787ef9df50 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js @@ -1,7 +1,7 @@ /** This is the common wrapper for jqplot based visualizations. */ define( [ 'plugin/charts/jqplot/common/plot-config', 'plugin/charts/utilities/tabular-utilities' ], function( configmaker, Utilities ) { return Backbone.View.extend({ - initialize: function( app, options ) { + initialize: function( options ) { this.options = options; var self = this; options.render = function( canvas_id, groups ) { diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/histogram_discrete/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/histogram_discrete/wrapper.js index 2e6c6c7a6fa2..6678f7c0b799 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/histogram_discrete/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/histogram_discrete/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', 'plugin/charts/jqplot/common/wrapper' ], function( Utilities, Jobs, Plot ) { return Backbone.Model.extend({ - initialize: function( app, options ) { - Jobs.request( app, Utilities.buildJobDictionary( 'histogramdiscrete', app.chart ), function( dataset ) { - var request_dictionary = Utilities.buildRequestDictionary( app.chart, dataset.id ); + initialize: function( options ) { + Jobs.request( options.chart, Utilities.buildJobDictionary( 'histogramdiscrete', options.chart ), function( dataset ) { + var request_dictionary = Utilities.buildRequestDictionary( options.chart, dataset.id ); var index = 1; var tmp_dict = { id : request_dictionary.id, groups : [] }; _.each( request_dictionary.groups, function( group ) { @@ -18,7 +18,7 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', axes: { xaxis: { min : -1 }, yaxis: { pad : 1.2 } } }); }; - new Plot( app, options ); + new Plot( options ); }); } }); diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/line/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/line/wrapper.js index 669b6529898d..881f2faa07f7 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/line/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/line/wrapper.js @@ -1,7 +1,7 @@ define( [ 'plugin/charts/jqplot/common/wrapper' ], function( Plot ) { return Backbone.Model.extend({ - initialize: function( app, options ) { - new Plot( app, options ); + initialize: function( options ) { + new Plot( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/scatter/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/scatter/wrapper.js index effb9ead43e6..1a9204ba55b6 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/scatter/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/scatter/wrapper.js @@ -1,6 +1,6 @@ define( [ 'plugin/charts/jqplot/common/wrapper' ], function( Plot ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.makeConfig = function( groups, plot_config ) { $.extend( true, plot_config, { seriesDefaults: { @@ -12,7 +12,7 @@ define( [ 'plugin/charts/jqplot/common/wrapper' ], function( Plot ) { } }); }; - new Plot( app, options ); + new Plot( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/bar/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/bar/wrapper.js index 9b6a1f17222f..34d275daab49 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/bar/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'multiBarChart'; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/wrapper.js index 5e6f4e154614..081796c7899e 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'multiBarHorizontalChart'; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/wrapper.js index 47218c8a27ca..3dfb6cb24f53 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/wrapper.js @@ -1,11 +1,11 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'multiBarHorizontalChart'; options.makeConfig = function( nvd3_model ) { nvd3_model.stacked( true ); }; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/wrapper.js index 876ce8fe3a40..dee4d151d7c1 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/wrapper.js @@ -1,11 +1,11 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'multiBarChart'; options.makeConfig = function( nvd3_model ) { nvd3_model.stacked( true ); }; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js index 28e47f8c86c3..e0d35bcd8dd0 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js @@ -1,7 +1,7 @@ /** This is the common wrapper for nvd3 based visualizations. */ define( [ 'plugin/charts/utilities/tabular-utilities' ], function( Utilities ) { return Backbone.View.extend({ - initialize: function( app, options ) { + initialize: function( options ) { var self = this; this.options = options; options.render = function( canvas_id, groups ) { diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/histogram/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/histogram/wrapper.js index 7faf9a07adc8..5a908f231171 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', 'plugin/charts/nvd3/common/wrapper' ], function( Utilities, Jobs, NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { - Jobs.request( app, Utilities.buildJobDictionary( 'histogram', app.chart ), function( dataset ) { - options.request_dictionary = Utilities.buildRequestDictionary( app.chart, dataset.id ); + initialize: function( options ) { + Jobs.request( options.chart, Utilities.buildJobDictionary( 'histogram', options.chart ), function( dataset ) { + options.request_dictionary = Utilities.buildRequestDictionary( options.chart, dataset.id ); var index = 1; _.each( options.request_dictionary.groups, function( group ) { group.columns = { x : { index : 0, is_numeric : true }, y : { index : index++ } } @@ -11,7 +11,7 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', options.makeConfig = function( nvd3_model ) { nvd3_model.options( { showControls: true } ); }; - new NVD3( app, options ); + new NVD3( options ); }, function() { options.process.reject() } ); } }); diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/wrapper.js index 6230c97c3e36..28c8f968195d 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', 'plugin/charts/nvd3/common/wrapper' ], function( Utilities, Jobs, NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { - Jobs.request( app, Utilities.buildJobDictionary( 'histogramdiscrete', app.chart ), function( dataset ) { - var request_dictionary = Utilities.buildRequestDictionary( app.chart, dataset.id ); + initialize: function( options ) { + Jobs.request( options.chart, Utilities.buildJobDictionary( 'histogramdiscrete', options.chart ), function( dataset ) { + var request_dictionary = Utilities.buildRequestDictionary( options.chart, dataset.id ); var index = 1; var tmp_dict = { id : request_dictionary.id, groups : [] }; _.each( request_dictionary.groups, function( group ) { @@ -16,7 +16,7 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', options.makeConfig = function( nvd3_model ) { nvd3_model.options( { showControls: true } ); }; - new NVD3( app, options ); + new NVD3( options ); }, function() { options.process.reject() } ); } }); diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/line/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/line/wrapper.js index 060a01b9ba80..bc612ab19e14 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/line/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/line/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'lineChart'; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/wrapper.js index 66d89e5de813..6649e1ccf38b 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'lineWithFocusChart'; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js index 7a93a525213c..cff9e6ff4235 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js @@ -1,10 +1,10 @@ /** Pie chart wrapper */ define( [ 'utils/utils', 'plugin/charts/utilities/tabular-utilities', 'plugin/charts/utilities/tabular-datasets' ], function( Utils, Utilities, Datasets ) { return Backbone.View.extend({ - initialize: function( app, options ) { + initialize: function( options ) { var self = this; - var chart = app.chart; - var request_dictionary = Utilities.buildRequestDictionary( app.chart ); + var chart = options.chart; + var request_dictionary = Utilities.buildRequestDictionary( chart ); var canvas_list = options.canvas_list; var process = options.process; request_dictionary.success = function( result ) { diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/scatter/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/scatter/wrapper.js index 73a7e1ccc736..b9ab9a9eaa6e 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/scatter/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/scatter/wrapper.js @@ -1,13 +1,13 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'scatterChart'; options.makeConfig = function( nvd3_model ) { nvd3_model.showDistX( true ) .showDistY( true ) .color( d3.scale.category10().range() ); }; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea/wrapper.js index 3a609b919bfb..1bbccba6964f 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'stackedAreaChart'; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_full/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_full/wrapper.js index b7c8147cc896..432e68dc59a9 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_full/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_full/wrapper.js @@ -1,11 +1,11 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'stackedAreaChart'; options.makeConfig = function( nvd3_model ) { nvd3_model.style( 'expand' ); }; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_stream/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_stream/wrapper.js index 29a1e70ea2ea..4f456b3ec997 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_stream/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/stackedarea_stream/wrapper.js @@ -1,11 +1,11 @@ define( [ 'plugin/charts/nvd3/common/wrapper' ], function( NVD3 ) { return Backbone.Model.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.type = 'stackedAreaChart'; options.makeConfig = function( nvd3_model ) { nvd3_model.style( 'stream' ) }; - new NVD3( app, options ); + new NVD3( options ); } }); }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js index b039e5ed1453..e96ba4ff768d 100644 --- a/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js +++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js @@ -26,9 +26,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'utils/utils', 'plugin/ch debug_color : '#FFFFFF' }, - initialize: function( app, options ) { + initialize: function( options ) { var self = this; - this.app = app; this.chart = options.chart; this.canvas_id = options.canvas_id; this.group = options.groups[ 0 ]; diff --git a/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js index 5179271ccc89..38471a8bbb8d 100644 --- a/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/charts/others/heatmap/heatmap-plugin' ], function( Utilities, HeatMap ) { return Backbone.View.extend({ - initialize: function( app, options ) { + initialize: function( options ) { options.render = function( canvas_id, groups ) { - new HeatMap( app, { + new HeatMap({ chart : options.chart, canvas_id : canvas_id, groups : groups diff --git a/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js b/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js index 79d6c97fe3ae..388a5eea5741 100644 --- a/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js @@ -1,8 +1,8 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', 'plugin/charts/others/heatmap/heatmap-plugin' ], function( Utilities, Jobs, HeatMap ) { return Backbone.View.extend({ - initialize: function(app, options) { - Jobs.request( app, Utilities.buildJobDictionary( 'heatmap', app.chart ), function( dataset ) { - var request_dictionary = Utilities.buildRequestDictionary( app.chart, dataset.id ); + initialize: function( options ) { + Jobs.request( options.chart, Utilities.buildJobDictionary( 'heatmap', options.chart ), function( dataset ) { + var request_dictionary = Utilities.buildRequestDictionary( options.chart, dataset.id ); var index = 0; var tmp_dict = { id : request_dictionary.id, groups : [] }; for ( var group_index in request_dictionary.groups ) { @@ -26,7 +26,7 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/components/jobs', } options.request_dictionary = tmp_dict; options.render = function( canvas_id, groups ) { - new HeatMap( app, { + new HeatMap({ chart : options.chart, canvas_id : canvas_id, groups : groups diff --git a/config/plugins/visualizations/charts/static/components/jobs.js b/config/plugins/visualizations/charts/static/components/jobs.js index 4a316004900e..82a056d7330b 100644 --- a/config/plugins/visualizations/charts/static/components/jobs.js +++ b/config/plugins/visualizations/charts/static/components/jobs.js @@ -5,8 +5,7 @@ define( [ 'utils/utils' ], function( Utils ) { var WAITTIME = 1000; /** Submit job request to charts tool */ - var request = function( app, parameters, success, error ) { - var chart = app.chart; + var request = function( chart, parameters, success, error ) { chart.state( 'wait', 'Requesting job results...' ); if ( chart.get( 'modified' ) ) { cleanup( chart ); @@ -33,7 +32,6 @@ define( [ 'utils/utils' ], function( Utils ) { var job = response.outputs[0]; chart.state( 'wait', 'Your job has been queued. You may close the browser window. The job will run in the background.' ); chart.set( 'dataset_id_job', job.id ); - self.app.storage.save(); wait( chart, success, error ); } }, diff --git a/config/plugins/visualizations/charts/static/components/model.js b/config/plugins/visualizations/charts/static/components/model.js index b0b782aa283f..0b72da8a90a4 100644 --- a/config/plugins/visualizations/charts/static/components/model.js +++ b/config/plugins/visualizations/charts/static/components/model.js @@ -20,10 +20,10 @@ define( [ 'utils/utils' ], function( Utils ) { reset: function( options ) { this.set({ - 'id' : Utils.uid(), - 'type' : 'nvd3_bar', - 'dataset_id' : options.config.dataset_id, - 'title' : 'New Chart' + id : Utils.uid(), + type : '__first', + dataset_id : options.config.dataset_id, + title : 'New Chart' }); this.settings.clear(); this.groups.reset(); @@ -31,7 +31,7 @@ define( [ 'utils/utils' ], function( Utils ) { }, state: function( value, info ) { - this.set( { 'state': value, 'state_info': info } ); + this.set( { state : value, state_info : info } ); this.trigger( 'set:state' ); console.debug( 'Chart:state() - ' + info + ' (' + value + ')' ); } diff --git a/config/plugins/visualizations/charts/static/views/types.js b/config/plugins/visualizations/charts/static/views/types.js index 26500bd0ed9a..ae71cd0f6f53 100644 --- a/config/plugins/visualizations/charts/static/views/types.js +++ b/config/plugins/visualizations/charts/static/views/types.js @@ -18,40 +18,49 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'plugin/charts/over render: function() { var self = this; this.index = {}; + this.first = null; _.each( this.app.types, function( type, type_id ) { - _.each( type.keywords.split( ' ' ), function( keyword ) { - self.index[ keyword ] = self.index[ keyword ] || {}; - self.index[ keyword ][ type.category ] = self.index[ keyword ][ type.category ] || {}; - self.index[ keyword ][ type.category ][ type_id ] = type; - }); + if ( self.app.dataset.file_ext === type.datatype ) { + _.each( type.keywords.split( ' ' ), function( keyword ) { + self.index[ keyword ] = self.index[ keyword ] || {}; + self.index[ keyword ][ type.category ] = self.index[ keyword ][ type.category ] || {}; + self.index[ keyword ][ type.category ][ type_id ] = type; + self.first = self.first || type_id; + }); + } }); this.tabs.delAll(); _.each( Overview, function( d, i ) { var keyword = d.value; var categories = self.index[ keyword ]; - var $help = $( '

' ).addClass( 'ui-form-info' ).html( d.help ) ; - var $el = $( '

' ).addClass( 'charts-grid' ).append( $help ); - _.each( categories, function( category, category_header ) { - var $category = self._templateHeader( { title: category_header } ); - $el.append( $category ); - _.each( category, function( type, type_id ) { - $el.append( self._templateType({ - id : type_id, - title : ( type.zoomable ? '' : '' ) + type.title + ' (' + type.library + ')', - url : app_root + 'charts/' + self.app.split( type_id ) + '/logo.png' - })); + if ( _.size( categories ) > 0 ) { + var $help = $( '

' ).addClass( 'ui-form-info' ).html( d.help ) ; + var $el = $( '

' ).addClass( 'charts-grid' ).append( $help ); + _.each( categories, function( category, category_header ) { + var $category = self._templateHeader( { title: category_header } ); + $el.append( $category ); + _.each( category, function( type, type_id ) { + $el.append( self._templateType({ + id : type_id, + title : ( type.zoomable ? '' : '' ) + type.title + ' (' + type.library + ')', + url : app_root + 'charts/' + self.app.split( type_id ) + '/logo.png' + })); + }); + }); + self.tabs.add({ + id : Utils.uid(), + title : d.label, + $el : $el }); - }); - self.tabs.add({ - id : Utils.uid(), - title : d.label, - $el : $el - }); + } }); }, /** Set/Get selected chart type */ value: function( new_value ) { + if ( new_value == '__first' ) { + new_value = this.first; + } var before = this.$( '.current' ).attr( 'chart_id' ); if ( new_value !== undefined ) { this.$( '.current' ).removeClass( 'current' ); @@ -60,7 +69,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'plugin/charts/over var after = this.$( '.current' ).attr( 'chart_id' ); if( after !== undefined ) { if ( after != before && this.options.onchange ) { - this.options.onchange( new_value ); + this.options.onchange( after ); } return after; } diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index 32ed1f618bb7..3ac31b9bce5e 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -112,13 +112,7 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port this._createContainer( chart.definition.tag, n_panels ); chart.state( 'wait', 'Please wait...' ); require( [ 'plugin/charts/' + this.app.split( chart.get( 'type' ) ) + '/wrapper' ], function( ChartView ) { - Utils.get({ - url : Galaxy.root + 'api/datasets/' + chart.get( 'dataset_id' ), - cache : true, - success : function( dataset ) { - new ChartView( self.app, { process: process, canvas_list: self.canvas_list, dataset: dataset } ); - } - }); + new ChartView( { process: process, chart: chart, dataset: self.app.dataset, canvas_list: self.canvas_list } ); }); } }); From e02eb60296eac4339aa2265313a38d4dc36aa415 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 05:02:26 -0400 Subject: [PATCH 05/27] Decouple storage, parse parameters explicitly --- .../visualizations/charts/static/app.js | 25 ++++++------------- .../charts/static/components/storage.js | 19 +++++++------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/config/plugins/visualizations/charts/static/app.js b/config/plugins/visualizations/charts/static/app.js index e00f8ce5926e..81b0622f63a0 100644 --- a/config/plugins/visualizations/charts/static/app.js +++ b/config/plugins/visualizations/charts/static/app.js @@ -4,8 +4,13 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils', 'plugin/components/storage', 'plugin/components/model', 'utils/deferred', 'plugin/views/viewer', 'plugin/views/editor', 'plugin/charts/types' ], function( Modal, Portlet, Ui, Utils, Storage, Chart, Deferred, Viewer, Editor, Types ) { return Backbone.View.extend({ - initialize: function( options ){ + initialize: function( options ) { var self = this; + this.options = options; + this.chart = new Chart(); + this.types = Types; + this.storage = new Storage( this.chart, this.types, options ); + this.deferred = new Deferred(); Utils.get({ url : Galaxy.root + 'api/datasets/' + options.config.dataset_id, cache : true, @@ -16,21 +21,11 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils }); }, - _build: function( options ){ - this.options = options; - this.modal = parent.Galaxy && parent.Galaxy.modal || new Modal.View(); - this.types = Types; - this.chart = new Chart(); - this.storage = new Storage( this ); - this.deferred = new Deferred(); - - // views + _build: function( options ) { this.viewer = new Viewer( this ); this.editor = new Editor( this ); this.$el.append( this.viewer.$el ); this.$el.append( this.editor.$el ); - - // load dataset and pick start screen if ( !this.storage.load() ) { this.go( 'editor' ); } else { @@ -49,12 +44,6 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils this[ view_id ].show(); }, - /** Message */ - showModal: function( title, body ) { - var self = this; - this.modal.show( { title: title, body: body, buttons: { 'Close': function() { self.modal.hide() } } } ); - }, - /** Split chart type into path components */ split: function( chart_type ) { var path = chart_type.split( /_(.+)/ ); diff --git a/config/plugins/visualizations/charts/static/components/storage.js b/config/plugins/visualizations/charts/static/components/storage.js index 5ef3abdc58e4..e2a696a1bd99 100644 --- a/config/plugins/visualizations/charts/static/components/storage.js +++ b/config/plugins/visualizations/charts/static/components/storage.js @@ -1,12 +1,13 @@ /** This class saves and loads a chart through the api. */ -define( [ 'utils/utils', 'plugin/components/model', 'mvc/visualization/visualization-model' ], function( Utils, Chart ) { +define( [ 'utils/utils', 'mvc/ui/ui-modal', 'plugin/components/model', 'mvc/visualization/visualization-model' ], function( Utils, Modal, Chart ) { return Backbone.Model.extend({ - initialize: function( app ) { - this.app = app; - this.chart = this.app.chart; - this.options = this.app.options; - this.id = this.options.id; + initialize: function( chart, types, options ) { + this.chart = chart; + this.options = options; + this.id = options.id; + this.types = types; + this.modal = parent.Galaxy && parent.Galaxy.modal || new Modal.View(); this.vis = new Visualization({ id : this.id, type : 'charts', @@ -24,7 +25,7 @@ define( [ 'utils/utils', 'plugin/components/model', 'mvc/visualization/visualiza /** Pack and save nested chart model */ save: function() { var self = this; - var chart = this.app.chart; + var chart = this.chart; var chart_dict = { attributes : chart.attributes, settings : chart.settings.attributes, @@ -37,7 +38,7 @@ define( [ 'utils/utils', 'plugin/components/model', 'mvc/visualization/visualiza this.vis.get( 'config' ).chart_dict = chart_dict; this.vis.save() .fail(function( xhr, status, message ) { - self.app.showModal( 'Saving failed.', 'An attempt to save this chart to the server failed. Please try again and contact the administrator.' ); + this.modal.show( { title: 'Saving failed.', body: 'An attempt to save this chart to the server failed. Please try again and contact the administrator.', buttons: { 'Close': function() { self.modal.hide() } } } ); }) .then( function( response ) { if ( response && response.id ) { @@ -60,7 +61,7 @@ define( [ 'utils/utils', 'plugin/components/model', 'mvc/visualization/visualiza console.debug( 'Storage::load() - Chart type not provided. Invalid format.' ); return false; } - var chart_definition = this.app.types[ chart_type ]; + var chart_definition = this.types[ chart_type ]; if ( !chart_definition ) { console.debug( 'Storage::load() - Chart type not supported. Please re-configure the chart.' ); return false; From 37c1e316a74348ad1023bd071f19e4396758540a Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 05:33:33 -0400 Subject: [PATCH 06/27] Move chart listener into storage --- config/plugins/visualizations/charts/static/app.js | 12 +++++------- .../charts/static/components/storage.js | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/plugins/visualizations/charts/static/app.js b/config/plugins/visualizations/charts/static/app.js index 81b0622f63a0..bd78fdb1f7a5 100644 --- a/config/plugins/visualizations/charts/static/app.js +++ b/config/plugins/visualizations/charts/static/app.js @@ -6,11 +6,6 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils return Backbone.View.extend({ initialize: function( options ) { var self = this; - this.options = options; - this.chart = new Chart(); - this.types = Types; - this.storage = new Storage( this.chart, this.types, options ); - this.deferred = new Deferred(); Utils.get({ url : Galaxy.root + 'api/datasets/' + options.config.dataset_id, cache : true, @@ -22,6 +17,11 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils }, _build: function( options ) { + this.options = options; + this.chart = new Chart(); + this.types = Types; + this.storage = new Storage( this.chart, this.types, options ); + this.deferred = new Deferred(); this.viewer = new Viewer( this ); this.editor = new Editor( this ); this.$el.append( this.viewer.$el ); @@ -32,8 +32,6 @@ define( [ 'mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils this.go( 'viewer' ); this.chart.trigger( 'redraw' ); } - var self = this; - this.chart.on( 'change:dataset_id_job', function() { self.storage.save() } ); }, /** Loads a view and makes sure that all others are hidden */ diff --git a/config/plugins/visualizations/charts/static/components/storage.js b/config/plugins/visualizations/charts/static/components/storage.js index e2a696a1bd99..4369821b9f92 100644 --- a/config/plugins/visualizations/charts/static/components/storage.js +++ b/config/plugins/visualizations/charts/static/components/storage.js @@ -3,6 +3,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-modal', 'plugin/components/model', 'mvc/visu return Backbone.Model.extend({ initialize: function( chart, types, options ) { + var self = this; this.chart = chart; this.options = options; this.id = options.id; @@ -20,6 +21,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-modal', 'plugin/components/model', 'mvc/visu if ( chart_dict ) { this.vis.get( 'config' ).chart_dict = chart_dict; } + this.chart.on( 'change:dataset_id_job', function() { self.save() } ); }, /** Pack and save nested chart model */ From 48ff0790bf9b2115d891ca4c1a375f7f266b3399 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 05:34:42 -0400 Subject: [PATCH 07/27] Fix save failed message --- .../plugins/visualizations/charts/static/components/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/components/storage.js b/config/plugins/visualizations/charts/static/components/storage.js index 4369821b9f92..02c227110d19 100644 --- a/config/plugins/visualizations/charts/static/components/storage.js +++ b/config/plugins/visualizations/charts/static/components/storage.js @@ -40,7 +40,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-modal', 'plugin/components/model', 'mvc/visu this.vis.get( 'config' ).chart_dict = chart_dict; this.vis.save() .fail(function( xhr, status, message ) { - this.modal.show( { title: 'Saving failed.', body: 'An attempt to save this chart to the server failed. Please try again and contact the administrator.', buttons: { 'Close': function() { self.modal.hide() } } } ); + self.modal.show( { title: 'Saving failed.', body: 'An attempt to save this chart to the server failed. Please try again and contact the administrator.', buttons: { 'Close': function() { self.modal.hide() } } } ); }) .then( function( response ) { if ( response && response.id ) { From 3048b56006cc1ee0877e24767e2535ccbe5164b7 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 05:47:11 -0400 Subject: [PATCH 08/27] Remove unused container list --- .../charts/static/charts/biojs/msa/wrapper.js | 2 +- .../charts/static/charts/jqplot/boxplot/wrapper.js | 2 +- .../charts/static/charts/nvd3/pie/wrapper.js | 4 ++-- .../charts/static/charts/others/example/wrapper.js | 2 +- .../static/charts/utilities/tabular-utilities.js | 6 +++--- .../visualizations/charts/static/views/viewport.js | 12 ++++-------- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js index b61c5835e156..f49439dbfb7f 100644 --- a/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/biojs/msa/wrapper.js @@ -5,7 +5,7 @@ define( [ 'utils/utils' ], function( Utils ) { var dataset = options.dataset; var settings = chart.settings; var m = new msa.msa({ - el: $( '#' + options.canvas_list[ 0 ] ), + el: $( '#' + options.targets[ 0 ] ), vis: { conserv: settings.get( 'conserv' ) == 'true', overviewbox: settings.get( 'overviewbox' ) == 'true' }, menu: 'small', diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js index dce642c87dc4..eb0628232707 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/boxplot/wrapper.js @@ -12,7 +12,7 @@ define( [ 'plugin/charts/jqplot/common/wrapper', 'plugin/components/jobs', 'plug process : options.process, chart : options.chart, request_dictionary : request_dictionary, - canvas_list : options.canvas_list, + targets : options.targets, makeConfig : function( groups, plot_config ){ var boundary = Utilities.getDomains( groups, 'x' ); $.extend( true, plot_config, { diff --git a/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js b/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js index cff9e6ff4235..591a017c4f19 100644 --- a/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/pie/wrapper.js @@ -5,12 +5,12 @@ define( [ 'utils/utils', 'plugin/charts/utilities/tabular-utilities', 'plugin/ch var self = this; var chart = options.chart; var request_dictionary = Utilities.buildRequestDictionary( chart ); - var canvas_list = options.canvas_list; + var targets = options.targets; var process = options.process; request_dictionary.success = function( result ) { for ( var group_index in result.groups ) { var group = result.groups[ group_index ]; - self._drawGroup( chart, group, canvas_list[ group_index ] ); + self._drawGroup( chart, group, targets[ group_index ] ); } chart.state('ok', 'Pie chart has been drawn.'); process.resolve(); diff --git a/config/plugins/visualizations/charts/static/charts/others/example/wrapper.js b/config/plugins/visualizations/charts/static/charts/others/example/wrapper.js index 7f86ebc872ae..7473b664a78b 100755 --- a/config/plugins/visualizations/charts/static/charts/others/example/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/others/example/wrapper.js @@ -8,7 +8,7 @@ define( [ 'plugin/charts/utilities/tabular-utilities', 'plugin/charts/utilities/ var colors = d3.scale.category20(); _.each( result.groups, function( group, group_index ) { try { - var svg = d3.select( '#' + ( options.canvas_list[ group_index ] || options.canvas_list[ 0 ] ) ); + var svg = d3.select( '#' + ( options.targets[ group_index ] || options.targets[ 0 ] ) ); var height = parseInt( svg.style( 'height' ) ); var width = parseInt( svg.style( 'width' ) ); var maxValue = d3.max( group.values, function( d ) { return Math.max( d.x, d.y ) } ); diff --git a/config/plugins/visualizations/charts/static/charts/utilities/tabular-utilities.js b/config/plugins/visualizations/charts/static/charts/utilities/tabular-utilities.js index dec6f2a79c57..ddaa8a699968 100644 --- a/config/plugins/visualizations/charts/static/charts/utilities/tabular-utilities.js +++ b/config/plugins/visualizations/charts/static/charts/utilities/tabular-utilities.js @@ -55,14 +55,14 @@ define( [ 'utils/utils', 'plugin/charts/utilities/tabular-datasets' ], function( var chart = options.chart; var request_dictionary = options.request_dictionary || buildRequestDictionary( chart ); var render = options.render; - var canvas_list = options.canvas_list; + var targets = options.targets; request_dictionary.success = function( result ) { try { if ( chart.settings.get( 'use_panels' ) === 'true' ) { var valid = true; for ( var group_index in result.groups ) { var group = result.groups[ group_index ]; - if (!render( canvas_list[ group_index ], [ group ] ) ) { + if (!render( targets[ group_index ], [ group ] ) ) { valid = false; break; } @@ -71,7 +71,7 @@ define( [ 'utils/utils', 'plugin/charts/utilities/tabular-datasets' ], function( chart.state( 'ok', 'Multi-panel chart drawn.' ); } } else { - if ( render( canvas_list[ 0 ], result.groups ) ) { + if ( render( targets[ 0 ], result.groups ) ) { chart.state( 'ok', 'Chart drawn.' ); } } diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index 3ac31b9bce5e..240be5a06552 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -88,11 +88,8 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port _createContainer: function( tag, n ) { tag = tag || 'div'; n = n || 1; - for ( var i in this.container_list ) { - this.container_list[ i ].remove(); - } - this.container_list = []; - this.canvas_list = []; + this.$( '.charts-viewport-container' ).remove(); + this.targets = []; for ( var i = 0; i < n; i++ ) { var container_id = Utils.uid(); var container_el = $( '
' ).addClass( 'charts-viewport-container' ) @@ -100,8 +97,7 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port .append( $( '
' ).attr( 'id', 'menu' ) ) .append( $( '<' + tag + ' class="charts-viewport-canvas" />' ).attr( 'id', container_id ) ); this.$el.append( container_el ); - this.container_list[ i ] = container_el; - this.canvas_list[ i ] = container_id; + this.targets.push( container_id ); } }, @@ -112,7 +108,7 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port this._createContainer( chart.definition.tag, n_panels ); chart.state( 'wait', 'Please wait...' ); require( [ 'plugin/charts/' + this.app.split( chart.get( 'type' ) ) + '/wrapper' ], function( ChartView ) { - new ChartView( { process: process, chart: chart, dataset: self.app.dataset, canvas_list: self.canvas_list } ); + new ChartView( { process: process, chart: chart, dataset: self.app.dataset, targets: self.targets } ); }); } }); From a63b07795c23a7412592d8aa7e395ff6394625ae Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 05:59:13 -0400 Subject: [PATCH 09/27] Fix scrolling behavior --- .../visualizations/charts/static/app.css | 2 +- .../charts/static/views/viewport.js | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/config/plugins/visualizations/charts/static/app.css b/config/plugins/visualizations/charts/static/app.css index 19e85e5210c2..5952e6c25fb7 100644 --- a/config/plugins/visualizations/charts/static/app.css +++ b/config/plugins/visualizations/charts/static/app.css @@ -1,5 +1,5 @@ .charts-viewer { - overflow: hidden; + overflow: auto; } .charts-viewer .ui-message { diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index 240be5a06552..c3ef594263f9 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -17,30 +17,13 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port this.$info = this.$( '.info' ); this.$icon = this.$( '.icon' ); this.$text = this.$( '.text' ); - - // use full screen for viewer this._fullscreen( this.$el, 55 ); - - // prevent window scrolling - var initial_overflow = $( 'body' ).css( 'overflow' ); - this.$el.on( 'mouseover', function() { - $( 'body' ).css( 'overflow', 'hidden' ); - }).on('mouseout', function() { - $( 'body' ).css( 'overflow', initial_overflow ); - }); - - // create container element this._createContainer( 'div' ); - - // link redraw trigger - var self = this; this.chart.on( 'redraw', function() { self.app.deferred.execute( function( process ) { self._draw( process, self.chart ); }); }); - - // link status handler this.chart.on( 'set:state', function() { var $container = self.$el.find( '.charts-viewport-container' ); var $info = self.$info; From f2c1e23409f407b773913629714c697a04fb0740 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 07:57:20 -0400 Subject: [PATCH 10/27] Add description for biojs --- .../plugins/visualizations/charts/static/charts/overview.js | 2 +- config/plugins/visualizations/charts/static/views/viewer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/plugins/visualizations/charts/static/charts/overview.js b/config/plugins/visualizations/charts/static/charts/overview.js index fd2fac444920..1c406b5e9298 100644 --- a/config/plugins/visualizations/charts/static/charts/overview.js +++ b/config/plugins/visualizations/charts/static/charts/overview.js @@ -10,7 +10,7 @@ define( [], function() { help : 'These visualizations were developed by the Galaxy team.' }, { label : 'BioJS', value: 'biojs', - help : 'BioJS plugins.' + help : 'BioJS is hosted at http://biojs.net. It is a library of over hundred JavaScript components enabling you to visualize and process data using current web technologies.' } ]; }); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/views/viewer.js b/config/plugins/visualizations/charts/static/views/viewer.js index bbe9c757296e..a5bf09ecebaf 100644 --- a/config/plugins/visualizations/charts/static/views/viewer.js +++ b/config/plugins/visualizations/charts/static/views/viewer.js @@ -106,7 +106,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'plugin/views/vi this.setElement( this.portlet.$el ); // events - this.chart.on( 'change:title', function() { self._refreshTitle() } ); + this.listenTo( this.chart, 'change', function() { self.render() } ); }, /** Show and refresh viewer */ @@ -121,7 +121,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'plugin/views/vi }, /** Change title */ - _refreshTitle: function() { + render: function() { var title = this.chart.get( 'title' ); this.portlet.title( title ); }, From 7107705b9c821c20a07ae3275c50eac517b44a37 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:23:01 -0400 Subject: [PATCH 11/27] Remove unused menu div --- config/plugins/visualizations/charts/static/views/viewport.js | 1 - 1 file changed, 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index c3ef594263f9..f127520d7bf1 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -77,7 +77,6 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port var container_id = Utils.uid(); var container_el = $( '
' ).addClass( 'charts-viewport-container' ) .width( parseInt( 100 / n ) + '%' ) - .append( $( '
' ).attr( 'id', 'menu' ) ) .append( $( '<' + tag + ' class="charts-viewport-canvas" />' ).attr( 'id', container_id ) ); this.$el.append( container_el ); this.targets.push( container_id ); From 5f642113156435b34d3ff6de01144069d2e370c1 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:27:14 -0400 Subject: [PATCH 12/27] Use shorter dom query command --- config/plugins/visualizations/charts/static/views/viewport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/viewport.js b/config/plugins/visualizations/charts/static/views/viewport.js index f127520d7bf1..5363f0726605 100644 --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -25,7 +25,7 @@ define( [ 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'utils/utils' ], function( Port }); }); this.chart.on( 'set:state', function() { - var $container = self.$el.find( '.charts-viewport-container' ); + var $container = self.$( '.charts-viewport-container' ); var $info = self.$info; var $icon = self.$icon; var $text = self.$text; From ebd0dab936b4fbb82dbb21218851ca7579197bf7 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:35:53 -0400 Subject: [PATCH 13/27] Change draw label to indicate that the chart will be saved too --- config/plugins/visualizations/charts/static/views/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/editor.js b/config/plugins/visualizations/charts/static/views/editor.js index c4fd1f3aeb9c..4ea90fa0ba0e 100644 --- a/config/plugins/visualizations/charts/static/views/editor.js +++ b/config/plugins/visualizations/charts/static/views/editor.js @@ -17,7 +17,7 @@ define( [ 'mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'utils/utils' 'save' : new Ui.ButtonIcon({ icon : 'fa-save', tooltip : 'Draw Chart', - title : 'Draw', + title : 'Save and Draw', onclick : function() { self._saveChart(); } From 30bd72310e4d51f49e9fe020b119c02642ffe854 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:36:43 -0400 Subject: [PATCH 14/27] Fix tooltip --- config/plugins/visualizations/charts/static/views/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/editor.js b/config/plugins/visualizations/charts/static/views/editor.js index 4ea90fa0ba0e..4086a16da819 100644 --- a/config/plugins/visualizations/charts/static/views/editor.js +++ b/config/plugins/visualizations/charts/static/views/editor.js @@ -16,7 +16,7 @@ define( [ 'mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'utils/utils' operations : { 'save' : new Ui.ButtonIcon({ icon : 'fa-save', - tooltip : 'Draw Chart', + tooltip : 'Save and Draw Chart', title : 'Save and Draw', onclick : function() { self._saveChart(); From 9481939154269253e59a2d9ffafe506947287dc1 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:57:17 -0400 Subject: [PATCH 15/27] Remove separated tabular input element --- .../static/charts/utilities/tabular-form.js | 69 +++++++++++++++++-- .../static/charts/utilities/tabular-inputs.js | 65 ----------------- .../charts/static/views/settings.js | 5 +- 3 files changed, 66 insertions(+), 73 deletions(-) delete mode 100644 config/plugins/visualizations/charts/static/charts/utilities/tabular-inputs.js diff --git a/config/plugins/visualizations/charts/static/charts/utilities/tabular-form.js b/config/plugins/visualizations/charts/static/charts/utilities/tabular-form.js index b7c22827d579..2b540bccc362 100644 --- a/config/plugins/visualizations/charts/static/charts/utilities/tabular-form.js +++ b/config/plugins/visualizations/charts/static/charts/utilities/tabular-form.js @@ -1,4 +1,59 @@ -define( [ 'plugin/charts/utilities/tabular-inputs' ], function( Inputs ) { +define( [], function() { + var axisLabel = function( name, options ) { + options = options || {}; + prefix = name.substr( 0, 1 ); + return { + name : name, + label : prefix.toUpperCase() + '-Axis label', + help : 'Provide a label for the axis.', + type : 'text', + value : options.value || prefix.toUpperCase() + '-axis', + placeholder : 'Axis label' + } + } + var axisType = function( name, options ) { + options = options || {}; + prefix = name.substr( 0, 1 ); + var axisPrecision = function() { + return { name : 'precision', + label : 'Axis tick format', + help : 'Select the tick format for the axis.', + type : 'select', + value : options.precision || 1, + data : [ { label : '0.00001', value : '5' }, + { label : '0.0001', value : '4' }, + { label : '0.001', value : '3' }, + { label : '0.01', value : '2' }, + { label : '0.1', value : '1' }, + { label : '1', value : '0' } ] } + } + return { + name : prefix + '_axis_type', + type : 'conditional', + test_param : { + name : 'type', + label : prefix.toUpperCase() + '-Axis value type', + type : 'select', + value : options.value || 'auto', + help : 'Select the value type of the axis.', + data : [ { value : 'hide', label : '-- Do not show values --' }, + { value : 'auto', label : 'Auto' }, + { value : 'f', label : 'Float' }, + { value : 'd', label : 'Integer' }, + { value : 'e', label : 'Exponent' }, + { value : 'p', label : 'Percent' }, + { value : 's', label : 'SI-prefix' } ] + }, + cases : [ { value : 'hide' }, + { value : 'auto' }, + { value : 'f', inputs: [ axisPrecision() ] }, + { value : 'd' }, + { value : 'e', inputs: [ axisPrecision() ] }, + { value : 'p', inputs: [ axisPrecision() ] }, + { value : 's' } ] + } + } + return { title : '', category : '', @@ -6,13 +61,13 @@ define( [ 'plugin/charts/utilities/tabular-inputs' ], function( Inputs ) { tag : '', keywords : '', datatype : 'tabular', + use_panels : true, settings : { - x_axis_label : Inputs.axisLabel( 'x_axis_label' ), - x_axis_type : Inputs.axisType( 'x_axis_type' ), - y_axis_label : Inputs.axisLabel( 'y_axis_label' ), - y_axis_type : Inputs.axisType( 'y_axis_type' ), - show_legend : Inputs.boolean( 'show_legend', { label: 'Show legend', help: 'Would you like to add a legend?' } ), - use_panels : Inputs.boolean( 'use_panels', { label: 'Use multi-panels', help: 'Would you like to separate your data into individual panels?' } ) + x_axis_label : axisLabel( 'x_axis_label' ), + x_axis_type : axisType( 'x_axis_type' ), + y_axis_label : axisLabel( 'y_axis_label' ), + y_axis_type : axisType( 'y_axis_type' ), + show_legend : { type: 'boolean', label: 'Show legend', help: 'Would you like to add a legend?' } }, groups : { key: { diff --git a/config/plugins/visualizations/charts/static/charts/utilities/tabular-inputs.js b/config/plugins/visualizations/charts/static/charts/utilities/tabular-inputs.js deleted file mode 100644 index 742c1517b46b..000000000000 --- a/config/plugins/visualizations/charts/static/charts/utilities/tabular-inputs.js +++ /dev/null @@ -1,65 +0,0 @@ -define( [], function() { - return { - axisLabel : function( name, options ) { - options = options || {}; - prefix = name.substr( 0, 1 ); - return { - name : name, - label : prefix.toUpperCase() + '-Axis label', - help : 'Provide a label for the axis.', - type : 'text', - value : options.value || prefix.toUpperCase() + '-axis', - placeholder : 'Axis label' - } - }, - axisType : function( name, options ) { - options = options || {}; - prefix = name.substr( 0, 1 ); - var axisPrecision = function() { - return { name : 'precision', - label : 'Axis tick format', - help : 'Select the tick format for the axis.', - type : 'select', - value : options.precision || 1, - data : [ { label : '0.00001', value : '5' }, - { label : '0.0001', value : '4' }, - { label : '0.001', value : '3' }, - { label : '0.01', value : '2' }, - { label : '0.1', value : '1' }, - { label : '1', value : '0' } ] } - } - return { - name : prefix + '_axis_type', - type : 'conditional', - test_param : { - name : 'type', - label : prefix.toUpperCase() + '-Axis value type', - type : 'select', - value : options.value || 'auto', - help : 'Select the value type of the axis.', - data : [ { value : 'hide', label : '-- Do not show values --' }, - { value : 'auto', label : 'Auto' }, - { value : 'f', label : 'Float' }, - { value : 'd', label : 'Integer' }, - { value : 'e', label : 'Exponent' }, - { value : 'p', label : 'Percent' }, - { value : 's', label : 'SI-prefix' } ] - }, - cases : [ { value : 'hide' }, - { value : 'auto' }, - { value : 'f', inputs: [ axisPrecision() ] }, - { value : 'd' }, - { value : 'e', inputs: [ axisPrecision() ] }, - { value : 'p', inputs: [ axisPrecision() ] }, - { value : 's' } ] - } - }, - boolean : function( name, options ) { - options = options || {}; - return { name : name, - label : options.label, - help : options.help, - type : 'boolean' } - } - } -}); \ No newline at end of file diff --git a/config/plugins/visualizations/charts/static/views/settings.js b/config/plugins/visualizations/charts/static/views/settings.js index 68b437b21f07..d14e95ac20b5 100644 --- a/config/plugins/visualizations/charts/static/views/settings.js +++ b/config/plugins/visualizations/charts/static/views/settings.js @@ -14,7 +14,10 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-view', 'mvc/form/form- }, render: function() { var self = this; - var inputs = Utils.clone( this.chart.definition.settings ); + var inputs = Utils.clone( this.chart.definition.settings ) || {}; + if ( this.chart.definition.use_panels ) { + inputs[ 'use_panels' ] = { type: 'boolean', label: 'Use multi-panels', help: 'Would you like to separate your data into individual panels?' }; + } if ( _.size( inputs ) > 0 ) { FormData.visitInputs( inputs, function( input, name ) { var model_value = self.chart.settings.get( name ); From 70e68c204b3f250e76032761d796f62552f63d70 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 08:58:07 -0400 Subject: [PATCH 16/27] Fix spacing --- .../plugins/visualizations/charts/static/views/settings.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/settings.js b/config/plugins/visualizations/charts/static/views/settings.js index d14e95ac20b5..6203d7925058 100644 --- a/config/plugins/visualizations/charts/static/views/settings.js +++ b/config/plugins/visualizations/charts/static/views/settings.js @@ -16,7 +16,11 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-view', 'mvc/form/form- var self = this; var inputs = Utils.clone( this.chart.definition.settings ) || {}; if ( this.chart.definition.use_panels ) { - inputs[ 'use_panels' ] = { type: 'boolean', label: 'Use multi-panels', help: 'Would you like to separate your data into individual panels?' }; + inputs[ 'use_panels' ] = { + type : 'boolean', + label : 'Use multi-panels', + help : 'Would you like to separate your data into individual panels?' + }; } if ( _.size( inputs ) > 0 ) { FormData.visitInputs( inputs, function( input, name ) { From 77dddc3fa42e28eef9ad14c30d8047b2b2865c09 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 09:03:13 -0400 Subject: [PATCH 17/27] Generalize internal use panels parameter option --- config/plugins/visualizations/charts/static/views/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/charts/static/views/settings.js b/config/plugins/visualizations/charts/static/views/settings.js index 6203d7925058..089f0a99cfc1 100644 --- a/config/plugins/visualizations/charts/static/views/settings.js +++ b/config/plugins/visualizations/charts/static/views/settings.js @@ -15,7 +15,7 @@ define( [ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-view', 'mvc/form/form- render: function() { var self = this; var inputs = Utils.clone( this.chart.definition.settings ) || {}; - if ( this.chart.definition.use_panels ) { + if ( this.chart.definition.use_panels && !inputs[ 'use_panels' ]) { inputs[ 'use_panels' ] = { type : 'boolean', label : 'Use multi-panels', From d6f174e487b77862c005b65843af79c53bd560c7 Mon Sep 17 00:00:00 2001 From: guerler Date: Thu, 25 Aug 2016 09:52:26 -0400 Subject: [PATCH 18/27] Filter exportable datatypes by chart type --- client/galaxy/scripts/mvc/ui/ui-buttons.js | 56 +++++++++++-------- .../visualizations/charts/static/app.js | 15 ++--- .../static/charts/jqplot/common/config.js | 1 + .../static/charts/nvd3/common/config.js | 1 + .../charts/static/views/viewer.js | 36 +++++------- static/maps/mvc/ui/ui-buttons.js.map | 2 +- static/scripts/bundled/analysis.bundled.js | 4 +- .../scripts/bundled/analysis.bundled.js.map | 2 +- static/scripts/bundled/libs.bundled.js.map | 2 +- static/scripts/mvc/ui/ui-buttons.js | 2 +- 10 files changed, 61 insertions(+), 60 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 1a4858324e94..a597d457676f 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -223,9 +223,11 @@ define( [ 'utils/utils' ], function( Utils ) { visible : true, tag : '' }).set( options ); + this.collection = new Backbone.Collection(); this.setElement( $( '
' ).append( this.$root = $( '
' ).append( this.$icon = $( '' ) ) .append( this.$title = $( '' ) ) ) ); this.listenTo( this.model, 'change', this.render, this ); + this.listenTo( this.collection, 'change add remove reset', this.render, this ); this.render(); }, @@ -237,7 +239,7 @@ define( [ 'utils/utils' ], function( Utils ) { .addClass( options.cls ) .attr( 'id', options.id ) .css( { float : options.floating, - display : options.visible ? 'block' : 'none' } ); + display : options.visible && this.collection.where( { visible: true } ).length > 0 ? 'block' : 'none' } ); this.$root.addClass( 'root button dropdown-toggle' ) .attr( 'data-toggle', 'dropdown' ) .tooltip( { title: options.tooltip, placement: 'bottom' } ) @@ -249,11 +251,38 @@ define( [ 'utils/utils' ], function( Utils ) { this.$icon.removeClass().addClass( 'icon fa' ).addClass( options.icon ); this.$title.removeClass().addClass( 'title' ).html( options.title ); options.icon && options.title && this.$icon.addClass( 'ui-margin-right' ); + this.$menu && this.$menu.remove(); + if ( this.collection.length > 0 ) { + this.$menu = $( '