pptx-react-viewer 3.21.0 → 4.1.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.
Files changed (188) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{AiChatPanel-UD756KAU.mjs → AiChatPanel-C3ACRWOY.mjs} +4 -4
  3. package/dist/AiChatPanel-C3ACRWOY.mjs.br +0 -0
  4. package/dist/AiChatPanel-C3ACRWOY.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-B3QM7MIC.js → AiChatPanel-GQNSKMP6.js} +25 -25
  6. package/dist/AiChatPanel-GQNSKMP6.js.br +0 -0
  7. package/dist/AiChatPanel-GQNSKMP6.js.gz +0 -0
  8. package/dist/{Area3DChartScene-435BFPLY.js → Area3DChartScene-3I6KB2DN.js} +2 -2
  9. package/dist/{Area3DChartScene-435BFPLY.js.br → Area3DChartScene-3I6KB2DN.js.br} +0 -0
  10. package/dist/Area3DChartScene-3I6KB2DN.js.gz +0 -0
  11. package/dist/{Area3DChartScene-MQKUWVMS.mjs → Area3DChartScene-4TPNRYXS.mjs} +1 -1
  12. package/dist/Area3DChartScene-4TPNRYXS.mjs.br +0 -0
  13. package/dist/Area3DChartScene-4TPNRYXS.mjs.gz +0 -0
  14. package/dist/{Bar3DChartScene-D4GMQGPN.mjs → Bar3DChartScene-V45IUIT7.mjs} +1 -1
  15. package/dist/Bar3DChartScene-V45IUIT7.mjs.br +0 -0
  16. package/dist/Bar3DChartScene-V45IUIT7.mjs.gz +0 -0
  17. package/dist/{Bar3DChartScene-KEYLVYJA.js → Bar3DChartScene-ZSCATOYF.js} +2 -2
  18. package/dist/Bar3DChartScene-ZSCATOYF.js.br +0 -0
  19. package/dist/Bar3DChartScene-ZSCATOYF.js.gz +0 -0
  20. package/dist/{Line3DChartScene-B3AWFXE4.mjs → Line3DChartScene-DCQJEZK6.mjs} +1 -1
  21. package/dist/Line3DChartScene-DCQJEZK6.mjs.br +0 -0
  22. package/dist/Line3DChartScene-DCQJEZK6.mjs.gz +0 -0
  23. package/dist/{Line3DChartScene-JYGXLE56.js → Line3DChartScene-DK55LQ2D.js} +2 -2
  24. package/dist/{Line3DChartScene-JYGXLE56.js.br → Line3DChartScene-DK55LQ2D.js.br} +0 -0
  25. package/dist/Line3DChartScene-DK55LQ2D.js.gz +0 -0
  26. package/dist/{Model3DScene-JF5J6N6W.js → Model3DScene-2WNP4XBP.js} +2 -2
  27. package/dist/Model3DScene-2WNP4XBP.js.br +0 -0
  28. package/dist/Model3DScene-2WNP4XBP.js.gz +0 -0
  29. package/dist/{Model3DScene-4TG4YRVM.mjs → Model3DScene-SA5XMR2D.mjs} +1 -1
  30. package/dist/Model3DScene-SA5XMR2D.mjs.br +0 -0
  31. package/dist/Model3DScene-SA5XMR2D.mjs.gz +0 -0
  32. package/dist/{PieChart3DScene-4BQ6PR7P.mjs → PieChart3DScene-HC2ZWL42.mjs} +1 -1
  33. package/dist/PieChart3DScene-HC2ZWL42.mjs.br +0 -0
  34. package/dist/PieChart3DScene-HC2ZWL42.mjs.gz +0 -0
  35. package/dist/{PieChart3DScene-CCQWSH3W.js → PieChart3DScene-Q75D66HS.js} +2 -2
  36. package/dist/{PieChart3DScene-CCQWSH3W.js.br → PieChart3DScene-Q75D66HS.js.br} +0 -0
  37. package/dist/PieChart3DScene-Q75D66HS.js.gz +0 -0
  38. package/dist/{SmartArt3DScene-QZGIABOK.mjs → SmartArt3DScene-D4VNNPHS.mjs} +124 -19
  39. package/dist/SmartArt3DScene-D4VNNPHS.mjs.br +0 -0
  40. package/dist/SmartArt3DScene-D4VNNPHS.mjs.gz +0 -0
  41. package/dist/{SmartArt3DScene-T236GYUT.js → SmartArt3DScene-NHD7CZJ5.js} +123 -18
  42. package/dist/SmartArt3DScene-NHD7CZJ5.js.br +0 -0
  43. package/dist/SmartArt3DScene-NHD7CZJ5.js.gz +0 -0
  44. package/dist/{SurfaceChart3DScene-FRQC5HBG.mjs → SurfaceChart3DScene-JRMX4PN5.mjs} +1 -1
  45. package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.br +0 -0
  46. package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.gz +0 -0
  47. package/dist/{SurfaceChart3DScene-UVZPT6OD.js → SurfaceChart3DScene-ODS5E6ZG.js} +2 -2
  48. package/dist/{SurfaceChart3DScene-UVZPT6OD.js.br → SurfaceChart3DScene-ODS5E6ZG.js.br} +0 -0
  49. package/dist/SurfaceChart3DScene-ODS5E6ZG.js.gz +0 -0
  50. package/dist/{chunk-EJMDD4VV.mjs → chunk-25CABWCR.mjs} +131 -329
  51. package/dist/chunk-25CABWCR.mjs.br +0 -0
  52. package/dist/chunk-25CABWCR.mjs.gz +0 -0
  53. package/dist/{chunk-BXMPXKV5.mjs → chunk-3B6YIH4K.mjs} +626 -133
  54. package/dist/chunk-3B6YIH4K.mjs.br +0 -0
  55. package/dist/chunk-3B6YIH4K.mjs.gz +0 -0
  56. package/dist/{chunk-BFPIMU6Q.js → chunk-A6JKOHSV.js} +2143 -1644
  57. package/dist/chunk-A6JKOHSV.js.br +0 -0
  58. package/dist/chunk-A6JKOHSV.js.gz +0 -0
  59. package/dist/{chunk-TOOKJUPG.mjs → chunk-GRAARMUW.mjs} +1 -1
  60. package/dist/chunk-GRAARMUW.mjs.br +0 -0
  61. package/dist/chunk-GRAARMUW.mjs.gz +0 -0
  62. package/dist/{chunk-H7QPQ4OR.js → chunk-MQHMMB6V.js} +5 -5
  63. package/dist/chunk-MQHMMB6V.js.br +0 -0
  64. package/dist/chunk-MQHMMB6V.js.gz +0 -0
  65. package/dist/{chunk-M6QJKPU2.js → chunk-NR4MQJM5.js} +1961 -2161
  66. package/dist/chunk-NR4MQJM5.js.br +0 -0
  67. package/dist/chunk-NR4MQJM5.js.gz +0 -0
  68. package/dist/{chunk-M24DEOP6.js → chunk-NXGUR2DO.js} +2 -0
  69. package/dist/chunk-NXGUR2DO.js.br +0 -0
  70. package/dist/chunk-NXGUR2DO.js.gz +0 -0
  71. package/dist/{chunk-R664EPDC.mjs → chunk-PC7H3C5W.mjs} +2 -0
  72. package/dist/chunk-PC7H3C5W.mjs.br +0 -0
  73. package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
  74. package/dist/{chunk-SUZIFHXI.js → chunk-PUALTXTU.js} +182 -182
  75. package/dist/chunk-PUALTXTU.js.br +0 -0
  76. package/dist/chunk-PUALTXTU.js.gz +0 -0
  77. package/dist/{chunk-TMTQJAGK.mjs → chunk-Q6QJOD56.mjs} +2307 -552
  78. package/dist/chunk-Q6QJOD56.mjs.br +0 -0
  79. package/dist/chunk-Q6QJOD56.mjs.gz +0 -0
  80. package/dist/{chunk-T6V342NP.js → chunk-SK2CZQ6P.js} +2313 -551
  81. package/dist/chunk-SK2CZQ6P.js.br +0 -0
  82. package/dist/chunk-SK2CZQ6P.js.gz +0 -0
  83. package/dist/{chunk-HZEOZUUH.mjs → chunk-WLWAYLL6.mjs} +2 -2
  84. package/dist/chunk-WLWAYLL6.mjs.br +0 -0
  85. package/dist/chunk-WLWAYLL6.mjs.gz +0 -0
  86. package/dist/i18n/de.cjs +2 -0
  87. package/dist/i18n/de.cjs.br +0 -0
  88. package/dist/i18n/de.cjs.gz +0 -0
  89. package/dist/i18n/de.mjs +2 -0
  90. package/dist/i18n/de.mjs.br +0 -0
  91. package/dist/i18n/de.mjs.gz +0 -0
  92. package/dist/i18n/es.cjs +2 -0
  93. package/dist/i18n/es.cjs.br +0 -0
  94. package/dist/i18n/es.cjs.gz +0 -0
  95. package/dist/i18n/es.mjs +2 -0
  96. package/dist/i18n/es.mjs.br +0 -0
  97. package/dist/i18n/es.mjs.gz +0 -0
  98. package/dist/i18n/fr.cjs +2 -0
  99. package/dist/i18n/fr.cjs.br +0 -0
  100. package/dist/i18n/fr.cjs.gz +0 -0
  101. package/dist/i18n/fr.mjs +2 -0
  102. package/dist/i18n/fr.mjs.br +0 -0
  103. package/dist/i18n/fr.mjs.gz +0 -0
  104. package/dist/i18n/zh-CN.cjs +2 -0
  105. package/dist/i18n/zh-CN.cjs.br +0 -0
  106. package/dist/i18n/zh-CN.cjs.gz +0 -0
  107. package/dist/i18n/zh-CN.mjs +2 -0
  108. package/dist/i18n/zh-CN.mjs.br +0 -0
  109. package/dist/i18n/zh-CN.mjs.gz +0 -0
  110. package/dist/i18n.js +4 -4
  111. package/dist/i18n.js.br +0 -0
  112. package/dist/i18n.js.gz +0 -0
  113. package/dist/i18n.mjs +1 -1
  114. package/dist/i18n.mjs.br +0 -0
  115. package/dist/i18n.mjs.gz +0 -0
  116. package/dist/index.d.ts +586 -7
  117. package/dist/index.js +52 -48
  118. package/dist/index.js.br +0 -0
  119. package/dist/index.js.gz +0 -0
  120. package/dist/index.mjs +6 -6
  121. package/dist/index.mjs.br +0 -0
  122. package/dist/index.mjs.gz +0 -0
  123. package/dist/internals.d.ts +447 -13
  124. package/dist/internals.js +105 -105
  125. package/dist/internals.js.br +0 -0
  126. package/dist/internals.js.gz +0 -0
  127. package/dist/internals.mjs +4 -4
  128. package/dist/internals.mjs.br +0 -0
  129. package/dist/internals.mjs.gz +0 -0
  130. package/dist/viewer/index.js +32 -32
  131. package/dist/viewer/index.js.br +0 -0
  132. package/dist/viewer/index.js.gz +0 -0
  133. package/dist/viewer/index.mjs +6 -6
  134. package/dist/viewer/index.mjs.br +0 -0
  135. package/dist/viewer/index.mjs.gz +0 -0
  136. package/package.json +2 -2
  137. package/dist/AiChatPanel-B3QM7MIC.js.br +0 -0
  138. package/dist/AiChatPanel-B3QM7MIC.js.gz +0 -0
  139. package/dist/AiChatPanel-UD756KAU.mjs.br +0 -0
  140. package/dist/AiChatPanel-UD756KAU.mjs.gz +0 -0
  141. package/dist/Area3DChartScene-435BFPLY.js.gz +0 -0
  142. package/dist/Area3DChartScene-MQKUWVMS.mjs.br +0 -0
  143. package/dist/Area3DChartScene-MQKUWVMS.mjs.gz +0 -0
  144. package/dist/Bar3DChartScene-D4GMQGPN.mjs.br +0 -0
  145. package/dist/Bar3DChartScene-D4GMQGPN.mjs.gz +0 -0
  146. package/dist/Bar3DChartScene-KEYLVYJA.js.br +0 -0
  147. package/dist/Bar3DChartScene-KEYLVYJA.js.gz +0 -0
  148. package/dist/Line3DChartScene-B3AWFXE4.mjs.br +0 -0
  149. package/dist/Line3DChartScene-B3AWFXE4.mjs.gz +0 -0
  150. package/dist/Line3DChartScene-JYGXLE56.js.gz +0 -0
  151. package/dist/Model3DScene-4TG4YRVM.mjs.br +0 -0
  152. package/dist/Model3DScene-4TG4YRVM.mjs.gz +0 -0
  153. package/dist/Model3DScene-JF5J6N6W.js.br +0 -0
  154. package/dist/Model3DScene-JF5J6N6W.js.gz +0 -0
  155. package/dist/PieChart3DScene-4BQ6PR7P.mjs.br +0 -0
  156. package/dist/PieChart3DScene-4BQ6PR7P.mjs.gz +0 -0
  157. package/dist/PieChart3DScene-CCQWSH3W.js.gz +0 -0
  158. package/dist/SmartArt3DScene-QZGIABOK.mjs.br +0 -0
  159. package/dist/SmartArt3DScene-QZGIABOK.mjs.gz +0 -0
  160. package/dist/SmartArt3DScene-T236GYUT.js.br +0 -0
  161. package/dist/SmartArt3DScene-T236GYUT.js.gz +0 -0
  162. package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.br +0 -0
  163. package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.gz +0 -0
  164. package/dist/SurfaceChart3DScene-UVZPT6OD.js.gz +0 -0
  165. package/dist/chunk-BFPIMU6Q.js.br +0 -0
  166. package/dist/chunk-BFPIMU6Q.js.gz +0 -0
  167. package/dist/chunk-BXMPXKV5.mjs.br +0 -0
  168. package/dist/chunk-BXMPXKV5.mjs.gz +0 -0
  169. package/dist/chunk-EJMDD4VV.mjs.br +0 -0
  170. package/dist/chunk-EJMDD4VV.mjs.gz +0 -0
  171. package/dist/chunk-H7QPQ4OR.js.br +0 -0
  172. package/dist/chunk-H7QPQ4OR.js.gz +0 -0
  173. package/dist/chunk-HZEOZUUH.mjs.br +0 -0
  174. package/dist/chunk-HZEOZUUH.mjs.gz +0 -0
  175. package/dist/chunk-M24DEOP6.js.br +0 -0
  176. package/dist/chunk-M24DEOP6.js.gz +0 -0
  177. package/dist/chunk-M6QJKPU2.js.br +0 -0
  178. package/dist/chunk-M6QJKPU2.js.gz +0 -0
  179. package/dist/chunk-R664EPDC.mjs.br +0 -0
  180. package/dist/chunk-R664EPDC.mjs.gz +0 -0
  181. package/dist/chunk-SUZIFHXI.js.br +0 -0
  182. package/dist/chunk-SUZIFHXI.js.gz +0 -0
  183. package/dist/chunk-T6V342NP.js.br +0 -0
  184. package/dist/chunk-T6V342NP.js.gz +0 -0
  185. package/dist/chunk-TMTQJAGK.mjs.br +0 -0
  186. package/dist/chunk-TMTQJAGK.mjs.gz +0 -0
  187. package/dist/chunk-TOOKJUPG.mjs.br +0 -0
  188. package/dist/chunk-TOOKJUPG.mjs.gz +0 -0
