pptx-react-viewer 4.0.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.
- package/CHANGELOG.md +6 -0
- package/dist/{AiChatPanel-MHURGN6G.mjs → AiChatPanel-C3ACRWOY.mjs} +4 -4
- package/dist/AiChatPanel-C3ACRWOY.mjs.br +0 -0
- package/dist/AiChatPanel-C3ACRWOY.mjs.gz +0 -0
- package/dist/{AiChatPanel-WMVQFNDC.js → AiChatPanel-GQNSKMP6.js} +25 -25
- package/dist/AiChatPanel-GQNSKMP6.js.br +0 -0
- package/dist/AiChatPanel-GQNSKMP6.js.gz +0 -0
- package/dist/{Area3DChartScene-IMGZEZNU.js → Area3DChartScene-3I6KB2DN.js} +2 -2
- package/dist/Area3DChartScene-3I6KB2DN.js.br +0 -0
- package/dist/Area3DChartScene-3I6KB2DN.js.gz +0 -0
- package/dist/{Area3DChartScene-LKOWSMAU.mjs → Area3DChartScene-4TPNRYXS.mjs} +1 -1
- package/dist/{Area3DChartScene-LKOWSMAU.mjs.br → Area3DChartScene-4TPNRYXS.mjs.br} +0 -0
- package/dist/Area3DChartScene-4TPNRYXS.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-NQNSIMUL.mjs → Bar3DChartScene-V45IUIT7.mjs} +1 -1
- package/dist/{Bar3DChartScene-NQNSIMUL.mjs.br → Bar3DChartScene-V45IUIT7.mjs.br} +0 -0
- package/dist/Bar3DChartScene-V45IUIT7.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-VLSYVFRT.js → Bar3DChartScene-ZSCATOYF.js} +2 -2
- package/dist/Bar3DChartScene-ZSCATOYF.js.br +0 -0
- package/dist/Bar3DChartScene-ZSCATOYF.js.gz +0 -0
- package/dist/{Line3DChartScene-ANZBJYQI.mjs → Line3DChartScene-DCQJEZK6.mjs} +1 -1
- package/dist/{Line3DChartScene-ANZBJYQI.mjs.br → Line3DChartScene-DCQJEZK6.mjs.br} +0 -0
- package/dist/Line3DChartScene-DCQJEZK6.mjs.gz +0 -0
- package/dist/{Line3DChartScene-IWZHA563.js → Line3DChartScene-DK55LQ2D.js} +2 -2
- package/dist/Line3DChartScene-DK55LQ2D.js.br +0 -0
- package/dist/Line3DChartScene-DK55LQ2D.js.gz +0 -0
- package/dist/{Model3DScene-2L3YRAMR.js → Model3DScene-2WNP4XBP.js} +2 -2
- package/dist/Model3DScene-2WNP4XBP.js.br +0 -0
- package/dist/Model3DScene-2WNP4XBP.js.gz +0 -0
- package/dist/{Model3DScene-Y34HTZXK.mjs → Model3DScene-SA5XMR2D.mjs} +1 -1
- package/dist/Model3DScene-SA5XMR2D.mjs.br +0 -0
- package/dist/Model3DScene-SA5XMR2D.mjs.gz +0 -0
- package/dist/{PieChart3DScene-FBRPLHLG.mjs → PieChart3DScene-HC2ZWL42.mjs} +1 -1
- package/dist/{PieChart3DScene-FBRPLHLG.mjs.br → PieChart3DScene-HC2ZWL42.mjs.br} +0 -0
- package/dist/PieChart3DScene-HC2ZWL42.mjs.gz +0 -0
- package/dist/{PieChart3DScene-NE3GN5VG.js → PieChart3DScene-Q75D66HS.js} +2 -2
- package/dist/PieChart3DScene-Q75D66HS.js.br +0 -0
- package/dist/PieChart3DScene-Q75D66HS.js.gz +0 -0
- package/dist/{SmartArt3DScene-QZGIABOK.mjs → SmartArt3DScene-D4VNNPHS.mjs} +124 -19
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.br +0 -0
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.gz +0 -0
- package/dist/{SmartArt3DScene-T236GYUT.js → SmartArt3DScene-NHD7CZJ5.js} +123 -18
- package/dist/SmartArt3DScene-NHD7CZJ5.js.br +0 -0
- package/dist/SmartArt3DScene-NHD7CZJ5.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-7HE5DA3X.mjs → SurfaceChart3DScene-JRMX4PN5.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-OSMAVZJC.js → SurfaceChart3DScene-ODS5E6ZG.js} +2 -2
- package/dist/SurfaceChart3DScene-ODS5E6ZG.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODS5E6ZG.js.gz +0 -0
- package/dist/{chunk-H7J4EYXS.mjs → chunk-25CABWCR.mjs} +131 -329
- package/dist/chunk-25CABWCR.mjs.br +0 -0
- package/dist/chunk-25CABWCR.mjs.gz +0 -0
- package/dist/{chunk-IWHZ2DUD.mjs → chunk-3B6YIH4K.mjs} +626 -133
- package/dist/chunk-3B6YIH4K.mjs.br +0 -0
- package/dist/chunk-3B6YIH4K.mjs.gz +0 -0
- package/dist/{chunk-L6I73WMO.js → chunk-A6JKOHSV.js} +2143 -1644
- package/dist/chunk-A6JKOHSV.js.br +0 -0
- package/dist/chunk-A6JKOHSV.js.gz +0 -0
- package/dist/{chunk-5F426BCZ.mjs → chunk-GRAARMUW.mjs} +1 -1
- package/dist/chunk-GRAARMUW.mjs.br +0 -0
- package/dist/chunk-GRAARMUW.mjs.gz +0 -0
- package/dist/{chunk-ZOB6ITIM.js → chunk-MQHMMB6V.js} +5 -5
- package/dist/chunk-MQHMMB6V.js.br +0 -0
- package/dist/chunk-MQHMMB6V.js.gz +0 -0
- package/dist/{chunk-I5F3XLVR.js → chunk-NR4MQJM5.js} +1961 -2161
- package/dist/chunk-NR4MQJM5.js.br +0 -0
- package/dist/chunk-NR4MQJM5.js.gz +0 -0
- package/dist/{chunk-M24DEOP6.js → chunk-NXGUR2DO.js} +2 -0
- package/dist/chunk-NXGUR2DO.js.br +0 -0
- package/dist/chunk-NXGUR2DO.js.gz +0 -0
- package/dist/{chunk-R664EPDC.mjs → chunk-PC7H3C5W.mjs} +2 -0
- package/dist/chunk-PC7H3C5W.mjs.br +0 -0
- package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
- package/dist/{chunk-NKACTGK5.js → chunk-PUALTXTU.js} +182 -182
- package/dist/chunk-PUALTXTU.js.br +0 -0
- package/dist/chunk-PUALTXTU.js.gz +0 -0
- package/dist/{chunk-33YE6E2O.mjs → chunk-Q6QJOD56.mjs} +2145 -470
- package/dist/chunk-Q6QJOD56.mjs.br +0 -0
- package/dist/chunk-Q6QJOD56.mjs.gz +0 -0
- package/dist/{chunk-LAAXFMRE.js → chunk-SK2CZQ6P.js} +2151 -469
- package/dist/chunk-SK2CZQ6P.js.br +0 -0
- package/dist/chunk-SK2CZQ6P.js.gz +0 -0
- package/dist/{chunk-GITM3RKP.mjs → chunk-WLWAYLL6.mjs} +2 -2
- package/dist/chunk-WLWAYLL6.mjs.br +0 -0
- package/dist/chunk-WLWAYLL6.mjs.gz +0 -0
- package/dist/i18n/de.cjs +2 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +2 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +2 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +2 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +2 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +2 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +2 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +2 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +586 -7
- package/dist/index.js +52 -48
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +447 -13
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +32 -32
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-MHURGN6G.mjs.br +0 -0
- package/dist/AiChatPanel-MHURGN6G.mjs.gz +0 -0
- package/dist/AiChatPanel-WMVQFNDC.js.br +0 -0
- package/dist/AiChatPanel-WMVQFNDC.js.gz +0 -0
- package/dist/Area3DChartScene-IMGZEZNU.js.br +0 -0
- package/dist/Area3DChartScene-IMGZEZNU.js.gz +0 -0
- package/dist/Area3DChartScene-LKOWSMAU.mjs.gz +0 -0
- package/dist/Bar3DChartScene-NQNSIMUL.mjs.gz +0 -0
- package/dist/Bar3DChartScene-VLSYVFRT.js.br +0 -0
- package/dist/Bar3DChartScene-VLSYVFRT.js.gz +0 -0
- package/dist/Line3DChartScene-ANZBJYQI.mjs.gz +0 -0
- package/dist/Line3DChartScene-IWZHA563.js.br +0 -0
- package/dist/Line3DChartScene-IWZHA563.js.gz +0 -0
- package/dist/Model3DScene-2L3YRAMR.js.br +0 -0
- package/dist/Model3DScene-2L3YRAMR.js.gz +0 -0
- package/dist/Model3DScene-Y34HTZXK.mjs.br +0 -0
- package/dist/Model3DScene-Y34HTZXK.mjs.gz +0 -0
- package/dist/PieChart3DScene-FBRPLHLG.mjs.gz +0 -0
- package/dist/PieChart3DScene-NE3GN5VG.js.br +0 -0
- package/dist/PieChart3DScene-NE3GN5VG.js.gz +0 -0
- package/dist/SmartArt3DScene-QZGIABOK.mjs.br +0 -0
- package/dist/SmartArt3DScene-QZGIABOK.mjs.gz +0 -0
- package/dist/SmartArt3DScene-T236GYUT.js.br +0 -0
- package/dist/SmartArt3DScene-T236GYUT.js.gz +0 -0
- package/dist/SurfaceChart3DScene-7HE5DA3X.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-7HE5DA3X.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-OSMAVZJC.js.br +0 -0
- package/dist/SurfaceChart3DScene-OSMAVZJC.js.gz +0 -0
- package/dist/chunk-33YE6E2O.mjs.br +0 -0
- package/dist/chunk-33YE6E2O.mjs.gz +0 -0
- package/dist/chunk-5F426BCZ.mjs.br +0 -0
- package/dist/chunk-5F426BCZ.mjs.gz +0 -0
- package/dist/chunk-GITM3RKP.mjs.br +0 -0
- package/dist/chunk-GITM3RKP.mjs.gz +0 -0
- package/dist/chunk-H7J4EYXS.mjs.br +0 -0
- package/dist/chunk-H7J4EYXS.mjs.gz +0 -0
- package/dist/chunk-I5F3XLVR.js.br +0 -0
- package/dist/chunk-I5F3XLVR.js.gz +0 -0
- package/dist/chunk-IWHZ2DUD.mjs.br +0 -0
- package/dist/chunk-IWHZ2DUD.mjs.gz +0 -0
- package/dist/chunk-L6I73WMO.js.br +0 -0
- package/dist/chunk-L6I73WMO.js.gz +0 -0
- package/dist/chunk-LAAXFMRE.js.br +0 -0
- package/dist/chunk-LAAXFMRE.js.gz +0 -0
- package/dist/chunk-M24DEOP6.js.br +0 -0
- package/dist/chunk-M24DEOP6.js.gz +0 -0
- package/dist/chunk-NKACTGK5.js.br +0 -0
- package/dist/chunk-NKACTGK5.js.gz +0 -0
- package/dist/chunk-R664EPDC.mjs.br +0 -0
- package/dist/chunk-R664EPDC.mjs.gz +0 -0
- package/dist/chunk-ZOB6ITIM.js.br +0 -0
- package/dist/chunk-ZOB6ITIM.js.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,
|
|
242
|
-
minX = Math.min(minX, x -
|
|
243
|
-
minY = Math.min(minY, y -
|
|
244
|
-
minZ = Math.min(minZ, z -
|
|
245
|
-
maxX = Math.max(maxX, x +
|
|
246
|
-
maxY = Math.max(maxY, y +
|
|
247
|
-
maxZ = Math.max(maxZ, z +
|
|
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
|
-
|
|
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
|
|
260
|
-
|
|
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
|
|
390
|
+
const bounds = contentSphere(model);
|
|
391
|
+
const { cx, cy, cz, radius } = bounds;
|
|
289
392
|
const aspect = width / Math.max(1, height);
|
|
290
|
-
const
|
|
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(
|
|
293
|
-
camera.lookAt(
|
|
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
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useStableChart3DInteraction, useLatestRef } from './chunk-T6GFCLSM.mjs';
|
|
2
|
-
import { mountSurfaceChart3D } from './chunk-
|
|
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';
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkDNR6CH6I_js = require('./chunk-DNR6CH6I.js');
|
|
4
|
-
var
|
|
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
|
|
26
|
+
void chunkSK2CZQ6P_js.mountSurfaceChart3D(container, options, stableInteraction).then((handle) => {
|
|
27
27
|
if (disposed) {
|
|
28
28
|
handle.dispose();
|
|
29
29
|
} else {
|
|
Binary file
|
|
Binary file
|