hyperprop-charting-library 0.1.87 → 0.1.89
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.
|
@@ -2648,7 +2648,7 @@ function createChart(element, options = {}) {
|
|
|
2648
2648
|
const prevFont = ctx.font;
|
|
2649
2649
|
ctx.font = `500 ${fontSize}px ${mergedOptions.fontFamily}`;
|
|
2650
2650
|
ctx.textAlign = "left";
|
|
2651
|
-
ctx.textBaseline = "
|
|
2651
|
+
ctx.textBaseline = "middle";
|
|
2652
2652
|
const lines = (drawing.label ?? "").split("\n");
|
|
2653
2653
|
const lineH = Math.round(fontSize * 1.35);
|
|
2654
2654
|
const textW = Math.max(1, ...lines.map((line) => ctx.measureText(line).width));
|
|
@@ -2666,17 +2666,15 @@ function createChart(element, options = {}) {
|
|
|
2666
2666
|
strokeRoundedRect(ax, ay, blockW, blockH, 4);
|
|
2667
2667
|
}
|
|
2668
2668
|
ctx.fillStyle = drawing.color;
|
|
2669
|
-
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH));
|
|
2670
|
-
ctx.restore();
|
|
2671
|
-
ctx.font = prevFont;
|
|
2669
|
+
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH + lineH / 2));
|
|
2672
2670
|
if (isSelected) {
|
|
2673
|
-
ctx.
|
|
2674
|
-
ctx.strokeStyle = hexToRgba(drawing.color, 0.
|
|
2671
|
+
ctx.setLineDash([3, 3]);
|
|
2672
|
+
ctx.strokeStyle = hexToRgba(drawing.color, 0.7);
|
|
2675
2673
|
ctx.lineWidth = 1;
|
|
2676
|
-
ctx.setLineDash([]);
|
|
2677
2674
|
strokeRoundedRect(ax - 2, ay - 2, blockW + 4, blockH + 4, 3);
|
|
2678
|
-
ctx.restore();
|
|
2679
2675
|
}
|
|
2676
|
+
ctx.restore();
|
|
2677
|
+
ctx.font = prevFont;
|
|
2680
2678
|
}
|
|
2681
2679
|
}
|
|
2682
2680
|
ctx.restore();
|
|
@@ -2622,7 +2622,7 @@ function createChart(element, options = {}) {
|
|
|
2622
2622
|
const prevFont = ctx.font;
|
|
2623
2623
|
ctx.font = `500 ${fontSize}px ${mergedOptions.fontFamily}`;
|
|
2624
2624
|
ctx.textAlign = "left";
|
|
2625
|
-
ctx.textBaseline = "
|
|
2625
|
+
ctx.textBaseline = "middle";
|
|
2626
2626
|
const lines = (drawing.label ?? "").split("\n");
|
|
2627
2627
|
const lineH = Math.round(fontSize * 1.35);
|
|
2628
2628
|
const textW = Math.max(1, ...lines.map((line) => ctx.measureText(line).width));
|
|
@@ -2640,17 +2640,15 @@ function createChart(element, options = {}) {
|
|
|
2640
2640
|
strokeRoundedRect(ax, ay, blockW, blockH, 4);
|
|
2641
2641
|
}
|
|
2642
2642
|
ctx.fillStyle = drawing.color;
|
|
2643
|
-
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH));
|
|
2644
|
-
ctx.restore();
|
|
2645
|
-
ctx.font = prevFont;
|
|
2643
|
+
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH + lineH / 2));
|
|
2646
2644
|
if (isSelected) {
|
|
2647
|
-
ctx.
|
|
2648
|
-
ctx.strokeStyle = hexToRgba(drawing.color, 0.
|
|
2645
|
+
ctx.setLineDash([3, 3]);
|
|
2646
|
+
ctx.strokeStyle = hexToRgba(drawing.color, 0.7);
|
|
2649
2647
|
ctx.lineWidth = 1;
|
|
2650
|
-
ctx.setLineDash([]);
|
|
2651
2648
|
strokeRoundedRect(ax - 2, ay - 2, blockW + 4, blockH + 4, 3);
|
|
2652
|
-
ctx.restore();
|
|
2653
2649
|
}
|
|
2650
|
+
ctx.restore();
|
|
2651
|
+
ctx.font = prevFont;
|
|
2654
2652
|
}
|
|
2655
2653
|
}
|
|
2656
2654
|
ctx.restore();
|
package/dist/index.cjs
CHANGED
|
@@ -2648,7 +2648,7 @@ function createChart(element, options = {}) {
|
|
|
2648
2648
|
const prevFont = ctx.font;
|
|
2649
2649
|
ctx.font = `500 ${fontSize}px ${mergedOptions.fontFamily}`;
|
|
2650
2650
|
ctx.textAlign = "left";
|
|
2651
|
-
ctx.textBaseline = "
|
|
2651
|
+
ctx.textBaseline = "middle";
|
|
2652
2652
|
const lines = (drawing.label ?? "").split("\n");
|
|
2653
2653
|
const lineH = Math.round(fontSize * 1.35);
|
|
2654
2654
|
const textW = Math.max(1, ...lines.map((line) => ctx.measureText(line).width));
|
|
@@ -2666,17 +2666,15 @@ function createChart(element, options = {}) {
|
|
|
2666
2666
|
strokeRoundedRect(ax, ay, blockW, blockH, 4);
|
|
2667
2667
|
}
|
|
2668
2668
|
ctx.fillStyle = drawing.color;
|
|
2669
|
-
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH));
|
|
2670
|
-
ctx.restore();
|
|
2671
|
-
ctx.font = prevFont;
|
|
2669
|
+
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH + lineH / 2));
|
|
2672
2670
|
if (isSelected) {
|
|
2673
|
-
ctx.
|
|
2674
|
-
ctx.strokeStyle = hexToRgba(drawing.color, 0.
|
|
2671
|
+
ctx.setLineDash([3, 3]);
|
|
2672
|
+
ctx.strokeStyle = hexToRgba(drawing.color, 0.7);
|
|
2675
2673
|
ctx.lineWidth = 1;
|
|
2676
|
-
ctx.setLineDash([]);
|
|
2677
2674
|
strokeRoundedRect(ax - 2, ay - 2, blockW + 4, blockH + 4, 3);
|
|
2678
|
-
ctx.restore();
|
|
2679
2675
|
}
|
|
2676
|
+
ctx.restore();
|
|
2677
|
+
ctx.font = prevFont;
|
|
2680
2678
|
}
|
|
2681
2679
|
}
|
|
2682
2680
|
ctx.restore();
|
package/dist/index.js
CHANGED
|
@@ -2622,7 +2622,7 @@ function createChart(element, options = {}) {
|
|
|
2622
2622
|
const prevFont = ctx.font;
|
|
2623
2623
|
ctx.font = `500 ${fontSize}px ${mergedOptions.fontFamily}`;
|
|
2624
2624
|
ctx.textAlign = "left";
|
|
2625
|
-
ctx.textBaseline = "
|
|
2625
|
+
ctx.textBaseline = "middle";
|
|
2626
2626
|
const lines = (drawing.label ?? "").split("\n");
|
|
2627
2627
|
const lineH = Math.round(fontSize * 1.35);
|
|
2628
2628
|
const textW = Math.max(1, ...lines.map((line) => ctx.measureText(line).width));
|
|
@@ -2640,17 +2640,15 @@ function createChart(element, options = {}) {
|
|
|
2640
2640
|
strokeRoundedRect(ax, ay, blockW, blockH, 4);
|
|
2641
2641
|
}
|
|
2642
2642
|
ctx.fillStyle = drawing.color;
|
|
2643
|
-
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH));
|
|
2644
|
-
ctx.restore();
|
|
2645
|
-
ctx.font = prevFont;
|
|
2643
|
+
lines.forEach((line, lineIndex) => ctx.fillText(line, ax + padX, ay + padY + lineIndex * lineH + lineH / 2));
|
|
2646
2644
|
if (isSelected) {
|
|
2647
|
-
ctx.
|
|
2648
|
-
ctx.strokeStyle = hexToRgba(drawing.color, 0.
|
|
2645
|
+
ctx.setLineDash([3, 3]);
|
|
2646
|
+
ctx.strokeStyle = hexToRgba(drawing.color, 0.7);
|
|
2649
2647
|
ctx.lineWidth = 1;
|
|
2650
|
-
ctx.setLineDash([]);
|
|
2651
2648
|
strokeRoundedRect(ax - 2, ay - 2, blockW + 4, blockH + 4, 3);
|
|
2652
|
-
ctx.restore();
|
|
2653
2649
|
}
|
|
2650
|
+
ctx.restore();
|
|
2651
|
+
ctx.font = prevFont;
|
|
2654
2652
|
}
|
|
2655
2653
|
}
|
|
2656
2654
|
ctx.restore();
|