@hpcc-js/timeline 2.54.1 → 2.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +8 -8
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/chart"),require("@hpcc-js/common"),require("@hpcc-js/html"),require("@hpcc-js/react"),require("@hpcc-js/layout")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/chart","@hpcc-js/common","@hpcc-js/html","@hpcc-js/react","@hpcc-js/layout"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/timeline"]={},t["@hpcc-js/api"],t["@hpcc-js/chart"],t["@hpcc-js/common"],t["@hpcc-js/html"],t["@hpcc-js/react"],t["@hpcc-js/layout"])}(this,(function(t,e,i,o,n,r,s){"use strict";var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},a(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var h=function(){return h=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},h.apply(this,arguments)};function p(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;!function(t,e){void 0===e&&(e={});var i=e.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}(".timeline_MiniGantt .line{fill:none;stroke:#d3d3d3;opacity:.7}.timeline_MiniGantt .common_TextBox .rect{fill:#87cefa;stroke:blue;opacity:.5}.timeline_MiniGantt .buckets .entity_shape rect{stroke:#333}.timeline_MiniGantt .buckets.selected .common_EntityRect .common_Shape>rect{stroke:red}.timeline_MiniGantt .common_TextBox .rect text{fill:#000;stroke:none}.timeline_MiniGantt .over{stroke:transparent;opacity:.8}.timeline_MiniGantt rect{shape-rendering:crispEdges}");var c=function(t){function n(){var n=t.call(this)||this;return n.localRect=o.local(),n.localEntityPin=o.local(),n._title_idx=0,n._startDate_idx=1,n._endDate_idx=2,n._icon_idx=-1,n._color_idx=-1,n._yoffset_idx=-1,e.ITooltip.call(n),o.Utility.SimpleSelectionMixin.call(n),n._drawStartPos="origin",n.tooltipHTML((function(t){return"<center>".concat(t[n._title_idx],"</center><br>").concat(n.tooltipFormatter(n.brAxis.parse(t[n._startDate_idx]))," -> ").concat(n.tooltipFormatter(n.brAxis.parse(t[n._endDate_idx])))})),n.tlAxis=(new i.Axis).type("time"),n.brAxis=(new i.Axis).type("time"),n.verticalBands=o.scaleBand().paddingOuter(.2).paddingInner(.2),n}return l(n,t),n.prototype.isHorizontal=function(){return"horizontal"===this.orientation()},n.prototype.fullExtent=function(){var t=this,e=p(p([],this.data().map((function(e){return e[t._startDate_idx]})),!0),this.data().filter((function(e){return!!e[t._endDate_idx]})).map((function(e){return e[t._endDate_idx]})),!0);return o.extent(e)},n.prototype.extent=function(){var t=this.rootExtent?[this.rootExtent[1],this.rootExtent[2]]:this.fullExtent();if(void 0!==t[0]&&void 0!==t[1]&&(t[0]===t[1]||this.centerOnMostRecent())){var e=o.timeParse(this.timePattern()),i=o.timeFormat(this.timePattern()),n=e(t[0]),r=e(t[1]);if(t[0]===t[1])t[0]=i(new Date(n.setFullYear(n.getFullYear()-1))),t[1]=i(new Date(n.setFullYear(n.getFullYear()+2)));else{var s=n.getTime(),a=r.getTime()-s;t[0]=i(n),t[1]=i(new Date(s+2*a))}}return t},n.prototype.dataStartPos=function(t){if(void 0!==this._dateCache[t[this._startDate_idx]])return this._dateCache[t[this._startDate_idx]];var e=this.brAxis.scalePos(t[this._startDate_idx]);return this._dateCache[t[this._startDate_idx]]=e,e},n.prototype.dataEndPos=function(t){if(void 0!==this._dateCache[t[this._endDate_idx]])return this._dateCache[t[this._endDate_idx]];var e=this.brAxis.scalePos(t[this._endDate_idx]);return this._dateCache[t[this._endDate_idx]]=e,e},n.prototype.dataWidth=function(t){return this.dataEndPos(t)-this.dataStartPos(t)},n.prototype.resetZoom=function(){this._zoom.transform(this.element(),o.zoomIdentity.translate(0,this.isHorizontal()?0:this.height()))},n.prototype.zoomed=function(){this.transform=o.d3Event().transform,this.render()},n.prototype.enter=function(e,i){var n=this;t.prototype.enter.call(this,e,i),this._zoom=o.zoom().scaleExtent([0,this.maxZoom()]).on("zoom",(function(){n.zoomed()})),this.background=i.append("rect").attr("fill","white").attr("opacity",0).on("dblclick",(function(){o.d3Event().stopPropagation(),delete n.rootExtent,n.resetZoom()})),this.gUpperContent=i.append("g").attr("class","gUpperContent"),this.gUpperAxis=i.append("g").attr("class","gUpperAxis"),this.gMiddleContent=i.append("g").attr("class","gMiddleContent"),this.gLowerAxis=i.append("g").attr("class","gLowerAxis"),this.gLowerContent=i.append("g").attr("class","gLowerContent"),this.tlAxis.target(this.gUpperAxis.node()).tickFormat(this.tickFormat()).guideTarget(this.gUpperAxis.append("g").node()).shrinkToFit("none").overlapMode(this.tickFormat_exists()?"stagger":"none").extend(.1),this.brAxis.target(this.gLowerAxis.node()).tickFormat(this.tickFormat()).guideTarget(this.gLowerAxis.append("g").node()).shrinkToFit("none").overlapMode(this.tickFormat_exists()?"stagger":"none").extend(.1),i.call(this._zoom),this._selection.widgetElement(this.gMiddleContent)},n.prototype.update=function(e,i){var n=this;if(t.prototype.update.call(this,e,i),this._dateCache={},this._title_idx=null!==this.titleColumn()?this.columns().indexOf(this.titleColumn()):this._title_idx,this._startDate_idx=null!==this.startDateColumn()?this.columns().indexOf(this.startDateColumn()):this._startDate_idx,this._endDate_idx=null!==this.endDateColumn()?this.columns().indexOf(this.endDateColumn()):this._endDate_idx,this._icon_idx=null!==this.iconColumn()?this.columns().indexOf(this.iconColumn()):this._icon_idx,this._color_idx=null!==this.colorColumn()?this.columns().indexOf(this.colorColumn()):this._color_idx,this._yoffset_idx=null!==this.yOffsetColumn()?this.columns().indexOf(this.yOffsetColumn()):this._yoffset_idx,this._prevIsHorizontal!==this.isHorizontal())return this._prevIsHorizontal=this.isHorizontal(),void this.resetZoom();this.tooltipFormatter=o.timeFormat(this.tooltipTimeFormat());var r=this.width(),s=this.height();this.background.attr("x",0).attr("y",0).attr("width",r).attr("height",s);var a=this.extent();if(this.tlAxis.x(r/2).orientation(this.isHorizontal()?"top":"left").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(r-1).low(a[0]).high(a[1]).updateScale(),this.brAxis.x(r/2).y(s/2).orientation(this.isHorizontal()?"bottom":"right").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(r-1).height(s).low(a[0]).high(a[1]).updateScale(),this.transform){var l=void 0,h=void 0;this.isHorizontal()?(l=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(0))),h=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(r-1)))):(l=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(0))),h=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(s-1)))),this.tlAxis.low(l).high(h).updateScale(),this.brAxis.low(l).high(h).updateScale()}var p=this.data().sort(this.isHorizontal()?function(t,e){var i=n.brAxis.scalePos(t[1])-n.brAxis.scalePos(e[1]);return 0===i?(""+t[0]).localeCompare(""+e[0]):i}:function(t,e){return n.brAxis.scalePos(e[1])-n.brAxis.scalePos(t[1])}),c=p.filter((function(t){return!t[n._endDate_idx]})),u=p.filter((function(t){return!!t[n._endDate_idx]}));this.tlAxis.render(),this.brAxis.render();var d=this.brAxis.getBBox(),m=this.updateEntityPins(c),_=d.height,g=s-m,x=-1!==this._yoffset_idx?Math.min.apply(void 0,this.data().filter((function(t){return!isNaN(t[n._yoffset_idx])})).map((function(t){return t[n._yoffset_idx]}))):0;if(c.length>0&&0===u.length){this.tlAxis.visible(!1);var f=m/4;f>s/2-_&&(f=s/2-_);var y=s/2+f,b=-1*(s/2-_-f),v=0!==x?x/2:0;this.gUpperContent.attr("transform","translate(0, ".concat(y-v,")")),this.gLowerAxis.attr("transform","translate(0, ".concat(b-v,")"))}else 0===c.length&&u.length>0?(this.tlAxis.visible(!0),this.gUpperContent.attr("transform","translate(0, ".concat(m,")")),this.gUpperAxis.attr("transform","translate(0, ".concat(m,")"))):(m-=x,g+=x,this.tlAxis.visible(!0),this.gUpperContent.attr("transform","translate(0, ".concat(m,")")),this.gUpperAxis.attr("transform","translate(0, ".concat(m,")")),this.gMiddleContent.attr("transform","translate(0, ".concat(m,")")));this.tlAxis.render();for(var k=this.tlAxis.getBBox(),C=[],w={},F=0,S=u;F<S.length;F++){for(var A=S[F],z=0;z<C.length;++z){var P=C[z];if(P.endPos+this.overlapTolerence()<=this.dataStartPos(A)){w[A]=z,P.endPos=this.dataEndPos(A);break}}void 0===w[A]&&(w[A]=C.length,C.push({endPos:this.dataEndPos(A)}))}var T=this.isHorizontal()?0+k.height:0+k.width,M=this.isHorizontal()?g-d.height:r-d.width;this.verticalBands.range([T,M]).domain(C.map((function(t,e){return e}))),u.length>0&&this.updateEventRanges(c,u,w,g,k,d,r)},n.prototype.updateEntityPins=function(t){for(var e=0,i=this,n=this.gUpperContent.selectAll(".entity_pin").data(t,(function(t){return t[0]+":"+t[1]})),r=this.eventFontColorColumn()?this.columns().indexOf(this.eventFontColorColumn()):-1,s=this.eventBorderColorColumn()?this.columns().indexOf(this.eventBorderColorColumn()):-1,a=this.eventBackgroundColorColumn()?this.columns().indexOf(this.eventBackgroundColorColumn()):-1,l={},h=0,p=t;h<p.length;h++){var c=p[h],u=void 0!==c[i._title_idx]?c[i._title_idx]:c[0];l[u]=l[u]?l[u]+1:1}var d=Object.keys(l),m=i.eventGroupOffset(),_=n.enter().append("g").attr("class","entity_pin");_.append("line").attr("class","entity_line"),_.on("mouseover",(function(t){o.select(this).raise()})).each((function(t,e){var n=(new o.EntityPin).target(this).icon("").iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).iconDiameter(18).iconPaddingPercent(1).titleFontSize(14).descriptionColor("#333").descriptionFontSize(15).iconColor(-1===r?"#333":t[r]).titleColor(-1===r?"#333":t[r]).descriptionColor(-1===r?"#333":t[r]).backgroundShape("pin").backgroundColorFill(-1===r?"#f8f8f8":t[a]).backgroundColorStroke(-1===r?"#ccc":t[s]).cornerRadius(5).arrowHeight(10).arrowWidth(16);i.localEntityPin.set(this,n)})).merge(n).each((function(t,n){var a=i.localEntityPin.get(this),l=void 0!==t[i._title_idx]?t[i._title_idx]:a.title(),h=i.dataStartPos(t)-0,p=d.indexOf(l)%i.eventGroupMod()*m-5;if(void 0!==t[i._yoffset_idx]&&(p+=t[i._yoffset_idx]?t[i._yoffset_idx]:0),t[i._title_idx]!==a.title()&&t[i._startDate_idx]!==a.description()){var c=i.brAxis.parse(t[i._startDate_idx]),u=i.tooltipFormatter(c);a.x(h).y(p).iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).icon(void 0!==t[i._icon_idx]?t[i._icon_idx]:a.icon()).title(l).description(u).animationFrameRender()}else a.move({x:h,y:p});var _=a.calcHeight();e<_&&(e=_),o.select(this).selectAll(".entity_line").attr("x1",h).attr("x2",h).attr("y1",0).attr("y2",p).style("stroke",-1===r?"#ccc":t[s]).style("stroke-width",1)})),n.exit().each((function(t,e){i.localEntityPin.get(this).target(null)})).remove();var g=Math.abs(Math.min(t.length,i.eventGroupMod())*i.eventGroupOffset());return e+g},n.prototype.updateEventRanges=function(t,e,i,n,r,s,a){var l=this,h=this,p=this.gMiddleContent.selectAll(".line").data(t,(function(t){return t[h._title_idx]}));p.enter().append("line").attr("class","line").merge(p).attr(this.isHorizontal()?"x1":"y1",(function(t){return l.dataStartPos(t)-0})).attr(this.isHorizontal()?"x2":"y2",(function(t){return l.dataStartPos(t)-0})).attr(this.isHorizontal()?"y1":"x1",this.isHorizontal()?r.height:r.width).attr(this.isHorizontal()?"y2":"x2",this.isHorizontal()?n-s.height:a-s.width),p.exit().remove();var c=this.gMiddleContent.selectAll(".buckets").data(e,(function(t){return t[h._title_idx]}));c.enter().append("g").attr("class","buckets").call(this._selection.enter.bind(this._selection)).each((function(t){var e=(new o.EntityRect).target(this).iconDiameter(28).iconPaddingPercent(0).titleFontSize(28).titleColor(h.rangeFontColor()).descriptionColor(h.rangeFontColor()).iconColor(h.rangeFontColor()).backgroundShape("rect").backgroundColorFill(t[h._color_idx]);h.localRect.set(this,e),h.enterEntityRect(e,t)})).on("click",(function(t){h.click(h.rowToObj(t),"range",h._selection.selected(this))}),!1).on("dblclick",(function(t){h.rootExtent=t,h.resetZoom(),h.dblclick(h.rowToObj(t),"range",h._selection.selected(this))}),!0).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(c).attr("transform",(function(t){return h.isHorizontal()?"translate(".concat(l.dataStartPos(t),", ").concat(l.verticalBands(i[t]),") "):"translate(".concat(l.verticalBands(i[t]),", ").concat(l.dataStartPos(t),") ")})).each((function(t){var e=h.localRect.get(this),i=h.dataWidth(t)/2,o=h.verticalBands.bandwidth()/2,n=Math.max(h.dataWidth(t),2),r=Math.max(h.verticalBands.bandwidth(),2),s=.191*r,a=.618*r,l=a;e.pos(h.isHorizontal()?{x:i,y:o}:{x:o,y:i}).fixedHeight(h.isHorizontal()?r:n).fixedWidth(h.isHorizontal()?n:r).icon(void 0!==t[h._icon_idx]?t[h._icon_idx]:"").title(void 0!==t[h._title_idx]?t[h._title_idx]:"").padding(s).iconDiameter(l).titleFontSize(a),1.5*l>n&&e.icon(null),h.updateEntityRect(e,t[h._icon_idx]),e.render()})),c.exit().remove()},n.prototype.exit=function(e,i){this.brAxis.target(null),this.tlAxis.target(null),t.prototype.exit.call(this,e,i)},n.prototype.click=function(t,e,i){},n.prototype.dblclick=function(t,e,i){},n.prototype.enterEntityRect=function(t,e){},n.prototype.updateEntityRect=function(t,e){},n}(o.SVGWidget);c.prototype._class+=" timeline_MiniGantt",c.prototype.implements(e.ITooltip.prototype),c.prototype.mixin(o.Utility.SimpleSelectionMixin),c.prototype.publish("timePattern","%Y-%m-%d","string","timePattern"),c.prototype.publish("tickFormat",null,"string","tickFormat",void 0,{optional:!0}),c.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","tooltipTimeFormat"),c.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),c.prototype.publish("orientation","horizontal","set","orientation",["horizontal","vertical"]),c.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),c.prototype.publish("titleColumn",null,"string","titleColumn"),c.prototype.publish("startDateColumn",null,"string","startDateColumn"),c.prototype.publish("endDateColumn",null,"string","endDateColumn"),c.prototype.publish("iconColumn",null,"string","iconColumn"),c.prototype.publish("colorColumn",null,"string","colorColumn"),c.prototype.publish("yOffsetColumn",null,"string","yOffsetColumn"),c.prototype.publish("maxZoom",16,"number","maxZoom"),c.prototype.publish("eventGroupOffset",-50,"number","eventGroupOffset"),c.prototype.publish("eventGroupMod",5,"number","eventGroupMod"),c.prototype.publish("eventFontColorColumn",null,"string","eventFontColorColumn"),c.prototype.publish("eventBorderColorColumn",null,"string","eventBorderColorColumn"),c.prototype.publish("eventBackgroundColorColumn",null,"string","eventBackgroundColorColumn"),c.prototype.publish("hideIconWhenCollapsed",!1,"boolean","hideIconWhenCollapsed"),c.prototype.publish("hideTitleWhenCollapsed",!1,"boolean","hideTitleWhenCollapsed"),c.prototype.publish("hideDescriptionWhenCollapsed",!1,"boolean","hideDescriptionWhenCollapsed"),c.prototype.publish("hideAnnotationsWhenCollapsed",!0,"boolean","hideAnnotationsWhenCollapsed"),c.prototype.publish("centerOnMostRecent",!1,"boolean","If true, the timeline will be centered on the most recent data point");var u=function(t){function e(e){void 0===e&&(e="origin");var i=t.call(this)||this;return i._selection=new o.Utility.Selection(i),i._title_idx=0,i._startDate_idx=1,i._endDate_idx=2,i._icon_idx=-1,i._color_idx=-1,i._series_idx=-1,i._bucket_idx=-1,i._yoffset_idx=-1,i._rangeOptions={rangePadding:2,fontFamily:"Verdana",fontSize:12,fill:"white",stroke:"black",textFill:"black",cornerRadius:3,strokeWidth:0},i._rangeRenderer=r.LabelledRect,i._transform={k:1,x:0,y:0},i._drawStartPos=e,i.showToolbar_default(!1),i._tooltip=new n.HTMLTooltip,i._tooltip.tooltipHTML((function(t){return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(t[1]," -> ").concat(t[2],"</div>")})),i._tooltip.followCursor(!0),i}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._selection.set(t),this):this._selection.get()},e.prototype.rangeRenderer=function(t){return arguments.length?(this._rangeRenderer=t,this._rangeRenderer):this._rangeRenderer},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.on("click",(function(t){o._selection.clear()})),this._tooltip.target(e)},e.prototype.update=function(e,i){var n=this;t.prototype.update.call(this,e,i),this.zoomExtent([.05,this.maxZoom()]),this._title_idx=null!==this.titleColumn()?this.columns().indexOf(this.titleColumn()):this._title_idx,this._startDate_idx=null!==this.startDateColumn()?this.columns().indexOf(this.startDateColumn()):this._startDate_idx,this._endDate_idx=null!==this.endDateColumn()?this.columns().indexOf(this.endDateColumn()):this._endDate_idx,this._icon_idx=null!==this.iconColumn()?this.columns().indexOf(this.iconColumn()):this._icon_idx,this._color_idx=null!==this.colorColumn()?this.columns().indexOf(this.colorColumn()):this._color_idx,this._series_idx=null!==this.seriesColumn()?this.columns().indexOf(this.seriesColumn()):this._series_idx,this._bucket_idx=null!==this.bucketColumn()?this.columns().indexOf(this.bucketColumn()):-1;var r=this,s=this.width(),a=s;if(this._interpolateX=o.scaleLinear().domain([this._minStart,this._maxEnd]).range([0,a]),this.data().sort((function(t,e){return t[1]-e[1]})),this._series_idx>-1){this._origIdxMap={},this._dataBySeries={},this._bucketsBySeries={},this.data().forEach((function(t,e){var i=t[n._series_idx];n._dataBySeries[i]||(n._origIdxMap[i]={},n._dataBySeries[i]=[]),n._dataBySeries[i].push({dataRow:t,origIdx:e})}));var l=this.gutter(),p=0,c=Object.keys(this._dataBySeries);c.forEach((function(t){n._dataBySeries[t].sort((function(t,e){return t.dataRow[1]-e.dataRow[1]})),n._bucketsBySeries[t]=n.calcBuckets(n._dataBySeries[t].map((function(t){return t.dataRow})),1,2),n._bucketsBySeries[t].bucketHeight=n.bucketHeight(),n._bucketsBySeries[t].bucketOffset=p,p+=(n._bucketsBySeries[t].bucketHeight+n.strokeWidth()+n.gutter())*(n._bucketsBySeries[t].maxBucket+1),n._dataBySeries[t].forEach((function(e,i){n._origIdxMap[t][e.origIdx]=i}))})),this._seriesBackgrounds=this._renderElement.selectAll(".series-background").data(c.map((function(t){return n._bucketsBySeries[t]}))),this._seriesBackgrounds.join((function(t){return t.append("rect").attr("class","series-background")}),(function(t){return t}),(function(t){return t.each((function(t){delete t.element})).remove()})).attr("opacity",(function(t){return t.props&&t.props.hidden?0:1})).each((function(t,e){o.select(this).attr("x",0).attr("y",t.bucketOffset-l/2).attr("width",s).attr("height",(t.bucketHeight+l)*(t.maxBucket+1)+l).attr("fill",e%2?r.oddSeriesBackground():r.evenSeriesBackground())}))}else-1!==this._bucket_idx?this._buckets=this.calcBuckets(this.data(),this._startDate_idx,this._endDate_idx,this._bucket_idx):this._buckets=this.calcBuckets(this.data(),this._startDate_idx,this._endDate_idx);var u=this._interpolateX(this._minStart);this.zoomTo([u,0],1);var d=this.bucketHeight();this.setRangeOptions(),this._maxFontScale=d-2*this.rangePadding(),this.measureDataText();var m=this._renderElement.selectAll(".item").data(this.data()),_=this.strokeWidth(),g=2*_;m.join((function(t){return t.append("g").attr("class","item").on("click.selectionBag",(function(t,e){var i=void 0===t.id?e:t.id;r._selection.isSelected({_id:i,element:t.element})?r._selection.clear():r._selection.click({_id:i,element:function(){return t.element}},o.d3Event),r.selectionChanged(),o.d3Event().stopPropagation()})).on("click",(function(t){var e=t.element.classed("selected");t[r.columns().length]&&(t.__lparam=t[r.columns().length]),r.click(t,"",e)})).on("dblclick",(function(t){var e=t.element.classed("selected");t[r.columns().length]&&(t.__lparam=t[r.columns().length]),r.click(t,"",e)})).on("mousein",(function(t){r.highlightItem(o.select(this),t);var e=t.element.classed("selected");r.mousein(t,"",e)})).on("mouseover",(function(t){var e=o.d3Event();r._tooltip._triggerElement=t.element,r._tooltip._cursorLoc=[e.clientX,e.clientY],r._tooltip.data(t).visible(!0).fitContent(!0).render(),r.highlightItem(o.select(this),t);var i=t.element.classed("selected");r.mouseover(t,"",i)})).on("mouseout",(function(t){r._tooltip.visible(!1).render(),r.highlightItem(null,null);var e=t.element.classed("selected");r.mouseout(t,"",e)})).each((function(t,e){t.that=this,t.element=o.select(this),t.x=r._interpolateX(t[1]);var i=r._interpolateX(t[2]);if(r._series_idx>-1){var n=t[r._series_idx],s=r._bucketsBySeries[n].bucketMap[r._origIdxMap[n][e]];t.y=r._bucketsBySeries[n].interpolateY(s)+r._bucketsBySeries[n].bucketOffset}else{var a=-1===r._bucket_idx?e:t[r._bucket_idx];t.y=r._buckets.interpolateY(r._buckets.bucketMap[a])}t.props=h(h({},t[3]),{text:t[0]}),t.props.width=i-t.x,t.props.height=d,t.x+=_,t.y+=_,t.props.width-=g,t.props.height-=g,t.element.attr("transform","translate(".concat(t.x+t.props.width/2," ").concat(t.y+t.props.height/2,")"))}))}),(function(t){return t}),(function(t){return t.each((function(t){delete t.element})).remove()})).attr("opacity",(function(t){return t.props&&t.props.hidden?0:1})).each((function(t,e){if(t.that=this,r._series_idx>-1){var i=t[r._series_idx];t.x=r.renderRangeElement(t,e,!1,r._rangeOptions,i)}else t.x=r.renderRangeElement(t,e,!1,r._rangeOptions)})).on("dblclick.zoom",(function(t){var e=n._interpolateX(t[1]),i=n._interpolateX(t[2]),o=s/(i-e);n.zoomTo([-e*o,0],o)})),i.on("dblclick.zoom",null)},e.prototype.renderRangeElement=function(t,e,i,n,s){void 0===i&&(i=!1),void 0===n&&(n={});var a,l,p=n.strokeWidth,c=2*p,u=n.rangePadding,d=isNaN(this._transform.x)?0:this._transform.x,m=isNaN(this._transform.k)?1:this._transform.k,_=this.bucketHeight();t.that.setAttribute("data-series",s),this._color_idx>-1&&t.that.setAttribute("data-color",t[this._color_idx]),void 0!==s?(l=this._bucketsBySeries[s].bucketMap[this._origIdxMap[s][e]],t.that.setAttribute("data-b",l),t.that.setAttribute("data-bucketOffset",this._bucketsBySeries[s].bucketOffset),t.y=this._bucketsBySeries[s].interpolateY(l)+this._bucketsBySeries[s].bucketOffset,t.that.setAttribute("data-dy",t.y)):(l=this._buckets.bucketMap[e],t.y=this._buckets.interpolateY(l)),this._color_idx>-1&&(n.fill=t[this._color_idx]),i?(t.x=this._interpolateX(t[1])*m,a=this._interpolateX(t[2])*m,t.props=h(h({},t[3]),{text:t[0]}),t.props.width=(a-t.x)/m,t.x+=d,t.props.width*=m):(t.x=this._interpolateX(t[1]),a=this._interpolateX(t[2]),t.props=h(h({},t[3]),{text:t[0]}),t.props.width=(a-t.x)/m),t.props.height=_,void 0===s&&this._buckets.bucketScale<1&&(t.props.height=this._buckets.bucketScale*_),void 0===t.element&&t.that&&(t.element=o.select(t.that)),t.element.attr("transform","translate(".concat(t.x+t.props.width/2," ").concat(t.y+t.props.height/2,")")),t.x+=p,t.y+=p,t.props.width-=c,t.props.height-=c,t.props.width=t.props.width<1?1:t.props.width,t.props.height=t.props.height<1?1:t.props.height;var g=this.truncateText(t.props.text,t.props.width-u,this._maxFontScale);g!==t.props.text?g=this.truncateText(t.props.text,t.props.width-u):t.props.fontSize=this._maxFontScale*n.fontSize,void 0===s&&this._buckets.bucketScale<1&&(t.props.fontSize=Math.min(this._maxFontScale,this._buckets.bucketScale)*n.fontSize),(!this._maxY||this._maxY<t.y+t.props.height)&&(this._maxY=t.y+t.props.height),(!this._maxX||this._maxX<t.x+t.props.width)&&(this._maxX=t.x+t.props.width),r.render(this._rangeRenderer,h(h(h({},n),t.props),{text:g}),t.that)},e.prototype.setRangeOptions=function(){this._rangeOptions={rangePadding:this.rangePadding(),fontFamily:this.fontFamily(),fontSize:this.fontSize(),strokeWidth:this.strokeWidth(),fill:this.fill(),stroke:this.stroke(),textFill:this.rangeFontColor(),cornerRadius:this.cornerRadius()}},e.prototype.zoomed=function(t){var e=this;if(this._transform=t,"scale-all"===this.renderMode())this._zoomScale=t.k,this._zoomTranslate=[t.x,0],this._zoomG.attr("transform","translate(".concat(t.x," ").concat(0,")scale(").concat(t.k," 1)"));else{var i=this._rangeOptions;this.data().forEach((function(t,o){if(e._color_idx>-1&&(i.fill=t[e._color_idx]),e._series_idx>-1){var n=t[e._series_idx];e.renderRangeElement(t,o,!0,i,n)}else e.renderRangeElement(t,o,!0,i)}))}this.zoomedHook(t)},e.prototype.zoomedHook=function(t){},e.prototype.calcBuckets=function(t,e,i,n){var r={},s={},a=this.overlapTolerence(),l=[{end:-1/0}],h=0;void 0!==n?(t.forEach((function(t,e){r[e]=t[n],s[t[n]]=!0})),h=Object.keys(s).length):t.forEach((function(t,o){for(var n=0;n<l.length;++n)if(0===o||l[n][i]+a<=t[e]){r[o]=n,h<n&&(h=n),l[n][i]=t[i];break}if(void 0===r[o]){r[o]=l.length;var s={};s[i]=t[i],l.push(s)}h<r[o]&&(h=r[o])}));var p=(h+1)*(this.bucketHeight()+this.gutter());return{bucketMap:r,maxBucket:h,bucketScale:this.height()/p,interpolateY:o.scaleLinear().domain([0,h+1]).range([0,Math.min(this.height(),p)])}},e.prototype.data=function(e){var i,o,n=t.prototype.data.apply(this,arguments);return arguments.length>0&&(this._minStart=null!==(i=Math.min.apply(Math,this.data().map((function(t){return t[1]}))))&&void 0!==i?i:0,this._maxEnd=null!==(o=Math.max.apply(Math,this.data().map((function(t){return t[2]}))))&&void 0!==o?o:1,this.measureDataText(!0)),n},e.prototype.measureDataText=function(t){void 0===t&&(t=!1);var e={},i={},n=this.fontFamily(),r=this.fontSize(),s=this.bucketHeight();s&&(this._maxFontScale=(s-2*this.rangePadding())/r),(t||this._prevFontFamily!==n||this._prevFontSize!==r)&&(i["."]=o.Utility.textSize(".",n,r).width,this.data().forEach((function(t){e[t[0]]||(e[t[0]]=o.Utility.textSize(t[0],n,r).width),t[0].split("").forEach((function(t){i[t]||(i[t]=o.Utility.textSize(t,n,r).width)}))})),this._textWidths=e,this._characterWidths=i),this._prevFontFamily=n,this._prevFontSize=r},e.prototype.truncateText=function(t,e,i){if(void 0===i&&(i=1),this._textWidths[t]*i<e)return t;for(var o="",n=0,r=e-3*this._characterWidths["."],s=0,a=t;s<a.length;s++){var l=a[s];if(!((n+=this._characterWidths[l])<r))break;o+=l}return r<0?"":o+"..."},e.prototype.resize=function(e){return this.fitWidthToContent()||this.fitHeightToContent()?t.prototype.resize.call(this,{width:e.width,height:this._maxY}):t.prototype.resize.apply(this,arguments)},e.prototype.selectionChanged=function(){},e.prototype.highlightItem=function(t,e){},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.mousein=function(t,e,i){},e.prototype.mouseover=function(t,e,i){},e.prototype.mouseout=function(t,e,i){},e}(o.SVGZoomWidget);u.prototype._class+=" timeline_ReactGantt",u.prototype.publish("fitWidthToContent",!1,"boolean","If true, resize will simply reapply the bounding box width"),u.prototype.publish("fitHeightToContent",!1,"boolean","If true, resize will simply reapply the bounding box height"),u.prototype.publish("titleColumn",null,"string","Column name to for the title"),u.prototype.publish("startDateColumn",null,"string","Column name to for the start date"),u.prototype.publish("endDateColumn",null,"string","Column name to for the end date"),u.prototype.publish("iconColumn",null,"string","Column name to for the icon"),u.prototype.publish("colorColumn",null,"string","Column name to for the color"),u.prototype.publish("seriesColumn",null,"string","Column name to for the series identifier"),u.prototype.publish("bucketColumn",null,"string","Column name to for the bucket identifier"),u.prototype.publish("renderMode","default","set","Render modes vary in features and performance",["default","scale-all"]),u.prototype.publish("rangePadding",3,"number","Padding within each range rectangle (pixels)"),u.prototype.publish("fill","#1f77b4","string","Background color of range rectangle"),u.prototype.publish("stroke",null,"string","Color of range rectangle border"),u.prototype.publish("strokeWidth",null,"number","Width of range rectangle border (pixels)"),u.prototype.publish("cornerRadius",3,"number","Space between range buckets (pixels)"),u.prototype.publish("fontFamily",null,"string","Font family within range rectangle",null,{optional:!0}),u.prototype.publish("fontSize",10,"number","Size of font within range rectangle (pixels)"),u.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),u.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),u.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),u.prototype.publish("bucketHeight",100,"number","Max height of range element (pixels)"),u.prototype.publish("gutter",2,"number","Space between range buckets (pixels)"),u.prototype.publish("maxZoom",16,"number","Maximum zoom"),u.prototype.publish("evenSeriesBackground","#FFFFFF","html-color","Background color of even series rows"),u.prototype.publish("oddSeriesBackground","#DDDDDD","html-color","Background color of odd series rows");var d=function(t){function e(){var e=t.call(this)||this;return e._topAxis=new i.Axis("center").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._gantt=new u("center").stroke("#000000"),e._bottomAxis=new i.Axis("center").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._drawStartPos="origin",e.rangeRenderer=function(){var t=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:t},e}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()},e.prototype.resizeWrappers=function(){var t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i,n=this.strokeWidth();this._topRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._topAxisElement.attr("transform","translate(0 0)"),this._topAxis.resize({height:i,width:t}),this._contentRect.attr("height",o).attr("width",t).attr("fill","transparent"),this._contentElement.attr("transform","translate(0 ".concat(i+n,")")),this._gantt.resize({height:o,width:t}),this._bottomRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._bottomAxisElement.attr("transform","translate(0 ".concat(i+o+n,")")),this._bottomAxis.resize({height:i,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._gantt.click=function(t,e,i){o.click(t,e,i)},this._gantt.dblclick=function(t,e,i){o.dblclick(t,e,i)},this._topAxisElement=i.append("g").attr("class","top-axis-wrapper"),this._topRect=this._topAxisElement.append("rect").attr("class","top-axis-rect"),this._contentElement=i.append("g").attr("class","content-wrapper"),this._contentRect=this._contentElement.append("rect").attr("class","content-rect"),this._bottomAxisElement=i.append("g").attr("class","bottom-axis-wrapper"),this._bottomRect=this._bottomAxisElement.append("rect").attr("class","top-axis-rect"),this._topAxis.target(this._topAxisElement.node()),this._gantt.target(this._contentElement.node()).bucketHeight(30),this._bottomAxis.target(this._bottomAxisElement.node()),this.resizeWrappers(),this._gantt.zoomedHook=function(t){o.onzoom(t)}},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).render(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).render()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()},e.prototype.columns=function(e){var i=t.prototype.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(e),i},e.prototype.data=function(e){var i,o,n=t.prototype.data.apply(this,arguments);if(arguments.length>0){var r=this.data().map((function(t){var e=p([],t,!0);return e[1]=isNaN(t[1])?new Date(t[1]).getTime():Number(t[1]),e[2]=isNaN(t[2])?new Date(t[2]).getTime():Number(t[2]),e}));this._gantt._minStart=null!==(i=Math.min.apply(Math,r.map((function(t){return t[1]}))))&&void 0!==i?i:0,this._gantt._maxEnd=null!==(o=Math.max.apply(Math,r.map((function(t){return t[2]}))))&&void 0!==o?o:1,this._gantt.data(r)}return n},e.prototype.resize=function(e){var i=t.prototype.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),i},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.tooltip=function(){return this._gantt._tooltip},e}(o.SVGWidget);d.prototype._class+=" timeline_ReactAxisGantt",d.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),d.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),d.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),d.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),d.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),d.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),d.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),d.prototype.publishProxy("gutter","_gantt"),d.prototype.publishProxy("renderMode","_gantt"),d.prototype.publishProxy("strokeWidth","_gantt"),d.prototype.publishProxy("fontSize","_gantt"),d.prototype.publishProxy("fontFamily","_gantt"),d.prototype.publishProxy("stroke","_gantt"),d.prototype.publishProxy("cornerRadius","_gantt"),d.prototype.publishProxy("titleColumn","_gantt"),d.prototype.publishProxy("startDateColumn","_gantt"),d.prototype.publishProxy("endDateColumn","_gantt"),d.prototype.publishProxy("iconColumn","_gantt"),d.prototype.publishProxy("colorColumn","_gantt"),d.prototype.publishProxy("bucketColumn","_gantt"),d.prototype.publishProxy("maxZoom","_gantt"),d.prototype.publishProxy("bucketHeight","_gantt");var m=function(t){function e(){var e=t.call(this)||this;return e._topAxis=new i.Axis("origin").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._gantt=new u("origin").stroke("#000000").fitHeightToContent(!0),e._bottomAxis=new i.Axis("origin").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e.centerOverflowX_default("hidden"),e.centerOverflowY_default("auto"),e}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()},e.prototype.rangeRenderer=function(t){var e=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:e},e.prototype.resizeWrappers=function(){var t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i;this.bottomHeight(i),this._topWA.resize({width:t,height:i}),this._centerWA.resize({width:t,height:o}),this._bottomWA.resize({width:t,height:i}),this.top().render(),this.bottom().render(),this.center().render()},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._gantt.click=function(t,e,i){o.click(t,e,i)},this._gantt.dblclick=function(t,e,i){o.dblclick(t,e,i)},this.top(this._topAxis),this.center(this._gantt),this.bottom(this._bottomAxis),this.resizeWrappers(),this._gantt.zoomedHook=function(t){o.onzoom(t)}},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).lazyRender(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).lazyRender()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()},e.prototype.columns=function(e){var i=t.prototype.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(e),i},e.prototype.data=function(e){var i=t.prototype.data.apply(this,arguments);if(arguments.length>0){var n=this.data().map((function(t){var e=p([],t,!0);return e[1]=isNaN(t[1])?new Date(t[1]).getTime():Number(t[1]),e[2]=isNaN(t[2])?new Date(t[2]).getTime():Number(t[2]),e}));this._gantt._minStart=o.min(n,(function(t){return t[1]})),this._gantt._maxEnd=o.max(n,(function(t){return t[2]})),this._gantt.data(n)}return i},e.prototype.resize=function(e){var i=t.prototype.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),i},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.tooltip=function(){return this._gantt._tooltip},e}(s.Border2);m.prototype._class+=" timeline_ReactAxisGanttSeries",m.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),m.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),m.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),m.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),m.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),m.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),m.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),m.prototype.publishProxy("gutter","_gantt"),m.prototype.publishProxy("renderMode","_gantt"),m.prototype.publishProxy("strokeWidth","_gantt"),m.prototype.publishProxy("fontSize","_gantt"),m.prototype.publishProxy("fontFamily","_gantt"),m.prototype.publishProxy("stroke","_gantt"),m.prototype.publishProxy("cornerRadius","_gantt"),m.prototype.publishProxy("titleColumn","_gantt"),m.prototype.publishProxy("startDateColumn","_gantt"),m.prototype.publishProxy("endDateColumn","_gantt"),m.prototype.publishProxy("iconColumn","_gantt"),m.prototype.publishProxy("colorColumn","_gantt"),m.prototype.publishProxy("seriesColumn","_gantt"),m.prototype.publishProxy("bucketColumn","_gantt"),m.prototype.publishProxy("maxZoom","_gantt"),m.prototype.publishProxy("evenSeriesBackground","_gantt"),m.prototype.publishProxy("oddSeriesBackground","_gantt"),m.prototype.publishProxy("bucketHeight","_gantt");var _=function(t){function e(){var e=t.call(this)||this;return e._drawStartPos="origin",e._topAxis.type("time"),e._bottomAxis.type("time"),e.tooltipHTML((function(t){var i=o.timeParse("%Q"),n=i(t[1]),r=i(t[2]),s=o.timeFormat(e.tooltipTimeFormat());return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(s(n)," -> ").concat(s(r),"</div>")})),e}return l(e,t),e.prototype.update=function(e,i){if(t.prototype.update.call(this,e,i),this.timePattern_exists()){var o=1/0,n=-1/0,r="",s="";this.data().map((function(t){var e=new Date(t[1]).getTime(),i=new Date(t[2]).getTime();o>e&&(o=e,r=""+t[1]),n<i&&(n=i,s=""+t[2])})),this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._gantt._minStart=o,this._gantt._maxEnd=n}},e.prototype.tooltipHTML=function(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this},e.prototype.parseAxisValue=function(t){var e=o.timeParse("%Q")(t);return o.timeFormat(this.timePattern())(e)},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render(),this._bottomAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render()},e}(d);_.prototype._class+=" timeline_ReactTimeline",_.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),_.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip");var g=o.timeParse("%Q"),x=function(t){function e(){var e=t.call(this)||this;return e._topAxis.type("time"),e._bottomAxis.type("time"),e.tooltipHTML((function(t){var i=g(t[1]),n=g(t[2]),r=o.timeFormat(e.tooltipTimeFormat());return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(r(i)," -> ").concat(r(n),"</div>")})),e}return l(e,t),e.prototype.update=function(e,i){if(t.prototype.update.call(this,e,i),this.timePattern_exists()){var o=1/0,n=-1/0,r="",s="";this.data().forEach((function(t){var e=new Date(t[1]).getTime(),i=new Date(t[2]).getTime();o>e&&(o=e,r=""+t[1]),n<i&&(n=i,s=""+t[2])})),this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._gantt._minStart=o,this._gantt._maxEnd=n}},e.prototype.tooltipHTML=function(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this},e.prototype.parseAxisValue=function(t){var e=g(t);return o.timeFormat(this.timePattern())(e)},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render(),this._bottomAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render()},e}(m);x.prototype._class+=" timeline_ReactTimelineSeries",x.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),x.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip"),t.BUILD_VERSION="2.108.2",t.MiniGantt=c,t.PKG_NAME="@hpcc-js/timeline",t.PKG_VERSION="2.54.1",t.ReactAxisGantt=d,t.ReactAxisGanttSeries=m,t.ReactGantt=u,t.ReactTimeline=_,t.ReactTimelineSeries=x}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/chart"),require("@hpcc-js/common"),require("@hpcc-js/html"),require("@hpcc-js/react"),require("@hpcc-js/layout")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/chart","@hpcc-js/common","@hpcc-js/html","@hpcc-js/react","@hpcc-js/layout"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/timeline"]={},t["@hpcc-js/api"],t["@hpcc-js/chart"],t["@hpcc-js/common"],t["@hpcc-js/html"],t["@hpcc-js/react"],t["@hpcc-js/layout"])}(this,function(t,e,i,o,n,r,s){"use strict";var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},a(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var h=function(){return h=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},h.apply(this,arguments)};function p(t,e,i){if(i||2===arguments.length)for(var o,n=0,r=e.length;n<r;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;!function(t,e){void 0===e&&(e={});var i=e.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}(".timeline_MiniGantt .line{fill:none;stroke:#d3d3d3;opacity:.7}.timeline_MiniGantt .common_TextBox .rect{fill:#87cefa;stroke:blue;opacity:.5}.timeline_MiniGantt .buckets .entity_shape rect{stroke:#333}.timeline_MiniGantt .buckets.selected .common_EntityRect .common_Shape>rect{stroke:red}.timeline_MiniGantt .common_TextBox .rect text{fill:#000;stroke:none}.timeline_MiniGantt .over{stroke:transparent;opacity:.8}.timeline_MiniGantt rect{shape-rendering:crispEdges}");var c=function(t){function n(){var n=t.call(this)||this;return n.localRect=o.local(),n.localEntityPin=o.local(),n._title_idx=0,n._startDate_idx=1,n._endDate_idx=2,n._icon_idx=-1,n._color_idx=-1,n._yoffset_idx=-1,e.ITooltip.call(n),o.Utility.SimpleSelectionMixin.call(n),n._drawStartPos="origin",n.tooltipHTML(function(t){return"<center>".concat(t[n._title_idx],"</center><br>").concat(n.tooltipFormatter(n.brAxis.parse(t[n._startDate_idx]))," -> ").concat(n.tooltipFormatter(n.brAxis.parse(t[n._endDate_idx])))}),n.tlAxis=(new i.Axis).type("time"),n.brAxis=(new i.Axis).type("time"),n.verticalBands=o.scaleBand().paddingOuter(.2).paddingInner(.2),n}return l(n,t),n.prototype.isHorizontal=function(){return"horizontal"===this.orientation()},n.prototype.fullExtent=function(){var t=this,e=p(p([],this.data().map(function(e){return e[t._startDate_idx]}),!0),this.data().filter(function(e){return!!e[t._endDate_idx]}).map(function(e){return e[t._endDate_idx]}),!0);return o.extent(e)},n.prototype.extent=function(){var t=this.rootExtent?[this.rootExtent[1],this.rootExtent[2]]:this.fullExtent();if(void 0!==t[0]&&void 0!==t[1]&&(t[0]===t[1]||this.centerOnMostRecent())){var e=o.timeParse(this.timePattern()),i=o.timeFormat(this.timePattern()),n=e(t[0]),r=e(t[1]);if(t[0]===t[1])t[0]=i(new Date(n.setFullYear(n.getFullYear()-1))),t[1]=i(new Date(n.setFullYear(n.getFullYear()+2)));else{var s=n.getTime(),a=r.getTime()-s;t[0]=i(n),t[1]=i(new Date(s+2*a))}}return t},n.prototype.dataStartPos=function(t){if(void 0!==this._dateCache[t[this._startDate_idx]])return this._dateCache[t[this._startDate_idx]];var e=this.brAxis.scalePos(t[this._startDate_idx]);return this._dateCache[t[this._startDate_idx]]=e,e},n.prototype.dataEndPos=function(t){if(void 0!==this._dateCache[t[this._endDate_idx]])return this._dateCache[t[this._endDate_idx]];var e=this.brAxis.scalePos(t[this._endDate_idx]);return this._dateCache[t[this._endDate_idx]]=e,e},n.prototype.dataWidth=function(t){return this.dataEndPos(t)-this.dataStartPos(t)},n.prototype.resetZoom=function(){this._zoom.transform(this.element(),o.zoomIdentity.translate(0,this.isHorizontal()?0:this.height()))},n.prototype.zoomed=function(){this.transform=o.d3Event().transform,this.render()},n.prototype.enter=function(e,i){var n=this;t.prototype.enter.call(this,e,i),this._zoom=o.zoom().scaleExtent([0,this.maxZoom()]).on("zoom",function(){n.zoomed()}),this.background=i.append("rect").attr("fill","white").attr("opacity",0).on("dblclick",function(){o.d3Event().stopPropagation(),delete n.rootExtent,n.resetZoom()}),this.gUpperContent=i.append("g").attr("class","gUpperContent"),this.gUpperAxis=i.append("g").attr("class","gUpperAxis"),this.gMiddleContent=i.append("g").attr("class","gMiddleContent"),this.gLowerAxis=i.append("g").attr("class","gLowerAxis"),this.gLowerContent=i.append("g").attr("class","gLowerContent"),this.tlAxis.target(this.gUpperAxis.node()).tickFormat(this.tickFormat()).guideTarget(this.gUpperAxis.append("g").node()).shrinkToFit("none").overlapMode(this.tickFormat_exists()?"stagger":"none").extend(.1),this.brAxis.target(this.gLowerAxis.node()).tickFormat(this.tickFormat()).guideTarget(this.gLowerAxis.append("g").node()).shrinkToFit("none").overlapMode(this.tickFormat_exists()?"stagger":"none").extend(.1),i.call(this._zoom),this._selection.widgetElement(this.gMiddleContent)},n.prototype.update=function(e,i){var n=this;if(t.prototype.update.call(this,e,i),this._dateCache={},this._title_idx=null!==this.titleColumn()?this.columns().indexOf(this.titleColumn()):this._title_idx,this._startDate_idx=null!==this.startDateColumn()?this.columns().indexOf(this.startDateColumn()):this._startDate_idx,this._endDate_idx=null!==this.endDateColumn()?this.columns().indexOf(this.endDateColumn()):this._endDate_idx,this._icon_idx=null!==this.iconColumn()?this.columns().indexOf(this.iconColumn()):this._icon_idx,this._color_idx=null!==this.colorColumn()?this.columns().indexOf(this.colorColumn()):this._color_idx,this._yoffset_idx=null!==this.yOffsetColumn()?this.columns().indexOf(this.yOffsetColumn()):this._yoffset_idx,this._prevIsHorizontal!==this.isHorizontal())return this._prevIsHorizontal=this.isHorizontal(),void this.resetZoom();this.tooltipFormatter=o.timeFormat(this.tooltipTimeFormat());var r=this.width(),s=this.height();this.background.attr("x",0).attr("y",0).attr("width",r).attr("height",s);var a=this.extent();if(this.tlAxis.x(r/2).orientation(this.isHorizontal()?"top":"left").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(r-1).low(a[0]).high(a[1]).updateScale(),this.brAxis.x(r/2).y(s/2).orientation(this.isHorizontal()?"bottom":"right").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(r-1).height(s).low(a[0]).high(a[1]).updateScale(),this.transform){var l=void 0,h=void 0;this.isHorizontal()?(l=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(0))),h=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(r-1)))):(l=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(0))),h=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(s-1)))),this.tlAxis.low(l).high(h).updateScale(),this.brAxis.low(l).high(h).updateScale()}var p=this.data().sort(this.isHorizontal()?function(t,e){var i=n.brAxis.scalePos(t[1])-n.brAxis.scalePos(e[1]);return 0===i?(""+t[0]).localeCompare(""+e[0]):i}:function(t,e){return n.brAxis.scalePos(e[1])-n.brAxis.scalePos(t[1])}),c=p.filter(function(t){return!t[n._endDate_idx]}),u=p.filter(function(t){return!!t[n._endDate_idx]});this.tlAxis.render(),this.brAxis.render();var d=this.brAxis.getBBox(),m=this.updateEntityPins(c),_=d.height,g=s-m,x=-1!==this._yoffset_idx?Math.min.apply(void 0,this.data().filter(function(t){return!isNaN(t[n._yoffset_idx])}).map(function(t){return t[n._yoffset_idx]})):0;if(c.length>0&&0===u.length){this.tlAxis.visible(!1);var f=m/4;f>s/2-_&&(f=s/2-_);var y=s/2+f,b=-1*(s/2-_-f),v=0!==x?x/2:0;this.gUpperContent.attr("transform","translate(0, ".concat(y-v,")")),this.gLowerAxis.attr("transform","translate(0, ".concat(b-v,")"))}else 0===c.length&&u.length>0?(this.tlAxis.visible(!0),this.gUpperContent.attr("transform","translate(0, ".concat(m,")")),this.gUpperAxis.attr("transform","translate(0, ".concat(m,")"))):(m-=x,g+=x,this.tlAxis.visible(!0),this.gUpperContent.attr("transform","translate(0, ".concat(m,")")),this.gUpperAxis.attr("transform","translate(0, ".concat(m,")")),this.gMiddleContent.attr("transform","translate(0, ".concat(m,")")));this.tlAxis.render();for(var k=this.tlAxis.getBBox(),C=[],w={},F=0,S=u;F<S.length;F++){for(var A=S[F],z=0;z<C.length;++z){var P=C[z];if(P.endPos+this.overlapTolerence()<=this.dataStartPos(A)){w[A]=z,P.endPos=this.dataEndPos(A);break}}void 0===w[A]&&(w[A]=C.length,C.push({endPos:this.dataEndPos(A)}))}var T=this.isHorizontal()?0+k.height:0+k.width,M=this.isHorizontal()?g-d.height:r-d.width;this.verticalBands.range([T,M]).domain(C.map(function(t,e){return e})),u.length>0&&this.updateEventRanges(c,u,w,g,k,d,r)},n.prototype.updateEntityPins=function(t){for(var e=0,i=this,n=this.gUpperContent.selectAll(".entity_pin").data(t,function(t){return t[0]+":"+t[1]}),r=this.eventFontColorColumn()?this.columns().indexOf(this.eventFontColorColumn()):-1,s=this.eventBorderColorColumn()?this.columns().indexOf(this.eventBorderColorColumn()):-1,a=this.eventBackgroundColorColumn()?this.columns().indexOf(this.eventBackgroundColorColumn()):-1,l={},h=0,p=t;h<p.length;h++){var c=p[h],u=void 0!==c[i._title_idx]?c[i._title_idx]:c[0];l[u]=l[u]?l[u]+1:1}var d=Object.keys(l),m=i.eventGroupOffset(),_=n.enter().append("g").attr("class","entity_pin");_.append("line").attr("class","entity_line"),_.on("mouseover",function(t){o.select(this).raise()}).each(function(t,e){var n=(new o.EntityPin).target(this).icon("").iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).iconDiameter(18).iconPaddingPercent(1).titleFontSize(14).descriptionColor("#333").descriptionFontSize(15).iconColor(-1===r?"#333":t[r]).titleColor(-1===r?"#333":t[r]).descriptionColor(-1===r?"#333":t[r]).backgroundShape("pin").backgroundColorFill(-1===r?"#f8f8f8":t[a]).backgroundColorStroke(-1===r?"#ccc":t[s]).cornerRadius(5).arrowHeight(10).arrowWidth(16);i.localEntityPin.set(this,n)}).merge(n).each(function(t,n){var a=i.localEntityPin.get(this),l=void 0!==t[i._title_idx]?t[i._title_idx]:a.title(),h=i.dataStartPos(t)-0,p=d.indexOf(l)%i.eventGroupMod()*m-5;if(void 0!==t[i._yoffset_idx]&&(p+=t[i._yoffset_idx]?t[i._yoffset_idx]:0),t[i._title_idx]!==a.title()&&t[i._startDate_idx]!==a.description()){var c=i.brAxis.parse(t[i._startDate_idx]),u=i.tooltipFormatter(c);a.x(h).y(p).iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).icon(void 0!==t[i._icon_idx]?t[i._icon_idx]:a.icon()).title(l).description(u).animationFrameRender()}else a.move({x:h,y:p});var _=a.calcHeight();e<_&&(e=_),o.select(this).selectAll(".entity_line").attr("x1",h).attr("x2",h).attr("y1",0).attr("y2",p).style("stroke",-1===r?"#ccc":t[s]).style("stroke-width",1)}),n.exit().each(function(t,e){i.localEntityPin.get(this).target(null)}).remove();var g=Math.abs(Math.min(t.length,i.eventGroupMod())*i.eventGroupOffset());return e+g},n.prototype.updateEventRanges=function(t,e,i,n,r,s,a){var l=this,h=this,p=this.gMiddleContent.selectAll(".line").data(t,function(t){return t[h._title_idx]});p.enter().append("line").attr("class","line").merge(p).attr(this.isHorizontal()?"x1":"y1",function(t){return l.dataStartPos(t)-0}).attr(this.isHorizontal()?"x2":"y2",function(t){return l.dataStartPos(t)-0}).attr(this.isHorizontal()?"y1":"x1",this.isHorizontal()?r.height:r.width).attr(this.isHorizontal()?"y2":"x2",this.isHorizontal()?n-s.height:a-s.width),p.exit().remove();var c=this.gMiddleContent.selectAll(".buckets").data(e,function(t){return t[h._title_idx]});c.enter().append("g").attr("class","buckets").call(this._selection.enter.bind(this._selection)).each(function(t){var e=(new o.EntityRect).target(this).iconDiameter(28).iconPaddingPercent(0).titleFontSize(28).titleColor(h.rangeFontColor()).descriptionColor(h.rangeFontColor()).iconColor(h.rangeFontColor()).backgroundShape("rect").backgroundColorFill(t[h._color_idx]);h.localRect.set(this,e),h.enterEntityRect(e,t)}).on("click",function(t){h.click(h.rowToObj(t),"range",h._selection.selected(this))},!1).on("dblclick",function(t){h.rootExtent=t,h.resetZoom(),h.dblclick(h.rowToObj(t),"range",h._selection.selected(this))},!0).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(c).attr("transform",function(t){return h.isHorizontal()?"translate(".concat(l.dataStartPos(t),", ").concat(l.verticalBands(i[t]),") "):"translate(".concat(l.verticalBands(i[t]),", ").concat(l.dataStartPos(t),") ")}).each(function(t){var e=h.localRect.get(this),i=h.dataWidth(t)/2,o=h.verticalBands.bandwidth()/2,n=Math.max(h.dataWidth(t),2),r=Math.max(h.verticalBands.bandwidth(),2),s=.191*r,a=.618*r,l=a;e.pos(h.isHorizontal()?{x:i,y:o}:{x:o,y:i}).fixedHeight(h.isHorizontal()?r:n).fixedWidth(h.isHorizontal()?n:r).icon(void 0!==t[h._icon_idx]?t[h._icon_idx]:"").title(void 0!==t[h._title_idx]?t[h._title_idx]:"").padding(s).iconDiameter(l).titleFontSize(a),1.5*l>n&&e.icon(null),h.updateEntityRect(e,t[h._icon_idx]),e.render()}),c.exit().remove()},n.prototype.exit=function(e,i){this.brAxis.target(null),this.tlAxis.target(null),t.prototype.exit.call(this,e,i)},n.prototype.click=function(t,e,i){},n.prototype.dblclick=function(t,e,i){},n.prototype.enterEntityRect=function(t,e){},n.prototype.updateEntityRect=function(t,e){},n}(o.SVGWidget);c.prototype._class+=" timeline_MiniGantt",c.prototype.implements(e.ITooltip.prototype),c.prototype.mixin(o.Utility.SimpleSelectionMixin),c.prototype.publish("timePattern","%Y-%m-%d","string","timePattern"),c.prototype.publish("tickFormat",null,"string","tickFormat",void 0,{optional:!0}),c.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","tooltipTimeFormat"),c.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),c.prototype.publish("orientation","horizontal","set","orientation",["horizontal","vertical"]),c.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),c.prototype.publish("titleColumn",null,"string","titleColumn"),c.prototype.publish("startDateColumn",null,"string","startDateColumn"),c.prototype.publish("endDateColumn",null,"string","endDateColumn"),c.prototype.publish("iconColumn",null,"string","iconColumn"),c.prototype.publish("colorColumn",null,"string","colorColumn"),c.prototype.publish("yOffsetColumn",null,"string","yOffsetColumn"),c.prototype.publish("maxZoom",16,"number","maxZoom"),c.prototype.publish("eventGroupOffset",-50,"number","eventGroupOffset"),c.prototype.publish("eventGroupMod",5,"number","eventGroupMod"),c.prototype.publish("eventFontColorColumn",null,"string","eventFontColorColumn"),c.prototype.publish("eventBorderColorColumn",null,"string","eventBorderColorColumn"),c.prototype.publish("eventBackgroundColorColumn",null,"string","eventBackgroundColorColumn"),c.prototype.publish("hideIconWhenCollapsed",!1,"boolean","hideIconWhenCollapsed"),c.prototype.publish("hideTitleWhenCollapsed",!1,"boolean","hideTitleWhenCollapsed"),c.prototype.publish("hideDescriptionWhenCollapsed",!1,"boolean","hideDescriptionWhenCollapsed"),c.prototype.publish("hideAnnotationsWhenCollapsed",!0,"boolean","hideAnnotationsWhenCollapsed"),c.prototype.publish("centerOnMostRecent",!1,"boolean","If true, the timeline will be centered on the most recent data point");var u=function(t){function e(e){void 0===e&&(e="origin");var i=t.call(this)||this;return i._selection=new o.Utility.Selection(i),i._title_idx=0,i._startDate_idx=1,i._endDate_idx=2,i._icon_idx=-1,i._color_idx=-1,i._series_idx=-1,i._bucket_idx=-1,i._yoffset_idx=-1,i._rangeOptions={rangePadding:2,fontFamily:"Verdana",fontSize:12,fill:"white",stroke:"black",textFill:"black",cornerRadius:3,strokeWidth:0},i._rangeRenderer=r.LabelledRect,i._transform={k:1,x:0,y:0},i._drawStartPos=e,i.showToolbar_default(!1),i._tooltip=new n.HTMLTooltip,i._tooltip.tooltipHTML(function(t){return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(t[1]," -> ").concat(t[2],"</div>")}),i._tooltip.followCursor(!0),i}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._selection.set(t),this):this._selection.get()},e.prototype.rangeRenderer=function(t){return arguments.length?(this._rangeRenderer=t,this._rangeRenderer):this._rangeRenderer},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.on("click",function(t){o._selection.clear()}),this._tooltip.target(e)},e.prototype.update=function(e,i){var n=this;t.prototype.update.call(this,e,i),this.zoomExtent([.05,this.maxZoom()]),this._title_idx=null!==this.titleColumn()?this.columns().indexOf(this.titleColumn()):this._title_idx,this._startDate_idx=null!==this.startDateColumn()?this.columns().indexOf(this.startDateColumn()):this._startDate_idx,this._endDate_idx=null!==this.endDateColumn()?this.columns().indexOf(this.endDateColumn()):this._endDate_idx,this._icon_idx=null!==this.iconColumn()?this.columns().indexOf(this.iconColumn()):this._icon_idx,this._color_idx=null!==this.colorColumn()?this.columns().indexOf(this.colorColumn()):this._color_idx,this._series_idx=null!==this.seriesColumn()?this.columns().indexOf(this.seriesColumn()):this._series_idx,this._bucket_idx=null!==this.bucketColumn()?this.columns().indexOf(this.bucketColumn()):-1;var r=this,s=this.width(),a=s;if(this._interpolateX=o.scaleLinear().domain([this._minStart,this._maxEnd]).range([0,a]),this.data().sort(function(t,e){return t[1]-e[1]}),this._series_idx>-1){this._origIdxMap={},this._dataBySeries={},this._bucketsBySeries={},this.data().forEach(function(t,e){var i=t[n._series_idx];n._dataBySeries[i]||(n._origIdxMap[i]={},n._dataBySeries[i]=[]),n._dataBySeries[i].push({dataRow:t,origIdx:e})});var l=this.gutter(),p=0,c=Object.keys(this._dataBySeries);c.forEach(function(t){n._dataBySeries[t].sort(function(t,e){return t.dataRow[1]-e.dataRow[1]}),n._bucketsBySeries[t]=n.calcBuckets(n._dataBySeries[t].map(function(t){return t.dataRow}),1,2),n._bucketsBySeries[t].bucketHeight=n.bucketHeight(),n._bucketsBySeries[t].bucketOffset=p,p+=(n._bucketsBySeries[t].bucketHeight+n.strokeWidth()+n.gutter())*(n._bucketsBySeries[t].maxBucket+1),n._dataBySeries[t].forEach(function(e,i){n._origIdxMap[t][e.origIdx]=i})}),this._seriesBackgrounds=this._renderElement.selectAll(".series-background").data(c.map(function(t){return n._bucketsBySeries[t]})),this._seriesBackgrounds.join(function(t){return t.append("rect").attr("class","series-background")},function(t){return t},function(t){return t.each(function(t){delete t.element}).remove()}).attr("opacity",function(t){return t.props&&t.props.hidden?0:1}).each(function(t,e){o.select(this).attr("x",0).attr("y",t.bucketOffset-l/2).attr("width",s).attr("height",(t.bucketHeight+l)*(t.maxBucket+1)+l).attr("fill",e%2?r.oddSeriesBackground():r.evenSeriesBackground())})}else-1!==this._bucket_idx?this._buckets=this.calcBuckets(this.data(),this._startDate_idx,this._endDate_idx,this._bucket_idx):this._buckets=this.calcBuckets(this.data(),this._startDate_idx,this._endDate_idx);var u=this._interpolateX(this._minStart);this.zoomTo([u,0],1);var d=this.bucketHeight();this.setRangeOptions(),this._maxFontScale=d-2*this.rangePadding(),this.measureDataText();var m=this._renderElement.selectAll(".item").data(this.data()),_=this.strokeWidth(),g=2*_;m.join(function(t){return t.append("g").attr("class","item").on("click.selectionBag",function(t,e){var i=void 0===t.id?e:t.id;r._selection.isSelected({_id:i,element:t.element})?r._selection.clear():r._selection.click({_id:i,element:function(){return t.element}},o.d3Event),r.selectionChanged(),o.d3Event().stopPropagation()}).on("click",function(t){var e=t.element.classed("selected");t[r.columns().length]&&(t.__lparam=t[r.columns().length]),r.click(t,"",e)}).on("dblclick",function(t){var e=t.element.classed("selected");t[r.columns().length]&&(t.__lparam=t[r.columns().length]),r.click(t,"",e)}).on("mousein",function(t){r.highlightItem(o.select(this),t);var e=t.element.classed("selected");r.mousein(t,"",e)}).on("mouseover",function(t){var e=o.d3Event();r._tooltip._triggerElement=t.element,r._tooltip._cursorLoc=[e.clientX,e.clientY],r._tooltip.data(t).visible(!0).fitContent(!0).render(),r.highlightItem(o.select(this),t);var i=t.element.classed("selected");r.mouseover(t,"",i)}).on("mouseout",function(t){r._tooltip.visible(!1).render(),r.highlightItem(null,null);var e=t.element.classed("selected");r.mouseout(t,"",e)}).each(function(t,e){t.that=this,t.element=o.select(this),t.x=r._interpolateX(t[1]);var i=r._interpolateX(t[2]);if(r._series_idx>-1){var n=t[r._series_idx],s=r._bucketsBySeries[n].bucketMap[r._origIdxMap[n][e]];t.y=r._bucketsBySeries[n].interpolateY(s)+r._bucketsBySeries[n].bucketOffset}else{var a=-1===r._bucket_idx?e:t[r._bucket_idx];t.y=r._buckets.interpolateY(r._buckets.bucketMap[a])}t.props=h(h({},t[3]),{text:t[0]}),t.props.width=i-t.x,t.props.height=d,t.x+=_,t.y+=_,t.props.width-=g,t.props.height-=g,t.element.attr("transform","translate(".concat(t.x+t.props.width/2," ").concat(t.y+t.props.height/2,")"))})},function(t){return t},function(t){return t.each(function(t){delete t.element}).remove()}).attr("opacity",function(t){return t.props&&t.props.hidden?0:1}).each(function(t,e){if(t.that=this,r._series_idx>-1){var i=t[r._series_idx];t.x=r.renderRangeElement(t,e,!1,r._rangeOptions,i)}else t.x=r.renderRangeElement(t,e,!1,r._rangeOptions)}).on("dblclick.zoom",function(t){var e=n._interpolateX(t[1]),i=n._interpolateX(t[2]),o=s/(i-e);n.zoomTo([-e*o,0],o)}),i.on("dblclick.zoom",null)},e.prototype.renderRangeElement=function(t,e,i,n,s){void 0===i&&(i=!1),void 0===n&&(n={});var a,l,p=n.strokeWidth,c=2*p,u=n.rangePadding,d=isNaN(this._transform.x)?0:this._transform.x,m=isNaN(this._transform.k)?1:this._transform.k,_=this.bucketHeight();t.that.setAttribute("data-series",s),this._color_idx>-1&&t.that.setAttribute("data-color",t[this._color_idx]),void 0!==s?(l=this._bucketsBySeries[s].bucketMap[this._origIdxMap[s][e]],t.that.setAttribute("data-b",l),t.that.setAttribute("data-bucketOffset",this._bucketsBySeries[s].bucketOffset),t.y=this._bucketsBySeries[s].interpolateY(l)+this._bucketsBySeries[s].bucketOffset,t.that.setAttribute("data-dy",t.y)):(l=this._buckets.bucketMap[e],t.y=this._buckets.interpolateY(l)),this._color_idx>-1&&(n.fill=t[this._color_idx]),i?(t.x=this._interpolateX(t[1])*m,a=this._interpolateX(t[2])*m,t.props=h(h({},t[3]),{text:t[0]}),t.props.width=(a-t.x)/m,t.x+=d,t.props.width*=m):(t.x=this._interpolateX(t[1]),a=this._interpolateX(t[2]),t.props=h(h({},t[3]),{text:t[0]}),t.props.width=(a-t.x)/m),t.props.height=_,void 0===s&&this._buckets.bucketScale<1&&(t.props.height=this._buckets.bucketScale*_),void 0===t.element&&t.that&&(t.element=o.select(t.that)),t.element.attr("transform","translate(".concat(t.x+t.props.width/2," ").concat(t.y+t.props.height/2,")")),t.x+=p,t.y+=p,t.props.width-=c,t.props.height-=c,t.props.width=t.props.width<1?1:t.props.width,t.props.height=t.props.height<1?1:t.props.height;var g=this.truncateText(t.props.text,t.props.width-u,this._maxFontScale);g!==t.props.text?g=this.truncateText(t.props.text,t.props.width-u):t.props.fontSize=this._maxFontScale*n.fontSize,void 0===s&&this._buckets.bucketScale<1&&(t.props.fontSize=Math.min(this._maxFontScale,this._buckets.bucketScale)*n.fontSize),(!this._maxY||this._maxY<t.y+t.props.height)&&(this._maxY=t.y+t.props.height),(!this._maxX||this._maxX<t.x+t.props.width)&&(this._maxX=t.x+t.props.width),r.render(this._rangeRenderer,h(h(h({},n),t.props),{text:g}),t.that)},e.prototype.setRangeOptions=function(){this._rangeOptions={rangePadding:this.rangePadding(),fontFamily:this.fontFamily(),fontSize:this.fontSize(),strokeWidth:this.strokeWidth(),fill:this.fill(),stroke:this.stroke(),textFill:this.rangeFontColor(),cornerRadius:this.cornerRadius()}},e.prototype.zoomed=function(t){var e=this;if(this._transform=t,"scale-all"===this.renderMode())this._zoomScale=t.k,this._zoomTranslate=[t.x,0],this._zoomG.attr("transform","translate(".concat(t.x," ").concat(0,")scale(").concat(t.k," 1)"));else{var i=this._rangeOptions;this.data().forEach(function(t,o){if(e._color_idx>-1&&(i.fill=t[e._color_idx]),e._series_idx>-1){var n=t[e._series_idx];e.renderRangeElement(t,o,!0,i,n)}else e.renderRangeElement(t,o,!0,i)})}this.zoomedHook(t)},e.prototype.zoomedHook=function(t){},e.prototype.calcBuckets=function(t,e,i,n){var r={},s={},a=this.overlapTolerence(),l=[{end:-1/0}],h=0;void 0!==n?(t.forEach(function(t,e){r[e]=t[n],s[t[n]]=!0}),h=Object.keys(s).length):t.forEach(function(t,o){for(var n=0;n<l.length;++n)if(0===o||l[n][i]+a<=t[e]){r[o]=n,h<n&&(h=n),l[n][i]=t[i];break}if(void 0===r[o]){r[o]=l.length;var s={};s[i]=t[i],l.push(s)}h<r[o]&&(h=r[o])});var p=(h+1)*(this.bucketHeight()+this.gutter());return{bucketMap:r,maxBucket:h,bucketScale:this.height()/p,interpolateY:o.scaleLinear().domain([0,h+1]).range([0,Math.min(this.height(),p)])}},e.prototype.data=function(e){var i,o,n=t.prototype.data.apply(this,arguments);return arguments.length>0&&(this._minStart=null!==(i=Math.min.apply(Math,this.data().map(function(t){return t[1]})))&&void 0!==i?i:0,this._maxEnd=null!==(o=Math.max.apply(Math,this.data().map(function(t){return t[2]})))&&void 0!==o?o:1,this.measureDataText(!0)),n},e.prototype.measureDataText=function(t){void 0===t&&(t=!1);var e={},i={},n=this.fontFamily(),r=this.fontSize(),s=this.bucketHeight();s&&(this._maxFontScale=(s-2*this.rangePadding())/r),(t||this._prevFontFamily!==n||this._prevFontSize!==r)&&(i["."]=o.Utility.textSize(".",n,r).width,this.data().forEach(function(t){e[t[0]]||(e[t[0]]=o.Utility.textSize(t[0],n,r).width),t[0].split("").forEach(function(t){i[t]||(i[t]=o.Utility.textSize(t,n,r).width)})}),this._textWidths=e,this._characterWidths=i),this._prevFontFamily=n,this._prevFontSize=r},e.prototype.truncateText=function(t,e,i){if(void 0===i&&(i=1),this._textWidths[t]*i<e)return t;for(var o="",n=0,r=e-3*this._characterWidths["."],s=0,a=t;s<a.length;s++){var l=a[s];if(!((n+=this._characterWidths[l])<r))break;o+=l}return r<0?"":o+"..."},e.prototype.resize=function(e){return this.fitWidthToContent()||this.fitHeightToContent()?t.prototype.resize.call(this,{width:e.width,height:this._maxY}):t.prototype.resize.apply(this,arguments)},e.prototype.selectionChanged=function(){},e.prototype.highlightItem=function(t,e){},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.mousein=function(t,e,i){},e.prototype.mouseover=function(t,e,i){},e.prototype.mouseout=function(t,e,i){},e}(o.SVGZoomWidget);u.prototype._class+=" timeline_ReactGantt",u.prototype.publish("fitWidthToContent",!1,"boolean","If true, resize will simply reapply the bounding box width"),u.prototype.publish("fitHeightToContent",!1,"boolean","If true, resize will simply reapply the bounding box height"),u.prototype.publish("titleColumn",null,"string","Column name to for the title"),u.prototype.publish("startDateColumn",null,"string","Column name to for the start date"),u.prototype.publish("endDateColumn",null,"string","Column name to for the end date"),u.prototype.publish("iconColumn",null,"string","Column name to for the icon"),u.prototype.publish("colorColumn",null,"string","Column name to for the color"),u.prototype.publish("seriesColumn",null,"string","Column name to for the series identifier"),u.prototype.publish("bucketColumn",null,"string","Column name to for the bucket identifier"),u.prototype.publish("renderMode","default","set","Render modes vary in features and performance",["default","scale-all"]),u.prototype.publish("rangePadding",3,"number","Padding within each range rectangle (pixels)"),u.prototype.publish("fill","#1f77b4","string","Background color of range rectangle"),u.prototype.publish("stroke",null,"string","Color of range rectangle border"),u.prototype.publish("strokeWidth",null,"number","Width of range rectangle border (pixels)"),u.prototype.publish("cornerRadius",3,"number","Space between range buckets (pixels)"),u.prototype.publish("fontFamily",null,"string","Font family within range rectangle",null,{optional:!0}),u.prototype.publish("fontSize",10,"number","Size of font within range rectangle (pixels)"),u.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),u.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),u.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),u.prototype.publish("bucketHeight",100,"number","Max height of range element (pixels)"),u.prototype.publish("gutter",2,"number","Space between range buckets (pixels)"),u.prototype.publish("maxZoom",16,"number","Maximum zoom"),u.prototype.publish("evenSeriesBackground","#FFFFFF","html-color","Background color of even series rows"),u.prototype.publish("oddSeriesBackground","#DDDDDD","html-color","Background color of odd series rows");var d=function(t){function e(){var e=t.call(this)||this;return e._topAxis=new i.Axis("center").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._gantt=new u("center").stroke("#000000"),e._bottomAxis=new i.Axis("center").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._drawStartPos="origin",e.rangeRenderer=function(){var t=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:t},e}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()},e.prototype.resizeWrappers=function(){var t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i,n=this.strokeWidth();this._topRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._topAxisElement.attr("transform","translate(0 0)"),this._topAxis.resize({height:i,width:t}),this._contentRect.attr("height",o).attr("width",t).attr("fill","transparent"),this._contentElement.attr("transform","translate(0 ".concat(i+n,")")),this._gantt.resize({height:o,width:t}),this._bottomRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._bottomAxisElement.attr("transform","translate(0 ".concat(i+o+n,")")),this._bottomAxis.resize({height:i,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._gantt.click=function(t,e,i){o.click(t,e,i)},this._gantt.dblclick=function(t,e,i){o.dblclick(t,e,i)},this._topAxisElement=i.append("g").attr("class","top-axis-wrapper"),this._topRect=this._topAxisElement.append("rect").attr("class","top-axis-rect"),this._contentElement=i.append("g").attr("class","content-wrapper"),this._contentRect=this._contentElement.append("rect").attr("class","content-rect"),this._bottomAxisElement=i.append("g").attr("class","bottom-axis-wrapper"),this._bottomRect=this._bottomAxisElement.append("rect").attr("class","top-axis-rect"),this._topAxis.target(this._topAxisElement.node()),this._gantt.target(this._contentElement.node()).bucketHeight(30),this._bottomAxis.target(this._bottomAxisElement.node()),this.resizeWrappers(),this._gantt.zoomedHook=function(t){o.onzoom(t)}},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).render(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).render()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()},e.prototype.columns=function(e){var i=t.prototype.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(e),i},e.prototype.data=function(e){var i,o,n=t.prototype.data.apply(this,arguments);if(arguments.length>0){var r=this.data().map(function(t){var e=p([],t,!0);return e[1]=isNaN(t[1])?new Date(t[1]).getTime():Number(t[1]),e[2]=isNaN(t[2])?new Date(t[2]).getTime():Number(t[2]),e});this._gantt._minStart=null!==(i=Math.min.apply(Math,r.map(function(t){return t[1]})))&&void 0!==i?i:0,this._gantt._maxEnd=null!==(o=Math.max.apply(Math,r.map(function(t){return t[2]})))&&void 0!==o?o:1,this._gantt.data(r)}return n},e.prototype.resize=function(e){var i=t.prototype.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),i},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.tooltip=function(){return this._gantt._tooltip},e}(o.SVGWidget);d.prototype._class+=" timeline_ReactAxisGantt",d.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),d.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),d.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),d.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),d.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),d.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),d.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),d.prototype.publishProxy("gutter","_gantt"),d.prototype.publishProxy("renderMode","_gantt"),d.prototype.publishProxy("strokeWidth","_gantt"),d.prototype.publishProxy("fontSize","_gantt"),d.prototype.publishProxy("fontFamily","_gantt"),d.prototype.publishProxy("stroke","_gantt"),d.prototype.publishProxy("cornerRadius","_gantt"),d.prototype.publishProxy("titleColumn","_gantt"),d.prototype.publishProxy("startDateColumn","_gantt"),d.prototype.publishProxy("endDateColumn","_gantt"),d.prototype.publishProxy("iconColumn","_gantt"),d.prototype.publishProxy("colorColumn","_gantt"),d.prototype.publishProxy("bucketColumn","_gantt"),d.prototype.publishProxy("maxZoom","_gantt"),d.prototype.publishProxy("bucketHeight","_gantt");var m=function(t){function e(){var e=t.call(this)||this;return e._topAxis=new i.Axis("origin").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e._gantt=new u("origin").stroke("#000000").fitHeightToContent(!0),e._bottomAxis=new i.Axis("origin").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d"),e.centerOverflowX_default("hidden"),e.centerOverflowY_default("auto"),e}return l(e,t),e.prototype.selection=function(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()},e.prototype.rangeRenderer=function(t){var e=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:e},e.prototype.resizeWrappers=function(){var t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i;this.bottomHeight(i),this._topWA.resize({width:t,height:i}),this._centerWA.resize({width:t,height:o}),this._bottomWA.resize({width:t,height:i}),this.top().render(),this.bottom().render(),this.center().render()},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._gantt.click=function(t,e,i){o.click(t,e,i)},this._gantt.dblclick=function(t,e,i){o.dblclick(t,e,i)},this.top(this._topAxis),this.center(this._gantt),this.bottom(this._bottomAxis),this.resizeWrappers(),this._gantt.zoomedHook=function(t){o.onzoom(t)}},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).lazyRender(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(r).high(s).lazyRender()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()},e.prototype.columns=function(e){var i=t.prototype.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(e),i},e.prototype.data=function(e){var i=t.prototype.data.apply(this,arguments);if(arguments.length>0){var n=this.data().map(function(t){var e=p([],t,!0);return e[1]=isNaN(t[1])?new Date(t[1]).getTime():Number(t[1]),e[2]=isNaN(t[2])?new Date(t[2]).getTime():Number(t[2]),e});this._gantt._minStart=o.min(n,function(t){return t[1]}),this._gantt._maxEnd=o.max(n,function(t){return t[2]}),this._gantt.data(n)}return i},e.prototype.resize=function(e){var i=t.prototype.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),i},e.prototype.click=function(t,e,i){},e.prototype.dblclick=function(t,e,i){},e.prototype.tooltip=function(){return this._gantt._tooltip},e}(s.Border2);m.prototype._class+=" timeline_ReactAxisGanttSeries",m.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),m.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),m.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),m.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),m.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),m.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),m.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),m.prototype.publishProxy("gutter","_gantt"),m.prototype.publishProxy("renderMode","_gantt"),m.prototype.publishProxy("strokeWidth","_gantt"),m.prototype.publishProxy("fontSize","_gantt"),m.prototype.publishProxy("fontFamily","_gantt"),m.prototype.publishProxy("stroke","_gantt"),m.prototype.publishProxy("cornerRadius","_gantt"),m.prototype.publishProxy("titleColumn","_gantt"),m.prototype.publishProxy("startDateColumn","_gantt"),m.prototype.publishProxy("endDateColumn","_gantt"),m.prototype.publishProxy("iconColumn","_gantt"),m.prototype.publishProxy("colorColumn","_gantt"),m.prototype.publishProxy("seriesColumn","_gantt"),m.prototype.publishProxy("bucketColumn","_gantt"),m.prototype.publishProxy("maxZoom","_gantt"),m.prototype.publishProxy("evenSeriesBackground","_gantt"),m.prototype.publishProxy("oddSeriesBackground","_gantt"),m.prototype.publishProxy("bucketHeight","_gantt");var _=function(t){function e(){var e=t.call(this)||this;return e._drawStartPos="origin",e._topAxis.type("time"),e._bottomAxis.type("time"),e.tooltipHTML(function(t){var i=o.timeParse("%Q"),n=i(t[1]),r=i(t[2]),s=o.timeFormat(e.tooltipTimeFormat());return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(s(n)," -> ").concat(s(r),"</div>")}),e}return l(e,t),e.prototype.update=function(e,i){if(t.prototype.update.call(this,e,i),this.timePattern_exists()){var o=1/0,n=-1/0,r="",s="";this.data().map(function(t){var e=new Date(t[1]).getTime(),i=new Date(t[2]).getTime();o>e&&(o=e,r=""+t[1]),n<i&&(n=i,s=""+t[2])}),this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._gantt._minStart=o,this._gantt._maxEnd=n}},e.prototype.tooltipHTML=function(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this},e.prototype.parseAxisValue=function(t){var e=o.timeParse("%Q")(t);return o.timeFormat(this.timePattern())(e)},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render(),this._bottomAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render()},e}(d);_.prototype._class+=" timeline_ReactTimeline",_.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),_.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip");var g=o.timeParse("%Q"),x=function(t){function e(){var e=t.call(this)||this;return e._topAxis.type("time"),e._bottomAxis.type("time"),e.tooltipHTML(function(t){var i=g(t[1]),n=g(t[2]),r=o.timeFormat(e.tooltipTimeFormat());return'<div style="text-align:center;">'.concat(t[0],"<br/><br/>").concat(r(i)," -> ").concat(r(n),"</div>")}),e}return l(e,t),e.prototype.update=function(e,i){if(t.prototype.update.call(this,e,i),this.timePattern_exists()){var o=1/0,n=-1/0,r="",s="";this.data().forEach(function(t){var e=new Date(t[1]).getTime(),i=new Date(t[2]).getTime();o>e&&(o=e,r=""+t[1]),n<i&&(n=i,s=""+t[2])}),this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").tickFormat(this._axisLabelFormatter).low(r).high(s),this._gantt._minStart=o,this._gantt._maxEnd=n}},e.prototype.tooltipHTML=function(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this},e.prototype.parseAxisValue=function(t){var e=g(t);return o.timeFormat(this.timePattern())(e)},e.prototype.onzoom=function(t){var e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,n=o/e,r=Math.floor(i-n*(t.x/t.k)),s=Math.ceil(o/t.k+r);this._topAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render(),this._bottomAxis.low(this.parseAxisValue(r)).high(this.parseAxisValue(s)).render()},e}(m);x.prototype._class+=" timeline_ReactTimelineSeries",x.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),x.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip"),t.BUILD_VERSION="2.108.6",t.MiniGantt=c,t.PKG_NAME="@hpcc-js/timeline",t.PKG_VERSION="2.57.0",t.ReactAxisGantt=d,t.ReactAxisGanttSeries=m,t.ReactGantt=u,t.ReactTimeline=_,t.ReactTimelineSeries=x});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|