@lv-x-software-house/x_view 1.2.5-dev.44 → 1.2.5-dev.45

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
@@ -14059,6 +14059,24 @@ function XViewScene({
14059
14059
  timeToYMap.set(ms, idx * TIMELINE_LAYER_SPACING_Y);
14060
14060
  });
14061
14061
  const startX = -((QUEST_STATUS_ORDER.length - 1) * QUEST_LENS_COLUMN_SPACING) / 2;
14062
+ const positionGroups = /* @__PURE__ */ new Map();
14063
+ const NODE_X_GAP = 22;
14064
+ QUEST_STATUS_ORDER.forEach((statusName) => {
14065
+ const questsInCol = questsByStatus[statusName];
14066
+ questsInCol.forEach((q, rowIndex) => {
14067
+ const timeInfo = questTimeInfos.get(String(q.id)) || { isUndated: true };
14068
+ let nodeY;
14069
+ if (!timeInfo.isUndated) {
14070
+ nodeY = timeToYMap.get(timeInfo.startDate.getTime());
14071
+ } else {
14072
+ const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
14073
+ nodeY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
14074
+ }
14075
+ const posKey = `${statusName}_${nodeY}`;
14076
+ if (!positionGroups.has(posKey)) positionGroups.set(posKey, []);
14077
+ positionGroups.get(posKey).push(String(q.id));
14078
+ });
14079
+ });
14062
14080
  Object.values(nodeObjects).forEach((mesh) => {
14063
14081
  const oldLabel = mesh.getObjectByName("questDateLabel") || mesh.getObjectByName("timelineLabel");
14064
14082
  if (oldLabel) {
@@ -14074,21 +14092,40 @@ function XViewScene({
14074
14092
  mesh.userData.timelineEndLabel = null;
14075
14093
  }
14076
14094
  });
14077
- Object.keys(nodeObjects).forEach((id) => {
14095
+ const nonFilteredNodeIds = Object.keys(nodeObjects).filter((id) => !filteredQuests.some((q) => String(q.id) === String(id)));
14096
+ const COMMON_START_X = startX - 100;
14097
+ const COMMON_COL_SPACING = 30;
14098
+ const COMMON_ROW_SPACING = 35;
14099
+ const MAX_COMMON_ROWS = 15;
14100
+ nonFilteredNodeIds.forEach((id, idx) => {
14078
14101
  const mesh = nodeObjects[id];
14079
- const isFilteredQuest = filteredQuests.some(
14080
- (q) => String(q.id) === String(id)
14081
- );
14082
- if (!isFilteredQuest) {
14083
- if (mesh.material) {
14084
- const fadeTween = new import_tween2.Tween(mesh.material).to({ opacity: 0.15 }, 1200).easing(import_tween2.Easing.Cubic.Out);
14085
- tweenGroup.add(fadeTween);
14086
- fadeTween.start();
14087
- }
14088
- if (mesh.userData.labelObject) {
14089
- mesh.userData.labelObject.visible = false;
14090
- }
14091
- } else {
14102
+ if (!mesh) return;
14103
+ const col = Math.floor(idx / MAX_COMMON_ROWS);
14104
+ const row = idx % MAX_COMMON_ROWS;
14105
+ const targetX = COMMON_START_X - col * COMMON_COL_SPACING;
14106
+ const targetY = -(row * COMMON_ROW_SPACING) + 50;
14107
+ const targetZ = 0;
14108
+ if (mesh.material) {
14109
+ const opacityTween = new import_tween2.Tween(mesh.material).to({ opacity: 1 }, 1200).easing(import_tween2.Easing.Cubic.Out);
14110
+ tweenGroup.add(opacityTween);
14111
+ opacityTween.start();
14112
+ }
14113
+ if (mesh.userData.labelObject) {
14114
+ mesh.userData.labelObject.visible = true;
14115
+ const labelTargetPos = new THREE3.Vector3(targetX, targetY, targetZ).add(
14116
+ mesh.userData.labelOffset || new THREE3.Vector3(0, 3.8, 0)
14117
+ );
14118
+ const labelTween = new import_tween2.Tween(mesh.userData.labelObject.position).to(labelTargetPos, 1500).easing(import_tween2.Easing.Cubic.InOut);
14119
+ tweenGroup.add(labelTween);
14120
+ labelTween.start();
14121
+ }
14122
+ const sideTween = new import_tween2.Tween(mesh.position).to({ x: targetX, y: targetY, z: targetZ }, 1500).easing(import_tween2.Easing.Cubic.InOut);
14123
+ tweenGroup.add(sideTween);
14124
+ sideTween.start();
14125
+ });
14126
+ filteredQuests.forEach((q) => {
14127
+ const mesh = nodeObjects[String(q.id)];
14128
+ if (mesh) {
14092
14129
  if (mesh.material) {
14093
14130
  const fadeInTween = new import_tween2.Tween(mesh.material).to({ opacity: 1 }, 1200).easing(import_tween2.Easing.Cubic.Out);
14094
14131
  tweenGroup.add(fadeInTween);
@@ -14106,9 +14143,6 @@ function XViewScene({
14106
14143
  questsInCol.forEach((q, rowIndex) => {
14107
14144
  const nodeId = String(q.id);
14108
14145
  let mesh = nodeObjects[nodeId];
14109
- if (!mesh) {
14110
- mesh = addOrUpdateNodeMesh(q, new THREE3.Vector3(colX, 150, 0), true);
14111
- }
14112
14146
  const timeInfo = questTimeInfos.get(nodeId) || { isUndated: true };
14113
14147
  let targetY;
14114
14148
  if (!timeInfo.isUndated) {
@@ -14117,7 +14151,15 @@ function XViewScene({
14117
14151
  const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
14118
14152
  targetY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
14119
14153
  }
14120
- const lensTween = new import_tween2.Tween(mesh.position).to({ x: colX, y: targetY, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
14154
+ const posKey = `${statusName}_${targetY}`;
14155
+ const group = positionGroups.get(posKey) || [nodeId];
14156
+ const indexInGroup = group.indexOf(nodeId);
14157
+ const xOffset = (indexInGroup - (group.length - 1) / 2) * NODE_X_GAP;
14158
+ const finalX = colX + xOffset;
14159
+ if (!mesh) {
14160
+ mesh = addOrUpdateNodeMesh(q, new THREE3.Vector3(finalX, 150, 0), true);
14161
+ }
14162
+ const lensTween = new import_tween2.Tween(mesh.position).to({ x: finalX, y: targetY, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
14121
14163
  tweenGroup.add(lensTween);
14122
14164
  lensTween.start();
14123
14165
  if (!timeInfo.isUndated && timeInfo.label && !mesh.getObjectByName("questDateLabel")) {
@@ -14147,20 +14189,19 @@ function XViewScene({
14147
14189
  });
14148
14190
  const intervalBar = new THREE3.Mesh(barGeometry, barMaterial);
14149
14191
  intervalBar.userData.associatedNodeId = mesh.userData.id;
14150
- const endPosition = new THREE3.Vector3(colX, endY, -0.5);
14151
- intervalBar.position.set(colX, (targetY + endY) / 2, -0.5);
14192
+ intervalBar.position.set(finalX, (targetY + endY) / 2, -0.5);
14152
14193
  intervalBar.scale.y = barHeight;
14153
14194
  graphGroup.add(intervalBar);
14154
14195
  mesh.userData.timelineIntervalBar = intervalBar;
14155
14196
  const endLabel = createTextSprite(timeInfo.label.split(" - ")[1] || "", 30);
14156
14197
  endLabel.name = "timelineEndLabel";
14157
- endLabel.position.set(colX, endY + 4, 0);
14198
+ endLabel.position.set(finalX, endY + 4, 0);
14158
14199
  graphGroup.add(endLabel);
14159
14200
  mesh.userData.timelineEndLabel = endLabel;
14160
14201
  }
14161
14202
  }
14162
14203
  if (mesh.userData.labelObject) {
14163
- const labelTargetPos = new THREE3.Vector3(colX, targetY, 0).add(
14204
+ const labelTargetPos = new THREE3.Vector3(finalX, targetY, 0).add(
14164
14205
  mesh.userData.labelOffset || new THREE3.Vector3(0, 3.8, 0)
14165
14206
  );
14166
14207
  const labelTween = new import_tween2.Tween(mesh.userData.labelObject.position).to(labelTargetPos, 1500).easing(import_tween2.Easing.Cubic.InOut);
package/dist/index.mjs CHANGED
@@ -14103,6 +14103,24 @@ function XViewScene({
14103
14103
  timeToYMap.set(ms, idx * TIMELINE_LAYER_SPACING_Y);
14104
14104
  });
14105
14105
  const startX = -((QUEST_STATUS_ORDER.length - 1) * QUEST_LENS_COLUMN_SPACING) / 2;
14106
+ const positionGroups = /* @__PURE__ */ new Map();
14107
+ const NODE_X_GAP = 22;
14108
+ QUEST_STATUS_ORDER.forEach((statusName) => {
14109
+ const questsInCol = questsByStatus[statusName];
14110
+ questsInCol.forEach((q, rowIndex) => {
14111
+ const timeInfo = questTimeInfos.get(String(q.id)) || { isUndated: true };
14112
+ let nodeY;
14113
+ if (!timeInfo.isUndated) {
14114
+ nodeY = timeToYMap.get(timeInfo.startDate.getTime());
14115
+ } else {
14116
+ const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
14117
+ nodeY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
14118
+ }
14119
+ const posKey = `${statusName}_${nodeY}`;
14120
+ if (!positionGroups.has(posKey)) positionGroups.set(posKey, []);
14121
+ positionGroups.get(posKey).push(String(q.id));
14122
+ });
14123
+ });
14106
14124
  Object.values(nodeObjects).forEach((mesh) => {
14107
14125
  const oldLabel = mesh.getObjectByName("questDateLabel") || mesh.getObjectByName("timelineLabel");
14108
14126
  if (oldLabel) {
@@ -14118,21 +14136,40 @@ function XViewScene({
14118
14136
  mesh.userData.timelineEndLabel = null;
14119
14137
  }
14120
14138
  });
14121
- Object.keys(nodeObjects).forEach((id) => {
14139
+ const nonFilteredNodeIds = Object.keys(nodeObjects).filter((id) => !filteredQuests.some((q) => String(q.id) === String(id)));
14140
+ const COMMON_START_X = startX - 100;
14141
+ const COMMON_COL_SPACING = 30;
14142
+ const COMMON_ROW_SPACING = 35;
14143
+ const MAX_COMMON_ROWS = 15;
14144
+ nonFilteredNodeIds.forEach((id, idx) => {
14122
14145
  const mesh = nodeObjects[id];
14123
- const isFilteredQuest = filteredQuests.some(
14124
- (q) => String(q.id) === String(id)
14125
- );
14126
- if (!isFilteredQuest) {
14127
- if (mesh.material) {
14128
- const fadeTween = new Tween2(mesh.material).to({ opacity: 0.15 }, 1200).easing(Easing2.Cubic.Out);
14129
- tweenGroup.add(fadeTween);
14130
- fadeTween.start();
14131
- }
14132
- if (mesh.userData.labelObject) {
14133
- mesh.userData.labelObject.visible = false;
14134
- }
14135
- } else {
14146
+ if (!mesh) return;
14147
+ const col = Math.floor(idx / MAX_COMMON_ROWS);
14148
+ const row = idx % MAX_COMMON_ROWS;
14149
+ const targetX = COMMON_START_X - col * COMMON_COL_SPACING;
14150
+ const targetY = -(row * COMMON_ROW_SPACING) + 50;
14151
+ const targetZ = 0;
14152
+ if (mesh.material) {
14153
+ const opacityTween = new Tween2(mesh.material).to({ opacity: 1 }, 1200).easing(Easing2.Cubic.Out);
14154
+ tweenGroup.add(opacityTween);
14155
+ opacityTween.start();
14156
+ }
14157
+ if (mesh.userData.labelObject) {
14158
+ mesh.userData.labelObject.visible = true;
14159
+ const labelTargetPos = new THREE3.Vector3(targetX, targetY, targetZ).add(
14160
+ mesh.userData.labelOffset || new THREE3.Vector3(0, 3.8, 0)
14161
+ );
14162
+ const labelTween = new Tween2(mesh.userData.labelObject.position).to(labelTargetPos, 1500).easing(Easing2.Cubic.InOut);
14163
+ tweenGroup.add(labelTween);
14164
+ labelTween.start();
14165
+ }
14166
+ const sideTween = new Tween2(mesh.position).to({ x: targetX, y: targetY, z: targetZ }, 1500).easing(Easing2.Cubic.InOut);
14167
+ tweenGroup.add(sideTween);
14168
+ sideTween.start();
14169
+ });
14170
+ filteredQuests.forEach((q) => {
14171
+ const mesh = nodeObjects[String(q.id)];
14172
+ if (mesh) {
14136
14173
  if (mesh.material) {
14137
14174
  const fadeInTween = new Tween2(mesh.material).to({ opacity: 1 }, 1200).easing(Easing2.Cubic.Out);
14138
14175
  tweenGroup.add(fadeInTween);
@@ -14150,9 +14187,6 @@ function XViewScene({
14150
14187
  questsInCol.forEach((q, rowIndex) => {
14151
14188
  const nodeId = String(q.id);
14152
14189
  let mesh = nodeObjects[nodeId];
14153
- if (!mesh) {
14154
- mesh = addOrUpdateNodeMesh(q, new THREE3.Vector3(colX, 150, 0), true);
14155
- }
14156
14190
  const timeInfo = questTimeInfos.get(nodeId) || { isUndated: true };
14157
14191
  let targetY;
14158
14192
  if (!timeInfo.isUndated) {
@@ -14161,7 +14195,15 @@ function XViewScene({
14161
14195
  const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
14162
14196
  targetY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
14163
14197
  }
14164
- const lensTween = new Tween2(mesh.position).to({ x: colX, y: targetY, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
14198
+ const posKey = `${statusName}_${targetY}`;
14199
+ const group = positionGroups.get(posKey) || [nodeId];
14200
+ const indexInGroup = group.indexOf(nodeId);
14201
+ const xOffset = (indexInGroup - (group.length - 1) / 2) * NODE_X_GAP;
14202
+ const finalX = colX + xOffset;
14203
+ if (!mesh) {
14204
+ mesh = addOrUpdateNodeMesh(q, new THREE3.Vector3(finalX, 150, 0), true);
14205
+ }
14206
+ const lensTween = new Tween2(mesh.position).to({ x: finalX, y: targetY, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
14165
14207
  tweenGroup.add(lensTween);
14166
14208
  lensTween.start();
14167
14209
  if (!timeInfo.isUndated && timeInfo.label && !mesh.getObjectByName("questDateLabel")) {
@@ -14191,20 +14233,19 @@ function XViewScene({
14191
14233
  });
14192
14234
  const intervalBar = new THREE3.Mesh(barGeometry, barMaterial);
14193
14235
  intervalBar.userData.associatedNodeId = mesh.userData.id;
14194
- const endPosition = new THREE3.Vector3(colX, endY, -0.5);
14195
- intervalBar.position.set(colX, (targetY + endY) / 2, -0.5);
14236
+ intervalBar.position.set(finalX, (targetY + endY) / 2, -0.5);
14196
14237
  intervalBar.scale.y = barHeight;
14197
14238
  graphGroup.add(intervalBar);
14198
14239
  mesh.userData.timelineIntervalBar = intervalBar;
14199
14240
  const endLabel = createTextSprite(timeInfo.label.split(" - ")[1] || "", 30);
14200
14241
  endLabel.name = "timelineEndLabel";
14201
- endLabel.position.set(colX, endY + 4, 0);
14242
+ endLabel.position.set(finalX, endY + 4, 0);
14202
14243
  graphGroup.add(endLabel);
14203
14244
  mesh.userData.timelineEndLabel = endLabel;
14204
14245
  }
14205
14246
  }
14206
14247
  if (mesh.userData.labelObject) {
14207
- const labelTargetPos = new THREE3.Vector3(colX, targetY, 0).add(
14248
+ const labelTargetPos = new THREE3.Vector3(finalX, targetY, 0).add(
14208
14249
  mesh.userData.labelOffset || new THREE3.Vector3(0, 3.8, 0)
14209
14250
  );
14210
14251
  const labelTween = new Tween2(mesh.userData.labelObject.position).to(labelTargetPos, 1500).easing(Easing2.Cubic.InOut);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.5-dev.44",
3
+ "version": "1.2.5-dev.45",
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",