gantt-canvas-chart 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * gantt-canvas-chart v1.0.1
2
+ * gantt-canvas-chart v1.0.2
3
3
  * (c) 2025-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -147,8 +147,8 @@ class GanttChart {
147
147
  offsetTop: 0,
148
148
  offsetLeft: 0,
149
149
  viewFactors: { Day: 80, Week: 20, Month: 15, Year: 6 },
150
- planBorderColor: "#caeed2",
151
- actualBgColor: "#78c78f",
150
+ planBorderColor: "#C1EFCF",
151
+ actualBgColor: "#5AC989",
152
152
  ...config
153
153
  };
154
154
  this.headerCanvas = headerCanvas;
@@ -383,6 +383,7 @@ class GanttChart {
383
383
  ctx.fillStyle = "#f9f9f9";
384
384
  ctx.fillRect(this.scrollLeft, 0, this.viewportWidth, h);
385
385
  ctx.textBaseline = "middle";
386
+ ctx.textRendering = "optimizeLegibility";
386
387
  let currentDate = new Date(this.visibleDateRange.start);
387
388
  currentDate = this.getIterationStartDate(currentDate);
388
389
  let lastUpperText = "";
@@ -449,13 +450,14 @@ class GanttChart {
449
450
  const unitWidth = this.dateToX(nextDate) - x;
450
451
  if (upperText !== lastUpperText) {
451
452
  ctx.fillStyle = "#333";
452
- ctx.font = "bold 13px sans-serif";
453
+ ctx.font = 'bold 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
454
+ ctx.textRendering = "optimizeLegibility";
453
455
  ctx.textAlign = "left";
454
456
  ctx.fillText(upperText, x + 5, h * 0.35);
455
457
  lastUpperText = upperText;
456
458
  }
457
- ctx.fillStyle = "#666";
458
- ctx.font = "12px sans-serif";
459
+ ctx.fillStyle = "#000412";
460
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
459
461
  ctx.textAlign = "center";
460
462
  ctx.fillText(lowerText, x + unitWidth / 2, h * 0.7);
461
463
  ctx.beginPath();
@@ -569,7 +571,9 @@ class GanttChart {
569
571
  }
570
572
  drawAllTasks(ctx) {
571
573
  ctx.textBaseline = "middle";
572
- ctx.font = "12px Arial";
574
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
575
+ ctx.textRendering = "optimizeSpeed";
576
+ ctx.imageSmoothingEnabled = false;
573
577
  for (let i = 0; i < this.data.length; i++) {
574
578
  const row = this.data[i];
575
579
  const y = i * this.config.rowHeight;
@@ -586,7 +590,7 @@ class GanttChart {
586
590
  }
587
591
  }
588
592
  drawGrid(ctx, startDate, endDate) {
589
- ctx.strokeStyle = "#f0f0f0";
593
+ ctx.strokeStyle = "#e6e6e6";
590
594
  ctx.lineWidth = 1;
591
595
  ctx.beginPath();
592
596
  if (this.config.showRowLines) {
@@ -701,7 +705,7 @@ class GanttChart {
701
705
  ctx.lineTo(pos.x_plan_start + width * percent_plan, taskY);
702
706
  ctx.stroke();
703
707
  }
704
- ctx.fillStyle = "#333";
708
+ ctx.fillStyle = "#000";
705
709
  if (this.config.showLeftRemark && task.leftRemark) {
706
710
  ctx.textAlign = "right";
707
711
  ctx.fillText(task.leftRemark, Math.min(...[pos.x_plan_start, pos.x_actual_start].filter((val) => val !== null && val !== void 0)) - 8, textY);
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * gantt-canvas-chart v1.0.1
2
+ * gantt-canvas-chart v1.0.2
3
3
  * (c) 2025-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -10,6 +10,7 @@
10
10
  overflow: hidden;
11
11
  position: relative;
12
12
  background: white;
13
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
13
14
  }
14
15
 
15
16
  .__gantt-chart-container {
@@ -18,6 +19,7 @@
18
19
  position: relative;
19
20
  background: #ffffff;
20
21
  height: 100%;
22
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
21
23
  }
22
24
 
23
25
  .__gantt-scroll-dummy {
@@ -37,6 +39,7 @@
37
39
  z-index: 10;
38
40
  background: #f8fafc;
39
41
  border-bottom: 1px solid #e2e8f0;
42
+ text-rendering: optimizeSpeed;
40
43
  }
41
44
 
42
45
  .__gantt-main-canvas {
@@ -44,6 +47,26 @@
44
47
  top: 56px; /* Corresponds to header height */
45
48
  left: 0;
46
49
  z-index: 1;
50
+ text-rendering: optimizeSpeed;
51
+ }
52
+
53
+ /* Add to your CSS file or create a stylesheet */
54
+ .__gantt-chart-container {
55
+ transform: translateZ(0); /* Force hardware acceleration */
56
+ -webkit-font-smoothing: antialiased;
57
+ -moz-osx-font-smoothing: grayscale;
58
+ text-rendering: optimizeLegibility;
59
+ }
60
+
61
+ .__gantt-header-canvas,
62
+ .__gantt-main-canvas {
63
+ image-rendering: -webkit-optimize-contrast;
64
+ image-rendering: crisp-edges;
65
+ shape-rendering: crispEdges;
66
+ /* Add font rendering optimizations */
67
+ -webkit-font-smoothing: antialiased;
68
+ -moz-osx-font-smoothing: grayscale;
69
+ text-rendering: optimizeSpeed;
47
70
  }
48
71
 
49
72
  /* Tooltip */
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * gantt-canvas-chart v1.0.1
2
+ * gantt-canvas-chart v1.0.2
3
3
  * (c) 2025-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -145,8 +145,8 @@ class GanttChart {
145
145
  offsetTop: 0,
146
146
  offsetLeft: 0,
147
147
  viewFactors: { Day: 80, Week: 20, Month: 15, Year: 6 },
148
- planBorderColor: "#caeed2",
149
- actualBgColor: "#78c78f",
148
+ planBorderColor: "#C1EFCF",
149
+ actualBgColor: "#5AC989",
150
150
  ...config
151
151
  };
152
152
  this.headerCanvas = headerCanvas;
@@ -381,6 +381,7 @@ class GanttChart {
381
381
  ctx.fillStyle = "#f9f9f9";
382
382
  ctx.fillRect(this.scrollLeft, 0, this.viewportWidth, h);
383
383
  ctx.textBaseline = "middle";
384
+ ctx.textRendering = "optimizeLegibility";
384
385
  let currentDate = new Date(this.visibleDateRange.start);
385
386
  currentDate = this.getIterationStartDate(currentDate);
386
387
  let lastUpperText = "";
@@ -447,13 +448,14 @@ class GanttChart {
447
448
  const unitWidth = this.dateToX(nextDate) - x;
448
449
  if (upperText !== lastUpperText) {
449
450
  ctx.fillStyle = "#333";
450
- ctx.font = "bold 13px sans-serif";
451
+ ctx.font = 'bold 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
452
+ ctx.textRendering = "optimizeLegibility";
451
453
  ctx.textAlign = "left";
452
454
  ctx.fillText(upperText, x + 5, h * 0.35);
453
455
  lastUpperText = upperText;
454
456
  }
455
- ctx.fillStyle = "#666";
456
- ctx.font = "12px sans-serif";
457
+ ctx.fillStyle = "#000412";
458
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
457
459
  ctx.textAlign = "center";
458
460
  ctx.fillText(lowerText, x + unitWidth / 2, h * 0.7);
459
461
  ctx.beginPath();
@@ -567,7 +569,9 @@ class GanttChart {
567
569
  }
568
570
  drawAllTasks(ctx) {
569
571
  ctx.textBaseline = "middle";
570
- ctx.font = "12px Arial";
572
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
573
+ ctx.textRendering = "optimizeSpeed";
574
+ ctx.imageSmoothingEnabled = false;
571
575
  for (let i = 0; i < this.data.length; i++) {
572
576
  const row = this.data[i];
573
577
  const y = i * this.config.rowHeight;
@@ -584,7 +588,7 @@ class GanttChart {
584
588
  }
585
589
  }
586
590
  drawGrid(ctx, startDate, endDate) {
587
- ctx.strokeStyle = "#f0f0f0";
591
+ ctx.strokeStyle = "#e6e6e6";
588
592
  ctx.lineWidth = 1;
589
593
  ctx.beginPath();
590
594
  if (this.config.showRowLines) {
@@ -699,7 +703,7 @@ class GanttChart {
699
703
  ctx.lineTo(pos.x_plan_start + width * percent_plan, taskY);
700
704
  ctx.stroke();
701
705
  }
702
- ctx.fillStyle = "#333";
706
+ ctx.fillStyle = "#000";
703
707
  if (this.config.showLeftRemark && task.leftRemark) {
704
708
  ctx.textAlign = "right";
705
709
  ctx.fillText(task.leftRemark, Math.min(...[pos.x_plan_start, pos.x_actual_start].filter((val) => val !== null && val !== void 0)) - 8, textY);
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * gantt-canvas-chart v1.0.1
2
+ * gantt-canvas-chart v1.0.2
3
3
  * (c) 2025-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -149,8 +149,8 @@
149
149
  offsetTop: 0,
150
150
  offsetLeft: 0,
151
151
  viewFactors: { Day: 80, Week: 20, Month: 15, Year: 6 },
152
- planBorderColor: "#caeed2",
153
- actualBgColor: "#78c78f",
152
+ planBorderColor: "#C1EFCF",
153
+ actualBgColor: "#5AC989",
154
154
  ...config
155
155
  };
156
156
  this.headerCanvas = headerCanvas;
@@ -385,6 +385,7 @@
385
385
  ctx.fillStyle = "#f9f9f9";
386
386
  ctx.fillRect(this.scrollLeft, 0, this.viewportWidth, h);
387
387
  ctx.textBaseline = "middle";
388
+ ctx.textRendering = "optimizeLegibility";
388
389
  let currentDate = new Date(this.visibleDateRange.start);
389
390
  currentDate = this.getIterationStartDate(currentDate);
390
391
  let lastUpperText = "";
@@ -451,13 +452,14 @@
451
452
  const unitWidth = this.dateToX(nextDate) - x;
452
453
  if (upperText !== lastUpperText) {
453
454
  ctx.fillStyle = "#333";
454
- ctx.font = "bold 13px sans-serif";
455
+ ctx.font = 'bold 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
456
+ ctx.textRendering = "optimizeLegibility";
455
457
  ctx.textAlign = "left";
456
458
  ctx.fillText(upperText, x + 5, h * 0.35);
457
459
  lastUpperText = upperText;
458
460
  }
459
- ctx.fillStyle = "#666";
460
- ctx.font = "12px sans-serif";
461
+ ctx.fillStyle = "#000412";
462
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
461
463
  ctx.textAlign = "center";
462
464
  ctx.fillText(lowerText, x + unitWidth / 2, h * 0.7);
463
465
  ctx.beginPath();
@@ -571,7 +573,9 @@
571
573
  }
572
574
  drawAllTasks(ctx) {
573
575
  ctx.textBaseline = "middle";
574
- ctx.font = "12px Arial";
576
+ ctx.font = '12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
577
+ ctx.textRendering = "optimizeSpeed";
578
+ ctx.imageSmoothingEnabled = false;
575
579
  for (let i = 0; i < this.data.length; i++) {
576
580
  const row = this.data[i];
577
581
  const y = i * this.config.rowHeight;
@@ -588,7 +592,7 @@
588
592
  }
589
593
  }
590
594
  drawGrid(ctx, startDate, endDate) {
591
- ctx.strokeStyle = "#f0f0f0";
595
+ ctx.strokeStyle = "#e6e6e6";
592
596
  ctx.lineWidth = 1;
593
597
  ctx.beginPath();
594
598
  if (this.config.showRowLines) {
@@ -703,7 +707,7 @@
703
707
  ctx.lineTo(pos.x_plan_start + width * percent_plan, taskY);
704
708
  ctx.stroke();
705
709
  }
706
- ctx.fillStyle = "#333";
710
+ ctx.fillStyle = "#000";
707
711
  if (this.config.showLeftRemark && task.leftRemark) {
708
712
  ctx.textAlign = "right";
709
713
  ctx.fillText(task.leftRemark, Math.min(...[pos.x_plan_start, pos.x_actual_start].filter((val) => val !== null && val !== void 0)) - 8, textY);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-canvas-chart",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "High performance Gantt chart component based on Canvas, can be applied to any framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",
@@ -14,7 +14,7 @@
14
14
  "import": "./dist/index.es.js",
15
15
  "require": "./dist/index.umd.cjs"
16
16
  },
17
- "./styles": "./dist/index.css"
17
+ "./style.css": "./dist/index.css"
18
18
  },
19
19
  "files": [
20
20
  "dist"