@hpcc-js/timeline 3.4.1 → 3.4.4

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/LICENSE CHANGED
@@ -1,43 +1,43 @@
1
- HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
-
16
- Intersection Algorithms Provided by Kevin Lindsey
17
- Copyright (c) 2000-2011, Kevin Lindsey
18
- All rights reserved.
19
-
20
- Redistribution and use in source and binary forms, with or without
21
- modification, are permitted provided that the following conditions are met:
22
-
23
- - Redistributions of source code must retain the above copyright notice,
24
- this list of conditions and the following disclaimer.
25
-
26
- - Redistributions in binary form must reproduce the above copyright
27
- notice, this list of conditions and the following disclaimer in the
28
- documentation and/or other materials provided with the distribution.
29
-
30
- - Neither the name of this software nor the names of its contributors
31
- may be used to endorse or promote products derived from this software
32
- without specific prior written permission.
33
-
34
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
38
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
41
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+
16
+ Intersection Algorithms Provided by Kevin Lindsey
17
+ Copyright (c) 2000-2011, Kevin Lindsey
18
+ All rights reserved.
19
+
20
+ Redistribution and use in source and binary forms, with or without
21
+ modification, are permitted provided that the following conditions are met:
22
+
23
+ - Redistributions of source code must retain the above copyright notice,
24
+ this list of conditions and the following disclaimer.
25
+
26
+ - Redistributions in binary form must reproduce the above copyright
27
+ notice, this list of conditions and the following disclaimer in the
28
+ documentation and/or other materials provided with the distribution.
29
+
30
+ - Neither the name of this software nor the names of its contributors
31
+ may be used to endorse or promote products derived from this software
32
+ without specific prior written permission.
33
+
34
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
38
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
41
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,91 +1,91 @@
1
- # @hpcc-js/timeline
2
- This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including [Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start), [Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html) and [Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials), please visit the main page on GitHub: [hpcc-systems/Visualization](https://github.com/hpcc-systems/Visualization).
3
-
4
- ## Exported Widgets
5
- * [MiniGantt](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/misc/Mini%20Gantt.js)
6
-
7
- ## Stand-alone HTML Example
8
- ```html
9
- <html>
10
- <head>
11
- <title>Simple MiniGantt</title>
12
- <script src="https://unpkg.com/@hpcc-js/util"></script>
13
- <script src="https://unpkg.com/@hpcc-js/common"></script>
14
- <script src="https://unpkg.com/@hpcc-js/api"></script>
15
- <script src="https://unpkg.com/@hpcc-js/chart"></script>
16
- <script src="https://unpkg.com/@hpcc-js/timeline"></script>
17
- </head>
18
- <body>
19
- <div id="placeholder" style="width:800px;height:600px;"></div>
20
- <script>
21
- var chart = new window["@hpcc-js/timeline"].MiniGantt()
22
- .target("placeholder")
23
- .columns(["Label", "start", "end"])
24
- .data([
25
- ["Range #1","2004-01-04T01:36:44.0Z","2005-10-05T01:59:16.0Z",""],
26
- ["Range #2","2004-03-07T17:12:44.0Z","2004-12-07T02:16:06.0Z",""],
27
- ["Range #3","2004-07-20T18:10:42.0Z","2005-07-22T02:30:31.0Z",""],
28
- ["Range #4","2004-09-09T05:53:17.0Z","2005-01-10T07:40:42.0Z",""],
29
- ["Event #1","2004-09-09T21:43:52.0Z"],
30
- ["Range #5","2005-01-04T05:30:36.0Z","2005-11-17T11:51:53.0Z",""],
31
- ["Range #6","2005-01-22T20:57:02.0Z","2005-06-12T05:28:33.0Z",""],
32
- ["Range #7","2005-04-18T15:26:23.0Z","2005-07-23T08:46:24.0Z",""],
33
- ["Range #8","2005-05-25T16:01:00.0Z","2005-06-17T23:18:56.0Z",""],
34
- ["Range #9","2005-06-19T09:38:40.0Z","2005-07-16T17:17:16.0Z",""]
35
- ])
36
- .timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
37
- .render();
38
- </script>
39
- </body>
40
- </html>
41
- ```
42
-
43
- ## Getting Started with @hpccjs
44
- * _[Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start)_
45
- * _[Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials)_
46
- * _[Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html)_ ([alt](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html))
47
- * _[Wiki](https://github.com/hpcc-systems/Visualization/wiki)_
48
-
49
- <ClientOnly>
50
- <hpcc-vitepress style="width:100%;height:600px">
51
- <div id="target" style="width:100%;height:600px">
52
- </div>
53
- <script type="module">
54
- import { MiniGantt } from "@hpcc-js/timeline";
55
-
56
- new MiniGantt()
57
- .target("target")
58
- .columns(["Label", "start", "end"])
59
- .data(random_datetime_ranges(10).concat(random_datetime_events(1)))
60
- .timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
61
- .render()
62
- ;
63
-
64
-
65
- function random_datetime_string() {
66
- const yyyy = 2004 + Math.floor(Math.random() * 2);
67
- const mm = 1 + Math.floor(Math.random() * 12);
68
- const dd = 1 + Math.floor(Math.random() * 28);
69
- const hh = 1 + Math.floor(Math.random() * 23);
70
- const min = 1 + Math.floor(Math.random() * 59);
71
- const sec = 0 + Math.floor(Math.random() * 59);
72
- return `${yyyy}-${mm < 10 ? '0' + mm : mm}-${dd < 10 ? '0' + dd : dd}T${hh < 10 ? '0' + hh : hh}:${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}.0Z`;
73
- }
74
-
75
- function random_datetime_ranges(n) {
76
- return Array(n).fill("").map((row, row_idx) => {
77
- const d1 = random_datetime_string();
78
- const d2 = random_datetime_string();
79
- const icon = ["", "", ""][Math.floor(Math.random() * 3)];
80
- return new Date(d1) - new Date(d2) > 0 ? [`Random Range #${row_idx}`, d2, d1, icon] : [`Random Range #${row_idx}`, d1, d2, icon];
81
- });
82
- }
83
-
84
- function random_datetime_events(n) {
85
- return Array(n).fill("").map((row, row_idx) => {
86
- return [`Random Event #${row_idx}`, random_datetime_string()];
87
- });
88
- }
89
- </script>
90
- </hpcc-vitepress>
91
- </ClientOnly>
1
+ # @hpcc-js/timeline
2
+ This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including [Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start), [Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html) and [Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials), please visit the main page on GitHub: [hpcc-systems/Visualization](https://github.com/hpcc-systems/Visualization).
3
+
4
+ ## Exported Widgets
5
+ * [MiniGantt](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/misc/Mini%20Gantt.js)
6
+
7
+ ## Stand-alone HTML Example
8
+ ```html
9
+ <html>
10
+ <head>
11
+ <title>Simple MiniGantt</title>
12
+ <script src="https://unpkg.com/@hpcc-js/util"></script>
13
+ <script src="https://unpkg.com/@hpcc-js/common"></script>
14
+ <script src="https://unpkg.com/@hpcc-js/api"></script>
15
+ <script src="https://unpkg.com/@hpcc-js/chart"></script>
16
+ <script src="https://unpkg.com/@hpcc-js/timeline"></script>
17
+ </head>
18
+ <body>
19
+ <div id="placeholder" style="width:800px;height:600px;"></div>
20
+ <script>
21
+ var chart = new window["@hpcc-js/timeline"].MiniGantt()
22
+ .target("placeholder")
23
+ .columns(["Label", "start", "end"])
24
+ .data([
25
+ ["Range #1","2004-01-04T01:36:44.0Z","2005-10-05T01:59:16.0Z",""],
26
+ ["Range #2","2004-03-07T17:12:44.0Z","2004-12-07T02:16:06.0Z",""],
27
+ ["Range #3","2004-07-20T18:10:42.0Z","2005-07-22T02:30:31.0Z",""],
28
+ ["Range #4","2004-09-09T05:53:17.0Z","2005-01-10T07:40:42.0Z",""],
29
+ ["Event #1","2004-09-09T21:43:52.0Z"],
30
+ ["Range #5","2005-01-04T05:30:36.0Z","2005-11-17T11:51:53.0Z",""],
31
+ ["Range #6","2005-01-22T20:57:02.0Z","2005-06-12T05:28:33.0Z",""],
32
+ ["Range #7","2005-04-18T15:26:23.0Z","2005-07-23T08:46:24.0Z",""],
33
+ ["Range #8","2005-05-25T16:01:00.0Z","2005-06-17T23:18:56.0Z",""],
34
+ ["Range #9","2005-06-19T09:38:40.0Z","2005-07-16T17:17:16.0Z",""]
35
+ ])
36
+ .timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
37
+ .render();
38
+ </script>
39
+ </body>
40
+ </html>
41
+ ```
42
+
43
+ ## Getting Started with @hpccjs
44
+ * _[Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start)_
45
+ * _[Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials)_
46
+ * _[Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html)_ ([alt](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html))
47
+ * _[Wiki](https://github.com/hpcc-systems/Visualization/wiki)_
48
+
49
+ <ClientOnly>
50
+ <hpcc-vitepress style="width:100%;height:600px">
51
+ <div id="target" style="width:100%;height:600px">
52
+ </div>
53
+ <script type="module">
54
+ import { MiniGantt } from "@hpcc-js/timeline";
55
+
56
+ new MiniGantt()
57
+ .target("target")
58
+ .columns(["Label", "start", "end"])
59
+ .data(random_datetime_ranges(10).concat(random_datetime_events(1)))
60
+ .timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
61
+ .render()
62
+ ;
63
+
64
+
65
+ function random_datetime_string() {
66
+ const yyyy = 2004 + Math.floor(Math.random() * 2);
67
+ const mm = 1 + Math.floor(Math.random() * 12);
68
+ const dd = 1 + Math.floor(Math.random() * 28);
69
+ const hh = 1 + Math.floor(Math.random() * 23);
70
+ const min = 1 + Math.floor(Math.random() * 59);
71
+ const sec = 0 + Math.floor(Math.random() * 59);
72
+ return `${yyyy}-${mm < 10 ? '0' + mm : mm}-${dd < 10 ? '0' + dd : dd}T${hh < 10 ? '0' + hh : hh}:${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}.0Z`;
73
+ }
74
+
75
+ function random_datetime_ranges(n) {
76
+ return Array(n).fill("").map((row, row_idx) => {
77
+ const d1 = random_datetime_string();
78
+ const d2 = random_datetime_string();
79
+ const icon = ["", "", ""][Math.floor(Math.random() * 3)];
80
+ return new Date(d1) - new Date(d2) > 0 ? [`Random Range #${row_idx}`, d2, d1, icon] : [`Random Range #${row_idx}`, d1, d2, icon];
81
+ });
82
+ }
83
+
84
+ function random_datetime_events(n) {
85
+ return Array(n).fill("").map((row, row_idx) => {
86
+ return [`Random Event #${row_idx}`, random_datetime_string()];
87
+ });
88
+ }
89
+ </script>
90
+ </hpcc-vitepress>
91
+ </ClientOnly>
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- var t=Object.defineProperty,e=(e,i)=>t(e,"name",{value:i,configurable:!0});import{ITooltip as i}from"@hpcc-js/api";import{Axis as o}from"@hpcc-js/chart";import{Utility as s,SVGWidget as n,local as r,scaleBand as a,extent as l,timeParse as h,timeFormat as p,zoomIdentity as c,d3Event as d,zoom as m,select as u,EntityPin as _,EntityRect as x,SVGZoomWidget as g,scaleLinear as b,min as y,max as f}from"@hpcc-js/common";import{HTMLTooltip as k}from"@hpcc-js/html";import{LabelledRect as C,render as F}from"@hpcc-js/react";import{Border2 as v}from"@hpcc-js/layout";const w="@hpcc-js/timeline",A="3.4.1",S="3.21.2",z=class _MiniGantt extends n{tlAxis;brAxis;verticalBands;_zoom;gUpperContent;gUpperAxis;gMiddleContent;gLowerAxis;gLowerContent;localRect=r();localEntityPin=r();tooltipFormatter;_dateCache;rootExtent;_title_idx=0;_startDate_idx=1;_endDate_idx=2;_icon_idx=-1;_color_idx=-1;_yoffset_idx=-1;constructor(){super(),i.call(this),s.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.tooltipHTML(t=>`<center>${t[this._title_idx]}</center><br>${this.tooltipFormatter(this.brAxis.parse(t[this._startDate_idx]))} -> ${this.tooltipFormatter(this.brAxis.parse(t[this._endDate_idx]))}`),this.tlAxis=(new o).type("time"),this.brAxis=(new o).type("time"),this.verticalBands=a().paddingOuter(.2).paddingInner(.2)}isHorizontal(){return"horizontal"===this.orientation()}fullExtent(){const t=[...this.data().map(t=>t[this._startDate_idx]),...this.data().filter(t=>!!t[this._endDate_idx]).map(t=>t[this._endDate_idx])];return l(t)}extent(){const 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())){const e=h(this.timePattern()),i=p(this.timePattern()),o=e(t[0]),s=e(t[1]);if(t[0]===t[1])t[0]=i(new Date(o.setFullYear(o.getFullYear()-1))),t[1]=i(new Date(o.setFullYear(o.getFullYear()+2)));else{const e=o.getTime(),n=s.getTime()-e;t[0]=i(o),t[1]=i(new Date(e+2*n))}}return t}dataStartPos(t){if(void 0!==this._dateCache[t[this._startDate_idx]])return this._dateCache[t[this._startDate_idx]];const e=this.brAxis.scalePos(t[this._startDate_idx]);return this._dateCache[t[this._startDate_idx]]=e,e}dataEndPos(t){if(void 0!==this._dateCache[t[this._endDate_idx]])return this._dateCache[t[this._endDate_idx]];const e=this.brAxis.scalePos(t[this._endDate_idx]);return this._dateCache[t[this._endDate_idx]]=e,e}dataWidth(t){return this.dataEndPos(t)-this.dataStartPos(t)}transform;resetZoom(){this._zoom.transform(this.element(),c.translate(0,this.isHorizontal()?0:this.height()))}zoomed(){this.transform=d().transform,this.render()}background;enter(t,e){super.enter(t,e),this._zoom=m().scaleExtent([0,this.maxZoom()]).on("zoom",()=>{this.zoomed()}),this.background=e.append("rect").attr("fill","white").attr("opacity",0).on("dblclick",()=>{d().stopPropagation(),delete this.rootExtent,this.resetZoom()}),this.gUpperContent=e.append("g").attr("class","gUpperContent"),this.gUpperAxis=e.append("g").attr("class","gUpperAxis"),this.gMiddleContent=e.append("g").attr("class","gMiddleContent"),this.gLowerAxis=e.append("g").attr("class","gLowerAxis"),this.gLowerContent=e.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),e.call(this._zoom),this._selection.widgetElement(this.gMiddleContent)}_prevIsHorizontal;update(t,e){if(super.update(t,e),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=p(this.tooltipTimeFormat());const i=this.width(),o=this.height();this.background.attr("x",0).attr("y",0).attr("width",i).attr("height",o);const s=this.extent();if(this.tlAxis.x(i/2).orientation(this.isHorizontal()?"top":"left").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(i-1).low(s[0]).high(s[1]).updateScale(),this.brAxis.x(i/2).y(o/2).orientation(this.isHorizontal()?"bottom":"right").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(i-1).height(o).low(s[0]).high(s[1]).updateScale(),this.transform){let t,e;this.isHorizontal()?(t=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(0))),e=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(i-1)))):(t=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(0))),e=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(o-1)))),this.tlAxis.low(t).high(e).updateScale(),this.brAxis.low(t).high(e).updateScale()}const n=this.data().sort(this.isHorizontal()?(t,e)=>{const i=this.brAxis.scalePos(t[1])-this.brAxis.scalePos(e[1]);return 0===i?(""+t[0]).localeCompare(""+e[0]):i}:(t,e)=>this.brAxis.scalePos(e[1])-this.brAxis.scalePos(t[1])),r=n.filter(t=>!t[this._endDate_idx]),a=n.filter(t=>!!t[this._endDate_idx]);this.tlAxis.render(),this.brAxis.render();const l=this.brAxis.getBBox();let h=this.updateEntityPins(r);const c=l.height;let d=o-h;const m=-1!==this._yoffset_idx?Math.min.apply(void 0,this.data().filter(t=>!isNaN(t[this._yoffset_idx])).map(t=>t[this._yoffset_idx])):0;if(r.length>0&&0===a.length){this.tlAxis.visible(!1);let t=h/4;t>o/2-c&&(t=o/2-c);const e=o/2+t,i=-1*(o/2-c-t),s=0!==m?m/2:0;this.gUpperContent.attr("transform",`translate(0, ${e-s})`),this.gLowerAxis.attr("transform",`translate(0, ${i-s})`)}else 0===r.length&&a.length>0?(this.tlAxis.visible(!0),this.gUpperContent.attr("transform",`translate(0, ${h})`),this.gUpperAxis.attr("transform",`translate(0, ${h})`)):(h-=m,d+=m,this.tlAxis.visible(!0),this.gUpperContent.attr("transform",`translate(0, ${h})`),this.gUpperAxis.attr("transform",`translate(0, ${h})`),this.gMiddleContent.attr("transform",`translate(0, ${h})`));this.tlAxis.render();const u=this.tlAxis.getBBox(),_=[],x={};for(const p of a){for(let t=0;t<_.length;++t){const e=_[t];if(e.endPos+this.overlapTolerence()<=this.dataStartPos(p)){x[p]=t,e.endPos=this.dataEndPos(p);break}}void 0===x[p]&&(x[p]=_.length,_.push({endPos:this.dataEndPos(p)}))}const g=this.isHorizontal()?0+u.height:0+u.width,b=this.isHorizontal()?d-l.height:i-l.width;this.verticalBands.range([g,b]).domain(_.map((t,e)=>e)),a.length>0&&this.updateEventRanges(r,a,x,d,u,l,i)}updateEntityPins(t){let e=0;const i=this,o=this.gUpperContent.selectAll(".entity_pin").data(t,t=>t[0]+":"+t[1]),s=this.eventFontColorColumn()?this.columns().indexOf(this.eventFontColorColumn()):-1,n=this.eventBorderColorColumn()?this.columns().indexOf(this.eventBorderColorColumn()):-1,r=this.eventBackgroundColorColumn()?this.columns().indexOf(this.eventBackgroundColorColumn()):-1,a={};for(const d of t){const t=void 0!==d[i._title_idx]?d[i._title_idx]:d[0];a[t]=a[t]?a[t]+1:1}const l=Object.keys(a),h=i.eventGroupOffset(),p=o.enter().append("g").attr("class","entity_pin");p.append("line").attr("class","entity_line"),p.on("mouseover",function(t){u(this).raise()}).each(function(t,e){const o=(new _).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===s?"#333":t[s]).titleColor(-1===s?"#333":t[s]).descriptionColor(-1===s?"#333":t[s]).backgroundShape("pin").backgroundColorFill(-1===s?"#f8f8f8":t[r]).backgroundColorStroke(-1===s?"#ccc":t[n]).cornerRadius(5).arrowHeight(10).arrowWidth(16);i.localEntityPin.set(this,o)}).merge(o).each(function(t,o){const r=i.localEntityPin.get(this),a=void 0!==t[i._title_idx]?t[i._title_idx]:r.title(),p=i.dataStartPos(t)-0;let c=l.indexOf(a)%i.eventGroupMod()*h-5;if(void 0!==t[i._yoffset_idx]&&(c+=t[i._yoffset_idx]?t[i._yoffset_idx]:0),t[i._title_idx]!==r.title()&&t[i._startDate_idx]!==r.description()){const e=i.brAxis.parse(t[i._startDate_idx]),o=i.tooltipFormatter(e);r.x(p).y(c).iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).icon(void 0!==t[i._icon_idx]?t[i._icon_idx]:r.icon()).title(a).description(o).animationFrameRender()}else r.move({x:p,y:c});const d=r.calcHeight();e<d&&(e=d),u(this).selectAll(".entity_line").attr("x1",p).attr("x2",p).attr("y1",0).attr("y2",c).style("stroke",-1===s?"#ccc":t[n]).style("stroke-width",1)}),o.exit().each(function(t,e){i.localEntityPin.get(this).target(null)}).remove();const c=Math.abs(Math.min(t.length,i.eventGroupMod())*i.eventGroupOffset());return e+c}updateEventRanges(t,e,i,o,s,n,r){const a=this,l=this.gMiddleContent.selectAll(".line").data(t,t=>t[a._title_idx]);l.enter().append("line").attr("class","line").merge(l).attr(this.isHorizontal()?"x1":"y1",t=>this.dataStartPos(t)-0).attr(this.isHorizontal()?"x2":"y2",t=>this.dataStartPos(t)-0).attr(this.isHorizontal()?"y1":"x1",this.isHorizontal()?s.height:s.width).attr(this.isHorizontal()?"y2":"x2",this.isHorizontal()?o-n.height:r-n.width),l.exit().remove();const h=this.gMiddleContent.selectAll(".buckets").data(e,t=>t[a._title_idx]);h.enter().append("g").attr("class","buckets").call(this._selection.enter.bind(this._selection)).each(function(t){const e=(new x).target(this).iconDiameter(28).iconPaddingPercent(0).titleFontSize(28).titleColor(a.rangeFontColor()).descriptionColor(a.rangeFontColor()).iconColor(a.rangeFontColor()).backgroundShape("rect").backgroundColorFill(t[a._color_idx]);a.localRect.set(this,e),a.enterEntityRect(e,t)}).on("click",function(t){a.click(a.rowToObj(t),"range",a._selection.selected(this))},!1).on("dblclick",function(t){a.rootExtent=t,a.resetZoom(),a.dblclick(a.rowToObj(t),"range",a._selection.selected(this))},!0).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(h).attr("transform",t=>a.isHorizontal()?`translate(${this.dataStartPos(t)}, ${this.verticalBands(i[t])}) `:`translate(${this.verticalBands(i[t])}, ${this.dataStartPos(t)}) `).each(function(t){const e=a.localRect.get(this),i=a.dataWidth(t)/2,o=a.verticalBands.bandwidth()/2,s=Math.max(a.dataWidth(t),2),n=Math.max(a.verticalBands.bandwidth(),2),r=.191*n,l=.618*n,h=l;e.pos(a.isHorizontal()?{x:i,y:o}:{x:o,y:i}).fixedHeight(a.isHorizontal()?n:s).fixedWidth(a.isHorizontal()?s:n).icon(void 0!==t[a._icon_idx]?t[a._icon_idx]:"").title(void 0!==t[a._title_idx]?t[a._title_idx]:"").padding(r).iconDiameter(h).titleFontSize(l),1.5*h>s&&e.icon(null),a.updateEntityRect(e,t[a._icon_idx]),e.render()}),h.exit().remove()}exit(t,e){this.brAxis.target(null),this.tlAxis.target(null),super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}enterEntityRect(t,e){}updateEntityRect(t,e){}};e(z,"MiniGantt");let P=z;P.prototype._class+=" timeline_MiniGantt",P.prototype.implements(i.prototype),P.prototype.mixin(s.SimpleSelectionMixin),P.prototype.publish("timePattern","%Y-%m-%d","string","timePattern"),P.prototype.publish("tickFormat",null,"string","tickFormat",void 0,{optional:!0}),P.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","tooltipTimeFormat"),P.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),P.prototype.publish("orientation","horizontal","set","orientation",["horizontal","vertical"]),P.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),P.prototype.publish("titleColumn",null,"string","titleColumn"),P.prototype.publish("startDateColumn",null,"string","startDateColumn"),P.prototype.publish("endDateColumn",null,"string","endDateColumn"),P.prototype.publish("iconColumn",null,"string","iconColumn"),P.prototype.publish("colorColumn",null,"string","colorColumn"),P.prototype.publish("yOffsetColumn",null,"string","yOffsetColumn"),P.prototype.publish("maxZoom",16,"number","maxZoom"),P.prototype.publish("eventGroupOffset",-50,"number","eventGroupOffset"),P.prototype.publish("eventGroupMod",5,"number","eventGroupMod"),P.prototype.publish("eventFontColorColumn",null,"string","eventFontColorColumn"),P.prototype.publish("eventBorderColorColumn",null,"string","eventBorderColorColumn"),P.prototype.publish("eventBackgroundColorColumn",null,"string","eventBackgroundColorColumn"),P.prototype.publish("hideIconWhenCollapsed",!1,"boolean","hideIconWhenCollapsed"),P.prototype.publish("hideTitleWhenCollapsed",!1,"boolean","hideTitleWhenCollapsed"),P.prototype.publish("hideDescriptionWhenCollapsed",!1,"boolean","hideDescriptionWhenCollapsed"),P.prototype.publish("hideAnnotationsWhenCollapsed",!0,"boolean","hideAnnotationsWhenCollapsed"),P.prototype.publish("centerOnMostRecent",!1,"boolean","If true, the timeline will be centered on the most recent data point");const T=class _ReactGantt extends g{_selection=new s.Selection(this);_buckets;_interpolateX;_interpolateY;_bucketsBySeries;_dataBySeries;_origIdxMap;_seriesBackgrounds;_maxFontSize;_tooltip;_minStart;_maxEnd;_prevZoomState=null;_title_idx=0;_startDate_idx=1;_endDate_idx=2;_icon_idx=-1;_color_idx=-1;_series_idx=-1;_bucket_idx=-1;_yoffset_idx=-1;_maxX;_maxY;_rangeOptions={rangePadding:2,fontFamily:"Verdana",fontSize:12,fill:"white",stroke:"black",textFill:"black",cornerRadius:3,strokeWidth:0};constructor(t="origin"){super(),this._drawStartPos=t,this.showToolbar_default(!1),this._tooltip=new k,this._tooltip.tooltipHTML(t=>`<div style="text-align:center;">${t[0]}<br/><br/>${t[1]} -&gt; ${t[2]}</div>`),this._tooltip.followCursor(!0)}selection(t){return arguments.length?(this._selection.set(t),this):this._selection.get()}_rangeRenderer=C;rangeRenderer(t){return arguments.length?(this._rangeRenderer=t,this._rangeRenderer):this._rangeRenderer}enter(t,e){super.enter(t,e);const i=this;e.on("click",function(t){i._selection.clear()}),this._tooltip.target(t)}update(t,i){super.update(t,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;const o=this,s=this.width(),n=s;if(this._interpolateX=b().domain([this._minStart,this._maxEnd]).range([0,n]),this.data().sort((t,e)=>t[1]-e[1]),this._series_idx>-1){this._origIdxMap={},this._dataBySeries={},this._bucketsBySeries={},this.data().forEach((t,e)=>{const i=t[this._series_idx];this._dataBySeries[i]||(this._origIdxMap[i]={},this._dataBySeries[i]=[]),this._dataBySeries[i].push({dataRow:t,origIdx:e})});const t=this.gutter();let e=0;const i=Object.keys(this._dataBySeries);i.forEach(t=>{this._dataBySeries[t].sort((t,e)=>t.dataRow[1]-e.dataRow[1]),this._bucketsBySeries[t]=this.calcBuckets(this._dataBySeries[t].map(t=>t.dataRow),1,2),this._bucketsBySeries[t].bucketHeight=this.bucketHeight(),this._bucketsBySeries[t].bucketOffset=e,e+=(this._bucketsBySeries[t].bucketHeight+this.strokeWidth()+this.gutter())*(this._bucketsBySeries[t].maxBucket+1),this._dataBySeries[t].forEach((e,i)=>{this._origIdxMap[t][e.origIdx]=i})}),this._seriesBackgrounds=this._renderElement.selectAll(".series-background").data(i.map(t=>this._bucketsBySeries[t])),this._seriesBackgrounds.join(t=>t.append("rect").attr("class","series-background"),t=>t,t=>t.each(function(t){delete t.element}).remove()).attr("opacity",t=>t.props&&t.props.hidden?0:1).each(function(e,i){u(this).attr("x",0).attr("y",e.bucketOffset-t/2).attr("width",s).attr("height",(e.bucketHeight+t)*(e.maxBucket+1)+t).attr("fill",i%2?o.oddSeriesBackground():o.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);if(!this.preserveZoom()||!this._prevZoomState){const t=this._interpolateX(this._minStart);this.zoomTo([t,0],1)}const r=this.bucketHeight();this.setRangeOptions(),this._maxFontScale=r-2*this.rangePadding(),this.measureDataText();const a=this._renderElement.selectAll(".item").data(this.data()),l=this.strokeWidth(),h=2*l;if(a.join(t=>t.append("g").attr("class","item").on("click.selectionBag",function(t,i){const s=void 0===t.id?i:t.id;o._selection.isSelected({_id:s,element:t.element})?o._selection.clear():o._selection.click({_id:s,element:/* @__PURE__ */e(()=>t.element,"element")},d),o.selectionChanged(),d().stopPropagation()}).on("click",function(t){const e=t.element.classed("selected");t[o.columns().length]&&(t.__lparam=t[o.columns().length]),o.click(t,"",e)}).on("dblclick",function(t){const e=t.element.classed("selected");t[o.columns().length]&&(t.__lparam=t[o.columns().length]),o.click(t,"",e)}).on("mousein",function(t){o.highlightItem(u(this),t);const e=t.element.classed("selected");o.mousein(t,"",e)}).on("mouseover",function(t){const e=d();o._tooltip._triggerElement=t.element,o._tooltip._cursorLoc=[e.clientX,e.clientY],o._tooltip.data(t).visible(!0).fitContent(!0).render(),o.highlightItem(u(this),t);const i=t.element.classed("selected");o.mouseover(t,"",i)}).on("mouseout",function(t){o._tooltip.visible(!1).render(),o.highlightItem(null,null);const e=t.element.classed("selected");o.mouseout(t,"",e)}).each(function(t,e){t.that=this,t.element=u(this),t.x=o._interpolateX(t[1]);const i=o._interpolateX(t[2]);if(o._series_idx>-1){const i=t[o._series_idx],s=o._bucketsBySeries[i].bucketMap[o._origIdxMap[i][e]];t.y=o._bucketsBySeries[i].interpolateY(s)+o._bucketsBySeries[i].bucketOffset}else{const i=-1===o._bucket_idx?e:t[o._bucket_idx];t.y=o._buckets.interpolateY(o._buckets.bucketMap[i])}t.props={...t[3],text:t[0]},t.props.width=i-t.x,t.props.height=r,t.x+=l,t.y+=l,t.props.width-=h,t.props.height-=h,t.element.attr("transform",`translate(${t.x+t.props.width/2} ${t.y+t.props.height/2})`)}),t=>t,t=>t.each(function(t){delete t.element}).remove()).attr("opacity",t=>t.props&&t.props.hidden?0:1).each(function(t,e){if(t.that=this,o._series_idx>-1){const i=t[o._series_idx];t.x=o.renderRangeElement(t,e,!1,o._rangeOptions,i)}else t.x=o.renderRangeElement(t,e,!1,o._rangeOptions)}).on("dblclick.zoom",t=>{const e=this._interpolateX(t[1]),i=this._interpolateX(t[2]),o=s/(i-e);this.zoomTo([-e*o,0],o)}),i.on("dblclick.zoom",null),this.preserveZoom()&&this._prevZoomState&&this._interpolateX){const t=this.width();if(t>0){const e=this._minStart,i=this._maxEnd,o=Math.max(e,Math.min(i,this._prevZoomState.visibleStart));let s=Math.max(e,Math.min(i,this._prevZoomState.visibleEnd));if(s<=o){const t=1e-6*(i-e)||1e-6;s=Math.min(i,o+t)}const n=this._interpolateX(o),r=this._interpolateX(s),a=r-n;if(isFinite(a)&&Math.abs(a)>1e-9){const o=t/a,s=.05,l=this.maxZoom(),h=Math.max(s,Math.min(l,o));if(h>0&&isFinite(h)){const o=(n+r)/2,s=t/(2*h),a=this._interpolateX(e),l=this._interpolateX(i);let p=o;p-s<a&&(p=a+s),p+s>l&&(p=l-s);const c=t/2-h*p;isFinite(c)&&this.zoomTo([c,0],h)}}}}}exit(t,e){this._tooltip.target(null),super.exit(t,e)}renderRangeElement(t,e,i=!1,o={},s){const n=o.strokeWidth,r=2*n,a=o.rangePadding;let l;const h=isNaN(this._transform.x)?0:this._transform.x,p=isNaN(this._transform.k)?1:this._transform.k;let c;const d=this.bucketHeight();t.that.setAttribute("data-series",s),this._color_idx>-1&&t.that.setAttribute("data-color",t[this._color_idx]),void 0!==s?(c=this._bucketsBySeries[s].bucketMap[this._origIdxMap[s][e]],t.that.setAttribute("data-b",c),t.that.setAttribute("data-bucketOffset",this._bucketsBySeries[s].bucketOffset),t.y=this._bucketsBySeries[s].interpolateY(c)+this._bucketsBySeries[s].bucketOffset,t.that.setAttribute("data-dy",t.y)):(c=this._buckets.bucketMap[e],t.y=this._buckets.interpolateY(c)),this._color_idx>-1&&(o.fill=t[this._color_idx]),i?(t.x=this._interpolateX(t[1])*p,l=this._interpolateX(t[2])*p,t.props={...t[3],text:t[0]},t.props.width=(l-t.x)/p,t.x+=h,t.props.width*=p):(t.x=this._interpolateX(t[1]),l=this._interpolateX(t[2]),t.props={...t[3],text:t[0]},t.props.width=(l-t.x)/p),t.props.height=d,void 0===s&&this._buckets.bucketScale<1&&(t.props.height=this._buckets.bucketScale*d),void 0===t.element&&t.that&&(t.element=u(t.that)),t.element.attr("transform",`translate(${t.x+t.props.width/2} ${t.y+t.props.height/2})`),t.x+=n,t.y+=n,t.props.width-=r,t.props.height-=r,t.props.width=t.props.width<1?1:t.props.width,t.props.height=t.props.height<1?1:t.props.height;let m=this.truncateText(t.props.text,t.props.width-a,this._maxFontScale);m!==t.props.text?m=this.truncateText(t.props.text,t.props.width-a):t.props.fontSize=this._maxFontScale*o.fontSize,void 0===s&&this._buckets.bucketScale<1&&(t.props.fontSize=Math.min(this._maxFontScale,this._buckets.bucketScale)*o.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),F(this._rangeRenderer,{...o,...t.props,text:m},t.that)}setRangeOptions(){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()}}_transform={k:1,x:0,y:0};zoomed(t){if(this._transform=t,this._interpolateX&&"function"==typeof this._interpolateX.invert){const e=this.width();if(e>0&&isFinite(t.k)&&0!==t.k){const i=(0-t.x)/t.k,o=(e-t.x)/t.k;let s=this._interpolateX.invert(i),n=this._interpolateX.invert(o);if(isFinite(s)&&isFinite(n)){if(s>n){const t=s;s=n,n=t}this._prevZoomState={visibleStart:s,visibleEnd:n}}}}if("scale-all"===this.renderMode())this._zoomScale=t.k,this._zoomTranslate=[t.x,0],this._zoomG.attr("transform",`translate(${t.x} 0)scale(${t.k} 1)`);else{const t=this._rangeOptions;this.data().forEach((e,i)=>{if(this._color_idx>-1&&(t.fill=e[this._color_idx]),this._series_idx>-1){const o=e[this._series_idx];this.renderRangeElement(e,i,!0,t,o)}else this.renderRangeElement(e,i,!0,t)})}this.zoomedHook(t)}zoomedHook(t){}calcBuckets(t,e,i,o){const s={},n={},r=this.overlapTolerence(),a=[{end:-1/0}];let l=0;void 0!==o?(t.forEach((t,e)=>{s[e]=t[o],n[t[o]]=!0}),l=Object.keys(n).length):t.forEach((t,o)=>{for(let n=0;n<a.length;++n)if(0===o||a[n][i]+r<=t[e]){s[o]=n,l<n&&(l=n),a[n][i]=t[i];break}if(void 0===s[o]){s[o]=a.length;const e={};e[i]=t[i],a.push(e)}l<s[o]&&(l=s[o])});const h=(l+1)*(this.bucketHeight()+this.gutter());return{bucketMap:s,maxBucket:l,bucketScale:this.height()/h,interpolateY:b().domain([0,l+1]).range([0,Math.min(this.height(),h)])}}data(t){const e=super.data.apply(this,arguments);return arguments.length>0&&(this._minStart=Math.min(...this.data().map(t=>t[1]))??0,this._maxEnd=Math.max(...this.data().map(t=>t[2]))??1,this.measureDataText(!0)),e}_textWidths;_maxFontScale;_characterWidths;_prevFontFamily;_prevFontSize;measureDataText(t=!1){const e={},i={},o=this.fontFamily(),n=this.fontSize(),r=this.bucketHeight();r&&(this._maxFontScale=(r-2*this.rangePadding())/n),(t||this._prevFontFamily!==o||this._prevFontSize!==n)&&(i["."]=s.textSize(".",o,n).width,this.data().forEach(t=>{e[t[0]]||(e[t[0]]=s.textSize(t[0],o,n).width),t[0].split("").forEach(t=>{i[t]||(i[t]=s.textSize(t,o,n).width)})}),this._textWidths=e,this._characterWidths=i),this._prevFontFamily=o,this._prevFontSize=n}truncateText(t,e,i=1){if(this._textWidths[t]*i<e)return t;let o="",s=0;const n=e-3*this._characterWidths["."];for(const r of t){if(s+=this._characterWidths[r],!(s<n))break;o+=r}return n<0?"":o+"..."}resize(t){let e;return e=this.fitWidthToContent()||this.fitHeightToContent()?super.resize.call(this,{width:t.width,height:this._maxY}):super.resize.apply(this,arguments),e}selectionChanged(){}highlightItem(t,e){}click(t,e,i){}dblclick(t,e,i){}mousein(t,e,i){}mouseover(t,e,i){}mouseout(t,e,i){}};e(T,"ReactGantt");let M=T;M.prototype._class+=" timeline_ReactGantt",M.prototype.publish("fitWidthToContent",!1,"boolean","If true, resize will simply reapply the bounding box width"),M.prototype.publish("fitHeightToContent",!1,"boolean","If true, resize will simply reapply the bounding box height"),M.prototype.publish("preserveZoom",!1,"boolean","If true, maintain zoom level when data is updated"),M.prototype.publish("titleColumn",null,"string","Column name to for the title"),M.prototype.publish("startDateColumn",null,"string","Column name to for the start date"),M.prototype.publish("endDateColumn",null,"string","Column name to for the end date"),M.prototype.publish("iconColumn",null,"string","Column name to for the icon"),M.prototype.publish("colorColumn",null,"string","Column name to for the color"),M.prototype.publish("seriesColumn",null,"string","Column name to for the series identifier"),M.prototype.publish("bucketColumn",null,"string","Column name to for the bucket identifier"),M.prototype.publish("renderMode","default","set","Render modes vary in features and performance",["default","scale-all"]),M.prototype.publish("rangePadding",3,"number","Padding within each range rectangle (pixels)"),M.prototype.publish("fill","#1f77b4","string","Background color of range rectangle"),M.prototype.publish("stroke",null,"string","Color of range rectangle border"),M.prototype.publish("strokeWidth",null,"number","Width of range rectangle border (pixels)"),M.prototype.publish("cornerRadius",3,"number","Space between range buckets (pixels)"),M.prototype.publish("fontFamily",null,"string","Font family within range rectangle",null,{optional:!0}),M.prototype.publish("fontSize",10,"number","Size of font within range rectangle (pixels)"),M.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),M.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),M.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),M.prototype.publish("bucketHeight",100,"number","Max height of range element (pixels)"),M.prototype.publish("gutter",2,"number","Space between range buckets (pixels)"),M.prototype.publish("maxZoom",16,"number","Maximum zoom"),M.prototype.publish("evenSeriesBackground","#FFFFFF","html-color","Background color of even series rows"),M.prototype.publish("oddSeriesBackground","#DDDDDD","html-color","Background color of odd series rows");const D=class _ReactAxisGantt extends n{_topAxis=new o("center").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_gantt=new M("center").stroke("#000000");_bottomAxis=new o("center").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_topAxisElement;_contentElement;_bottomAxisElement;_topRect;_contentRect;_bottomRect;rangeRenderer;constructor(){super(),this._drawStartPos="origin",this.rangeRenderer=function(){const t=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:t}}selection(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()}resizeWrappers(){const t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i,s=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 ${i+s})`),this._gantt.resize({height:o,width:t}),this._bottomRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._bottomAxisElement.attr("transform",`translate(0 ${i+o+s})`),this._bottomAxis.resize({height:i,width:t})}enter(t,e){super.enter(t,e),this._gantt.click=(t,e,i)=>{this.click(t,e,i)},this._gantt.dblclick=(t,e,i)=>{this.dblclick(t,e,i)},this._topAxisElement=e.append("g").attr("class","top-axis-wrapper"),this._topRect=this._topAxisElement.append("rect").attr("class","top-axis-rect"),this._contentElement=e.append("g").attr("class","content-wrapper"),this._contentRect=this._contentElement.append("rect").attr("class","content-rect"),this._bottomAxisElement=e.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=t=>{this.onzoom(t)}}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).render(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).render()}update(t,e){super.update(t,e),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()}exit(t,e){this._bottomAxis.target(null),this._gantt.target(null),this._topAxis.target(null),super.exit(t,e)}columns(t){const e=super.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(t),e}data(t){const e=super.data.apply(this,arguments);if(arguments.length>0){const t=this.data().map(t=>{const e=[...t];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=Math.min(...t.map(t=>t[1]))??0,this._gantt._maxEnd=Math.max(...t.map(t=>t[2]))??1,this._gantt.data(t)}return e}resize(t){const e=super.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),e}click(t,e,i){}dblclick(t,e,i){}tooltip(){return this._gantt._tooltip}};e(D,"ReactAxisGantt");let E=D;E.prototype._class+=" timeline_ReactAxisGantt",E.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),E.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),E.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),E.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),E.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),E.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),E.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),E.prototype.publishProxy("gutter","_gantt"),E.prototype.publishProxy("renderMode","_gantt"),E.prototype.publishProxy("strokeWidth","_gantt"),E.prototype.publishProxy("fontSize","_gantt"),E.prototype.publishProxy("fontFamily","_gantt"),E.prototype.publishProxy("stroke","_gantt"),E.prototype.publishProxy("cornerRadius","_gantt"),E.prototype.publishProxy("titleColumn","_gantt"),E.prototype.publishProxy("startDateColumn","_gantt"),E.prototype.publishProxy("endDateColumn","_gantt"),E.prototype.publishProxy("iconColumn","_gantt"),E.prototype.publishProxy("colorColumn","_gantt"),E.prototype.publishProxy("bucketColumn","_gantt"),E.prototype.publishProxy("maxZoom","_gantt"),E.prototype.publishProxy("bucketHeight","_gantt");const H=class _ReactAxisGanttSeries extends v{_topAxis=new o("origin").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_gantt=new M("origin").stroke("#000000").fitHeightToContent(!0);_bottomAxis=new o("origin").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_topAxisElement;_contentElement;_bottomAxisElement;_topRect;_contentRect;_bottomRect;constructor(){super(),this.centerOverflowX_default("hidden"),this.centerOverflowY_default("auto")}selection(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()}rangeRenderer(t){const e=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:e}resizeWrappers(){const 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()}enter(t,e){super.enter(t,e),this._gantt.click=(t,e,i)=>{this.click(t,e,i)},this._gantt.dblclick=(t,e,i)=>{this.dblclick(t,e,i)},this.top(this._topAxis),this.center(this._gantt),this.bottom(this._bottomAxis),this.resizeWrappers(),this._gantt.zoomedHook=t=>{this.onzoom(t)}}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).lazyRender(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).lazyRender()}update(t,e){super.update(t,e),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()}columns(t){const e=super.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(t),e}data(t){const e=super.data.apply(this,arguments);if(arguments.length>0){const t=this.data().map(t=>{const e=[...t];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=y(t,t=>t[1]),this._gantt._maxEnd=f(t,t=>t[2]),this._gantt.data(t)}return e}resize(t){const e=super.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),e}click(t,e,i){}dblclick(t,e,i){}tooltip(){return this._gantt._tooltip}};e(H,"ReactAxisGanttSeries");let R=H;R.prototype._class+=" timeline_ReactAxisGanttSeries",R.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),R.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),R.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),R.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),R.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),R.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),R.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),R.prototype.publishProxy("gutter","_gantt"),R.prototype.publishProxy("renderMode","_gantt"),R.prototype.publishProxy("strokeWidth","_gantt"),R.prototype.publishProxy("fontSize","_gantt"),R.prototype.publishProxy("fontFamily","_gantt"),R.prototype.publishProxy("stroke","_gantt"),R.prototype.publishProxy("cornerRadius","_gantt"),R.prototype.publishProxy("titleColumn","_gantt"),R.prototype.publishProxy("startDateColumn","_gantt"),R.prototype.publishProxy("endDateColumn","_gantt"),R.prototype.publishProxy("iconColumn","_gantt"),R.prototype.publishProxy("colorColumn","_gantt"),R.prototype.publishProxy("seriesColumn","_gantt"),R.prototype.publishProxy("bucketColumn","_gantt"),R.prototype.publishProxy("maxZoom","_gantt"),R.prototype.publishProxy("preserveZoom","_gantt"),R.prototype.publishProxy("evenSeriesBackground","_gantt"),R.prototype.publishProxy("oddSeriesBackground","_gantt"),R.prototype.publishProxy("bucketHeight","_gantt");const O=class _ReactTimeline extends E{_axisLabelFormatter;constructor(){super(),this._drawStartPos="origin",this._topAxis.type("time"),this._bottomAxis.type("time"),this.tooltipHTML(t=>{const e=h("%Q"),i=e(t[1]),o=e(t[2]),s=p(this.tooltipTimeFormat());return`<div style="text-align:center;">${t[0]}<br/><br/>${s(i)} -&gt; ${s(o)}</div>`})}update(t,e){if(super.update(t,e),this.timePattern_exists()){let t=1/0,e=-1/0,i="",o="";this.data().map(s=>{const n=new Date(s[1]).getTime(),r=new Date(s[2]).getTime();t>n&&(t=n,i=""+s[1]),e<r&&(e=r,o=""+s[2])});const s=this._axisLabelFormatter?this._axisLabelFormatter:this.tickFormat_exists&&this.tickFormat_exists()?this.tickFormat():void 0;this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),s?(this._topAxis.tickFormat(s),this._bottomAxis.tickFormat(s)):(this._topAxis.tickFormat_reset(),this._bottomAxis.tickFormat_reset()),this._gantt._minStart=t,this._gantt._maxEnd=e}}tooltipHTML(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this}parseAxisValue(t){const e=h("%Q")(t);return p(this.timePattern())(e)}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render(),this._bottomAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render()}};e(O,"ReactTimeline");let B=O;B.prototype._class+=" timeline_ReactTimeline",B.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),B.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip");const W=h("%Q"),L=class _ReactTimelineSeries extends R{_axisLabelFormatter;constructor(){super(),this._topAxis.type("time"),this._bottomAxis.type("time"),this.tooltipHTML(t=>{const e=W(t[1]),i=W(t[2]),o=p(this.tooltipTimeFormat());return`<div style="text-align:center;">${t[0]}<br/><br/>${o(e)} -&gt; ${o(i)}</div>`})}update(t,e){if(super.update(t,e),this.timePattern_exists()){let t=1/0,e=-1/0,i="",o="";this.data().forEach(s=>{const n=new Date(s[1]).getTime(),r=new Date(s[2]).getTime();t>n&&(t=n,i=""+s[1]),e<r&&(e=r,o=""+s[2])});const s=this._axisLabelFormatter?this._axisLabelFormatter:this.tickFormat_exists&&this.tickFormat_exists()?this.tickFormat():void 0;this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),s?(this._topAxis.tickFormat(s),this._bottomAxis.tickFormat(s)):(this._topAxis.tickFormat_reset(),this._bottomAxis.tickFormat_reset()),this._gantt._minStart=t,this._gantt._maxEnd=e}}tickFormatFunc(t){return arguments.length?(this._axisLabelFormatter=t,this._topAxis.tickFormatFunc(t),this._bottomAxis.tickFormatFunc(t),this):this._axisLabelFormatter}tooltipHTML(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this}parseAxisValue(t){const e=W(t);return p(this.timePattern())(e)}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render(),this._bottomAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render()}_tooltipHTML};e(L,"ReactTimelineSeries");let $=L;$.prototype._class+=" timeline_ReactTimelineSeries",$.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");export{S as BUILD_VERSION,P as MiniGantt,w as PKG_NAME,A as PKG_VERSION,E as ReactAxisGantt,R as ReactAxisGanttSeries,M as ReactGantt,B as ReactTimeline,$ as ReactTimelineSeries};
1
+ var t=Object.defineProperty,e=(e,i)=>t(e,"name",{value:i,configurable:!0});import{ITooltip as i}from"@hpcc-js/api";import{Axis as o}from"@hpcc-js/chart";import{Utility as s,SVGWidget as n,local as r,scaleBand as a,extent as l,timeParse as h,timeFormat as p,zoomIdentity as c,d3Event as d,zoom as m,select as u,EntityPin as _,EntityRect as x,SVGZoomWidget as g,scaleLinear as b,min as y,max as f}from"@hpcc-js/common";import{HTMLTooltip as k}from"@hpcc-js/html";import{LabelledRect as C,render as F}from"@hpcc-js/react";import{Border2 as v}from"@hpcc-js/layout";const w="@hpcc-js/timeline",A="3.4.3",S="3.21.4",z=class _MiniGantt extends n{tlAxis;brAxis;verticalBands;_zoom;gUpperContent;gUpperAxis;gMiddleContent;gLowerAxis;gLowerContent;localRect=r();localEntityPin=r();tooltipFormatter;_dateCache;rootExtent;_title_idx=0;_startDate_idx=1;_endDate_idx=2;_icon_idx=-1;_color_idx=-1;_yoffset_idx=-1;constructor(){super(),i.call(this),s.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.tooltipHTML(t=>`<center>${t[this._title_idx]}</center><br>${this.tooltipFormatter(this.brAxis.parse(t[this._startDate_idx]))} -> ${this.tooltipFormatter(this.brAxis.parse(t[this._endDate_idx]))}`),this.tlAxis=(new o).type("time"),this.brAxis=(new o).type("time"),this.verticalBands=a().paddingOuter(.2).paddingInner(.2)}isHorizontal(){return"horizontal"===this.orientation()}fullExtent(){const t=[...this.data().map(t=>t[this._startDate_idx]),...this.data().filter(t=>!!t[this._endDate_idx]).map(t=>t[this._endDate_idx])];return l(t)}extent(){const 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())){const e=h(this.timePattern()),i=p(this.timePattern()),o=e(t[0]),s=e(t[1]);if(t[0]===t[1])t[0]=i(new Date(o.setFullYear(o.getFullYear()-1))),t[1]=i(new Date(o.setFullYear(o.getFullYear()+2)));else{const e=o.getTime(),n=s.getTime()-e;t[0]=i(o),t[1]=i(new Date(e+2*n))}}return t}dataStartPos(t){if(void 0!==this._dateCache[t[this._startDate_idx]])return this._dateCache[t[this._startDate_idx]];const e=this.brAxis.scalePos(t[this._startDate_idx]);return this._dateCache[t[this._startDate_idx]]=e,e}dataEndPos(t){if(void 0!==this._dateCache[t[this._endDate_idx]])return this._dateCache[t[this._endDate_idx]];const e=this.brAxis.scalePos(t[this._endDate_idx]);return this._dateCache[t[this._endDate_idx]]=e,e}dataWidth(t){return this.dataEndPos(t)-this.dataStartPos(t)}transform;resetZoom(){this._zoom.transform(this.element(),c.translate(0,this.isHorizontal()?0:this.height()))}zoomed(){this.transform=d().transform,this.render()}background;enter(t,e){super.enter(t,e),this._zoom=m().scaleExtent([0,this.maxZoom()]).on("zoom",()=>{this.zoomed()}),this.background=e.append("rect").attr("fill","white").attr("opacity",0).on("dblclick",()=>{d().stopPropagation(),delete this.rootExtent,this.resetZoom()}),this.gUpperContent=e.append("g").attr("class","gUpperContent"),this.gUpperAxis=e.append("g").attr("class","gUpperAxis"),this.gMiddleContent=e.append("g").attr("class","gMiddleContent"),this.gLowerAxis=e.append("g").attr("class","gLowerAxis"),this.gLowerContent=e.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),e.call(this._zoom),this._selection.widgetElement(this.gMiddleContent)}_prevIsHorizontal;update(t,e){if(super.update(t,e),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=p(this.tooltipTimeFormat());const i=this.width(),o=this.height();this.background.attr("x",0).attr("y",0).attr("width",i).attr("height",o);const s=this.extent();if(this.tlAxis.x(i/2).orientation(this.isHorizontal()?"top":"left").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(i-1).low(s[0]).high(s[1]).updateScale(),this.brAxis.x(i/2).y(o/2).orientation(this.isHorizontal()?"bottom":"right").reverse(!this.isHorizontal()).timePattern(this.timePattern()).width(i-1).height(o).low(s[0]).high(s[1]).updateScale(),this.transform){let t,e;this.isHorizontal()?(t=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(0))),e=this.tlAxis.parseInvert(this.tlAxis.invert(this.transform.invertX(i-1)))):(t=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(0))),e=this.tlAxis.parseInvert(this.tlAxis.invert(-this.transform.invertY(o-1)))),this.tlAxis.low(t).high(e).updateScale(),this.brAxis.low(t).high(e).updateScale()}const n=this.data().sort(this.isHorizontal()?(t,e)=>{const i=this.brAxis.scalePos(t[1])-this.brAxis.scalePos(e[1]);return 0===i?(""+t[0]).localeCompare(""+e[0]):i}:(t,e)=>this.brAxis.scalePos(e[1])-this.brAxis.scalePos(t[1])),r=n.filter(t=>!t[this._endDate_idx]),a=n.filter(t=>!!t[this._endDate_idx]);this.tlAxis.render(),this.brAxis.render();const l=this.brAxis.getBBox();let h=this.updateEntityPins(r);const c=l.height;let d=o-h;const m=-1!==this._yoffset_idx?Math.min.apply(void 0,this.data().filter(t=>!isNaN(t[this._yoffset_idx])).map(t=>t[this._yoffset_idx])):0;if(r.length>0&&0===a.length){this.tlAxis.visible(!1);let t=h/4;t>o/2-c&&(t=o/2-c);const e=o/2+t,i=-1*(o/2-c-t),s=0!==m?m/2:0;this.gUpperContent.attr("transform",`translate(0, ${e-s})`),this.gLowerAxis.attr("transform",`translate(0, ${i-s})`)}else 0===r.length&&a.length>0?(this.tlAxis.visible(!0),this.gUpperContent.attr("transform",`translate(0, ${h})`),this.gUpperAxis.attr("transform",`translate(0, ${h})`)):(h-=m,d+=m,this.tlAxis.visible(!0),this.gUpperContent.attr("transform",`translate(0, ${h})`),this.gUpperAxis.attr("transform",`translate(0, ${h})`),this.gMiddleContent.attr("transform",`translate(0, ${h})`));this.tlAxis.render();const u=this.tlAxis.getBBox(),_=[],x={};for(const p of a){for(let t=0;t<_.length;++t){const e=_[t];if(e.endPos+this.overlapTolerence()<=this.dataStartPos(p)){x[p]=t,e.endPos=this.dataEndPos(p);break}}void 0===x[p]&&(x[p]=_.length,_.push({endPos:this.dataEndPos(p)}))}const g=this.isHorizontal()?0+u.height:0+u.width,b=this.isHorizontal()?d-l.height:i-l.width;this.verticalBands.range([g,b]).domain(_.map((t,e)=>e)),a.length>0&&this.updateEventRanges(r,a,x,d,u,l,i)}updateEntityPins(t){let e=0;const i=this,o=this.gUpperContent.selectAll(".entity_pin").data(t,t=>t[0]+":"+t[1]),s=this.eventFontColorColumn()?this.columns().indexOf(this.eventFontColorColumn()):-1,n=this.eventBorderColorColumn()?this.columns().indexOf(this.eventBorderColorColumn()):-1,r=this.eventBackgroundColorColumn()?this.columns().indexOf(this.eventBackgroundColorColumn()):-1,a={};for(const d of t){const t=void 0!==d[i._title_idx]?d[i._title_idx]:d[0];a[t]=a[t]?a[t]+1:1}const l=Object.keys(a),h=i.eventGroupOffset(),p=o.enter().append("g").attr("class","entity_pin");p.append("line").attr("class","entity_line"),p.on("mouseover",function(t){u(this).raise()}).each(function(t,e){const o=(new _).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===s?"#333":t[s]).titleColor(-1===s?"#333":t[s]).descriptionColor(-1===s?"#333":t[s]).backgroundShape("pin").backgroundColorFill(-1===s?"#f8f8f8":t[r]).backgroundColorStroke(-1===s?"#ccc":t[n]).cornerRadius(5).arrowHeight(10).arrowWidth(16);i.localEntityPin.set(this,o)}).merge(o).each(function(t,o){const r=i.localEntityPin.get(this),a=void 0!==t[i._title_idx]?t[i._title_idx]:r.title(),p=i.dataStartPos(t)-0;let c=l.indexOf(a)%i.eventGroupMod()*h-5;if(void 0!==t[i._yoffset_idx]&&(c+=t[i._yoffset_idx]?t[i._yoffset_idx]:0),t[i._title_idx]!==r.title()&&t[i._startDate_idx]!==r.description()){const e=i.brAxis.parse(t[i._startDate_idx]),o=i.tooltipFormatter(e);r.x(p).y(c).iconOnlyShowOnHover(i.hideIconWhenCollapsed()).titleOnlyShowOnHover(i.hideTitleWhenCollapsed()).descriptionOnlyShowOnHover(i.hideDescriptionWhenCollapsed()).annotationOnlyShowOnHover(i.hideAnnotationsWhenCollapsed()).icon(void 0!==t[i._icon_idx]?t[i._icon_idx]:r.icon()).title(a).description(o).animationFrameRender()}else r.move({x:p,y:c});const d=r.calcHeight();e<d&&(e=d),u(this).selectAll(".entity_line").attr("x1",p).attr("x2",p).attr("y1",0).attr("y2",c).style("stroke",-1===s?"#ccc":t[n]).style("stroke-width",1)}),o.exit().each(function(t,e){i.localEntityPin.get(this).target(null)}).remove();const c=Math.abs(Math.min(t.length,i.eventGroupMod())*i.eventGroupOffset());return e+c}updateEventRanges(t,e,i,o,s,n,r){const a=this,l=this.gMiddleContent.selectAll(".line").data(t,t=>t[a._title_idx]);l.enter().append("line").attr("class","line").merge(l).attr(this.isHorizontal()?"x1":"y1",t=>this.dataStartPos(t)-0).attr(this.isHorizontal()?"x2":"y2",t=>this.dataStartPos(t)-0).attr(this.isHorizontal()?"y1":"x1",this.isHorizontal()?s.height:s.width).attr(this.isHorizontal()?"y2":"x2",this.isHorizontal()?o-n.height:r-n.width),l.exit().remove();const h=this.gMiddleContent.selectAll(".buckets").data(e,t=>t[a._title_idx]);h.enter().append("g").attr("class","buckets").call(this._selection.enter.bind(this._selection)).each(function(t){const e=(new x).target(this).iconDiameter(28).iconPaddingPercent(0).titleFontSize(28).titleColor(a.rangeFontColor()).descriptionColor(a.rangeFontColor()).iconColor(a.rangeFontColor()).backgroundShape("rect").backgroundColorFill(t[a._color_idx]);a.localRect.set(this,e),a.enterEntityRect(e,t)}).on("click",function(t){a.click(a.rowToObj(t),"range",a._selection.selected(this))},!1).on("dblclick",function(t){a.rootExtent=t,a.resetZoom(),a.dblclick(a.rowToObj(t),"range",a._selection.selected(this))},!0).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(h).attr("transform",t=>a.isHorizontal()?`translate(${this.dataStartPos(t)}, ${this.verticalBands(i[t])}) `:`translate(${this.verticalBands(i[t])}, ${this.dataStartPos(t)}) `).each(function(t){const e=a.localRect.get(this),i=a.dataWidth(t)/2,o=a.verticalBands.bandwidth()/2,s=Math.max(a.dataWidth(t),2),n=Math.max(a.verticalBands.bandwidth(),2),r=.191*n,l=.618*n,h=l;e.pos(a.isHorizontal()?{x:i,y:o}:{x:o,y:i}).fixedHeight(a.isHorizontal()?n:s).fixedWidth(a.isHorizontal()?s:n).icon(void 0!==t[a._icon_idx]?t[a._icon_idx]:"").title(void 0!==t[a._title_idx]?t[a._title_idx]:"").padding(r).iconDiameter(h).titleFontSize(l),1.5*h>s&&e.icon(null),a.updateEntityRect(e,t[a._icon_idx]),e.render()}),h.exit().remove()}exit(t,e){this.brAxis.target(null),this.tlAxis.target(null),super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}enterEntityRect(t,e){}updateEntityRect(t,e){}};e(z,"MiniGantt");let P=z;P.prototype._class+=" timeline_MiniGantt",P.prototype.implements(i.prototype),P.prototype.mixin(s.SimpleSelectionMixin),P.prototype.publish("timePattern","%Y-%m-%d","string","timePattern"),P.prototype.publish("tickFormat",null,"string","tickFormat",void 0,{optional:!0}),P.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","tooltipTimeFormat"),P.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),P.prototype.publish("orientation","horizontal","set","orientation",["horizontal","vertical"]),P.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),P.prototype.publish("titleColumn",null,"string","titleColumn"),P.prototype.publish("startDateColumn",null,"string","startDateColumn"),P.prototype.publish("endDateColumn",null,"string","endDateColumn"),P.prototype.publish("iconColumn",null,"string","iconColumn"),P.prototype.publish("colorColumn",null,"string","colorColumn"),P.prototype.publish("yOffsetColumn",null,"string","yOffsetColumn"),P.prototype.publish("maxZoom",16,"number","maxZoom"),P.prototype.publish("eventGroupOffset",-50,"number","eventGroupOffset"),P.prototype.publish("eventGroupMod",5,"number","eventGroupMod"),P.prototype.publish("eventFontColorColumn",null,"string","eventFontColorColumn"),P.prototype.publish("eventBorderColorColumn",null,"string","eventBorderColorColumn"),P.prototype.publish("eventBackgroundColorColumn",null,"string","eventBackgroundColorColumn"),P.prototype.publish("hideIconWhenCollapsed",!1,"boolean","hideIconWhenCollapsed"),P.prototype.publish("hideTitleWhenCollapsed",!1,"boolean","hideTitleWhenCollapsed"),P.prototype.publish("hideDescriptionWhenCollapsed",!1,"boolean","hideDescriptionWhenCollapsed"),P.prototype.publish("hideAnnotationsWhenCollapsed",!0,"boolean","hideAnnotationsWhenCollapsed"),P.prototype.publish("centerOnMostRecent",!1,"boolean","If true, the timeline will be centered on the most recent data point");const M=class _ReactGantt extends g{_selection=new s.Selection(this);_buckets;_interpolateX;_interpolateY;_bucketsBySeries;_dataBySeries;_origIdxMap;_seriesBackgrounds;_maxFontSize;_tooltip;_minStart;_maxEnd;_prevZoomState=null;_title_idx=0;_startDate_idx=1;_endDate_idx=2;_icon_idx=-1;_color_idx=-1;_series_idx=-1;_bucket_idx=-1;_yoffset_idx=-1;_maxX;_maxY;_rangeOptions={rangePadding:2,fontFamily:"Verdana",fontSize:12,fill:"white",stroke:"black",textFill:"black",cornerRadius:3,strokeWidth:0};constructor(t="origin"){super(),this._drawStartPos=t,this.showToolbar_default(!1),this._tooltip=new k,this._tooltip.tooltipHTML(t=>`<div style="text-align:center;">${t[0]}<br/><br/>${t[1]} -&gt; ${t[2]}</div>`),this._tooltip.followCursor(!0)}selection(t){return arguments.length?(this._selection.set(t),this):this._selection.get()}_rangeRenderer=C;rangeRenderer(t){return arguments.length?(this._rangeRenderer=t,this._rangeRenderer):this._rangeRenderer}enter(t,e){super.enter(t,e);const i=this;e.on("click",function(t){i._selection.clear()}),this._tooltip.target(t)}update(t,i){super.update(t,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;const o=this,s=this.width(),n=s;if(this._interpolateX=b().domain([this._minStart,this._maxEnd]).range([0,n]),this.data().sort((t,e)=>t[1]-e[1]),this._series_idx>-1){this._origIdxMap={},this._dataBySeries={},this._bucketsBySeries={},this.data().forEach((t,e)=>{const i=t[this._series_idx];this._dataBySeries[i]||(this._origIdxMap[i]={},this._dataBySeries[i]=[]),this._dataBySeries[i].push({dataRow:t,origIdx:e})});const t=this.gutter();let e=0;const i=Object.keys(this._dataBySeries);i.forEach(t=>{this._dataBySeries[t].sort((t,e)=>t.dataRow[1]-e.dataRow[1]),this._bucketsBySeries[t]=this.calcBuckets(this._dataBySeries[t].map(t=>t.dataRow),1,2),this._bucketsBySeries[t].bucketHeight=this.bucketHeight(),this._bucketsBySeries[t].bucketOffset=e,e+=(this._bucketsBySeries[t].bucketHeight+this.strokeWidth()+this.gutter())*(this._bucketsBySeries[t].maxBucket+1),this._dataBySeries[t].forEach((e,i)=>{this._origIdxMap[t][e.origIdx]=i})}),this._seriesBackgrounds=this._renderElement.selectAll(".series-background").data(i.map(t=>this._bucketsBySeries[t])),this._seriesBackgrounds.join(t=>t.append("rect").attr("class","series-background"),t=>t,t=>t.each(function(t){delete t.element}).remove()).attr("opacity",t=>t.props&&t.props.hidden?0:1).each(function(e,i){u(this).attr("x",0).attr("y",e.bucketOffset-t/2).attr("width",s).attr("height",(e.bucketHeight+t)*(e.maxBucket+1)+t).attr("fill",i%2?o.oddSeriesBackground():o.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);if(!this.preserveZoom()||!this._prevZoomState){const t=this._interpolateX(this._minStart);this.zoomTo([t,0],1)}const r=this.bucketHeight();this.setRangeOptions(),this._maxFontScale=r-2*this.rangePadding(),this.measureDataText();const a=this._renderElement.selectAll(".item").data(this.data()),l=this.strokeWidth(),h=2*l;if(a.join(t=>t.append("g").attr("class","item").on("click.selectionBag",function(t,i){const s=void 0===t.id?i:t.id;o._selection.isSelected({_id:s,element:t.element})?o._selection.clear():o._selection.click({_id:s,element:/* @__PURE__ */e(()=>t.element,"element")},d),o.selectionChanged(),d().stopPropagation()}).on("click",function(t){const e=t.element.classed("selected");t[o.columns().length]&&(t.__lparam=t[o.columns().length]),o.click(t,"",e)}).on("dblclick",function(t){const e=t.element.classed("selected");t[o.columns().length]&&(t.__lparam=t[o.columns().length]),o.click(t,"",e)}).on("mousein",function(t){o.highlightItem(u(this),t);const e=t.element.classed("selected");o.mousein(t,"",e)}).on("mouseover",function(t){const e=d();o._tooltip._triggerElement=t.element,o._tooltip._cursorLoc=[e.clientX,e.clientY],o._tooltip.data(t).visible(!0).fitContent(!0).render(),o.highlightItem(u(this),t);const i=t.element.classed("selected");o.mouseover(t,"",i)}).on("mouseout",function(t){o._tooltip.visible(!1).render(),o.highlightItem(null,null);const e=t.element.classed("selected");o.mouseout(t,"",e)}).each(function(t,e){t.that=this,t.element=u(this),t.x=o._interpolateX(t[1]);const i=o._interpolateX(t[2]);if(o._series_idx>-1){const i=t[o._series_idx],s=o._bucketsBySeries[i].bucketMap[o._origIdxMap[i][e]];t.y=o._bucketsBySeries[i].interpolateY(s)+o._bucketsBySeries[i].bucketOffset}else{const i=-1===o._bucket_idx?e:t[o._bucket_idx];t.y=o._buckets.interpolateY(o._buckets.bucketMap[i])}t.props={...t[3],text:t[0]},t.props.width=i-t.x,t.props.height=r,t.x+=l,t.y+=l,t.props.width-=h,t.props.height-=h,t.element.attr("transform",`translate(${t.x+t.props.width/2} ${t.y+t.props.height/2})`)}),t=>t,t=>t.each(function(t){delete t.element}).remove()).attr("opacity",t=>t.props&&t.props.hidden?0:1).each(function(t,e){if(t.that=this,o._series_idx>-1){const i=t[o._series_idx];t.x=o.renderRangeElement(t,e,!1,o._rangeOptions,i)}else t.x=o.renderRangeElement(t,e,!1,o._rangeOptions)}).on("dblclick.zoom",t=>{const e=this._interpolateX(t[1]),i=this._interpolateX(t[2]),o=s/(i-e);this.zoomTo([-e*o,0],o)}),i.on("dblclick.zoom",null),this.preserveZoom()&&this._prevZoomState&&this._interpolateX){const t=this.width();if(t>0){const e=this._minStart,i=this._maxEnd,o=Math.max(e,Math.min(i,this._prevZoomState.visibleStart));let s=Math.max(e,Math.min(i,this._prevZoomState.visibleEnd));if(s<=o){const t=1e-6*(i-e)||1e-6;s=Math.min(i,o+t)}const n=this._interpolateX(o),r=this._interpolateX(s),a=r-n;if(isFinite(a)&&Math.abs(a)>1e-9){const o=t/a,s=.05,l=this.maxZoom(),h=Math.max(s,Math.min(l,o));if(h>0&&isFinite(h)){const o=(n+r)/2,s=t/(2*h),a=this._interpolateX(e),l=this._interpolateX(i);let p=o;p-s<a&&(p=a+s),p+s>l&&(p=l-s);const c=t/2-h*p;isFinite(c)&&this.zoomTo([c,0],h)}}}}}exit(t,e){this._tooltip.target(null),super.exit(t,e)}renderRangeElement(t,e,i=!1,o={},s){const n=o.strokeWidth,r=2*n,a=o.rangePadding;let l;const h=isNaN(this._transform.x)?0:this._transform.x,p=isNaN(this._transform.k)?1:this._transform.k;let c;const d=this.bucketHeight();t.that.setAttribute("data-series",s),this._color_idx>-1&&t.that.setAttribute("data-color",t[this._color_idx]),void 0!==s?(c=this._bucketsBySeries[s].bucketMap[this._origIdxMap[s][e]],t.that.setAttribute("data-b",c),t.that.setAttribute("data-bucketOffset",this._bucketsBySeries[s].bucketOffset),t.y=this._bucketsBySeries[s].interpolateY(c)+this._bucketsBySeries[s].bucketOffset,t.that.setAttribute("data-dy",t.y)):(c=this._buckets.bucketMap[e],t.y=this._buckets.interpolateY(c)),this._color_idx>-1&&(o.fill=t[this._color_idx]),i?(t.x=this._interpolateX(t[1])*p,l=this._interpolateX(t[2])*p,t.props={...t[3],text:t[0]},t.props.width=(l-t.x)/p,t.x+=h,t.props.width*=p):(t.x=this._interpolateX(t[1]),l=this._interpolateX(t[2]),t.props={...t[3],text:t[0]},t.props.width=(l-t.x)/p),t.props.height=d,void 0===s&&this._buckets.bucketScale<1&&(t.props.height=this._buckets.bucketScale*d),void 0===t.element&&t.that&&(t.element=u(t.that)),t.element.attr("transform",`translate(${t.x+t.props.width/2} ${t.y+t.props.height/2})`),t.x+=n,t.y+=n,t.props.width-=r,t.props.height-=r,t.props.width=t.props.width<1?1:t.props.width,t.props.height=t.props.height<1?1:t.props.height;let m=this.truncateText(t.props.text,t.props.width-a,this._maxFontScale);m!==t.props.text?m=this.truncateText(t.props.text,t.props.width-a):t.props.fontSize=this._maxFontScale*o.fontSize,void 0===s&&this._buckets.bucketScale<1&&(t.props.fontSize=Math.min(this._maxFontScale,this._buckets.bucketScale)*o.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),F(this._rangeRenderer,{...o,...t.props,text:m},t.that)}setRangeOptions(){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()}}_transform={k:1,x:0,y:0};zoomed(t){if(this._transform=t,this._interpolateX&&"function"==typeof this._interpolateX.invert){const e=this.width();if(e>0&&isFinite(t.k)&&0!==t.k){const i=(0-t.x)/t.k,o=(e-t.x)/t.k;let s=this._interpolateX.invert(i),n=this._interpolateX.invert(o);if(isFinite(s)&&isFinite(n)){if(s>n){const t=s;s=n,n=t}this._prevZoomState={visibleStart:s,visibleEnd:n}}}}if("scale-all"===this.renderMode())this._zoomScale=t.k,this._zoomTranslate=[t.x,0],this._zoomG.attr("transform",`translate(${t.x} 0)scale(${t.k} 1)`);else{const t=this._rangeOptions;this.data().forEach((e,i)=>{if(this._color_idx>-1&&(t.fill=e[this._color_idx]),this._series_idx>-1){const o=e[this._series_idx];this.renderRangeElement(e,i,!0,t,o)}else this.renderRangeElement(e,i,!0,t)})}this.zoomedHook(t)}zoomedHook(t){}calcBuckets(t,e,i,o){const s={},n={},r=this.overlapTolerence(),a=[{end:-1/0}];let l=0;void 0!==o?(t.forEach((t,e)=>{s[e]=t[o],n[t[o]]=!0}),l=Object.keys(n).length):t.forEach((t,o)=>{for(let n=0;n<a.length;++n)if(0===o||a[n][i]+r<=t[e]){s[o]=n,l<n&&(l=n),a[n][i]=t[i];break}if(void 0===s[o]){s[o]=a.length;const e={};e[i]=t[i],a.push(e)}l<s[o]&&(l=s[o])});const h=(l+1)*(this.bucketHeight()+this.gutter());return{bucketMap:s,maxBucket:l,bucketScale:this.height()/h,interpolateY:b().domain([0,l+1]).range([0,Math.min(this.height(),h)])}}data(t){const e=super.data.apply(this,arguments);return arguments.length>0&&(this._minStart=Math.min(...this.data().map(t=>t[1]))??0,this._maxEnd=Math.max(...this.data().map(t=>t[2]))??1,this.measureDataText(!0)),e}_textWidths;_maxFontScale;_characterWidths;_prevFontFamily;_prevFontSize;measureDataText(t=!1){const e={},i={},o=this.fontFamily(),n=this.fontSize(),r=this.bucketHeight();r&&(this._maxFontScale=(r-2*this.rangePadding())/n),(t||this._prevFontFamily!==o||this._prevFontSize!==n)&&(i["."]=s.textSize(".",o,n).width,this.data().forEach(t=>{e[t[0]]||(e[t[0]]=s.textSize(t[0],o,n).width),t[0].split("").forEach(t=>{i[t]||(i[t]=s.textSize(t,o,n).width)})}),this._textWidths=e,this._characterWidths=i),this._prevFontFamily=o,this._prevFontSize=n}truncateText(t,e,i=1){if(this._textWidths[t]*i<e)return t;let o="",s=0;const n=e-3*this._characterWidths["."];for(const r of t){if(s+=this._characterWidths[r],!(s<n))break;o+=r}return n<0?"":o+"..."}resize(t){let e;return e=this.fitWidthToContent()||this.fitHeightToContent()?super.resize.call(this,{width:t.width,height:Math.max(this._maxY??0,t?.height??0)}):super.resize.apply(this,arguments),e}selectionChanged(){}highlightItem(t,e){}click(t,e,i){}dblclick(t,e,i){}mousein(t,e,i){}mouseover(t,e,i){}mouseout(t,e,i){}};e(M,"ReactGantt");let T=M;T.prototype._class+=" timeline_ReactGantt",T.prototype.publish("fitWidthToContent",!1,"boolean","If true, resize will simply reapply the bounding box width"),T.prototype.publish("fitHeightToContent",!1,"boolean","If true, resize will simply reapply the bounding box height"),T.prototype.publish("preserveZoom",!1,"boolean","If true, maintain zoom level when data is updated"),T.prototype.publish("titleColumn",null,"string","Column name to for the title"),T.prototype.publish("startDateColumn",null,"string","Column name to for the start date"),T.prototype.publish("endDateColumn",null,"string","Column name to for the end date"),T.prototype.publish("iconColumn",null,"string","Column name to for the icon"),T.prototype.publish("colorColumn",null,"string","Column name to for the color"),T.prototype.publish("seriesColumn",null,"string","Column name to for the series identifier"),T.prototype.publish("bucketColumn",null,"string","Column name to for the bucket identifier"),T.prototype.publish("renderMode","default","set","Render modes vary in features and performance",["default","scale-all"]),T.prototype.publish("rangePadding",3,"number","Padding within each range rectangle (pixels)"),T.prototype.publish("fill","#1f77b4","string","Background color of range rectangle"),T.prototype.publish("stroke",null,"string","Color of range rectangle border"),T.prototype.publish("strokeWidth",null,"number","Width of range rectangle border (pixels)"),T.prototype.publish("cornerRadius",3,"number","Space between range buckets (pixels)"),T.prototype.publish("fontFamily",null,"string","Font family within range rectangle",null,{optional:!0}),T.prototype.publish("fontSize",10,"number","Size of font within range rectangle (pixels)"),T.prototype.publish("rangeFontColor","#ecf0f1","html-color","rangeFontColor"),T.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),T.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),T.prototype.publish("bucketHeight",100,"number","Max height of range element (pixels)"),T.prototype.publish("gutter",2,"number","Space between range buckets (pixels)"),T.prototype.publish("maxZoom",16,"number","Maximum zoom"),T.prototype.publish("evenSeriesBackground","#FFFFFF","html-color","Background color of even series rows"),T.prototype.publish("oddSeriesBackground","#DDDDDD","html-color","Background color of odd series rows");const D=class _ReactAxisGantt extends n{_topAxis=new o("center").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_gantt=new T("center").stroke("#000000");_bottomAxis=new o("center").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_topAxisElement;_contentElement;_bottomAxisElement;_topRect;_contentRect;_bottomRect;rangeRenderer;constructor(){super(),this._drawStartPos="origin",this.rangeRenderer=function(){const t=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:t}}selection(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()}resizeWrappers(){const t=this.width(),e=this.height(),i=this.axisHeight(),o=e-2*i,s=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 ${i+s})`),this._gantt.resize({height:o,width:t}),this._bottomRect.attr("height",i).attr("width",t).attr("fill","transparent"),this._bottomAxisElement.attr("transform",`translate(0 ${i+o+s})`),this._bottomAxis.resize({height:i,width:t})}enter(t,e){super.enter(t,e),this._gantt.click=(t,e,i)=>{this.click(t,e,i)},this._gantt.dblclick=(t,e,i)=>{this.dblclick(t,e,i)},this._topAxisElement=e.append("g").attr("class","top-axis-wrapper"),this._topRect=this._topAxisElement.append("rect").attr("class","top-axis-rect"),this._contentElement=e.append("g").attr("class","content-wrapper"),this._contentRect=this._contentElement.append("rect").attr("class","content-rect"),this._bottomAxisElement=e.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=t=>{this.onzoom(t)}}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).render(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).render()}update(t,e){super.update(t,e),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()}exit(t,e){this._bottomAxis.target(null),this._gantt.target(null),this._topAxis.target(null),super.exit(t,e)}columns(t){const e=super.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(t),e}data(t){const e=super.data.apply(this,arguments);if(arguments.length>0){const t=this.data().map(t=>{const e=[...t];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=Math.min(...t.map(t=>t[1]))??0,this._gantt._maxEnd=Math.max(...t.map(t=>t[2]))??1,this._gantt.data(t)}return e}resize(t){const e=super.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),e}click(t,e,i){}dblclick(t,e,i){}tooltip(){return this._gantt._tooltip}};e(D,"ReactAxisGantt");let E=D;E.prototype._class+=" timeline_ReactAxisGantt",E.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),E.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),E.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),E.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),E.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),E.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),E.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),E.prototype.publishProxy("gutter","_gantt"),E.prototype.publishProxy("renderMode","_gantt"),E.prototype.publishProxy("strokeWidth","_gantt"),E.prototype.publishProxy("fontSize","_gantt"),E.prototype.publishProxy("fontFamily","_gantt"),E.prototype.publishProxy("stroke","_gantt"),E.prototype.publishProxy("cornerRadius","_gantt"),E.prototype.publishProxy("titleColumn","_gantt"),E.prototype.publishProxy("startDateColumn","_gantt"),E.prototype.publishProxy("endDateColumn","_gantt"),E.prototype.publishProxy("iconColumn","_gantt"),E.prototype.publishProxy("colorColumn","_gantt"),E.prototype.publishProxy("bucketColumn","_gantt"),E.prototype.publishProxy("maxZoom","_gantt"),E.prototype.publishProxy("bucketHeight","_gantt");const H=class _ReactAxisGanttSeries extends v{_topAxis=new o("origin").orientation("top").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_gantt=new T("origin").stroke("#000000").fitHeightToContent(!0);_bottomAxis=new o("origin").orientation("bottom").type("linear").shrinkToFit("none").overlapMode("hide").extend(0).tickFormat("d");_topAxisElement;_contentElement;_bottomAxisElement;_topRect;_contentRect;_bottomRect;constructor(){super(),this.centerOverflowX_default("hidden"),this.centerOverflowY_default("auto")}selection(t){return arguments.length?(this._gantt.selection(t),this):this._gantt.selection()}rangeRenderer(t){const e=this._gantt.rangeRenderer.apply(this._gantt,arguments);return arguments.length?this:e}resizeWrappers(){const 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()}enter(t,e){super.enter(t,e),this._gantt.click=(t,e,i)=>{this.click(t,e,i)},this._gantt.dblclick=(t,e,i)=>{this.dblclick(t,e,i)},this.top(this._topAxis),this.center(this._gantt),this.bottom(this._bottomAxis),this.resizeWrappers(),this._gantt.zoomedHook=t=>{this.onzoom(t)}}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).lazyRender(),this._bottomAxis.fontFamily(this.axisFontFamily()).fontSize(this.axisFontSize()).tickLength(this.axisTickLength()).low(n).high(r).lazyRender()}update(t,e){super.update(t,e),this._topAxis.tickFormat(this.tickFormat()).render(),this._bottomAxis.tickFormat(this.tickFormat()).render(),this._gantt.render()}columns(t){const e=super.columns.apply(this,arguments);return arguments.length>0&&this._gantt.columns(t),e}data(t){const e=super.data.apply(this,arguments);if(arguments.length>0){const t=this.data().map(t=>{const e=[...t];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=y(t,t=>t[1]),this._gantt._maxEnd=f(t,t=>t[2]),this._gantt.data(t)}return e}resize(t){const e=super.resize.apply(this,arguments);return this._topAxisElement&&this.resizeWrappers(),e}click(t,e,i){}dblclick(t,e,i){}tooltip(){return this._gantt._tooltip}};e(H,"ReactAxisGanttSeries");let R=H;R.prototype._class+=" timeline_ReactAxisGanttSeries",R.prototype.publish("tickFormat",null,"string","Format rule applied to axis tick labels",void 0,{optional:!0}),R.prototype.publish("axisHeight",22,"number","Height of axes (pixels)"),R.prototype.publish("overlapTolerence",2,"number","overlapTolerence"),R.prototype.publish("smallestRangeWidth",10,"number","Width of the shortest range (pixels)"),R.prototype.publish("axisFontSize",null,"number","Font size of axis tick labels"),R.prototype.publish("axisFontFamily",null,"string","Font family of axis tick labels"),R.prototype.publish("axisTickLength",null,"number","Length of axis ticks"),R.prototype.publishProxy("gutter","_gantt"),R.prototype.publishProxy("renderMode","_gantt"),R.prototype.publishProxy("strokeWidth","_gantt"),R.prototype.publishProxy("fontSize","_gantt"),R.prototype.publishProxy("fontFamily","_gantt"),R.prototype.publishProxy("stroke","_gantt"),R.prototype.publishProxy("cornerRadius","_gantt"),R.prototype.publishProxy("titleColumn","_gantt"),R.prototype.publishProxy("startDateColumn","_gantt"),R.prototype.publishProxy("endDateColumn","_gantt"),R.prototype.publishProxy("iconColumn","_gantt"),R.prototype.publishProxy("colorColumn","_gantt"),R.prototype.publishProxy("seriesColumn","_gantt"),R.prototype.publishProxy("bucketColumn","_gantt"),R.prototype.publishProxy("maxZoom","_gantt"),R.prototype.publishProxy("preserveZoom","_gantt"),R.prototype.publishProxy("evenSeriesBackground","_gantt"),R.prototype.publishProxy("oddSeriesBackground","_gantt"),R.prototype.publishProxy("bucketHeight","_gantt");const O=class _ReactTimeline extends E{_axisLabelFormatter;constructor(){super(),this._drawStartPos="origin",this._topAxis.type("time"),this._bottomAxis.type("time"),this.tooltipHTML(t=>{const e=h("%Q"),i=e(t[1]),o=e(t[2]),s=p(this.tooltipTimeFormat());return`<div style="text-align:center;">${t[0]}<br/><br/>${s(i)} -&gt; ${s(o)}</div>`})}update(t,e){if(super.update(t,e),this.timePattern_exists()){let t=1/0,e=-1/0,i="",o="";this.data().map(s=>{const n=new Date(s[1]).getTime(),r=new Date(s[2]).getTime();t>n&&(t=n,i=""+s[1]),e<r&&(e=r,o=""+s[2])});const s=this._axisLabelFormatter?this._axisLabelFormatter:this.tickFormat_exists&&this.tickFormat_exists()?this.tickFormat():void 0;this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),s?(this._topAxis.tickFormat(s),this._bottomAxis.tickFormat(s)):(this._topAxis.tickFormat_reset(),this._bottomAxis.tickFormat_reset()),this._gantt._minStart=t,this._gantt._maxEnd=e}}tooltipHTML(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this}parseAxisValue(t){const e=h("%Q")(t);return p(this.timePattern())(e)}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render(),this._bottomAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render()}};e(O,"ReactTimeline");let B=O;B.prototype._class+=" timeline_ReactTimeline",B.prototype.publish("timePattern","%Y-%m-%d","string","Time pattern used for parsing datetime strings on each data row",null,{optional:!0}),B.prototype.publish("tooltipTimeFormat","%Y-%m-%d","string","Time format used in the default html tooltip");const W=h("%Q"),L=class _ReactTimelineSeries extends R{_axisLabelFormatter;constructor(){super(),this._topAxis.type("time"),this._bottomAxis.type("time"),this.tooltipHTML(t=>{const e=W(t[1]),i=W(t[2]),o=p(this.tooltipTimeFormat());return`<div style="text-align:center;">${t[0]}<br/><br/>${o(e)} -&gt; ${o(i)}</div>`})}update(t,e){if(super.update(t,e),this.timePattern_exists()){let t=1/0,e=-1/0,i="",o="";this.data().forEach(s=>{const n=new Date(s[1]).getTime(),r=new Date(s[2]).getTime();t>n&&(t=n,i=""+s[1]),e<r&&(e=r,o=""+s[2])});const s=this._axisLabelFormatter?this._axisLabelFormatter:this.tickFormat_exists&&this.tickFormat_exists()?this.tickFormat():void 0;this._topAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),this._bottomAxis.type("time").timePattern(this.timePattern()).overlapMode("none").low(i).high(o),s?(this._topAxis.tickFormat(s),this._bottomAxis.tickFormat(s)):(this._topAxis.tickFormat_reset(),this._bottomAxis.tickFormat_reset()),this._gantt._minStart=t,this._gantt._maxEnd=e}}tickFormatFunc(t){return arguments.length?(this._axisLabelFormatter=t,this._topAxis.tickFormatFunc(t),this._bottomAxis.tickFormatFunc(t),this):this._axisLabelFormatter}tooltipHTML(t){return this._tooltipHTML=t,this.tooltip().tooltipHTML(this._tooltipHTML),this}parseAxisValue(t){const e=W(t);return p(this.timePattern())(e)}onzoom(t){const e=this.width(),i=this._gantt._minStart,o=this._gantt._maxEnd-i,s=o/e,n=Math.floor(i-s*(t.x/t.k)),r=Math.ceil(o/t.k+n);this._topAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render(),this._bottomAxis.low(this.parseAxisValue(n)).high(this.parseAxisValue(r)).render()}_tooltipHTML};e(L,"ReactTimelineSeries");let $=L;$.prototype._class+=" timeline_ReactTimelineSeries",$.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");export{S as BUILD_VERSION,P as MiniGantt,w as PKG_NAME,A as PKG_VERSION,E as ReactAxisGantt,R as ReactAxisGanttSeries,T as ReactGantt,B as ReactTimeline,$ as ReactTimelineSeries};
2
2
  //# sourceMappingURL=index.js.map
3
3
  !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".timeline_MiniGantt .line{fill:none;stroke:#d3d3d3;opacity:.7}.timeline_MiniGantt .common_TextBox .rect{fill:#87cefa;stroke:#00f;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}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();