ooxml-ui 0.31.0 → 1.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/README.md +16 -0
- package/custom-elements.json +10 -0
- package/dist/{chunk-OXKWNNNJ.js → chunk-3FPW7M6U.js} +1 -1
- package/dist/{chunk-XDUYS4KK.js → chunk-BEN3453I.js} +1 -1
- package/dist/{chunk-HZ422LTR.js → chunk-BOX43CZD.js} +1 -0
- package/dist/{chunk-3GE2NHNG.js → chunk-KVKKXRL7.js} +121 -83
- package/dist/{chunk-2QW4QE56.js → chunk-M5DTJSOV.js} +105 -70
- package/dist/{chunk-ZV2Z4IWH.js → chunk-USDLALB5.js} +4 -1
- package/dist/{chunk-RAZAJMHK.js → chunk-ZU7GX4SY.js} +4 -4
- package/dist/controls.js +4 -4
- package/dist/docx/hard-break-command.d.ts +1 -3
- package/dist/docx/link-commands.d.ts +4 -15
- package/dist/docx/localization-strings.d.ts +1 -1
- package/dist/docx/localization.d.ts +0 -1
- package/dist/docx/note-editor.d.ts +3 -2
- package/dist/docx/run-styles.d.ts +1 -1
- package/dist/docx/schema.d.ts +1 -1
- package/dist/docx/toggle-commands.d.ts +2 -8
- package/dist/docx.js +118 -321
- package/dist/form/gradient-direction-gallery.d.ts +19 -0
- package/dist/form/gradient-gallery-preview.d.ts +3 -0
- package/dist/form/gradient-preset-gallery.d.ts +16 -0
- package/dist/form/gradient-stop-track.d.ts +20 -0
- package/dist/form/number-range.d.ts +12 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.js +7 -7
- package/dist/menu/menu-button.d.ts +10 -0
- package/dist/menu/menu-button.d.ts.map +1 -1
- package/dist/pptx/{chart-3d-view-scene-IANLDFIE.mjs → chart-3d-view-scene-2KRQ5667.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-3DK5TUBZ.cjs → chart-3d-view-scene-36DMZWZ3.cjs} +37 -37
- package/dist/pptx/{chunk-C42ZL35K.mjs → chunk-ADOC5JLI.mjs} +1 -1
- package/dist/pptx/{chunk-QM4FGZG4.cjs → chunk-AIL3BNZS.cjs} +31 -131
- package/dist/pptx/{chunk-WLETAW3T.cjs → chunk-CJU4P5FT.cjs} +33 -13
- package/dist/pptx/{chunk-6SCK57RJ.cjs → chunk-KPZWYF44.cjs} +220 -342
- package/dist/pptx/{chunk-XQZWZMGZ.cjs → chunk-SM3CWDIQ.cjs} +7 -17
- package/dist/pptx/{chunk-JSBGBVBH.mjs → chunk-VRFNAF3Q.mjs} +7 -17
- package/dist/pptx/{chunk-EVGSFPUV.mjs → chunk-Y2W4SZER.mjs} +71 -202
- package/dist/pptx/{chunk-7JEMQW6R.mjs → chunk-YARCML7O.mjs} +11 -122
- package/dist/pptx/{chunk-OHE5UXST.cjs → chunk-YHA6XAB3.cjs} +1 -1
- package/dist/pptx/{chunk-X2F6PA2D.mjs → chunk-YOGDIDPB.mjs} +22 -3
- package/dist/pptx/dom/index.cjs +238 -238
- package/dist/pptx/dom/index.mjs +8 -8
- package/dist/pptx/export/html2canvas-clone.cjs +2 -2
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translator.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3006 -2990
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/render/chart-combo-stock.cjs +3 -3
- package/dist/pptx/render/chart-combo-stock.mjs +1 -1
- package/dist/pptx/render/chart-manual-layout.d.ts +2 -20
- package/dist/pptx/render/chart-manual-layout.d.ts.map +1 -1
- package/dist/pptx/render/chart-overlays.cjs +7 -7
- package/dist/pptx/render/chart-overlays.mjs +1 -1
- package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
- package/dist/pptx/render/chart-svg-def-types.d.ts +6 -1
- package/dist/pptx/render/chart-svg-def-types.d.ts.map +1 -1
- package/dist/pptx/render/chart-view-model-dom-helpers.d.ts +1 -1
- package/dist/pptx/render/chart-view-model-dom-helpers.d.ts.map +1 -1
- package/dist/pptx/render/chart-view-model.cjs +41 -41
- package/dist/pptx/render/chart-view-model.mjs +1 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
- package/dist/pptx/render/connector-elbow-geometry.d.ts +7 -43
- package/dist/pptx/render/connector-elbow-geometry.d.ts.map +1 -1
- package/dist/pptx/render/element-interaction.d.ts +1 -1
- package/dist/pptx/render/element-interaction.d.ts.map +1 -1
- package/dist/pptx/render/gradient-picker.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/path-gradient-rect.d.ts +1 -75
- package/dist/pptx/render/path-gradient-rect.d.ts.map +1 -1
- package/dist/pptx/render/rotate-handle-placement.d.ts +1 -27
- package/dist/pptx/render/rotate-handle-placement.d.ts.map +1 -1
- package/dist/pptx/render/rotation-drag.d.ts +1 -7
- package/dist/pptx/render/rotation-drag.d.ts.map +1 -1
- package/dist/pptx/render/viewer-root-options.d.ts +46 -0
- package/dist/pptx/render/viewer-root-options.d.ts.map +1 -0
- package/dist/pptx/web-components/registration-contract.d.ts.map +1 -1
- package/dist/presence.js +2 -2
- package/dist/registry.d.ts +2 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/smartart.js +2 -2
- package/dist/teams/app/files-panel.d.ts +8 -3
- package/dist/teams/app/teams-app.d.ts +1 -0
- package/dist/teams/app/teams-settings.d.ts +6 -0
- package/dist/teams.js +5 -5
- package/dist/visio/render-fill.d.ts +2 -1
- package/dist/visio/render-svg.d.ts +2 -0
- package/dist/visio/ribbon-action.d.ts +8 -1
- package/dist/visio/ribbon-parts.d.ts +2 -1
- package/dist/visio/ribbon-router.d.ts +4 -2
- package/dist/visio/viewer-commands.d.ts +3 -3
- package/dist/visio/viewer-draw-tool.d.ts +16 -6
- package/dist/visio/viewer-handle-events.d.ts +19 -0
- package/dist/visio/viewer-line-endpoints.d.ts +14 -0
- package/dist/visio/viewer-rotation-handle.d.ts +14 -0
- package/dist/visio/viewer-rotation-preview.d.ts +7 -0
- package/dist/visio.js +742 -90
- package/dist/xlsx/chart-area-pane.d.ts +9 -0
- package/dist/xlsx/chart-fill-binding.d.ts +23 -0
- package/dist/xlsx/chart-gradient-preview.d.ts +8 -0
- package/dist/xlsx/chart-series-fill.d.ts +2 -1
- package/dist/xlsx/chart-series-gradient-type.d.ts +9 -0
- package/dist/xlsx/chart-series-gradient.d.ts +8 -0
- package/dist/xlsx/chart-series-pane.d.ts +2 -1
- package/dist/xlsx/chart-series-range-preview.d.ts +7 -0
- package/dist/xlsx/chart-series-transparency.d.ts +2 -1
- package/dist/xlsx/grid/measure.d.ts +5 -0
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx.js +965 -105
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var pptx = require('ooxml-core/pptx');
|
|
4
4
|
var color = require('ooxml-core/color');
|
|
5
|
+
var diagram = require('ooxml-core/diagram');
|
|
5
6
|
var chart = require('ooxml-core/chart');
|
|
6
7
|
|
|
7
8
|
// src/pptx/render/chart-font.ts
|
|
@@ -295,104 +296,6 @@ var DEFAULT_TEXT_FONT_SIZE = 24;
|
|
|
295
296
|
var DEFAULT_BODY_INSET_LR_PX = 91440 / 9525;
|
|
296
297
|
var DEFAULT_BODY_INSET_TB_PX = 45720 / 9525;
|
|
297
298
|
|
|
298
|
-
// src/pptx/render/path-gradient-rect.ts
|
|
299
|
-
var BAND_COUNT = 40;
|
|
300
|
-
function hexToRgb(color) {
|
|
301
|
-
const hex = color.replace("#", "");
|
|
302
|
-
return {
|
|
303
|
-
r: Number.parseInt(hex.slice(0, 2), 16) || 0,
|
|
304
|
-
g: Number.parseInt(hex.slice(2, 4), 16) || 0,
|
|
305
|
-
b: Number.parseInt(hex.slice(4, 6), 16) || 0
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
function toHexChannel(value) {
|
|
309
|
-
return Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0");
|
|
310
|
-
}
|
|
311
|
-
function lerpStops(a, b, t) {
|
|
312
|
-
const ca = hexToRgb(a.color);
|
|
313
|
-
const cb = hexToRgb(b.color);
|
|
314
|
-
const oa = a.opacity ?? 1;
|
|
315
|
-
const ob = b.opacity ?? 1;
|
|
316
|
-
return {
|
|
317
|
-
color: `#${toHexChannel(ca.r + (cb.r - ca.r) * t)}${toHexChannel(ca.g + (cb.g - ca.g) * t)}${toHexChannel(ca.b + (cb.b - ca.b) * t)}`,
|
|
318
|
-
opacity: oa + (ob - oa) * t
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
function colorAt(stops, position) {
|
|
322
|
-
const first = stops[0];
|
|
323
|
-
const last = stops[stops.length - 1];
|
|
324
|
-
if (position <= first.position) {
|
|
325
|
-
return { color: first.color, opacity: first.opacity ?? 1 };
|
|
326
|
-
}
|
|
327
|
-
if (position >= last.position) {
|
|
328
|
-
return { color: last.color, opacity: last.opacity ?? 1 };
|
|
329
|
-
}
|
|
330
|
-
for (let i = 0; i < stops.length - 1; i += 1) {
|
|
331
|
-
const from = stops[i];
|
|
332
|
-
const to = stops[i + 1];
|
|
333
|
-
if (position >= from.position && position <= to.position) {
|
|
334
|
-
const span = to.position - from.position;
|
|
335
|
-
const t = span > 0 ? (position - from.position) / span : 0;
|
|
336
|
-
return lerpStops(from, to, t);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
return { color: last.color, opacity: last.opacity ?? 1 };
|
|
340
|
-
}
|
|
341
|
-
function resolveInnerRect(fillToRect, focalPoint) {
|
|
342
|
-
let centerX = 50;
|
|
343
|
-
let centerY = 50;
|
|
344
|
-
let width = 0;
|
|
345
|
-
let height = 0;
|
|
346
|
-
if (fillToRect) {
|
|
347
|
-
const { l, t, r, b } = fillToRect;
|
|
348
|
-
centerX = (l + (1 - r)) / 2 * 100;
|
|
349
|
-
centerY = (t + (1 - b)) / 2 * 100;
|
|
350
|
-
width = Math.max(0, Math.min(1, 1 - l - r)) * 100;
|
|
351
|
-
height = Math.max(0, Math.min(1, 1 - t - b)) * 100;
|
|
352
|
-
if (focalPoint) {
|
|
353
|
-
centerX = (centerX + focalPoint.x * 100) / 2;
|
|
354
|
-
centerY = (centerY + focalPoint.y * 100) / 2;
|
|
355
|
-
}
|
|
356
|
-
} else if (focalPoint) {
|
|
357
|
-
centerX = focalPoint.x * 100;
|
|
358
|
-
centerY = focalPoint.y * 100;
|
|
359
|
-
}
|
|
360
|
-
return {
|
|
361
|
-
left: centerX - width / 2,
|
|
362
|
-
top: centerY - height / 2,
|
|
363
|
-
right: centerX + width / 2,
|
|
364
|
-
bottom: centerY + height / 2
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
function lerpEdge(inner, outer, t) {
|
|
368
|
-
return inner + (outer - inner) * t;
|
|
369
|
-
}
|
|
370
|
-
function buildRectPathGradientSvg(stops, focalPoint, fillToRect) {
|
|
371
|
-
if (stops.length === 0) {
|
|
372
|
-
return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
|
|
373
|
-
}
|
|
374
|
-
const sorted = [...stops].sort((a, b) => a.position - b.position);
|
|
375
|
-
const inner = resolveInnerRect(fillToRect, focalPoint);
|
|
376
|
-
const rects = [];
|
|
377
|
-
for (let i = BAND_COUNT; i >= 0; i -= 1) {
|
|
378
|
-
const t = i / BAND_COUNT;
|
|
379
|
-
const { color, opacity } = colorAt(sorted, t * 100);
|
|
380
|
-
const left = lerpEdge(inner.left, 0, t);
|
|
381
|
-
const top = lerpEdge(inner.top, 0, t);
|
|
382
|
-
const right = lerpEdge(inner.right, 100, t);
|
|
383
|
-
const bottom = lerpEdge(inner.bottom, 100, t);
|
|
384
|
-
const opacityAttr = opacity < 1 ? ` fill-opacity="${Math.max(0, opacity).toFixed(3)}"` : "";
|
|
385
|
-
rects.push(
|
|
386
|
-
`<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="${color}"${opacityAttr}/>`
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${rects.join("")}</svg>`;
|
|
390
|
-
}
|
|
391
|
-
function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
|
|
392
|
-
const markup = buildRectPathGradientSvg(stops, focalPoint, fillToRect);
|
|
393
|
-
return `url("data:image/svg+xml,${encodeURIComponent(markup)}")`;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
299
|
// src/pptx/render/vector-subpath-paint.ts
|
|
397
300
|
function toHexByte(value) {
|
|
398
301
|
const clamped = Math.max(0, Math.min(255, Math.round(value)));
|
|
@@ -578,7 +481,7 @@ function buildCirclePathGradient(stops, focalPoint, fillToRect) {
|
|
|
578
481
|
return `radial-gradient(circle at ${posX} ${posY}, ${stopStr})`;
|
|
579
482
|
}
|
|
580
483
|
function buildRectPathGradient(stops, focalPoint, fillToRect) {
|
|
581
|
-
return buildRectPathGradientImage(stops, focalPoint, fillToRect);
|
|
484
|
+
return diagram.buildRectPathGradientImage(stops, focalPoint, fillToRect);
|
|
582
485
|
}
|
|
583
486
|
function buildShapePathGradient(stops, focalPoint, fillToRect) {
|
|
584
487
|
const stopStr = stops.map(toCssGradientStop).join(", ");
|
|
@@ -1830,7 +1733,7 @@ var DEFAULT_CHART_PALETTE = [
|
|
|
1830
1733
|
"#FF0000",
|
|
1831
1734
|
"#00B0F0"
|
|
1832
1735
|
];
|
|
1833
|
-
function
|
|
1736
|
+
function hexToRgb(hex) {
|
|
1834
1737
|
const h = hex.replace("#", "");
|
|
1835
1738
|
return [
|
|
1836
1739
|
parseInt(h.substring(0, 2), 16),
|
|
@@ -1843,11 +1746,11 @@ function rgbToHex(r, g, b) {
|
|
|
1843
1746
|
return `#${clamp3(r).toString(16).padStart(2, "0")}${clamp3(g).toString(16).padStart(2, "0")}${clamp3(b).toString(16).padStart(2, "0")}`;
|
|
1844
1747
|
}
|
|
1845
1748
|
function tint(hex, amount) {
|
|
1846
|
-
const [r, g, b] =
|
|
1749
|
+
const [r, g, b] = hexToRgb(hex);
|
|
1847
1750
|
return rgbToHex(r + (255 - r) * amount, g + (255 - g) * amount, b + (255 - b) * amount);
|
|
1848
1751
|
}
|
|
1849
1752
|
function shade(hex, amount) {
|
|
1850
|
-
const [r, g, b] =
|
|
1753
|
+
const [r, g, b] = hexToRgb(hex);
|
|
1851
1754
|
return rgbToHex(r * (1 - amount), g * (1 - amount), b * (1 - amount));
|
|
1852
1755
|
}
|
|
1853
1756
|
function colorfulSequential(offset) {
|
|
@@ -2481,7 +2384,7 @@ function resolveDataPointPictureFill(series, pointIndex, seriesIndex, face) {
|
|
|
2481
2384
|
}
|
|
2482
2385
|
|
|
2483
2386
|
// src/pptx/render/chart-palette.ts
|
|
2484
|
-
function
|
|
2387
|
+
function hexToRgb2(hex) {
|
|
2485
2388
|
const h = hex.replace("#", "");
|
|
2486
2389
|
return [
|
|
2487
2390
|
parseInt(h.substring(0, 2), 16),
|
|
@@ -2494,11 +2397,11 @@ function rgbToHex2(r, g, b) {
|
|
|
2494
2397
|
return `#${clamp3(r).toString(16).padStart(2, "0")}${clamp3(g).toString(16).padStart(2, "0")}${clamp3(b).toString(16).padStart(2, "0")}`;
|
|
2495
2398
|
}
|
|
2496
2399
|
function tint2(hex, amount) {
|
|
2497
|
-
const [r, g, b] =
|
|
2400
|
+
const [r, g, b] = hexToRgb2(hex);
|
|
2498
2401
|
return rgbToHex2(r + (255 - r) * amount, g + (255 - g) * amount, b + (255 - b) * amount);
|
|
2499
2402
|
}
|
|
2500
2403
|
function shade2(hex, amount) {
|
|
2501
|
-
const [r, g, b] =
|
|
2404
|
+
const [r, g, b] = hexToRgb2(hex);
|
|
2502
2405
|
return rgbToHex2(r * (1 - amount), g * (1 - amount), b * (1 - amount));
|
|
2503
2406
|
}
|
|
2504
2407
|
|
|
@@ -3127,24 +3030,9 @@ function computeDataTableHeight(dataTable, seriesCount) {
|
|
|
3127
3030
|
const rowCount = Math.max(seriesCount, 1);
|
|
3128
3031
|
return 14 + rowCount * 14;
|
|
3129
3032
|
}
|
|
3130
|
-
|
|
3131
|
-
// src/pptx/render/chart-manual-layout.ts
|
|
3132
|
-
function hasManualLayoutFields(layout) {
|
|
3133
|
-
return layout !== null && layout !== void 0 && (layout.x !== void 0 || layout.y !== void 0 || layout.width !== void 0 || layout.height !== void 0);
|
|
3134
|
-
}
|
|
3135
3033
|
function manualLayoutOf(chartData, region) {
|
|
3136
3034
|
const layout = chartData?.layouts?.[region];
|
|
3137
|
-
return hasManualLayoutFields(layout) ? layout : void 0;
|
|
3138
|
-
}
|
|
3139
|
-
function resolveManualLayoutRect(layout, frame, auto) {
|
|
3140
|
-
if (!hasManualLayoutFields(layout)) {
|
|
3141
|
-
return void 0;
|
|
3142
|
-
}
|
|
3143
|
-
const x = layout.x === void 0 ? auto.x : layout.xMode === "edge" ? layout.x * frame.width : auto.x + layout.x * frame.width;
|
|
3144
|
-
const y = layout.y === void 0 ? auto.y : layout.yMode === "edge" ? layout.y * frame.height : auto.y + layout.y * frame.height;
|
|
3145
|
-
const width = layout.width === void 0 ? auto.width : layout.widthMode === "edge" ? layout.width * frame.width - x : layout.width * frame.width;
|
|
3146
|
-
const height = layout.height === void 0 ? auto.height : layout.heightMode === "edge" ? layout.height * frame.height - y : layout.height * frame.height;
|
|
3147
|
-
return { x, y, width: Math.max(width, 1), height: Math.max(height, 1) };
|
|
3035
|
+
return chart.hasManualLayoutFields(layout) ? layout : void 0;
|
|
3148
3036
|
}
|
|
3149
3037
|
var CHART_TITLE_FONT_PX = 12;
|
|
3150
3038
|
var TITLE_GLYPH_ADVANCE = 0.6;
|
|
@@ -3158,7 +3046,7 @@ function manualTitleAnchor(layout, frame, title, auto) {
|
|
|
3158
3046
|
width: textWidth,
|
|
3159
3047
|
height: CHART_TITLE_FONT_PX * 1.4
|
|
3160
3048
|
};
|
|
3161
|
-
const rect = resolveManualLayoutRect(layout, frame, autoRect);
|
|
3049
|
+
const rect = chart.resolveManualLayoutRect(layout, frame, autoRect);
|
|
3162
3050
|
if (!rect) {
|
|
3163
3051
|
return void 0;
|
|
3164
3052
|
}
|
|
@@ -3172,17 +3060,17 @@ function manualLegendAnchor(layout, frame, entryCount, vertical, auto) {
|
|
|
3172
3060
|
width: count * LEGEND_ITEM_WIDTH,
|
|
3173
3061
|
height: LEGEND_ITEM_HEIGHT
|
|
3174
3062
|
};
|
|
3175
|
-
const rect = resolveManualLayoutRect(layout, frame, autoRect);
|
|
3063
|
+
const rect = chart.resolveManualLayoutRect(layout, frame, autoRect);
|
|
3176
3064
|
if (!rect) {
|
|
3177
3065
|
return void 0;
|
|
3178
3066
|
}
|
|
3179
3067
|
return vertical ? { x: rect.x, y: rect.y } : { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 };
|
|
3180
3068
|
}
|
|
3181
3069
|
function applyLabelManualLayout(layout, frame, point) {
|
|
3182
|
-
if (!hasManualLayoutFields(layout)) {
|
|
3070
|
+
if (!chart.hasManualLayoutFields(layout)) {
|
|
3183
3071
|
return point;
|
|
3184
3072
|
}
|
|
3185
|
-
const rect = resolveManualLayoutRect(layout, frame, {
|
|
3073
|
+
const rect = chart.resolveManualLayoutRect(layout, frame, {
|
|
3186
3074
|
x: point.x,
|
|
3187
3075
|
y: point.y,
|
|
3188
3076
|
width: 1,
|
|
@@ -9060,7 +8948,7 @@ function computePieLayout(elementWidth, elementHeight, chartData, isDoughnut) {
|
|
|
9060
8948
|
const offset = chartFrameToViewOffset(
|
|
9061
8949
|
{ width: elementWidth, height: elementHeight },
|
|
9062
8950
|
{ svgWidth: size, svgHeight: size }
|
|
9063
|
-
), manual = resolveManualLayoutRect(
|
|
8951
|
+
), manual = chart.resolveManualLayoutRect(
|
|
9064
8952
|
manualLayoutOf(chartData, "plotArea"),
|
|
9065
8953
|
{ width: elementWidth, height: elementHeight },
|
|
9066
8954
|
{
|
|
@@ -9348,7 +9236,7 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
9348
9236
|
plotLeft = Math.max(plotLeft, 8 + tableMetrics.keyW);
|
|
9349
9237
|
}
|
|
9350
9238
|
const autoPlotHeight = Math.max(plotBottom - plotTop, 1);
|
|
9351
|
-
const plotLayout = manualLayoutOf(chartData, "plotArea"), manual = resolveManualLayoutRect(
|
|
9239
|
+
const plotLayout = manualLayoutOf(chartData, "plotArea"), manual = chart.resolveManualLayoutRect(
|
|
9352
9240
|
plotLayout,
|
|
9353
9241
|
{ width: svgWidth, height: svgHeight },
|
|
9354
9242
|
{ x: plotLeft, y: plotTop, width: plotRight - plotLeft, height: plotBottom - plotTop }
|
|
@@ -10867,6 +10755,14 @@ Object.defineProperty(exports, "normalizeHexColor", {
|
|
|
10867
10755
|
enumerable: true,
|
|
10868
10756
|
get: function () { return color.normalizeHexColor; }
|
|
10869
10757
|
});
|
|
10758
|
+
Object.defineProperty(exports, "buildRectPathGradientImage", {
|
|
10759
|
+
enumerable: true,
|
|
10760
|
+
get: function () { return diagram.buildRectPathGradientImage; }
|
|
10761
|
+
});
|
|
10762
|
+
Object.defineProperty(exports, "buildRectPathGradientSvg", {
|
|
10763
|
+
enumerable: true,
|
|
10764
|
+
get: function () { return diagram.buildRectPathGradientSvg; }
|
|
10765
|
+
});
|
|
10870
10766
|
Object.defineProperty(exports, "axisTargetIntervals", {
|
|
10871
10767
|
enumerable: true,
|
|
10872
10768
|
get: function () { return chart.axisTargetIntervals; }
|
|
@@ -10895,6 +10791,10 @@ Object.defineProperty(exports, "fitPolynomial", {
|
|
|
10895
10791
|
enumerable: true,
|
|
10896
10792
|
get: function () { return chart.fitPolynomial; }
|
|
10897
10793
|
});
|
|
10794
|
+
Object.defineProperty(exports, "hasManualLayoutFields", {
|
|
10795
|
+
enumerable: true,
|
|
10796
|
+
get: function () { return chart.hasManualLayoutFields; }
|
|
10797
|
+
});
|
|
10898
10798
|
Object.defineProperty(exports, "niceValueAxisBounds", {
|
|
10899
10799
|
enumerable: true,
|
|
10900
10800
|
get: function () { return chart.niceValueAxisBounds; }
|
|
@@ -10907,6 +10807,10 @@ Object.defineProperty(exports, "radarRingPoints", {
|
|
|
10907
10807
|
enumerable: true,
|
|
10908
10808
|
get: function () { return chart.radarRingPoints; }
|
|
10909
10809
|
});
|
|
10810
|
+
Object.defineProperty(exports, "resolveManualLayoutRect", {
|
|
10811
|
+
enumerable: true,
|
|
10812
|
+
get: function () { return chart.resolveManualLayoutRect; }
|
|
10813
|
+
});
|
|
10910
10814
|
exports.AXIS_LABEL_COLOR = AXIS_LABEL_COLOR;
|
|
10911
10815
|
exports.CHART_PX_PER_PT = CHART_PX_PER_PT;
|
|
10912
10816
|
exports.CHART_TITLE_FONT_PX = CHART_TITLE_FONT_PX;
|
|
@@ -10970,8 +10874,6 @@ exports.buildPieViewModel = buildPieViewModel;
|
|
|
10970
10874
|
exports.buildPrimaryAxis = buildPrimaryAxis;
|
|
10971
10875
|
exports.buildRadarViewModel = buildRadarViewModel;
|
|
10972
10876
|
exports.buildRectPathGradient = buildRectPathGradient;
|
|
10973
|
-
exports.buildRectPathGradientImage = buildRectPathGradientImage;
|
|
10974
|
-
exports.buildRectPathGradientSvg = buildRectPathGradientSvg;
|
|
10975
10877
|
exports.buildReflectedGradientStops = buildReflectedGradientStops;
|
|
10976
10878
|
exports.buildRegionMapEntries = buildRegionMapEntries;
|
|
10977
10879
|
exports.buildRegionMapViewModel = buildRegionMapViewModel;
|
|
@@ -11081,7 +10983,6 @@ exports.getSecondaryValueAxis = getSecondaryValueAxis;
|
|
|
11081
10983
|
exports.getSecondaryValueAxisId = getSecondaryValueAxisId;
|
|
11082
10984
|
exports.getSvgStrokeDasharray = getSvgStrokeDasharray;
|
|
11083
10985
|
exports.getTextCompensationTransform = getTextCompensationTransform;
|
|
11084
|
-
exports.hasManualLayoutFields = hasManualLayoutFields;
|
|
11085
10986
|
exports.hasSecondaryCategoryAxis = hasSecondaryCategoryAxis;
|
|
11086
10987
|
exports.hasSecondaryValueAxis = hasSecondaryValueAxis;
|
|
11087
10988
|
exports.isParetoChart = isParetoChart;
|
|
@@ -11125,7 +11026,6 @@ exports.resolveLabelPosition = resolveLabelPosition;
|
|
|
11125
11026
|
exports.resolveLegendAnchorPosition = resolveLegendAnchorPosition;
|
|
11126
11027
|
exports.resolveLegendPlacement = resolveLegendPlacement;
|
|
11127
11028
|
exports.resolveLegendSwatchKind = resolveLegendSwatchKind;
|
|
11128
|
-
exports.resolveManualLayoutRect = resolveManualLayoutRect;
|
|
11129
11029
|
exports.resolveMarkerLabelAnchor = resolveMarkerLabelAnchor;
|
|
11130
11030
|
exports.resolveMarkerLabelPlacement = resolveMarkerLabelPlacement;
|
|
11131
11031
|
exports.resolveRegionCode = resolveRegionCode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAIL3BNZS_cjs = require('./chunk-AIL3BNZS.cjs');
|
|
4
4
|
|
|
5
5
|
// src/pptx/render/chart-legend-layout.ts
|
|
6
6
|
var LEGEND_ITEM_WIDTH = 80;
|
|
@@ -16,11 +16,11 @@ function computeChartLegendLayout(vm) {
|
|
|
16
16
|
y,
|
|
17
17
|
color: entry.color,
|
|
18
18
|
label: entry.label,
|
|
19
|
-
fontSize: textStyle?.fontSize !== void 0 ?
|
|
19
|
+
fontSize: textStyle?.fontSize !== void 0 ? chunkAIL3BNZS_cjs.chartFontPx(textStyle.fontSize) : DEFAULT_LEGEND_FONT_SIZE,
|
|
20
20
|
fill: textStyle?.color ?? DEFAULT_LEGEND_TEXT_COLOR,
|
|
21
21
|
fontWeight: textStyle?.bold ? "bold" : "normal",
|
|
22
22
|
fontStyle: textStyle?.italic ? "italic" : "normal",
|
|
23
|
-
fontFamily:
|
|
23
|
+
fontFamily: chunkAIL3BNZS_cjs.chartTextFontFamily(textStyle),
|
|
24
24
|
...entry.lineSwatch ? { lineSwatch: entry.lineSwatch } : {}
|
|
25
25
|
};
|
|
26
26
|
});
|
|
@@ -35,7 +35,7 @@ function buildRadarDragGeometry(element, chartData, categoryLabels, pointIndex)
|
|
|
35
35
|
if (pointIndex < 0 || pointIndex >= catCount) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
-
const layout =
|
|
38
|
+
const layout = chunkAIL3BNZS_cjs.computePlotLayout(element.width, element.height, chartData, false), cx = layout.plotLeft + layout.plotWidth / 2, cy = layout.plotTop + layout.plotHeight / 2, radius = Math.max(Math.min(layout.plotWidth, layout.plotHeight) / 2 - 4, 1), maxVal = Math.max(1, ...chartData.series.flatMap((s) => s.values.map((v) => Math.abs(v)))), angle = chunkAIL3BNZS_cjs.radarAngle(pointIndex, catCount);
|
|
39
39
|
return { cx, cy, radius, maxVal, angle };
|
|
40
40
|
}
|
|
41
41
|
function resolveRadarDragValue(geometry, pointerX, pointerY) {
|
|
@@ -59,10 +59,10 @@ function buildStackedDragGeometry(element, chartData, seriesIndex, pointIndex) {
|
|
|
59
59
|
chartData.categories.length,
|
|
60
60
|
...seriesValues.map((values) => values.length),
|
|
61
61
|
pointIndex + 1
|
|
62
|
-
), plots =
|
|
62
|
+
), plots = chunkAIL3BNZS_cjs.computeStackedSeriesPlots(seriesValues, catCount, percent), baseValue = plots[seriesIndex]?.base[pointIndex] ?? 0, otherAbsSum = seriesValues.reduce(
|
|
63
63
|
(sum, values, si) => si === seriesIndex ? sum : sum + Math.abs(values[pointIndex] ?? 0),
|
|
64
64
|
0
|
|
65
|
-
), layoutOpts =
|
|
65
|
+
), layoutOpts = chunkAIL3BNZS_cjs.computeLayoutOptions(chartData.axes, chartData.dataTable, chartData.series.length), layout = chunkAIL3BNZS_cjs.computePlotLayout(element.width, element.height, chartData, true, layoutOpts), range = percent ? { min: 0, max: 100, span: 100 } : chunkAIL3BNZS_cjs.computeStackedValueRange(chartData.series, catCount, layout.autoPlotHeight);
|
|
66
66
|
return {
|
|
67
67
|
range,
|
|
68
68
|
plotTop: layout.plotTop,
|
|
@@ -174,7 +174,7 @@ function dragValueForPart(viewY, drag, seriesIndex) {
|
|
|
174
174
|
return roundDragValue(valueFromY(viewY, range, drag.plotTop, drag.plotBottom), range);
|
|
175
175
|
}
|
|
176
176
|
function dragAnchorViewY(value, drag, seriesIndex) {
|
|
177
|
-
return
|
|
177
|
+
return chunkAIL3BNZS_cjs.valueToY2(value, rangeForSeries(drag, seriesIndex), drag.plotTop, drag.plotBottom);
|
|
178
178
|
}
|
|
179
179
|
function withChartPointValue(chartData, seriesIndex, pointIndex, value) {
|
|
180
180
|
const series = chartData.series[seriesIndex];
|
|
@@ -195,7 +195,7 @@ function withChartTitle(chartData, title) {
|
|
|
195
195
|
// A multi-run title collapses to one run in its dominant style so this
|
|
196
196
|
// edit does not leave another, now-stale run's text trailing the new
|
|
197
197
|
// title; see `collapseChartTitleRunsForEdit`'s doc.
|
|
198
|
-
...
|
|
198
|
+
...chunkAIL3BNZS_cjs.collapseChartTitleRunsForEdit(chartData, trimmed),
|
|
199
199
|
style: { ...chartData.style, hasTitle: trimmed.length > 0 }
|
|
200
200
|
};
|
|
201
201
|
}
|
|
@@ -241,7 +241,7 @@ function buildPieDragGeometry(element, chartData, pointIndex) {
|
|
|
241
241
|
if (!series || pointIndex < 0 || pointIndex >= series.values.length) {
|
|
242
242
|
return null;
|
|
243
243
|
}
|
|
244
|
-
const isDoughnut = chartData.chartType === "doughnut", { cx, cy } =
|
|
244
|
+
const isDoughnut = chartData.chartType === "doughnut", { cx, cy } = chunkAIL3BNZS_cjs.computePieLayout(element.width, element.height, chartData, isDoughnut), startAngle = -Math.PI / 2 + (chartData.firstSliceAngle ?? 0) * Math.PI / 180;
|
|
245
245
|
return { cx, cy, values: series.values, pointIndex, startAngle };
|
|
246
246
|
}
|
|
247
247
|
function resolvePieSliceShareValue(pointerAngle, leadingAngle, values, pointIndex) {
|
|
@@ -352,6 +352,23 @@ function advanceChartValueDrag(state, clientY, svgHeight) {
|
|
|
352
352
|
return { chartData, value };
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
// src/pptx/render/chart-svg-def-types.ts
|
|
356
|
+
function resolveChartSvgDef(def) {
|
|
357
|
+
if (def.kind !== "rectPath") return def;
|
|
358
|
+
return {
|
|
359
|
+
kind: "pattern",
|
|
360
|
+
id: def.id,
|
|
361
|
+
href: def.href,
|
|
362
|
+
patternUnits: "objectBoundingBox",
|
|
363
|
+
patternContentUnits: "objectBoundingBox",
|
|
364
|
+
x: 0,
|
|
365
|
+
y: 0,
|
|
366
|
+
width: 1,
|
|
367
|
+
height: 1,
|
|
368
|
+
preserveAspectRatio: "none"
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
355
372
|
// src/pptx/render/chart-view-model-dom-helpers.ts
|
|
356
373
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
357
374
|
function setSvgAttrs(el, attrs) {
|
|
@@ -368,7 +385,8 @@ function createSvgEl(doc, tag, attrs) {
|
|
|
368
385
|
}
|
|
369
386
|
return el;
|
|
370
387
|
}
|
|
371
|
-
function renderPatternDef(doc,
|
|
388
|
+
function renderPatternDef(doc, input) {
|
|
389
|
+
const def = resolveChartSvgDef(input);
|
|
372
390
|
if (def.kind !== "pattern") {
|
|
373
391
|
const gradient = def.kind === "linearGradient" ? createSvgEl(doc, "linearGradient", {
|
|
374
392
|
id: def.id,
|
|
@@ -391,6 +409,7 @@ function renderPatternDef(doc, def) {
|
|
|
391
409
|
const pattern = createSvgEl(doc, "pattern", {
|
|
392
410
|
id: def.id,
|
|
393
411
|
patternUnits: def.patternUnits,
|
|
412
|
+
patternContentUnits: def.patternContentUnits,
|
|
394
413
|
x: def.x,
|
|
395
414
|
y: def.y,
|
|
396
415
|
width: def.width,
|
|
@@ -936,7 +955,7 @@ function buildBarChart3DHoverTooltip(hit, data) {
|
|
|
936
955
|
if (!hit) {
|
|
937
956
|
return void 0;
|
|
938
957
|
}
|
|
939
|
-
return
|
|
958
|
+
return chunkAIL3BNZS_cjs.buildMarkTooltip(
|
|
940
959
|
data.seriesNames[hit.seriesIndex],
|
|
941
960
|
data.categoryLabels[hit.categoryIndex],
|
|
942
961
|
hit.value,
|
|
@@ -949,7 +968,7 @@ function formatValueLabel(chartData, grouping, v) {
|
|
|
949
968
|
if (grouping === "percentStacked") {
|
|
950
969
|
return `${Math.round(v * 100)}%`;
|
|
951
970
|
}
|
|
952
|
-
return
|
|
971
|
+
return chunkAIL3BNZS_cjs.formatAxisValueWithUnits(
|
|
953
972
|
v,
|
|
954
973
|
chartData.axes?.find((a) => a.axisType === "valAx")
|
|
955
974
|
);
|
|
@@ -1033,7 +1052,7 @@ function buildGridlines(layout) {
|
|
|
1033
1052
|
const { w, h, d } = layout.box;
|
|
1034
1053
|
const lines = [];
|
|
1035
1054
|
const span = layout.range.max - layout.range.min;
|
|
1036
|
-
for (const v of
|
|
1055
|
+
for (const v of chunkAIL3BNZS_cjs.axisTickValues({ ...layout.range, span })) {
|
|
1037
1056
|
const p = valuePos(layout, v);
|
|
1038
1057
|
if (layout.horizontal) {
|
|
1039
1058
|
lines.push({ from: [p, 0, d], to: [p, h, d] }, { from: [p, 0, 0], to: [p, 0, d] });
|
|
@@ -1087,6 +1106,7 @@ exports.renderChartPrimitiveSvg = renderChartPrimitiveSvg;
|
|
|
1087
1106
|
exports.renderChartTextSvg = renderChartTextSvg;
|
|
1088
1107
|
exports.renderChartViewModelSvg = renderChartViewModelSvg;
|
|
1089
1108
|
exports.resolveChartDragValue = resolveChartDragValue;
|
|
1109
|
+
exports.resolveChartSvgDef = resolveChartSvgDef;
|
|
1090
1110
|
exports.resolvePieDragValue = resolvePieDragValue;
|
|
1091
1111
|
exports.resolvePieSliceShareValue = resolvePieSliceShareValue;
|
|
1092
1112
|
exports.resolveRadarDragValue = resolveRadarDragValue;
|