@cardenelabs/cdl 0.112.0 → 0.113.0

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.js CHANGED
@@ -16217,7 +16217,15 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16217
16217
  const preferredSubDx = subBranchW + 20;
16218
16218
  const reserve = maxSubDepth > 0 ? branchW / 2 + maxSubDepth * preferredSubDx : 0;
16219
16219
  const maxLayer1XOffset = Math.max(minLayer1XOffset, canvasW / 2 - reserve);
16220
- const layer1XOffset = Math.max(minLayer1XOffset, Math.min(canvasW * 0.32, maxLayer1XOffset));
16220
+ const \u8449\u306E\u540D\u524D\u306E\u6700\u5927\u5E45 = Math.max(
16221
+ 0,
16222
+ ...firstLevel.filter((br) => (childrenOf.get(br.id) ?? []).length === 0).map((br) => {
16223
+ const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title: br.title, isRoot: false })[0];
16224
+ return measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize});
16225
+ })
16226
+ );
16227
+ const \u540D\u524D\u3067\u6C7A\u307E\u308B\u4E0A\u9650 = canvasW / 2 + branchW / 2 - \u8449\u306E\u540D\u524D\u306E\u6700\u5927\u5E45;
16228
+ const layer1XOffset = Math.max(minLayer1XOffset, Math.min(\u540D\u524D\u3067\u6C7A\u307E\u308B\u4E0A\u9650, maxLayer1XOffset));
16221
16229
  const room = canvasW / 2 - layer1XOffset;
16222
16230
  const MIN_SUB_W = 56;
16223
16231
  const PREFERRED_GAP = MIND_BOX_GAP;
@@ -16315,7 +16323,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16315
16323
  let maxExtentX = rootW / 2;
16316
16324
  let maxExtentY = rootH / 2;
16317
16325
  for (const n of nodes) {
16318
- maxExtentX = Math.max(maxExtentX, Math.abs(n.x - cx) + n.w / 2);
16326
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
16327
+ maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
16319
16328
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
16320
16329
  }
16321
16330
  const scale = Math.min(1, drawableHalfW / maxExtentX, drawableHalfH / maxExtentY);