@hirokisakabe/pom 7.3.1 → 7.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measureCompositeNodes.d.ts","sourceRoot":"","sources":["../../src/calcYogaLayout/measureCompositeNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EAEZ,MAAM,aAAa,CAAC;AAOrB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAuBA;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,
|
|
1
|
+
{"version":3,"file":"measureCompositeNodes.d.ts","sourceRoot":"","sources":["../../src/calcYogaLayout/measureCompositeNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EAEZ,MAAM,aAAa,CAAC;AAOrB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAuBA;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAsCA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAQA;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAuCA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAsBA;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAcA"}
|
|
@@ -43,9 +43,11 @@ export function measureTimeline(node) {
|
|
|
43
43
|
const direction = node.direction ?? "horizontal";
|
|
44
44
|
if (direction === "horizontal") {
|
|
45
45
|
// 各アイテムの幅: 120px (ラベル幅)
|
|
46
|
-
//
|
|
46
|
+
// 両端アイテムのラベルがコンテナに収まるよう labelW 込みで計算する
|
|
47
|
+
// (描画側 renderHorizontalTimeline は線端点を labelW/2 でインセットする)
|
|
48
|
+
const labelW = 120;
|
|
47
49
|
const minItemSpacing = 120; // 各アイテムの最小間隔
|
|
48
|
-
const minWidth =
|
|
50
|
+
const minWidth = labelW + (itemCount - 1) * minItemSpacing;
|
|
49
51
|
// 高さ: 上部ラベル(40) + nodeRadius*2 + 下部ラベル(24+32) + マージン
|
|
50
52
|
const height = 40 + nodeRadius * 2 + 8 + 24 + 32;
|
|
51
53
|
return {
|
|
@@ -35,8 +35,11 @@ export function renderTimelineNode(node, ctx) {
|
|
|
35
35
|
function renderHorizontalTimeline(node, ctx, items, defaultColor, nodeRadius, lineWidth, scaleFactor) {
|
|
36
36
|
const itemCount = items.length;
|
|
37
37
|
const lineY = node.y + node.h / 2;
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const labelW = 120 * scaleFactor;
|
|
39
|
+
// 極端に狭い node.w でも startX <= endX を保つため、インセットを node.w/2 で頭打ちする
|
|
40
|
+
const inset = Math.min(labelW / 2, node.w / 2);
|
|
41
|
+
const startX = node.x + inset;
|
|
42
|
+
const endX = node.x + node.w - inset;
|
|
40
43
|
const lineLength = endX - startX;
|
|
41
44
|
// メインの線を描画
|
|
42
45
|
ctx.slide.addShape(ctx.pptx.ShapeType.line, {
|
|
@@ -46,7 +49,6 @@ function renderHorizontalTimeline(node, ctx, items, defaultColor, nodeRadius, li
|
|
|
46
49
|
h: 0,
|
|
47
50
|
line: { color: "E2E8F0", width: pxToPt(lineWidth) },
|
|
48
51
|
});
|
|
49
|
-
const labelW = 120 * scaleFactor;
|
|
50
52
|
const dateLabelH = 24 * scaleFactor;
|
|
51
53
|
const titleLabelH = 24 * scaleFactor;
|
|
52
54
|
const descLabelH = 32 * scaleFactor;
|