@@ -161,9 +161,12 @@ function buildLabelPlane(m, textStyle) {
161
161
  const planeMaterial = new chunk3N6AC4HA_js.MeshBasicMaterial({
162
162
  map: tex.texture,
163
163
  transparent: true,
164
- depthWrite: false
164
+ depthWrite: false,
165
+ depthTest: false,
166
+ side: chunk3N6AC4HA_js.DoubleSide
165
167
  });
166
168
  const plane = new chunk3N6AC4HA_js.Mesh(planeGeo, planeMaterial);
169
+ plane.renderOrder = 1;
167
170
  const euler = new chunk3N6AC4HA_js.Euler(m.rotation.x, m.rotation.y, m.rotation.z);
168
171
  const offset = new chunk3N6AC4HA_js.Vector3(0, 0, m.depth + m.bevel + 0.4).applyEuler(euler);
169
172
  plane.position.set(m.position.x + offset.x, m.position.y + offset.y, m.position.z + offset.z);
@@ -220,6 +223,13 @@ function buildMeshGroup(model, textStyle) {
220
223
  }
221
224
  }
222
225
  },
226
+ forEachLabelPlane(fn) {
227
+ for (const entry of labelEntries) {
228
+ if (entry.plane) {
229
+ fn(entry.plane);
230
+ }
231
+ }
232
+ },
223
233
  dispose() {
224
234
  for (const d of blockDisposables) {
225
235
  d.dispose();
@@ -231,6 +241,17 @@ function buildMeshGroup(model, textStyle) {
231
241
  };
232
242
  }
233
243
  var FOV = 42;
244
+ function expandForMesh(expand, m) {
245
+ const hx = m.halfWidth + m.bevel;
246
+ const hy = m.halfHeight + m.bevel;
247
+ const hz = m.depth / 2 + m.bevel;
248
+ const midZ = m.position.z + m.depth / 2;
249
+ const cosY = Math.cos(m.rotation.y);
250
+ const sinY = Math.sin(m.rotation.y);
251
+ const worldHalfX = Math.abs(hx * cosY) + Math.abs(hz * sinY);
252
+ const worldHalfZ = Math.abs(hx * sinY) + Math.abs(hz * cosY);
253
+ expand(m.position.x, m.position.y, midZ, worldHalfX, hy, worldHalfZ);
254
+ }
234
255
  function contentSphere(model) {
235
256
  let minX = Infinity;
236
257
  let minY = Infinity;
@@ -238,32 +259,36 @@ function contentSphere(model) {
238
259
  let maxX = -Infinity;
239
260
  let maxY = -Infinity;
240
261
  let maxZ = -Infinity;
241
- const expand = (x, y, z, r) => {
242
- minX = Math.min(minX, x - r);
243
- minY = Math.min(minY, y - r);
244
- minZ = Math.min(minZ, z - r);
245
- maxX = Math.max(maxX, x + r);
246
- maxY = Math.max(maxY, y + r);
247
- maxZ = Math.max(maxZ, z + r);
262
+ const expand = (x, y, z, rx, ry, rz) => {
263
+ minX = Math.min(minX, x - rx);
264
+ minY = Math.min(minY, y - ry);
265
+ minZ = Math.min(minZ, z - rz);
266
+ maxX = Math.max(maxX, x + rx);
267
+ maxY = Math.max(maxY, y + ry);
268
+ maxZ = Math.max(maxZ, z + rz);
248
269
  };
249
270
  for (const m of model.meshes) {
250
- const r = Math.max(m.halfWidth, m.halfHeight) + m.depth + m.bevel;
251
- expand(m.position.x, m.position.y, m.position.z, r);
271
+ expandForMesh(expand, m);
252
272
  }
253
273
  for (const c of model.connectors) {
254
274
  for (const p of c.points) {
255
- expand(p.x, p.y, p.z, 1);
275
+ expand(p.x, p.y, p.z, 1, 1, 1);
256
276
  }
257
277
  }
258
278
  if (!Number.isFinite(minX)) {
259
- const fallback = Math.max(model.bounds.width, model.bounds.height) / 2 || 1;
260
- return { cx: 0, cy: 0, cz: 0, radius: fallback };
279
+ const halfW = model.bounds.width / 2 || 1;
280
+ const halfH = model.bounds.height / 2 || 1;
281
+ const fallback = Math.max(halfW, halfH);
282
+ return { cx: 0, cy: 0, cz: 0, radius: fallback, halfW, halfH, halfD: 1 };
261
283
  }
262
284
  return {
263
285
  cx: (minX + maxX) / 2,
264
286
  cy: (minY + maxY) / 2,
265
287
  cz: (minZ + maxZ) / 2,
266
- radius: 0.5 * Math.hypot(maxX - minX, maxY - minY, maxZ - minZ) || 1
288
+ radius: 0.5 * Math.hypot(maxX - minX, maxY - minY, maxZ - minZ) || 1,
289
+ halfW: (maxX - minX) / 2,
290
+ halfH: (maxY - minY) / 2,
291
+ halfD: (maxZ - minZ) / 2
267
292
  };
268
293
  }
269
294
  function frameDistance(radius, aspect) {
@@ -272,6 +297,83 @@ function frameDistance(radius, aspect) {
272
297
  const minFov = Math.min(vFov, hFov);
273
298
  return radius / Math.sin(minFov / 2) * 1.1;
274
299
  }
300
+ var FRAME_FILL = 0.92;
301
+ function placeCamera(bounds, family, dist) {
302
+ const { cx, cy, cz, radius } = bounds;
303
+ const elevation = cameraElevation(family, radius, dist);
304
+ return {
305
+ position: [cx + radius * 0.25, cy + elevation, cz + dist],
306
+ target: [cx, cy, cz],
307
+ dist
308
+ };
309
+ }
310
+ function projectedFill(bounds, placement, aspect) {
311
+ const vFov = FOV * Math.PI / 180;
312
+ const tanV = Math.tan(vFov / 2);
313
+ const tanH = tanV * aspect;
314
+ const [px, py, pz] = placement.position;
315
+ const [tx, ty, tz] = placement.target;
316
+ let fx = tx - px, fy = ty - py, fz = tz - pz;
317
+ const fl = Math.hypot(fx, fy, fz) || 1;
318
+ fx /= fl;
319
+ fy /= fl;
320
+ fz /= fl;
321
+ let rx = -fz, rz = fx;
322
+ const rl = Math.hypot(rx, rz) || 1;
323
+ rx /= rl;
324
+ rz /= rl;
325
+ const ux = -rz * fy, uy = rz * fx - rx * fz, uz = rx * fy;
326
+ let worst = 0;
327
+ for (const sx of [-1, 1]) {
328
+ for (const sy of [-1, 1]) {
329
+ for (const sz of [-1, 1]) {
330
+ const dx = bounds.cx + sx * bounds.halfW - px;
331
+ const dy = bounds.cy + sy * bounds.halfH - py;
332
+ const dz = bounds.cz + sz * bounds.halfD - pz;
333
+ const depth = dx * fx + dy * fy + dz * fz;
334
+ if (depth <= 1e-6) {
335
+ return Infinity;
336
+ }
337
+ const x = Math.abs(dx * rx + dz * rz) / (depth * tanH);
338
+ const y = Math.abs(dx * ux + dy * uy + dz * uz) / (depth * tanV);
339
+ worst = Math.max(worst, x, y);
340
+ }
341
+ }
342
+ }
343
+ return worst;
344
+ }
345
+ function fitCamera(bounds, family, aspect) {
346
+ let dist = frameDistance(bounds.radius, aspect);
347
+ let placement = placeCamera(bounds, family, dist);
348
+ for (let step = 0; step < 8; step++) {
349
+ const fill = projectedFill(bounds, placement, aspect);
350
+ if (!Number.isFinite(fill)) {
351
+ dist *= 2;
352
+ } else {
353
+ const ratio = fill / FRAME_FILL;
354
+ if (Math.abs(ratio - 1) < 0.01) {
355
+ break;
356
+ }
357
+ dist *= ratio;
358
+ }
359
+ placement = placeCamera(bounds, family, dist);
360
+ }
361
+ return placement;
362
+ }
363
+ var CAROUSEL_ELEVATION_DEG = 34;
364
+ function cameraElevation(family, radius, dist) {
365
+ if (family === "cycle" || family === "radial") {
366
+ return dist * Math.tan(CAROUSEL_ELEVATION_DEG * Math.PI / 180);
367
+ }
368
+ return radius * 0.3;
369
+ }
370
+ function billboardLabels(built, camera) {
371
+ built.forEachLabelPlane((plane) => {
372
+ const dx = camera.position.x - plane.position.x;
373
+ const dz = camera.position.z - plane.position.z;
374
+ plane.rotation.set(0, Math.atan2(dx, dz), 0);
375
+ });
376
+ }
275
377
  function mountSmartArt3D(canvas, model, width, height, options = {}) {
276
378
  const renderer = new chunk3N6AC4HA_js.WebGLRenderer({ canvas, antialias: true, alpha: !options.background });
277
379
  renderer.setPixelRatio(
@@ -285,12 +387,14 @@ function mountSmartArt3D(canvas, model, width, height, options = {}) {
285
387
  if (options.background) {
286
388
  scene.background = new chunk3N6AC4HA_js.Color(options.background);
287
389
  }
288
- const { cx, cy, cz, radius } = contentSphere(model);
390
+ const bounds = contentSphere(model);
391
+ const { cx, cy, cz, radius } = bounds;
289
392
  const aspect = width / Math.max(1, height);
290
- const dist = frameDistance(radius, aspect);
393
+ const placement = fitCamera(bounds, model.family, aspect);
394
+ const { dist } = placement;
291
395
  const camera = new chunk3N6AC4HA_js.PerspectiveCamera(FOV, aspect, 0.1, dist * 8 + radius * 4);
292
- camera.position.set(cx + radius * 0.25, cy + radius * 0.3, cz + dist);
293
- camera.lookAt(cx, cy, cz);
396
+ camera.position.set(...placement.position);
397
+ camera.lookAt(...placement.target);
294
398
  scene.add(new chunk3N6AC4HA_js.AmbientLight(16777215, 0.62));
295
399
  const key = new chunk3N6AC4HA_js.DirectionalLight(16777215, 0.95);
296
400
  key.position.set(cx + radius, cy + radius * 1.4, cz + dist);
@@ -326,6 +430,7 @@ function mountSmartArt3D(canvas, model, width, height, options = {}) {
326
430
  return;
327
431
  }
328
432
  frame = requestAnimationFrame(renderLoop);
433
+ billboardLabels(built, camera);
329
434
  controls?.update();
330
435
  renderer.render(scene, camera);
331
436
  };
@@ -1,5 +1,5 @@
1
1
  import { useStableChart3DInteraction, useLatestRef } from './chunk-T6GFCLSM.mjs';
2
- import { mountSurfaceChart3D } from './chunk-TMTQJAGK.mjs';
2
+ import { mountSurfaceChart3D } from './chunk-Q6QJOD56.mjs';
3
3
  import './chunk-XGB3TDIC.mjs';
4
4
  import { useRef, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkDNR6CH6I_js = require('./chunk-DNR6CH6I.js');
4
- var chunkT6V342NP_js = require('./chunk-T6V342NP.js');
4
+ var chunkSK2CZQ6P_js = require('./chunk-SK2CZQ6P.js');
5
5
  require('./chunk-4VNS5WPM.js');
6
6
  var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -23,7 +23,7 @@ function SurfaceChart3DScene({
23
23
  return;
24
24
  }
25
25
  let disposed = false;
26
- void chunkT6V342NP_js.mountSurfaceChart3D(container, options, stableInteraction).then((handle) => {
26
+ void chunkSK2CZQ6P_js.mountSurfaceChart3D(container, options, stableInteraction).then((handle) => {
27
27
  if (disposed) {
28
28
  handle.dispose();
29
29
  } else {