@operato/gantt 2.0.0-beta.14 → 2.0.0-beta.17

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/src/gantt-chart-controller.d.ts +32 -0
  3. package/dist/src/gantt-chart-controller.js +393 -0
  4. package/dist/src/gantt-chart-controller.js.map +1 -0
  5. package/dist/src/locales.d.ts +52 -0
  6. package/dist/src/locales.js +79 -0
  7. package/dist/src/locales.js.map +1 -0
  8. package/dist/src/ox-gantt-chart.d.ts +10 -17
  9. package/dist/src/ox-gantt-chart.js +134 -440
  10. package/dist/src/ox-gantt-chart.js.map +1 -1
  11. package/dist/src/ox-gantt-resize-splitter.d.ts +2 -3
  12. package/dist/src/ox-gantt-resize-splitter.js +15 -22
  13. package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
  14. package/dist/src/ox-gantt.d.ts +13 -1
  15. package/dist/src/ox-gantt.js +154 -27
  16. package/dist/src/ox-gantt.js.map +1 -1
  17. package/dist/src/ox-task-tooltip.d.ts +12 -0
  18. package/dist/src/ox-task-tooltip.js +132 -0
  19. package/dist/src/ox-task-tooltip.js.map +1 -0
  20. package/dist/src/types.d.ts +10 -3
  21. package/dist/src/types.js.map +1 -1
  22. package/dist/stories/ox-gantt.stories.js +91 -85
  23. package/dist/stories/ox-gantt.stories.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +3 -2
  26. package/src/gantt-chart-controller.ts +470 -0
  27. package/src/locales.ts +78 -0
  28. package/src/ox-gantt-chart.ts +141 -487
  29. package/src/ox-gantt-resize-splitter.ts +18 -25
  30. package/src/ox-gantt.ts +163 -29
  31. package/src/ox-task-tooltip.ts +120 -0
  32. package/src/types.ts +11 -3
  33. package/stories/ox-gantt.stories.ts +93 -85
  34. package/translations/en.json +11 -1
  35. package/translations/ja.json +11 -1
  36. package/translations/ko.json +11 -1
  37. package/translations/ms.json +11 -1
  38. package/translations/zh.json +11 -1
  39. package/dist/src/locale.d.ts +0 -1
  40. package/dist/src/locale.js +0 -49
  41. package/dist/src/locale.js.map +0 -1
  42. package/src/locale.ts +0 -51
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.0-beta.17](https://github.com/hatiolab/operato/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2024-06-11)
7
+
8
+
9
+ ### :rocket: New Features
10
+
11
+ * ox-input-table-column-config ([0b84541](https://github.com/hatiolab/operato/commit/0b84541ec63fc71538292abd9e81d8c38baee44c))
12
+
13
+
14
+
15
+ ## [2.0.0-beta.15](https://github.com/hatiolab/operato/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2024-06-10)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * gantt 의 그리드라인이 공백이 없도록 함 ([9cd6f33](https://github.com/hatiolab/operato/commit/9cd6f335b21f6383ae41e6f15df733ea81f4fd74))
21
+ * revert i18next version ([75975f7](https://github.com/hatiolab/operato/commit/75975f7295febfbbb2d02774249ca2b742019ba9))
22
+ * splitter는 마우스 움직이는 범위를 gannt 안에서만 허용하도록 함 ([dd2164e](https://github.com/hatiolab/operato/commit/dd2164e01bd8544e6a66d3e5e892609dd4fbea77))
23
+
24
+
25
+ ### :rocket: New Features
26
+
27
+ * gantt chart taskbar tooltip ([758ecd4](https://github.com/hatiolab/operato/commit/758ecd4b7d6b2b77b98cf13d6e4b36c822f4ff12))
28
+ * gantt chart taskbar tooltip 위치 보정 ([1b36b40](https://github.com/hatiolab/operato/commit/1b36b4015c501ee492bf1b1d22355edcce976033))
29
+ * make gantt table section column mergable ([02a91ca](https://github.com/hatiolab/operato/commit/02a91ca89c40156ba43d4db221dc72e7ceccf914))
30
+ * make gantt table section column mergable ([f4dc900](https://github.com/hatiolab/operato/commit/f4dc90022d9dbae01ef8bc8f58d66ed0a0b561a6))
31
+
32
+
33
+
6
34
  ## [2.0.0-beta.14](https://github.com/hatiolab/operato/compare/v2.0.0-beta.13...v2.0.0-beta.14) (2024-06-10)
7
35
 
8
36
 
@@ -0,0 +1,32 @@
1
+ import { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import * as d3 from 'd3';
3
+ import { LEVEL, Task, TaskTag } from './types';
4
+ import { OxTaskTooltip } from './ox-task-tooltip';
5
+ export declare class GanttChartController implements ReactiveController {
6
+ private host;
7
+ private fromTime;
8
+ private toTime;
9
+ private totalDays;
10
+ private _timeScale?;
11
+ private touchStartY?;
12
+ private scrollStartY?;
13
+ baseWidth: number;
14
+ level: LEVEL;
15
+ selectedTaskId?: string;
16
+ tasks: Task[];
17
+ extendGridLines: boolean;
18
+ constructor(host: ReactiveControllerHost & LitElement, fromDate: string, toDate: string, axisScale: LEVEL);
19
+ hostConnected(): void;
20
+ get timeScale(): d3.ScaleTime<number, number, never>;
21
+ updateRange(fromDate: string, toDate: string): void;
22
+ setTasks(tasks: Task[]): void;
23
+ updateTimeScale(): void;
24
+ getChartWidth(): number;
25
+ getScale(): number;
26
+ drawAxes(svgHeader: SVGElement): void;
27
+ drawBody(svgBody: SVGElement, tooltip: OxTaskTooltip): void;
28
+ getTaskColor(tags: TaskTag[]): string;
29
+ handleWheelForBody(event: WheelEvent, container: HTMLDivElement): void;
30
+ handleTouchStartForBody(event: TouchEvent, container: HTMLDivElement): void;
31
+ handleTouchMoveForBody(event: TouchEvent, container: HTMLDivElement): void;
32
+ }
@@ -0,0 +1,393 @@
1
+ import * as d3 from 'd3';
2
+ export class GanttChartController {
3
+ constructor(host, fromDate, toDate, axisScale) {
4
+ this.baseWidth = 30;
5
+ this.tasks = [];
6
+ this.extendGridLines = false;
7
+ this.host = host;
8
+ this.fromTime = new Date(fromDate);
9
+ this.toTime = new Date(toDate);
10
+ this.level = axisScale;
11
+ this.totalDays = d3.timeDay.count(this.fromTime, d3.timeDay.offset(this.toTime, 1));
12
+ this.host.addController(this);
13
+ }
14
+ hostConnected() {
15
+ this.updateTimeScale();
16
+ }
17
+ get timeScale() {
18
+ if (!this._timeScale) {
19
+ this._timeScale = d3
20
+ .scaleTime()
21
+ .domain([d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1)])
22
+ .range([0, this.getChartWidth()]);
23
+ }
24
+ return this._timeScale;
25
+ }
26
+ updateRange(fromDate, toDate) {
27
+ this.fromTime = new Date(fromDate);
28
+ this.toTime = new Date(toDate);
29
+ this.totalDays = d3.timeDay.count(this.fromTime, d3.timeDay.offset(this.toTime, 1));
30
+ this._timeScale = undefined;
31
+ this.host.requestUpdate();
32
+ }
33
+ setTasks(tasks) {
34
+ this.tasks = tasks;
35
+ this.host.requestUpdate();
36
+ }
37
+ updateTimeScale() {
38
+ this.timeScale.range([0, this.getChartWidth()]);
39
+ }
40
+ getChartWidth() {
41
+ return (this.totalDays * this.baseWidth) / this.getScale();
42
+ }
43
+ getScale() {
44
+ if (this.level == 'quarter-week') {
45
+ return 7 / 2;
46
+ }
47
+ else if (this.level == 'year-month') {
48
+ return 30 / 2;
49
+ }
50
+ else if (this.level == 'year-quarter') {
51
+ return 90 / 2;
52
+ }
53
+ return 1;
54
+ }
55
+ drawAxes(svgHeader) {
56
+ const header = d3.select(svgHeader);
57
+ header.selectAll('*').remove();
58
+ header.attr('width', this.getChartWidth());
59
+ const addGridLines = (ticks, yStart, yEnd) => {
60
+ ticks.forEach(tick => {
61
+ const startX = this.timeScale(tick);
62
+ header
63
+ .append('line')
64
+ .attr('x1', startX)
65
+ .attr('x2', startX)
66
+ .attr('y1', yStart)
67
+ .attr('y2', yEnd)
68
+ .attr('stroke', 'var(--ox-gantt-color-gridlines, var(--md-sys-color-outline))')
69
+ .attr('stroke-width', 1);
70
+ });
71
+ };
72
+ const centerLabel = (selection, tickInterval) => {
73
+ selection.selectAll('text').attr('transform', (d) => {
74
+ const tickIntervalWidth = this.timeScale(tickInterval.offset(d, 1)) - this.timeScale(d);
75
+ return `translate(${tickIntervalWidth / 2}, -2)`;
76
+ });
77
+ };
78
+ if (this.level === 'week-day') {
79
+ const weekAxis = d3
80
+ .axisTop(this.timeScale)
81
+ .ticks(d3.timeWeek.every(1))
82
+ .tickFormat(d3.timeFormat('%B %d'))
83
+ .tickSize(0);
84
+ const weekTicks = d3.timeWeek
85
+ .every(1)
86
+ .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1));
87
+ addGridLines(weekTicks, 0, 20);
88
+ const weekAxisG = header
89
+ .append('g')
90
+ .classed('week-axis no-select md-typescale-label-small', true)
91
+ .attr('transform', `translate(0, 20)`)
92
+ .call(weekAxis);
93
+ centerLabel(weekAxisG, d3.timeWeek);
94
+ const dayAxis = d3
95
+ .axisTop(this.timeScale)
96
+ .ticks(d3.timeDay.every(1))
97
+ .tickFormat(d3.timeFormat('%d'))
98
+ .tickSize(0);
99
+ const dayTicks = d3.timeDay.every(1).range(d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1));
100
+ addGridLines(dayTicks, 20, 40);
101
+ const dayAxisG = header
102
+ .append('g')
103
+ .classed('day-axis no-select md-typescale-label-small', true)
104
+ .attr('transform', `translate(0, 40)`)
105
+ .call(dayAxis);
106
+ centerLabel(dayAxisG, d3.timeDay);
107
+ }
108
+ else if (this.level === 'quarter-week') {
109
+ const quarterAxis = d3
110
+ .axisTop(this.timeScale)
111
+ .ticks(d3.timeMonth.every(3))
112
+ .tickFormat(d3.timeFormat('%Y %b'))
113
+ .tickSize(0);
114
+ const quarterTicks = d3.timeMonth
115
+ .every(3)
116
+ .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3));
117
+ addGridLines(quarterTicks, 0, 20);
118
+ const quarterAxisG = header
119
+ .append('g')
120
+ .classed('quarter-axis no-select md-typescale-label-small', true)
121
+ .attr('transform', `translate(0, 20)`)
122
+ .call(quarterAxis);
123
+ centerLabel(quarterAxisG, d3.timeMonth.every(3));
124
+ const weekAxis = d3
125
+ .axisTop(this.timeScale)
126
+ .ticks(d3.timeWeek.every(1))
127
+ .tickFormat(d3.timeFormat('%b %d'))
128
+ .tickSize(0);
129
+ const weekTicks = d3.timeWeek
130
+ .every(1)
131
+ .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1));
132
+ addGridLines(weekTicks, 20, 40);
133
+ const weekAxisG = header
134
+ .append('g')
135
+ .classed('week-axis no-select md-typescale-label-small', true)
136
+ .attr('transform', `translate(0, 40)`)
137
+ .call(weekAxis);
138
+ centerLabel(weekAxisG, d3.timeWeek);
139
+ }
140
+ else if (this.level === 'year-month') {
141
+ const yearAxis = d3
142
+ .axisTop(this.timeScale)
143
+ .ticks(d3.timeYear.every(1))
144
+ .tickFormat(d3.timeFormat('%Y'))
145
+ .tickSize(0);
146
+ const yearTicks = d3.timeYear
147
+ .every(1)
148
+ .range(d3.timeYear.floor(this.fromTime), d3.timeYear.offset(this.toTime, 1));
149
+ addGridLines(yearTicks, 0, 20);
150
+ const yearAxisG = header
151
+ .append('g')
152
+ .classed('year-axis no-select md-typescale-label-small', true)
153
+ .attr('transform', `translate(0, 20)`)
154
+ .call(yearAxis);
155
+ centerLabel(yearAxisG, d3.timeYear.every(1));
156
+ const monthAxis = d3
157
+ .axisTop(this.timeScale)
158
+ .ticks(d3.timeMonth.every(1))
159
+ .tickFormat(d3.timeFormat('%b'))
160
+ .tickSize(0);
161
+ const monthTicks = d3.timeMonth
162
+ .every(1)
163
+ .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 1));
164
+ addGridLines(monthTicks, 20, 40);
165
+ const monthAxisG = header
166
+ .append('g')
167
+ .classed('month-axis no-select md-typescale-label-small', true)
168
+ .attr('transform', `translate(0, 40)`)
169
+ .call(monthAxis);
170
+ centerLabel(monthAxisG, d3.timeMonth.every(1));
171
+ }
172
+ else if (this.level === 'year-quarter') {
173
+ const yearAxis = d3
174
+ .axisTop(this.timeScale)
175
+ .ticks(d3.timeYear.every(1))
176
+ .tickFormat(d3.timeFormat('%Y'))
177
+ .tickSize(0);
178
+ const yearTicks = d3.timeYear
179
+ .every(1)
180
+ .range(d3.timeYear.floor(this.fromTime), d3.timeYear.offset(this.toTime, 1));
181
+ addGridLines(yearTicks, 0, 20);
182
+ const yearAxisG = header
183
+ .append('g')
184
+ .classed('year-axis no-select md-typescale-label-small', true)
185
+ .attr('transform', `translate(0, 20)`)
186
+ .call(yearAxis);
187
+ centerLabel(yearAxisG, d3.timeYear.every(1));
188
+ const quarterAxis = d3
189
+ .axisTop(this.timeScale)
190
+ .ticks(d3.timeMonth.every(3))
191
+ .tickFormat(d3.timeFormat('%Y %b'))
192
+ .tickSize(0);
193
+ const quarterTicks = d3.timeMonth
194
+ .every(3)
195
+ .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3));
196
+ addGridLines(quarterTicks, 20, 40);
197
+ const quarterAxisG = header
198
+ .append('g')
199
+ .classed('quarter-axis no-select md-typescale-label-small', true)
200
+ .attr('transform', `translate(0, 40)`)
201
+ .call(quarterAxis);
202
+ centerLabel(quarterAxisG, d3.timeMonth.every(3));
203
+ }
204
+ }
205
+ drawBody(svgBody, tooltip) {
206
+ const body = d3.select(svgBody);
207
+ body.selectAll('*').remove();
208
+ body.attr('width', this.getChartWidth());
209
+ if (this.extendGridLines) {
210
+ const addGridLines = (ticks) => {
211
+ ticks.forEach(tick => {
212
+ const startX = this.timeScale(tick);
213
+ body
214
+ .append('line')
215
+ .attr('x1', startX)
216
+ .attr('x2', startX)
217
+ .attr('y1', 0)
218
+ .attr('y2', Number(svgBody.getBoundingClientRect().height) || 0)
219
+ .attr('stroke', 'var(--ox-gantt-color-gridlines, var(--md-sys-color-outline))')
220
+ .attr('stroke-width', 1);
221
+ });
222
+ };
223
+ if (this.level === 'week-day') {
224
+ const dayTicks = d3.timeDay.every(1).range(d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1));
225
+ addGridLines(dayTicks);
226
+ }
227
+ else if (this.level === 'quarter-week') {
228
+ const weekTicks = d3.timeWeek
229
+ .every(1)
230
+ .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1));
231
+ addGridLines(weekTicks);
232
+ }
233
+ else if (this.level === 'year-month') {
234
+ const monthTicks = d3.timeMonth
235
+ .every(1)
236
+ .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 1));
237
+ addGridLines(monthTicks);
238
+ }
239
+ else if (this.level === 'year-quarter') {
240
+ const quarterTicks = d3.timeMonth
241
+ .every(3)
242
+ .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3));
243
+ addGridLines(quarterTicks);
244
+ }
245
+ }
246
+ const taskPositions = {};
247
+ this.tasks.forEach((task, index) => {
248
+ const startX = this.timeScale(d3.timeDay.floor(d3.min([task.startDate, task.endDate])));
249
+ const endX = this.timeScale(d3.timeDay.offset(d3.timeDay.ceil(d3.max([task.startDate, task.endDate])), -1));
250
+ const taskWidth = endX - startX + this.baseWidth / this.getScale();
251
+ const taskY = index * 30 + 7.5;
252
+ const showTooltip = (event) => {
253
+ tooltip.title = task.title;
254
+ tooltip.startDate = task.startDate.toISOString().split('T')[0];
255
+ tooltip.endDate = task.endDate.toISOString().split('T')[0];
256
+ tooltip.progress = task.progress ?? 0;
257
+ tooltip.type = task.type;
258
+ tooltip.show(event.clientX, event.clientY);
259
+ };
260
+ const hideTooltip = () => {
261
+ tooltip.hide();
262
+ };
263
+ if (this.selectedTaskId === task.id) {
264
+ body
265
+ .append('rect')
266
+ .attr('x', 0)
267
+ .attr('y', taskY - 7.5)
268
+ .attr('width', this.getChartWidth())
269
+ .attr('height', 30)
270
+ .attr('fill', 'var(--ox-gantt-selected-row-background-color, var(--md-sys-color-surface-variant))');
271
+ }
272
+ const taskBar = body
273
+ .append('rect')
274
+ .attr('x', startX)
275
+ .attr('y', taskY)
276
+ .attr('width', taskWidth)
277
+ .attr('height', 15)
278
+ .attr('fill', this.getTaskColor(task.tags || []))
279
+ .attr('stroke', 'black')
280
+ .attr('stroke-width', 1);
281
+ taskBar
282
+ .on('click', () => {
283
+ this.selectedTaskId = task.id;
284
+ const customEvent = new CustomEvent('task-clicked', {
285
+ detail: { taskId: task.id },
286
+ bubbles: true,
287
+ composed: true
288
+ });
289
+ this.host.dispatchEvent(customEvent);
290
+ this.host.requestUpdate();
291
+ })
292
+ .on('mouseover', showTooltip)
293
+ .on('mouseout', hideTooltip);
294
+ if (task.progress !== undefined) {
295
+ const progressWidth = taskWidth * (task.progress / 100);
296
+ const progressBar = body
297
+ .append('rect')
298
+ .attr('x', startX)
299
+ .attr('y', taskY + 7.5 - 3.75)
300
+ .attr('width', progressWidth)
301
+ .attr('height', 7.5)
302
+ .attr('fill', 'lightgreen');
303
+ progressBar
304
+ .on('click', () => {
305
+ this.selectedTaskId = task.id;
306
+ const customEvent = new CustomEvent('task-clicked', {
307
+ detail: { taskId: task.id },
308
+ bubbles: true,
309
+ composed: true
310
+ });
311
+ this.host.dispatchEvent(customEvent);
312
+ this.host.requestUpdate();
313
+ })
314
+ .on('mouseover', showTooltip)
315
+ .on('mouseout', hideTooltip);
316
+ }
317
+ taskPositions[task.id] = { x: endX + this.baseWidth / this.getScale(), y: taskY + 7.5, width: taskWidth };
318
+ });
319
+ this.tasks.forEach(task => {
320
+ if (task.dependsOn && taskPositions[task.dependsOn]) {
321
+ const prevTask = taskPositions[task.dependsOn];
322
+ const currTask = taskPositions[task.id];
323
+ body
324
+ .append('path')
325
+ .attr('d', `
326
+ M${prevTask.x},${prevTask.y}
327
+ L${prevTask.x + 10},${prevTask.y}
328
+ ${prevTask.x + 10 < currTask.x - 10 - currTask.width
329
+ ? `
330
+ L${(prevTask.x + currTask.x - currTask.width) / 2},${prevTask.y}
331
+ L${(prevTask.x + currTask.x - currTask.width) / 2},${currTask.y}
332
+ `
333
+ : `
334
+ L${prevTask.x + 10},${(prevTask.y + currTask.y) / 2}
335
+ L${currTask.x - 10 - currTask.width},${(prevTask.y + currTask.y) / 2}
336
+ `}
337
+ L${currTask.x - 10 - currTask.width},${currTask.y}
338
+ L${currTask.x - currTask.width},${currTask.y}
339
+ `)
340
+ .attr('stroke', 'black')
341
+ .attr('fill', 'none')
342
+ .attr('stroke-width', 1);
343
+ }
344
+ });
345
+ }
346
+ getTaskColor(tags) {
347
+ if (tags.includes('critical')) {
348
+ return 'red';
349
+ }
350
+ else if (tags.includes('milestone')) {
351
+ return 'blue';
352
+ }
353
+ else if (tags.includes('done')) {
354
+ return 'green';
355
+ }
356
+ else {
357
+ return 'grey';
358
+ }
359
+ }
360
+ handleWheelForBody(event, container) {
361
+ event.preventDefault();
362
+ event.stopPropagation();
363
+ if (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey) {
364
+ container.scrollLeft += event.shiftKey ? event.deltaX : event.deltaY;
365
+ }
366
+ else {
367
+ container.scrollTop += event.deltaY;
368
+ }
369
+ const customEvent = new CustomEvent('scroll', {
370
+ detail: { offset: event.shiftKey ? container.scrollLeft : container.scrollTop },
371
+ bubbles: true,
372
+ composed: true
373
+ });
374
+ this.host.dispatchEvent(customEvent);
375
+ }
376
+ handleTouchStartForBody(event, container) {
377
+ event.stopPropagation();
378
+ this.touchStartY = event.touches[0].clientY;
379
+ this.scrollStartY = container.scrollTop;
380
+ }
381
+ handleTouchMoveForBody(event, container) {
382
+ const touchCurrentY = event.touches[0].clientY;
383
+ const deltaY = this.touchStartY - touchCurrentY;
384
+ container.scrollTop = this.scrollStartY + deltaY;
385
+ const customEvent = new CustomEvent('scroll', {
386
+ detail: { offset: container.scrollTop },
387
+ bubbles: true,
388
+ composed: true
389
+ });
390
+ this.host.dispatchEvent(customEvent);
391
+ }
392
+ }
393
+ //# sourceMappingURL=gantt-chart-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gantt-chart-controller.js","sourceRoot":"","sources":["../../src/gantt-chart-controller.ts"],"names":[],"mappings":"AACA,OA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AAA;QAChD,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,YAAa,GAAG,MAAM,CAAA;QAEjD,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE;YAC5C,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE;YACvC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;IACtC,CAAC;CACF","sourcesContent":["import { LitElement, ReactiveController, ReactiveControllerHost } from 'lit'\nimport * as d3 from 'd3'\nimport { LEVEL, Task, TaskTag } from './types'\nimport { OxTaskTooltip } from './ox-task-tooltip'\n\nexport class GanttChartController implements ReactiveController {\n private host: ReactiveControllerHost & LitElement\n private fromTime: Date\n private toTime: Date\n private totalDays: number\n private _timeScale?: d3.ScaleTime<number, number, never>\n\n private touchStartY?: number\n private scrollStartY?: number\n\n public baseWidth: number = 30\n public level: LEVEL\n public selectedTaskId?: string\n\n public tasks: Task[] = []\n public extendGridLines: boolean = false\n\n constructor(host: ReactiveControllerHost & LitElement, fromDate: string, toDate: string, axisScale: LEVEL) {\n this.host = host\n this.fromTime = new Date(fromDate)\n this.toTime = new Date(toDate)\n this.level = axisScale\n this.totalDays = d3.timeDay.count(this.fromTime, d3.timeDay.offset(this.toTime, 1))\n this.host.addController(this)\n }\n\n hostConnected() {\n this.updateTimeScale()\n }\n\n get timeScale() {\n if (!this._timeScale) {\n this._timeScale = d3\n .scaleTime()\n .domain([d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1)])\n .range([0, this.getChartWidth()])\n }\n return this._timeScale\n }\n\n updateRange(fromDate: string, toDate: string) {\n this.fromTime = new Date(fromDate)\n this.toTime = new Date(toDate)\n this.totalDays = d3.timeDay.count(this.fromTime, d3.timeDay.offset(this.toTime, 1))\n this._timeScale = undefined\n this.host.requestUpdate()\n }\n\n setTasks(tasks: Task[]) {\n this.tasks = tasks\n this.host.requestUpdate()\n }\n\n updateTimeScale() {\n this.timeScale.range([0, this.getChartWidth()])\n }\n\n getChartWidth() {\n return (this.totalDays * this.baseWidth) / this.getScale()\n }\n\n getScale() {\n if (this.level == 'quarter-week') {\n return 7 / 2\n } else if (this.level == 'year-month') {\n return 30 / 2\n } else if (this.level == 'year-quarter') {\n return 90 / 2\n }\n return 1\n }\n\n drawAxes(svgHeader: SVGElement) {\n const header = d3.select(svgHeader)\n\n header.selectAll('*').remove()\n header.attr('width', this.getChartWidth())\n\n const addGridLines = (ticks: Date[], yStart: number, yEnd: number) => {\n ticks.forEach(tick => {\n const startX = this.timeScale(tick)\n header\n .append('line')\n .attr('x1', startX)\n .attr('x2', startX)\n .attr('y1', yStart)\n .attr('y2', yEnd)\n .attr('stroke', 'var(--ox-gantt-color-gridlines, var(--md-sys-color-outline))')\n .attr('stroke-width', 1)\n })\n }\n\n const centerLabel = (\n selection: d3.Selection<SVGGElement, unknown, null, any>,\n tickInterval: d3.CountableTimeInterval\n ) => {\n selection.selectAll('text').attr('transform', (d: any) => {\n const tickIntervalWidth = this.timeScale(tickInterval.offset(d, 1)) - this.timeScale(d)\n return `translate(${tickIntervalWidth / 2}, -2)`\n })\n }\n\n if (this.level === 'week-day') {\n const weekAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeWeek.every(1))\n .tickFormat(d3.timeFormat('%B %d') as any)\n .tickSize(0)\n const weekTicks = d3.timeWeek\n .every(1)!\n .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1))\n addGridLines(weekTicks, 0, 20)\n\n const weekAxisG = header\n .append('g')\n .classed('week-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 20)`)\n .call(weekAxis)\n\n centerLabel(weekAxisG, d3.timeWeek)\n\n const dayAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeDay.every(1))\n .tickFormat(d3.timeFormat('%d') as any)\n .tickSize(0)\n\n const dayTicks = d3.timeDay.every(1)!.range(d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1))\n addGridLines(dayTicks, 20, 40)\n\n const dayAxisG = header\n .append('g')\n .classed('day-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 40)`)\n .call(dayAxis)\n\n centerLabel(dayAxisG, d3.timeDay)\n } else if (this.level === 'quarter-week') {\n const quarterAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeMonth.every(3))\n .tickFormat(d3.timeFormat('%Y %b') as any)\n .tickSize(0)\n\n const quarterTicks = d3.timeMonth\n .every(3)!\n .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3))\n addGridLines(quarterTicks, 0, 20)\n\n const quarterAxisG = header\n .append('g')\n .classed('quarter-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 20)`)\n .call(quarterAxis)\n\n centerLabel(quarterAxisG, d3.timeMonth.every(3) as any)\n\n const weekAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeWeek.every(1))\n .tickFormat(d3.timeFormat('%b %d') as any)\n .tickSize(0)\n const weekTicks = d3.timeWeek\n .every(1)!\n .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1))\n addGridLines(weekTicks, 20, 40)\n\n const weekAxisG = header\n .append('g')\n .classed('week-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 40)`)\n .call(weekAxis)\n\n centerLabel(weekAxisG, d3.timeWeek)\n } else if (this.level === 'year-month') {\n const yearAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeYear.every(1))\n .tickFormat(d3.timeFormat('%Y') as any)\n .tickSize(0)\n\n const yearTicks = d3.timeYear\n .every(1)!\n .range(d3.timeYear.floor(this.fromTime), d3.timeYear.offset(this.toTime, 1))\n addGridLines(yearTicks, 0, 20)\n\n const yearAxisG = header\n .append('g')\n .classed('year-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 20)`)\n .call(yearAxis)\n\n centerLabel(yearAxisG, d3.timeYear.every(1)! as any)\n\n const monthAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeMonth.every(1))\n .tickFormat(d3.timeFormat('%b') as any)\n .tickSize(0)\n\n const monthTicks = d3.timeMonth\n .every(1)!\n .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 1))\n addGridLines(monthTicks, 20, 40)\n\n const monthAxisG = header\n .append('g')\n .classed('month-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 40)`)\n .call(monthAxis)\n\n centerLabel(monthAxisG, d3.timeMonth.every(1) as any)\n } else if (this.level === 'year-quarter') {\n const yearAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeYear.every(1))\n .tickFormat(d3.timeFormat('%Y') as any)\n .tickSize(0)\n\n const yearTicks = d3.timeYear\n .every(1)!\n .range(d3.timeYear.floor(this.fromTime), d3.timeYear.offset(this.toTime, 1))\n addGridLines(yearTicks, 0, 20)\n\n const yearAxisG = header\n .append('g')\n .classed('year-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 20)`)\n .call(yearAxis)\n\n centerLabel(yearAxisG, d3.timeYear.every(1)! as any)\n\n const quarterAxis = d3\n .axisTop(this.timeScale)\n .ticks(d3.timeMonth.every(3))\n .tickFormat(d3.timeFormat('%Y %b') as any)\n .tickSize(0)\n\n const quarterTicks = d3.timeMonth\n .every(3)!\n .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3))\n addGridLines(quarterTicks, 20, 40)\n\n const quarterAxisG = header\n .append('g')\n .classed('quarter-axis no-select md-typescale-label-small', true)\n .attr('transform', `translate(0, 40)`)\n .call(quarterAxis)\n\n centerLabel(quarterAxisG, d3.timeMonth.every(3) as any)\n }\n }\n\n drawBody(svgBody: SVGElement, tooltip: OxTaskTooltip) {\n const body = d3.select(svgBody)\n\n body.selectAll('*').remove()\n body.attr('width', this.getChartWidth())\n\n if (this.extendGridLines) {\n const addGridLines = (ticks: Date[]) => {\n ticks.forEach(tick => {\n const startX = this.timeScale(tick)\n body\n .append('line')\n .attr('x1', startX)\n .attr('x2', startX)\n .attr('y1', 0)\n .attr('y2', Number(svgBody.getBoundingClientRect().height) || 0)\n .attr('stroke', 'var(--ox-gantt-color-gridlines, var(--md-sys-color-outline))')\n .attr('stroke-width', 1)\n })\n }\n\n if (this.level === 'week-day') {\n const dayTicks = d3.timeDay.every(1)!.range(d3.timeDay.floor(this.fromTime), d3.timeDay.offset(this.toTime, 1))\n addGridLines(dayTicks)\n } else if (this.level === 'quarter-week') {\n const weekTicks = d3.timeWeek\n .every(1)!\n .range(d3.timeWeek.floor(this.fromTime), d3.timeWeek.offset(this.toTime, 1))\n addGridLines(weekTicks)\n } else if (this.level === 'year-month') {\n const monthTicks = d3.timeMonth\n .every(1)!\n .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 1))\n addGridLines(monthTicks)\n } else if (this.level === 'year-quarter') {\n const quarterTicks = d3.timeMonth\n .every(3)!\n .range(d3.timeMonth.floor(this.fromTime), d3.timeMonth.offset(this.toTime, 3))\n addGridLines(quarterTicks)\n }\n }\n\n const taskPositions: { [key: string]: { x: number; y: number; width: number } } = {}\n\n this.tasks.forEach((task, index) => {\n const startX = this.timeScale(d3.timeDay.floor(d3.min([task.startDate, task.endDate])!))\n const endX = this.timeScale(d3.timeDay.offset(d3.timeDay.ceil(d3.max([task.startDate, task.endDate])!), -1))\n\n const taskWidth = endX - startX + this.baseWidth / this.getScale()\n const taskY = index * 30 + 7.5\n\n const showTooltip = (event: MouseEvent) => {\n tooltip.title = task.title\n tooltip.startDate = task.startDate.toISOString().split('T')[0]\n tooltip.endDate = task.endDate.toISOString().split('T')[0]\n tooltip.progress = task.progress ?? 0\n tooltip.type = task.type\n\n tooltip.show(event.clientX, event.clientY)\n }\n\n const hideTooltip = () => {\n tooltip.hide()\n }\n\n if (this.selectedTaskId === task.id) {\n body\n .append('rect')\n .attr('x', 0)\n .attr('y', taskY - 7.5)\n .attr('width', this.getChartWidth())\n .attr('height', 30)\n .attr('fill', 'var(--ox-gantt-selected-row-background-color, var(--md-sys-color-surface-variant))')\n }\n\n const taskBar = body\n .append('rect')\n .attr('x', startX)\n .attr('y', taskY)\n .attr('width', taskWidth)\n .attr('height', 15)\n .attr('fill', this.getTaskColor(task.tags || []))\n .attr('stroke', 'black')\n .attr('stroke-width', 1)\n\n taskBar\n .on('click', () => {\n this.selectedTaskId = task.id\n const customEvent = new CustomEvent('task-clicked', {\n detail: { taskId: task.id },\n bubbles: true,\n composed: true\n })\n this.host.dispatchEvent(customEvent)\n this.host.requestUpdate()\n })\n .on('mouseover', showTooltip)\n .on('mouseout', hideTooltip)\n\n if (task.progress !== undefined) {\n const progressWidth = taskWidth * (task.progress / 100)\n const progressBar = body\n .append('rect')\n .attr('x', startX)\n .attr('y', taskY + 7.5 - 3.75)\n .attr('width', progressWidth)\n .attr('height', 7.5)\n .attr('fill', 'lightgreen')\n\n progressBar\n .on('click', () => {\n this.selectedTaskId = task.id\n const customEvent = new CustomEvent('task-clicked', {\n detail: { taskId: task.id },\n bubbles: true,\n composed: true\n })\n this.host.dispatchEvent(customEvent)\n this.host.requestUpdate()\n })\n .on('mouseover', showTooltip)\n .on('mouseout', hideTooltip)\n }\n\n taskPositions[task.id] = { x: endX + this.baseWidth / this.getScale(), y: taskY + 7.5, width: taskWidth }\n })\n\n this.tasks.forEach(task => {\n if (task.dependsOn && taskPositions[task.dependsOn]) {\n const prevTask = taskPositions[task.dependsOn]\n const currTask = taskPositions[task.id]\n\n body\n .append('path')\n .attr(\n 'd',\n `\n M${prevTask.x},${prevTask.y}\n L${prevTask.x + 10},${prevTask.y}\n ${\n prevTask.x + 10 < currTask.x - 10 - currTask.width\n ? `\n L${(prevTask.x + currTask.x - currTask.width) / 2},${prevTask.y}\n L${(prevTask.x + currTask.x - currTask.width) / 2},${currTask.y}\n `\n : `\n L${prevTask.x + 10},${(prevTask.y + currTask.y) / 2}\n L${currTask.x - 10 - currTask.width},${(prevTask.y + currTask.y) / 2}\n `\n }\n L${currTask.x - 10 - currTask.width},${currTask.y}\n L${currTask.x - currTask.width},${currTask.y}\n `\n )\n .attr('stroke', 'black')\n .attr('fill', 'none')\n .attr('stroke-width', 1)\n }\n })\n }\n\n getTaskColor(tags: TaskTag[]): string {\n if (tags.includes('critical')) {\n return 'red'\n } else if (tags.includes('milestone')) {\n return 'blue'\n } else if (tags.includes('done')) {\n return 'green'\n } else {\n return 'grey'\n }\n }\n\n handleWheelForBody(event: WheelEvent, container: HTMLDivElement) {\n event.preventDefault()\n event.stopPropagation()\n\n if (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey) {\n container.scrollLeft += event.shiftKey ? event.deltaX : event.deltaY\n } else {\n container.scrollTop += event.deltaY\n }\n\n const customEvent = new CustomEvent('scroll', {\n detail: { offset: event.shiftKey ? container.scrollLeft : container.scrollTop },\n bubbles: true,\n composed: true\n })\n\n this.host.dispatchEvent(customEvent)\n }\n\n handleTouchStartForBody(event: TouchEvent, container: HTMLDivElement) {\n event.stopPropagation()\n\n this.touchStartY = event.touches[0].clientY\n this.scrollStartY = container.scrollTop\n }\n\n handleTouchMoveForBody(event: TouchEvent, container: HTMLDivElement) {\n const touchCurrentY = event.touches[0].clientY\n const deltaY = this.touchStartY! - touchCurrentY\n container.scrollTop = this.scrollStartY! + deltaY\n\n const customEvent = new CustomEvent('scroll', {\n detail: { offset: container.scrollTop },\n bubbles: true,\n composed: true\n })\n this.host.dispatchEvent(customEvent)\n }\n}\n"]}
@@ -0,0 +1,52 @@
1
+ export declare const locales: {
2
+ 'en-US': {
3
+ dateTime: string;
4
+ date: string;
5
+ time: string;
6
+ periods: string[];
7
+ days: string[];
8
+ shortDays: string[];
9
+ months: string[];
10
+ shortMonths: string[];
11
+ };
12
+ 'ko-KR': {
13
+ dateTime: string;
14
+ date: string;
15
+ time: string;
16
+ periods: string[];
17
+ days: string[];
18
+ shortDays: string[];
19
+ months: string[];
20
+ shortMonths: string[];
21
+ };
22
+ 'ja-JP': {
23
+ dateTime: string;
24
+ date: string;
25
+ time: string;
26
+ periods: string[];
27
+ days: string[];
28
+ shortDays: string[];
29
+ months: string[];
30
+ shortMonths: string[];
31
+ };
32
+ 'zh-CN': {
33
+ dateTime: string;
34
+ date: string;
35
+ time: string;
36
+ periods: string[];
37
+ days: string[];
38
+ shortDays: string[];
39
+ months: string[];
40
+ shortMonths: string[];
41
+ };
42
+ 'ms-MY': {
43
+ dateTime: string;
44
+ date: string;
45
+ time: string;
46
+ periods: string[];
47
+ days: string[];
48
+ shortDays: string[];
49
+ months: string[];
50
+ shortMonths: string[];
51
+ };
52
+ };
@@ -0,0 +1,79 @@
1
+ export const locales = {
2
+ 'en-US': {
3
+ dateTime: '%x, %X',
4
+ date: '%-m/%-d/%Y',
5
+ time: '%-I:%M:%S %p',
6
+ periods: ['AM', 'PM'],
7
+ days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
8
+ shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9
+ months: [
10
+ 'January',
11
+ 'February',
12
+ 'March',
13
+ 'April',
14
+ 'May',
15
+ 'June',
16
+ 'July',
17
+ 'August',
18
+ 'September',
19
+ 'October',
20
+ 'November',
21
+ 'December'
22
+ ],
23
+ shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
24
+ },
25
+ 'ko-KR': {
26
+ dateTime: '%x, %X',
27
+ date: '%Y-%m-%d',
28
+ time: '%H:%M:%S',
29
+ periods: ['오전', '오후'],
30
+ days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
31
+ shortDays: ['일', '월', '화', '수', '목', '금', '토'],
32
+ months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
33
+ shortMonths: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
34
+ },
35
+ 'ja-JP': {
36
+ dateTime: '%x, %X',
37
+ date: '%Y/%m/%d',
38
+ time: '%H:%M:%S',
39
+ periods: ['午前', '午後'],
40
+ days: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
41
+ shortDays: ['日', '月', '火', '水', '木', '金', '土'],
42
+ months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
43
+ shortMonths: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
44
+ },
45
+ 'zh-CN': {
46
+ dateTime: '%x, %X',
47
+ date: '%Y-%m-%d',
48
+ time: '%H:%M:%S',
49
+ periods: ['上午', '下午'],
50
+ days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
51
+ shortDays: ['日', '一', '二', '三', '四', '五', '六'],
52
+ months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
53
+ shortMonths: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
54
+ },
55
+ 'ms-MY': {
56
+ dateTime: '%x, %X',
57
+ date: '%d/%m/%Y',
58
+ time: '%H:%M:%S',
59
+ periods: ['AM', 'PM'],
60
+ days: ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'],
61
+ shortDays: ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'],
62
+ months: [
63
+ 'Januari',
64
+ 'Februari',
65
+ 'Mac',
66
+ 'April',
67
+ 'Mei',
68
+ 'Jun',
69
+ 'Julai',
70
+ 'Ogos',
71
+ 'September',
72
+ 'Oktober',
73
+ 'November',
74
+ 'Disember'
75
+ ],
76
+ shortMonths: ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogo', 'Sep', 'Okt', 'Nov', 'Dis']
77
+ }
78
+ };
79
+ //# sourceMappingURL=locales.js.map