@lv-x-software-house/x_view 1.2.8-dev.19 → 1.2.8-dev.20

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
@@ -16393,6 +16393,7 @@ function XViewScene({
16393
16393
  const baseX = sourceMesh.position.x + TIMELINE_NODE_SPACING_X;
16394
16394
  const baseY = sourceMesh.position.y;
16395
16395
  const columns = [];
16396
+ const allFinalPoints = [sourceMesh.position.clone()];
16396
16397
  timelineNodes.forEach((node) => {
16397
16398
  const { mesh, type, startDate, endDate, label } = node;
16398
16399
  const startY = timeToYMap.get(startDate.getTime());
@@ -16412,6 +16413,7 @@ function XViewScene({
16412
16413
  }
16413
16414
  const x = baseX + node.columnIndex * TIMELINE_NODE_SPACING_X;
16414
16415
  const y = baseY + startY;
16416
+ allFinalPoints.push(new THREE3.Vector3(x, y, 0));
16415
16417
  const versionTween = new import_tween2.Tween(mesh.position).to({ x, y, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
16416
16418
  tweenGroup.add(versionTween);
16417
16419
  versionTween.start();
@@ -16455,7 +16457,21 @@ function XViewScene({
16455
16457
  }
16456
16458
  }
16457
16459
  });
16458
- }, []);
16460
+ if (allFinalPoints.length > 0) {
16461
+ const boundingBox = new THREE3.Box3().setFromPoints(allFinalPoints);
16462
+ const center = new THREE3.Vector3();
16463
+ boundingBox.getCenter(center);
16464
+ const size = new THREE3.Vector3();
16465
+ boundingBox.getSize(size);
16466
+ const spread = Math.max(size.x, size.y, size.z, 1);
16467
+ const desiredDistance = Math.max(
16468
+ x_view_config.CAMERA_ZOOM_DISTANCE,
16469
+ spread * 1.5
16470
+ );
16471
+ const zoomFactor = x_view_config.CAMERA_ZOOM_DISTANCE / desiredDistance;
16472
+ tweenToTarget(center, zoomFactor);
16473
+ }
16474
+ }, [tweenToTarget]);
16459
16475
  (0, import_react33.useEffect)(() => {
16460
16476
  async function fetchAllData(configPath, ownerId2) {
16461
16477
  var _a2, _b2;
package/dist/index.mjs CHANGED
@@ -16456,6 +16456,7 @@ function XViewScene({
16456
16456
  const baseX = sourceMesh.position.x + TIMELINE_NODE_SPACING_X;
16457
16457
  const baseY = sourceMesh.position.y;
16458
16458
  const columns = [];
16459
+ const allFinalPoints = [sourceMesh.position.clone()];
16459
16460
  timelineNodes.forEach((node) => {
16460
16461
  const { mesh, type, startDate, endDate, label } = node;
16461
16462
  const startY = timeToYMap.get(startDate.getTime());
@@ -16475,6 +16476,7 @@ function XViewScene({
16475
16476
  }
16476
16477
  const x = baseX + node.columnIndex * TIMELINE_NODE_SPACING_X;
16477
16478
  const y = baseY + startY;
16479
+ allFinalPoints.push(new THREE3.Vector3(x, y, 0));
16478
16480
  const versionTween = new Tween2(mesh.position).to({ x, y, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
16479
16481
  tweenGroup.add(versionTween);
16480
16482
  versionTween.start();
@@ -16518,7 +16520,21 @@ function XViewScene({
16518
16520
  }
16519
16521
  }
16520
16522
  });
16521
- }, []);
16523
+ if (allFinalPoints.length > 0) {
16524
+ const boundingBox = new THREE3.Box3().setFromPoints(allFinalPoints);
16525
+ const center = new THREE3.Vector3();
16526
+ boundingBox.getCenter(center);
16527
+ const size = new THREE3.Vector3();
16528
+ boundingBox.getSize(size);
16529
+ const spread = Math.max(size.x, size.y, size.z, 1);
16530
+ const desiredDistance = Math.max(
16531
+ x_view_config.CAMERA_ZOOM_DISTANCE,
16532
+ spread * 1.5
16533
+ );
16534
+ const zoomFactor = x_view_config.CAMERA_ZOOM_DISTANCE / desiredDistance;
16535
+ tweenToTarget(center, zoomFactor);
16536
+ }
16537
+ }, [tweenToTarget]);
16522
16538
  useEffect25(() => {
16523
16539
  async function fetchAllData(configPath, ownerId2) {
16524
16540
  var _a2, _b2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.8-dev.19",
3
+ "version": "1.2.8-dev.20",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",