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

nextflow.trace.assets.d3-timeline.min.js Maven / Gradle / Ivy

Go to download

A DSL modelled around the UNIX pipe concept, that simplifies writing parallel and scalable pipelines in a portable manner

There is a newer version: 24.11.0-edge
Show newest version
!function(){var t=d3.scale.category20c().domain(d3.range(0,20)).range();var n="#9c9c9c",e="#bdbdbd";d3.timeline=function(){var r=["circle","rect"],i=function(){},a=function(){},o=function(){},c=function(){},l=function(){},u=function(t){return t},s=function(){},f=function(){},g="bottom",h=null,d=null,m=null,p=null,x={format:d3.time.format("%I %p"),tickTime:d3.time.hours,tickInterval:1,tickSize:6},v=d3.scale.category20(),w=null,k="rect",y=0,_=0,T=0,b={left:30,right:30,top:30,bottom:30},F=!1,B=!1,A=!1,E=!1,S=20,I=5,Y=60,z=!0,M=!1,C=!1,O=!1,H={stroke:"stroke-dasharray",spacing:"4 10"},L={marginTop:25,marginBottom:0,width:1,color:v},R=!1,j={marginTop:25,marginBottom:0,width:1,color:v},D=!1,N=!1,P=!1,W="white",q={},G=function(t,n,e){D&&K(t,0,0),N&&J(t);t.append("g").attr("class","axis").attr("transform","translate(0,"+e+")").call(n)},J=function(t){var n=b.left-Y,e=(h-b.left)/6,r=h-b.right-e+Y,i=t.append("g").attr("class","axis").attr("transform","translate(0, 20)");P&&function(t){var n=y.getFullYear();y.getFullYear()!=T.getFullYear()&&(n=y.getFullYear()+"-"+T.getFullYear()),t.append("text").attr("transform","translate(20, 0)").attr("x",0).attr("y",14).attr("class","calendarYear").text(n)}(i),i.append("text").attr("transform","translate("+n+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text("<").on("click",function(){return s(y,q)}),i.append("text").attr("transform","translate("+r+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text(">").on("click",function(){return f(T,q)})},K=function(t,n,e){t.insert("rect").attr("class","row-green-bar").attr("x",n).attr("width",h).attr("y",e).attr("height",S).attr("fill",W)},Q=function(t,n,e){t.append("g").attr("class","axis").attr("transform","translate(0,"+(b.top+(S+I)*e)+")").attr(H.stroke,H.spacing).call(n.tickFormat("").tickSize(-(b.top+(S+I)*(e-1)+3),0,0))},U=function(t,n,e,r,i){var a=(S+I)*t[n]+b.top;e.selectAll("svg").data(r).enter().insert("rect").attr("class","row-green-bar").attr("x",E?0:b.left).attr("width",E?h:h-b.right-b.left).attr("y",a).attr("height",S).attr("fill",p instanceof Function?p(i,n):p)},V=function(t,n,e,r,i){var a=S+I,o=a+a*(n[e]||1);t.append("text").attr("class","timeline-label").attr("transform","translate("+_+","+o+")").text(r?u(i.label):i.id).on("click",function(t,n){c(t,e,i)})};function X(r){var u=r.append("g"),s=r[0][0].getBoundingClientRect(),f=d3.select(r[0][0]),v={},w=1,_=0,E=0;!function(){if(h||s.width){if(!h||!s.width)try{h=f.attr("width")}catch(t){console.log(t)}}else try{if(!(h=f.attr("width")))throw"width of the timeline is not set. As of Firefox 27, timeline().with(x) needs to be explicitly set in order to render"}catch(t){console.log(t)}}(),A&&u.each(function(t,n){t.forEach(function(t,n){t.times.forEach(function(t,e){0===n&&0===e?(originTime=t.starting_time,t.starting_time=0,t.ending_time=t.ending_time-originTime):(t.starting_time=t.starting_time-originTime,t.ending_time=t.ending_time-originTime)})})}),(F||0===T||0===y)&&(u.each(function(t,n){t.forEach(function(t,n){F&&-1==Object.keys(v).indexOf(n)&&(v[n]=w,w++),t.times.forEach(function(t,n){0===y&&(t.starting_time<_||0===_&&!1===A)&&(_=t.starting_time),0===T&&t.ending_time>E&&(E=t.ending_time)})})}),0===T&&(T=E),0===y&&(y=_));var Y=1/(T-y)*(h-b.left-b.right),H=d3.time.scale().domain([y,T]).range([b.left,h-b.right]),D=d3.svg.axis().scale(H).orient(g).tickFormat(x.format).ticks(x.numTicks||x.tickTime,x.tickInterval).tickSize(x.tickSize);u.each(function(l,s){q=l,l.forEach(function(l,s){var f=l.cached,g=l.index,d=l.times,x=void 0!==l.label;if(void 0!==l.id&&console.warn("d3Timeline Warning: Ids per dataset is deprecated in favor of a 'class' key. Ids are now per data element."),p&&U(v,s,u,d,l),u.selectAll("svg").data(d).enter().append(function(t,n){return document.createElementNS(d3.ns.prefix.svg,"display"in t?t.display:k)}).attr("x",K).attr("y",y).attr("width",function(t,n){return(t.ending_time-t.starting_time)*Y}).attr("cy",function(t,n){return y(t,n)+S/2}).attr("cx",K).attr("r",S/2).attr("height",S).style("fill",function(r,i){return 0==i?e:1==i?f?n:t[g%16]:e}).on("mousemove",function(t,n){i(t,s,l)}).on("mouseover",function(t,n){a(t,n,l)}).on("mouseout",function(t,n){o(t,n,l)}).on("click",function(t,n){c(t,s,l)}).attr("class",function(t,n){return l.class?"timelineSeries_"+l.class:"timelineSeries_"+s}).attr("id",function(t,n){return l.id&&!t.id?"timelineItem_"+l.id:t.id?t.id:"timelineItem_"+s+"_"+n}),u.selectAll("svg").data(d).enter().append("text").attr("x",X).attr("y",function(t,n){if(F)return b.top+(S+I)*v[s]+.75*S;return b.top+.75*S}).text(function(t){return t.label}),m){var w=S+I/2+b.top+(S+I)*v[s];r.append("svg:line").attr("class","row-seperator").attr("x1",0+b.left).attr("x2",h-b.right).attr("y1",w).attr("y2",w).attr("stroke-width",1).attr("stroke",m)}function y(t,n){return F?b.top+(S+I)*v[s]:b.top}x&&V(r,v,s,x,l),void 0!==l.icon&&r.append("image").attr("class","timeline-label").attr("transform","translate(0,"+(b.top+(S+I)*v[s])+")").attr("xlink:href",l.icon).attr("width",b.left).attr("height",S)})});var N=b.top+(S+I)*w,P=b.top;if(z&&G(u,D,M?P:N),O&&Q(u,D,w),h>s.width){var W=d3.behavior.zoom().x(H).on("zoom",function(){var t=Math.min(0,Math.max(s.width-h,d3.event.translate[0]));W.translate([t,0]),u.attr("transform","translate("+t+",0)"),l(t*Y,H)});r.attr("class","scrollable").call(W)}B&&u.selectAll(".tick text").attr("transform",function(t){return"rotate("+B+")translate("+(this.getBBox().width/2+10)+","+this.getBBox().height/2+")"});var J=u[0][0].getBoundingClientRect();(function(){if(d||f.attr("height"))d?f.attr("height",d):d=f.attr("height");else{if(!S)throw"height of the timeline is not set";d=J.height+J.top-s.top,d3.select(r[0][0]).attr("height",d)}}(),R&&u.each(function(t,n){t.forEach(function(t){t.times.forEach(function(t){Z(H(t.starting_time),j),Z(H(t.ending_time),j)})})}),C)&&Z(H(new Date),L);function K(t,n){return b.left+(t.starting_time-y)*Y}function X(t,n){return b.left+(t.starting_time-y)*Y+5}function Z(t,n){r.append("svg:line").attr("x1",t).attr("y1",n.marginTop).attr("x2",t).attr("y2",d-n.marginBottom).style("stroke",n.color).style("stroke-width",n.width)}}return X.margin=function(t){return arguments.length?(b=t,X):b},X.orient=function(t){return arguments.length?(g=t,X):g},X.itemHeight=function(t){return arguments.length?(S=t,X):S},X.itemMargin=function(t){return arguments.length?(I=t,X):I},X.navMargin=function(t){return arguments.length?(Y=t,X):Y},X.height=function(t){return arguments.length?(d=t,X):d},X.width=function(t){return arguments.length?(h=t,X):h},X.display=function(t){return arguments.length&&-1!=r.indexOf(t)?(k=t,X):k},X.labelFormat=function(t){return arguments.length?(u=t,X):null},X.tickFormat=function(t){return arguments.length?(x=t,X):x},X.hover=function(t){return arguments.length?(i=t,X):i},X.mouseover=function(t){return arguments.length?(a=t,X):t},X.mouseout=function(t){return arguments.length?(o=t,X):t},X.click=function(t){return arguments.length?(c=t,X):c},X.scroll=function(t){return arguments.length?(l=t,X):l},X.colors=function(t){return arguments.length?(v=t,X):v},X.beginning=function(t){return arguments.length?(y=t,X):y},X.ending=function(t){return arguments.length?(T=t,X):T},X.labelMargin=function(t){return arguments.length?(_=t,X):T},X.rotateTicks=function(t){return B=t,X},X.stack=function(){return F=!F,X},X.relativeTime=function(){return A=!A,X},X.showBorderLine=function(){return R=!R,X},X.showBorderFormat=function(t){return arguments.length?(j=t,X):j},X.showToday=function(){return C=!C,X},X.showTodayFormat=function(t){return arguments.length?(L=t,X):L},X.colorProperty=function(t){return arguments.length?(w=t,X):w},X.rowSeperators=function(t){return arguments.length?(m=t,X):m},X.background=function(t){return arguments.length?(p=t,X):p},X.showTimeAxis=function(){return z=!z,X},X.showAxisTop=function(){return M=!M,X},X.showAxisCalendarYear=function(){return P=!P,X},X.showTimeAxisTick=function(){return O=!O,X},X.fullLengthBackgrounds=function(){return E=!E,X},X.showTimeAxisTickFormat=function(t){return arguments.length?(H=t,X):H},X.showAxisHeaderBackground=function(t){return D=!D,t&&(W=t),X},X.navigate=function(t,n){return s=t,f=n,N=!N,X},X}}();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy