ooxml-ui 1.30.0 → 1.32.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 +10 -0
- package/custom-elements.json +4 -0
- package/dist/building-block-styles.d.ts +0 -1
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/{chunk-SBBFNAKM.js → chunk-32P252JS.js} +3 -3
- package/dist/{chunk-E4H3Y7M4.js → chunk-6TS7ASDJ.js} +1 -1
- package/dist/{chunk-BKHWBIXP.js → chunk-CALEXPBD.js} +132 -69
- package/dist/{chunk-SXVOXSTE.js → chunk-CDC5MAZS.js} +1 -1
- package/dist/chunk-DA57FPSN.js +54 -0
- package/dist/{chunk-HNREZW5U.js → chunk-KYXSQFDB.js} +484 -1
- package/dist/{chunk-IE6HKH4X.js → chunk-OKEFAQJT.js} +1 -1
- package/dist/controls.d.ts +6 -0
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/dialog/dialog-session.d.ts +19 -0
- package/dist/dialog/dialog-session.d.ts.map +1 -0
- package/dist/docx/smartart-node-view.d.ts +1 -1
- package/dist/docx.js +36 -20
- package/dist/fonts/availability.d.ts +10 -0
- package/dist/fonts/availability.d.ts.map +1 -0
- package/dist/fonts/catalog.d.ts +63 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/custom-fonts.d.ts +75 -0
- package/dist/fonts/custom-fonts.d.ts.map +1 -0
- package/dist/form/color-input/live-color-input.d.ts +93 -0
- package/dist/form/color-input/live-color-input.d.ts.map +1 -0
- package/dist/form/color-input/live-color-leaves.d.ts +34 -0
- package/dist/form/color-input/live-color-leaves.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -5
- package/dist/picture-effects.d.ts +6 -0
- package/dist/pptx/ai/host.cjs +41 -37
- package/dist/pptx/ai/host.d.ts +2 -0
- package/dist/pptx/ai/host.d.ts.map +1 -1
- package/dist/pptx/ai/host.mjs +2 -2
- package/dist/pptx/ai/index.cjs +47 -43
- package/dist/pptx/ai/index.d.ts +2 -0
- package/dist/pptx/ai/index.d.ts.map +1 -1
- package/dist/pptx/ai/index.mjs +3 -3
- package/dist/pptx/{chart-3d-view-scene-ZUGA3DKM.mjs → chart-3d-view-scene-HNL4NWJT.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-N7UQOYFI.cjs → chart-3d-view-scene-OPVBTZL5.cjs} +38 -38
- package/dist/pptx/chunk-3RIGT7H6.cjs +82 -0
- package/dist/pptx/{chunk-D7UYDESZ.mjs → chunk-7DT3UJQB.mjs} +3 -3
- package/dist/pptx/{chunk-KY75GY5O.mjs → chunk-7FXQHSPE.mjs} +6 -24
- package/dist/pptx/{chunk-45OYSCLD.mjs → chunk-CH4Z6H6C.mjs} +581 -230
- package/dist/pptx/{chunk-6KLPQQYP.cjs → chunk-D4LJJ7Z7.cjs} +77 -327
- package/dist/pptx/{chunk-MNSWEXYO.mjs → chunk-DACFW5LO.mjs} +26 -3
- package/dist/pptx/{chunk-IOOI63TH.cjs → chunk-FFWLDANS.cjs} +6 -24
- package/dist/pptx/{chunk-SMMEIEEJ.mjs → chunk-KGDMMWIY.mjs} +1 -1
- package/dist/pptx/{chunk-LXEMMWVI.mjs → chunk-LCCRLB7Q.mjs} +1 -1
- package/dist/pptx/{chunk-BMMTD6PB.cjs → chunk-M55PNMFQ.cjs} +2 -2
- package/dist/pptx/chunk-PM2SOLK3.mjs +79 -0
- package/dist/pptx/{chunk-QX6XPYVA.mjs → chunk-PTIGQSTY.mjs} +31 -14
- package/dist/pptx/{chunk-34LEUH5R.mjs → chunk-RZVEPTLN.mjs} +63 -316
- package/dist/pptx/{chunk-CQYWHRZE.cjs → chunk-S3L5NNCK.cjs} +1 -1
- package/dist/pptx/{chunk-H5IPNKX6.cjs → chunk-S5I64Y55.cjs} +12 -12
- package/dist/pptx/{chunk-WQA3KZRB.mjs → chunk-SPOECCPV.mjs} +1 -1
- package/dist/pptx/{chunk-YMWEU56T.cjs → chunk-TDIJHLS5.cjs} +927 -543
- package/dist/pptx/{chunk-QWF3PGUX.cjs → chunk-VEFFYJGG.cjs} +26 -2
- package/dist/pptx/{chunk-BSGCZ4JZ.cjs → chunk-WBGU7BWD.cjs} +31 -14
- package/dist/pptx/{chunk-2CBK46AW.cjs → chunk-ZS5EVODY.cjs} +48 -48
- package/dist/pptx/dom/index.cjs +431 -430
- package/dist/pptx/dom/index.mjs +15 -14
- package/dist/pptx/export/html2canvas-clone.cjs +6 -6
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/index.cjs +3423 -3355
- package/dist/pptx/index.mjs +8 -8
- package/dist/pptx/render/bullet-toggle-selection.d.ts +8 -4
- package/dist/pptx/render/bullet-toggle-selection.d.ts.map +1 -1
- package/dist/pptx/render/chart-box-whisker.d.ts.map +1 -1
- 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-data-table-metrics.d.ts +1 -1
- package/dist/pptx/render/chart-data-table-metrics.d.ts.map +1 -1
- package/dist/pptx/render/chart-data-table-render.d.ts.map +1 -1
- package/dist/pptx/render/chart-date-axis.d.ts +1 -1
- package/dist/pptx/render/chart-date-axis.d.ts.map +1 -1
- package/dist/pptx/render/chart-date-format.d.ts +1 -30
- package/dist/pptx/render/chart-date-format.d.ts.map +1 -1
- package/dist/pptx/render/chart-funnel-sunburst.d.ts +1 -1
- package/dist/pptx/render/chart-funnel-sunburst.d.ts.map +1 -1
- package/dist/pptx/render/chart-line-path.d.ts +2 -26
- package/dist/pptx/render/chart-line-path.d.ts.map +1 -1
- package/dist/pptx/render/chart-manual-layout.d.ts +1 -1
- 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-view-model-layout.d.ts.map +1 -1
- package/dist/pptx/render/chart-view-model.cjs +44 -44
- 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/controller/ai-assistant.d.ts +73 -0
- package/dist/pptx/render/controller/ai-assistant.d.ts.map +1 -0
- package/dist/pptx/render/controller/autosave-controller.d.ts.map +1 -1
- package/dist/pptx/render/controller/collaboration-history.d.ts +25 -0
- package/dist/pptx/render/controller/collaboration-history.d.ts.map +1 -1
- package/dist/pptx/render/controller/history-controller.d.ts +9 -0
- package/dist/pptx/render/controller/history-controller.d.ts.map +1 -1
- package/dist/pptx/render/controller/index.d.ts +4 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/custom-fonts.cjs +9 -5
- package/dist/pptx/render/custom-fonts.d.ts +1 -64
- package/dist/pptx/render/custom-fonts.d.ts.map +1 -1
- package/dist/pptx/render/custom-fonts.mjs +1 -1
- package/dist/pptx/render/editor-geometry.d.ts +3 -15
- package/dist/pptx/render/editor-geometry.d.ts.map +1 -1
- package/dist/pptx/render/font-availability.d.ts +1 -9
- package/dist/pptx/render/font-availability.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.cjs +3 -3
- package/dist/pptx/render/font-catalog.d.ts +3 -61
- package/dist/pptx/render/font-catalog.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.mjs +1 -1
- package/dist/pptx/render/hyperlink-security.cjs +8 -8
- package/dist/pptx/render/hyperlink-security.d.ts +1 -27
- package/dist/pptx/render/hyperlink-security.d.ts.map +1 -1
- package/dist/pptx/render/hyperlink-security.mjs +1 -1
- package/dist/pptx/render/image-effects.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/inline-list-style.d.ts +2 -1
- package/dist/pptx/render/inline-list-style.d.ts.map +1 -1
- package/dist/pptx/render/live-color-input.d.ts +2 -92
- package/dist/pptx/render/live-color-input.d.ts.map +1 -1
- package/dist/pptx/render/live-color-leaves.d.ts +2 -33
- package/dist/pptx/render/live-color-leaves.d.ts.map +1 -1
- package/dist/pptx/render/options/autocorrect.d.ts +15 -2
- package/dist/pptx/render/options/autocorrect.d.ts.map +1 -1
- package/dist/pptx/render/picture-crop/crop-geometry.d.ts +2 -20
- package/dist/pptx/render/picture-crop/crop-geometry.d.ts.map +1 -1
- package/dist/pptx/render/slides-pane-model.d.ts +79 -0
- package/dist/pptx/render/slides-pane-model.d.ts.map +1 -0
- package/dist/pptx/render/table-cell-edit.d.ts +1 -1
- package/dist/pptx/render/table-cell-edit.d.ts.map +1 -1
- package/dist/pptx/render/text-list-style-update.d.ts +23 -2
- package/dist/pptx/render/text-list-style-update.d.ts.map +1 -1
- package/dist/pptx/render/text-script-fonts.d.ts +4 -72
- package/dist/pptx/render/text-script-fonts.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts +10 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-curves.d.ts +8 -0
- package/dist/pptx/render/text-warp-envelope-curves.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-layout.d.ts +9 -3
- package/dist/pptx/render/text-warp-envelope-layout.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-map.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts +29 -0
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts +13 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-preset-sampler.d.ts +12 -0
- package/dist/pptx/render/text-warp-preset-sampler.d.ts.map +1 -1
- package/dist/pptx/render/text-warp.d.ts +3 -2
- package/dist/pptx/render/text-warp.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-SKFD7NCQ.mjs → smartart-insert-preview-RQUFRLSV.mjs} +9 -9
- package/dist/pptx/{smartart-insert-preview-7OL7VWEK.cjs → smartart-insert-preview-YKNB37GE.cjs} +10 -10
- package/dist/recovery-scheduler.d.ts +18 -0
- package/dist/recovery-scheduler.d.ts.map +1 -0
- package/dist/smartart/smartart-geometry.d.ts +1 -3
- package/dist/smartart/smartart-paint.d.ts +2 -1
- package/dist/smartart/smartart-picture.d.ts +7 -0
- package/dist/smartart/smartart-svg.d.ts +2 -1
- package/dist/smartart/smartart.d.ts +6 -0
- package/dist/smartart.js +1 -1
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/theme.d.ts +0 -1
- package/dist/visio/controller.d.ts +2 -2
- package/dist/visio/viewer-autorecover.d.ts +0 -1
- package/dist/visio/viewer-commands.d.ts +1 -1
- package/dist/visio/viewer-guides.d.ts +2 -2
- package/dist/visio/viewer-pointer-gestures.d.ts +1 -1
- package/dist/visio/viewer-resize-frame.d.ts +2 -2
- package/dist/visio/viewer-resize-handles.d.ts +1 -1
- package/dist/visio.js +109 -62
- package/dist/xlsx/grid/smartart.d.ts +1 -1
- package/dist/xlsx.js +91 -62
- package/package.json +2 -2
- package/dist/pptx/chunk-WM5SW737.mjs +0 -27
- package/dist/pptx/chunk-Y6DO6SVT.cjs +0 -29
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSubstituteFonts, buildFontFamilyString, hasShapeProperties, ooxmlGradientAngleToCssDegrees, chartDataChangeType, isParetoChartData, resolveDisplayedChartTypeName, evaluateCustomGeometryPaths, customGeometryPathsToSvgSubpaths, evaluatePresetShape, parseDataUrlToBytes, sampleFirstPixelColorFromBytes, flattenChartUserShapes } from 'ooxml-core/pptx';
|
|
2
|
-
import { DEFAULT_CHART_PALETTE, computeAxisStackedValueRange, computeAxisValueRange, formatCompactAxisValue, automaticMarkerSymbol, markerOutline, getChartStylePalette, formatChartNumber, clusteredBarGeometry, tint, shade, hasManualLayoutFields, resolveManualLayoutRect, resolveDataLabelFlags, composeDataLabelText, generateAxisTicks, generateMinorAxisTicks, computeStackedValueRangeForAxis, computeValueRangeForChart, computeValueRangeForAxis, groupRowsByCategory,
|
|
3
|
-
export { DEFAULT_BAR_GAP_WIDTH, DEFAULT_CHART_PALETTE, computeBoxStats, computeBubbleRadius, computeLinearRegression, computeLogValueRange, computeRSquared, computeRadarPoints, computeStackedSeriesPlots, computeStackedValueRangeForAxis, computeValueRangeForAxis, computeValueRangeForChart, findLogAxis, fitPolynomial, generateAxisTicks, generateLogTicks, generateMinorAxisTicks, getChartStylePalette, hasManualLayoutFields, radarAngle, radarRingPoints, resolveManualLayoutRect, shade, tint, valueToYLog } from 'ooxml-core/chart';
|
|
2
|
+
import { DEFAULT_CHART_PALETTE, computeAxisStackedValueRange, computeAxisValueRange, formatCompactAxisValue, automaticMarkerSymbol, markerOutline, getChartStylePalette, formatChartNumber, clusteredBarGeometry, tint, shade, hasManualLayoutFields, resolveManualLayoutRect, applyLabelManualLayout, resolveDataLabelFlags, composeDataLabelText, generateAxisTicks, generateMinorAxisTicks, computeStackedValueRangeForAxis, computeValueRangeForChart, computeValueRangeForAxis, groupRowsByCategory, boxWhiskerDistribution, computeHistogramBins as computeHistogramBins$1, aggregateByCategory, computeSunburstArcs as computeSunburstArcs$1, computeHierarchicalSunburstArcs as computeHierarchicalSunburstArcs$1, computeFunnelGeometry, resolveManualPlotRect, radarRingPoints, radarAngle, computeRadarPoints, buildWaterfallSteps, computeWaterfallRange, buildMarkerPrimitive as buildMarkerPrimitive$1, chartDataTableMetrics, resolveBlankDisplay, computeStackedSeriesPlots, visibleRuns, smoothLinePath, maxBubbleSize, medianBubbleRadius, computeBubbleRadius, resolveAutoTitleText, STOCK_DEFAULT_WICK_COLOR, stockCandle, STOCK_DEFAULT_UP_FILL, STOCK_DEFAULT_DOWN_FILL, STOCK_TICK_WIDTH, boxMeanMarkerPath, buildHierarchyRoots, layoutTreemap, hierarchyBranchLabels, placeBestFitLabel, nudgeOutsideLabels, impliesAutoTitle, buildChartGradientDef, chartErrorBarAmount, fitChartTrendline, chartLineDashArray, calendarTicks, formatDate, excelSerialToDate, sampleSmoothLine, polylineRunsPath } from 'ooxml-core/chart';
|
|
3
|
+
export { DEFAULT_BAR_GAP_WIDTH, DEFAULT_CHART_PALETTE, applyLabelManualLayout, computeBoxStats, computeBubbleRadius, computeLinearRegression, computeLogValueRange, computeRSquared, computeRadarPoints, computeStackedSeriesPlots, computeStackedValueRangeForAxis, computeValueRangeForAxis, computeValueRangeForChart, findLogAxis, fitPolynomial, generateAxisTicks, generateLogTicks, generateMinorAxisTicks, getChartStylePalette, hasManualLayoutFields, radarAngle, radarRingPoints, resolveManualLayoutRect, shade, tint, valueToYLog } from 'ooxml-core/chart';
|
|
4
4
|
import { colorWithOpacity, clampUnitInterval, normalizeHexColor, hexToRgbChannels } from 'ooxml-core/color';
|
|
5
5
|
export { clampUnitInterval, colorWithOpacity, hexToRgbChannels, normalizeHexColor } from 'ooxml-core/color';
|
|
6
6
|
import { buildRectPathGradientImage } from 'ooxml-core/diagram';
|
|
@@ -1960,16 +1960,16 @@ function bevelMarkup(rects, threeD) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
|
|
1962
1962
|
// src/pptx/render/chart-format/chart-format-geometry.ts
|
|
1963
|
-
function chartTextBox(text,
|
|
1963
|
+
function chartTextBox(text, pad = 3) {
|
|
1964
1964
|
const width = Math.max(4, text.text.length * text.fontSize * 0.58);
|
|
1965
1965
|
const left = text.textAnchor === "start" ? text.x : text.textAnchor === "end" ? text.x - width : text.x - width / 2;
|
|
1966
1966
|
const middle = text.dominantBaseline === "middle" || text.dominantBaseline === "central";
|
|
1967
1967
|
const top = middle ? text.y - text.fontSize / 2 : text.y - text.fontSize;
|
|
1968
1968
|
return {
|
|
1969
|
-
left: left -
|
|
1970
|
-
top: top -
|
|
1971
|
-
right: left + width +
|
|
1972
|
-
bottom: top + text.fontSize +
|
|
1969
|
+
left: left - pad,
|
|
1970
|
+
top: top - pad,
|
|
1971
|
+
right: left + width + pad,
|
|
1972
|
+
bottom: top + text.fontSize + pad
|
|
1973
1973
|
};
|
|
1974
1974
|
}
|
|
1975
1975
|
function chartPlotBounds(vm) {
|
|
@@ -2553,12 +2553,12 @@ var hasBox = (format, ownGradient = true) => Boolean(
|
|
|
2553
2553
|
format && !format.reset && (paints(format.fill, ownGradient) || format.line?.kind === "solid" || format.line?.kind === "gradient" || format.effects?.shadow || format.effects?.glow && format.effects.glow.radius > 0 || format.threeD?.bevelTop || format.threeD?.contour)
|
|
2554
2554
|
);
|
|
2555
2555
|
var boxFill = (fill, ownGradient) => fill?.kind === "gradient" && !ownGradient ? void 0 : fill;
|
|
2556
|
-
function union(boxes,
|
|
2556
|
+
function union(boxes, pad) {
|
|
2557
2557
|
if (boxes.length === 0) return void 0;
|
|
2558
|
-
const left = Math.min(...boxes.map((b) => b.left)) -
|
|
2559
|
-
const top = Math.min(...boxes.map((b) => b.top)) -
|
|
2560
|
-
const right = Math.max(...boxes.map((b) => b.right)) +
|
|
2561
|
-
const bottom = Math.max(...boxes.map((b) => b.bottom)) +
|
|
2558
|
+
const left = Math.min(...boxes.map((b) => b.left)) - pad;
|
|
2559
|
+
const top = Math.min(...boxes.map((b) => b.top)) - pad;
|
|
2560
|
+
const right = Math.max(...boxes.map((b) => b.right)) + pad;
|
|
2561
|
+
const bottom = Math.max(...boxes.map((b) => b.bottom)) + pad;
|
|
2562
2562
|
return { x: left, y: top, w: right - left, h: bottom - top };
|
|
2563
2563
|
}
|
|
2564
2564
|
var textBoxes = (texts) => (texts ?? []).filter((t) => !t.transform).map((t) => chartTextBox(t, 2));
|
|
@@ -3493,18 +3493,6 @@ function manualLegendAnchor(layout, frame, entryCount, vertical, auto) {
|
|
|
3493
3493
|
}
|
|
3494
3494
|
return vertical ? { x: rect.x, y: rect.y } : { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 };
|
|
3495
3495
|
}
|
|
3496
|
-
function applyLabelManualLayout(layout, frame, point) {
|
|
3497
|
-
if (!hasManualLayoutFields(layout)) {
|
|
3498
|
-
return point;
|
|
3499
|
-
}
|
|
3500
|
-
const rect = resolveManualLayoutRect(layout, frame, {
|
|
3501
|
-
x: point.x,
|
|
3502
|
-
y: point.y,
|
|
3503
|
-
width: 1,
|
|
3504
|
-
height: 1
|
|
3505
|
-
});
|
|
3506
|
-
return rect ? { x: rect.x, y: rect.y } : point;
|
|
3507
|
-
}
|
|
3508
3496
|
function chartFrameToViewOffset(frame, view) {
|
|
3509
3497
|
return { x: (frame.width - view.svgWidth) / 2, y: (frame.height - view.svgHeight) / 2 };
|
|
3510
3498
|
}
|
|
@@ -3879,60 +3867,6 @@ function dataLabelFontOverride(style) {
|
|
|
3879
3867
|
...style.color ? { fill: style.color } : {}
|
|
3880
3868
|
};
|
|
3881
3869
|
}
|
|
3882
|
-
|
|
3883
|
-
// src/pptx/render/chart-line-path.ts
|
|
3884
|
-
function smoothLinePath(points) {
|
|
3885
|
-
if (points.length === 0) {
|
|
3886
|
-
return "";
|
|
3887
|
-
}
|
|
3888
|
-
if (points.length === 1) {
|
|
3889
|
-
return `M${points[0].x.toFixed(2)},${points[0].y.toFixed(2)}`;
|
|
3890
|
-
}
|
|
3891
|
-
if (points.length === 2) {
|
|
3892
|
-
return `M${points[0].x.toFixed(2)},${points[0].y.toFixed(2)} L${points[1].x.toFixed(2)},${points[1].y.toFixed(2)}`;
|
|
3893
|
-
}
|
|
3894
|
-
let d = `M${points[0].x.toFixed(2)},${points[0].y.toFixed(2)}`;
|
|
3895
|
-
for (let i = 0; i < points.length - 1; i++) {
|
|
3896
|
-
const [cp1, cp2, end] = smoothSegment(points, i);
|
|
3897
|
-
d += ` C${cp1.x.toFixed(2)},${cp1.y.toFixed(2)} ${cp2.x.toFixed(2)},${cp2.y.toFixed(2)} ${end.x.toFixed(2)},${end.y.toFixed(2)}`;
|
|
3898
|
-
}
|
|
3899
|
-
return d;
|
|
3900
|
-
}
|
|
3901
|
-
function smoothSegment(points, i) {
|
|
3902
|
-
const p0 = points[i - 1] ?? points[i];
|
|
3903
|
-
const p1 = points[i];
|
|
3904
|
-
const p2 = points[i + 1];
|
|
3905
|
-
const p3 = points[i + 2] ?? p2;
|
|
3906
|
-
return [
|
|
3907
|
-
{ x: p1.x + (p2.x - p0.x) / 6, y: p1.y + (p2.y - p0.y) / 6 },
|
|
3908
|
-
{ x: p2.x - (p3.x - p1.x) / 6, y: p2.y - (p3.y - p1.y) / 6 },
|
|
3909
|
-
p2
|
|
3910
|
-
];
|
|
3911
|
-
}
|
|
3912
|
-
function sampleSmoothLine(points, stepsPerSegment = 16) {
|
|
3913
|
-
if (points.length < 3) {
|
|
3914
|
-
return [...points];
|
|
3915
|
-
}
|
|
3916
|
-
const out = [points[0]];
|
|
3917
|
-
for (let i = 0; i < points.length - 1; i++) {
|
|
3918
|
-
const start = points[i], [cp1, cp2, end] = smoothSegment(points, i);
|
|
3919
|
-
for (let step = 1; step <= stepsPerSegment; step++) {
|
|
3920
|
-
const t = step / stepsPerSegment, u = 1 - t, a = u * u * u, b = 3 * u * u * t, c = 3 * u * t * t, d = t * t * t;
|
|
3921
|
-
out.push(
|
|
3922
|
-
step === stepsPerSegment ? end : {
|
|
3923
|
-
x: a * start.x + b * cp1.x + c * cp2.x + d * end.x,
|
|
3924
|
-
y: a * start.y + b * cp1.y + c * cp2.y + d * end.y
|
|
3925
|
-
}
|
|
3926
|
-
);
|
|
3927
|
-
}
|
|
3928
|
-
}
|
|
3929
|
-
return out;
|
|
3930
|
-
}
|
|
3931
|
-
function polylineRunsPath(runs) {
|
|
3932
|
-
return runs.map(
|
|
3933
|
-
(run) => run.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(" ")
|
|
3934
|
-
).join(" ");
|
|
3935
|
-
}
|
|
3936
3870
|
var DEFAULT_COLOR = "#64748b";
|
|
3937
3871
|
function chartAxisTextStyle(axis, defaultFontSizePx = DEFAULT_CHART_TEXT_PX) {
|
|
3938
3872
|
return {
|
|
@@ -5397,8 +5331,6 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
|
|
|
5397
5331
|
}
|
|
5398
5332
|
return { primitives: [...primitives, ...labelBoxes], dataLabels };
|
|
5399
5333
|
}
|
|
5400
|
-
|
|
5401
|
-
// src/pptx/render/chart-data-table-metrics.ts
|
|
5402
5334
|
function resolveDataTableMetrics(chartData) {
|
|
5403
5335
|
const table = chartData.dataTable;
|
|
5404
5336
|
if (!table) {
|
|
@@ -5406,10 +5338,11 @@ function resolveDataTableMetrics(chartData) {
|
|
|
5406
5338
|
}
|
|
5407
5339
|
const sizePt = resolveChartTextStyle(chartData, table.txPr)?.fontSize;
|
|
5408
5340
|
const fontSize = sizePt !== void 0 ? chartFontPx(sizePt) : resolveChartStyleDefaults(chartData).bodyTextPx;
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5341
|
+
return chartDataTableMetrics(
|
|
5342
|
+
fontSize,
|
|
5343
|
+
chartData.series.map((s) => s.name ?? ""),
|
|
5344
|
+
table.showKeys !== false
|
|
5345
|
+
);
|
|
5413
5346
|
}
|
|
5414
5347
|
function labelsBesideTable(chartData, axis) {
|
|
5415
5348
|
return chartData.dataTable ? [] : axis.labels;
|
|
@@ -5495,14 +5428,14 @@ function computeDataTablePrimitives(chartData, layout, colorPalette) {
|
|
|
5495
5428
|
out.push(line2(x, top, x, bottom));
|
|
5496
5429
|
}
|
|
5497
5430
|
});
|
|
5498
|
-
if (showV
|
|
5431
|
+
if (showV) {
|
|
5499
5432
|
out.push(line2(layout.plotLeft, top, layout.plotLeft, bottom));
|
|
5500
5433
|
}
|
|
5501
5434
|
series.forEach((s, si) => {
|
|
5502
5435
|
const rowTop = top + rowH * (si + 1);
|
|
5503
5436
|
const cy = rowTop + rowH / 2;
|
|
5504
5437
|
if (showH) {
|
|
5505
|
-
out.push(line2(
|
|
5438
|
+
out.push(line2(left, rowTop, right, rowTop));
|
|
5506
5439
|
}
|
|
5507
5440
|
if (showK) {
|
|
5508
5441
|
const swatch = Math.max(6, Math.round(metrics.fontSize * 0.55));
|
|
@@ -5514,8 +5447,9 @@ function computeDataTablePrimitives(chartData, layout, colorPalette) {
|
|
|
5514
5447
|
h: swatch,
|
|
5515
5448
|
fill: seriesColor2(s, si, colorPalette)
|
|
5516
5449
|
});
|
|
5517
|
-
out.push(label(left + DATA_TABLE_PADDING + swatch + 3, cy, s.name, "start"));
|
|
5518
5450
|
}
|
|
5451
|
+
const keyInset = showK ? Math.max(6, Math.round(metrics.fontSize * 0.55)) + 3 : 0;
|
|
5452
|
+
out.push(label(left + DATA_TABLE_PADDING + keyInset, cy, s.name, "start"));
|
|
5519
5453
|
categories.forEach((_cat, ci) => {
|
|
5520
5454
|
const val = s.values[ci];
|
|
5521
5455
|
const x = layout.plotLeft + ci * cellW + cellW / 2;
|
|
@@ -5643,175 +5577,6 @@ function computeHelperLinePrimitives(chartData, layout, range, catCount, options
|
|
|
5643
5577
|
...computeHiLowLinePrimitives(chartData, layout, range, catCount, options)
|
|
5644
5578
|
];
|
|
5645
5579
|
}
|
|
5646
|
-
|
|
5647
|
-
// src/pptx/render/chart-date-format.ts
|
|
5648
|
-
var MONTH_ABBR = [
|
|
5649
|
-
"Jan",
|
|
5650
|
-
"Feb",
|
|
5651
|
-
"Mar",
|
|
5652
|
-
"Apr",
|
|
5653
|
-
"May",
|
|
5654
|
-
"Jun",
|
|
5655
|
-
"Jul",
|
|
5656
|
-
"Aug",
|
|
5657
|
-
"Sep",
|
|
5658
|
-
"Oct",
|
|
5659
|
-
"Nov",
|
|
5660
|
-
"Dec"
|
|
5661
|
-
];
|
|
5662
|
-
var MONTH_FULL = [
|
|
5663
|
-
"January",
|
|
5664
|
-
"February",
|
|
5665
|
-
"March",
|
|
5666
|
-
"April",
|
|
5667
|
-
"May",
|
|
5668
|
-
"June",
|
|
5669
|
-
"July",
|
|
5670
|
-
"August",
|
|
5671
|
-
"September",
|
|
5672
|
-
"October",
|
|
5673
|
-
"November",
|
|
5674
|
-
"December"
|
|
5675
|
-
];
|
|
5676
|
-
var WEEKDAY_ABBR = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
5677
|
-
var WEEKDAY_FULL = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
5678
|
-
function scanDateFormatTokens(code) {
|
|
5679
|
-
const tokens = [];
|
|
5680
|
-
let i = 0;
|
|
5681
|
-
while (i < code.length) {
|
|
5682
|
-
const ch = code[i];
|
|
5683
|
-
if (ch === '"') {
|
|
5684
|
-
const close = code.indexOf('"', i + 1);
|
|
5685
|
-
tokens.push({
|
|
5686
|
-
kind: "literal",
|
|
5687
|
-
text: close === -1 ? code.slice(i + 1) : code.slice(i + 1, close)
|
|
5688
|
-
});
|
|
5689
|
-
i = close === -1 ? code.length : close + 1;
|
|
5690
|
-
continue;
|
|
5691
|
-
}
|
|
5692
|
-
if (ch === "\\") {
|
|
5693
|
-
tokens.push({ kind: "literal", text: code[i + 1] ?? "" });
|
|
5694
|
-
i += 2;
|
|
5695
|
-
continue;
|
|
5696
|
-
}
|
|
5697
|
-
const rest = code.slice(i);
|
|
5698
|
-
if (/^am\/pm/iu.test(rest)) {
|
|
5699
|
-
tokens.push({ kind: "ampm", upper: ch === ch.toUpperCase(), short: false });
|
|
5700
|
-
i += 5;
|
|
5701
|
-
continue;
|
|
5702
|
-
}
|
|
5703
|
-
if (/^a\/p/iu.test(rest)) {
|
|
5704
|
-
tokens.push({ kind: "ampm", upper: ch === ch.toUpperCase(), short: true });
|
|
5705
|
-
i += 3;
|
|
5706
|
-
continue;
|
|
5707
|
-
}
|
|
5708
|
-
if (/[ymdhs]/iu.test(ch)) {
|
|
5709
|
-
let j = i + 1;
|
|
5710
|
-
while (j < code.length && code[j].toLowerCase() === ch.toLowerCase()) {
|
|
5711
|
-
j += 1;
|
|
5712
|
-
}
|
|
5713
|
-
tokens.push({
|
|
5714
|
-
kind: "letters",
|
|
5715
|
-
letter: ch.toLowerCase(),
|
|
5716
|
-
count: j - i
|
|
5717
|
-
});
|
|
5718
|
-
i = j;
|
|
5719
|
-
continue;
|
|
5720
|
-
}
|
|
5721
|
-
tokens.push({ kind: "literal", text: ch });
|
|
5722
|
-
i += 1;
|
|
5723
|
-
}
|
|
5724
|
-
return tokens;
|
|
5725
|
-
}
|
|
5726
|
-
function findNonLiteral(tokens, index, step) {
|
|
5727
|
-
for (let i = index + step; i >= 0 && i < tokens.length; i += step) {
|
|
5728
|
-
if (tokens[i].kind !== "literal") {
|
|
5729
|
-
return tokens[i];
|
|
5730
|
-
}
|
|
5731
|
-
}
|
|
5732
|
-
return void 0;
|
|
5733
|
-
}
|
|
5734
|
-
function pad(n, width) {
|
|
5735
|
-
return String(n).padStart(width, "0");
|
|
5736
|
-
}
|
|
5737
|
-
function renderDatePart(part, count, date, twelveHour) {
|
|
5738
|
-
switch (part) {
|
|
5739
|
-
case "year":
|
|
5740
|
-
return count >= 4 ? pad(date.getUTCFullYear(), 4) : pad(date.getUTCFullYear() % 100, 2);
|
|
5741
|
-
case "month":
|
|
5742
|
-
if (count >= 4) {
|
|
5743
|
-
return MONTH_FULL[date.getUTCMonth()] ?? "";
|
|
5744
|
-
}
|
|
5745
|
-
if (count === 3) {
|
|
5746
|
-
return MONTH_ABBR[date.getUTCMonth()] ?? "";
|
|
5747
|
-
}
|
|
5748
|
-
return count >= 2 ? pad(date.getUTCMonth() + 1, 2) : String(date.getUTCMonth() + 1);
|
|
5749
|
-
case "day":
|
|
5750
|
-
if (count >= 4) {
|
|
5751
|
-
return WEEKDAY_FULL[date.getUTCDay()] ?? "";
|
|
5752
|
-
}
|
|
5753
|
-
if (count === 3) {
|
|
5754
|
-
return WEEKDAY_ABBR[date.getUTCDay()] ?? "";
|
|
5755
|
-
}
|
|
5756
|
-
return count >= 2 ? pad(date.getUTCDate(), 2) : String(date.getUTCDate());
|
|
5757
|
-
case "hour": {
|
|
5758
|
-
const h24 = date.getUTCHours();
|
|
5759
|
-
const h = twelveHour ? h24 % 12 === 0 ? 12 : h24 % 12 : h24;
|
|
5760
|
-
return count >= 2 ? pad(h, 2) : String(h);
|
|
5761
|
-
}
|
|
5762
|
-
case "minute":
|
|
5763
|
-
return count >= 2 ? pad(date.getUTCMinutes(), 2) : String(date.getUTCMinutes());
|
|
5764
|
-
case "second":
|
|
5765
|
-
return count >= 2 ? pad(date.getUTCSeconds(), 2) : String(date.getUTCSeconds());
|
|
5766
|
-
}
|
|
5767
|
-
}
|
|
5768
|
-
function renderExcelDateFormat(date, code) {
|
|
5769
|
-
const tokens = scanDateFormatTokens(code);
|
|
5770
|
-
const hasAmPm = tokens.some((t) => t.kind === "ampm");
|
|
5771
|
-
let out = "";
|
|
5772
|
-
for (const [index, token] of tokens.entries()) {
|
|
5773
|
-
if (token.kind === "literal") {
|
|
5774
|
-
out += token.text;
|
|
5775
|
-
continue;
|
|
5776
|
-
}
|
|
5777
|
-
if (token.kind === "ampm") {
|
|
5778
|
-
const hour = date.getUTCHours(), text = token.short ? hour < 12 ? "A" : "P" : hour < 12 ? "AM" : "PM";
|
|
5779
|
-
out += token.upper ? text : text.toLowerCase();
|
|
5780
|
-
continue;
|
|
5781
|
-
}
|
|
5782
|
-
if (token.letter === "m") {
|
|
5783
|
-
const prev = findNonLiteral(tokens, index, -1), next = findNonLiteral(tokens, index, 1), isMinute = prev?.kind === "letters" && prev.letter === "h" || next?.kind === "letters" && next.letter === "s";
|
|
5784
|
-
out += renderDatePart(isMinute ? "minute" : "month", token.count, date, hasAmPm);
|
|
5785
|
-
continue;
|
|
5786
|
-
}
|
|
5787
|
-
const part = { y: "year", d: "day", h: "hour", s: "second" };
|
|
5788
|
-
out += renderDatePart(part[token.letter], token.count, date, hasAmPm);
|
|
5789
|
-
}
|
|
5790
|
-
return out;
|
|
5791
|
-
}
|
|
5792
|
-
function formatDate(date, unit, format) {
|
|
5793
|
-
if (format && /[ymdhs]/iu.test(format)) {
|
|
5794
|
-
const rendered = renderExcelDateFormat(date, format);
|
|
5795
|
-
if (rendered.length > 0) {
|
|
5796
|
-
return rendered;
|
|
5797
|
-
}
|
|
5798
|
-
}
|
|
5799
|
-
const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" }), year = String(date.getUTCFullYear()), day = String(date.getUTCDate());
|
|
5800
|
-
if (unit === "years") {
|
|
5801
|
-
return year;
|
|
5802
|
-
}
|
|
5803
|
-
if (unit === "months") {
|
|
5804
|
-
return `${month} ${year}`;
|
|
5805
|
-
}
|
|
5806
|
-
return `${day} ${month}`;
|
|
5807
|
-
}
|
|
5808
|
-
|
|
5809
|
-
// src/pptx/render/chart-date-axis.ts
|
|
5810
|
-
var DAY_MS = 864e5;
|
|
5811
|
-
function excelSerialToDate(serial5, date1904 = false) {
|
|
5812
|
-
const epoch2 = date1904 ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, serial5 < 60 ? 31 : 30);
|
|
5813
|
-
return new Date(epoch2 + serial5 * DAY_MS);
|
|
5814
|
-
}
|
|
5815
5580
|
function primaryDateAxis(chartData) {
|
|
5816
5581
|
return chartData.axes?.find((axis) => axis.axisType === "dateAx" && axis.axPos !== "t") ?? chartData.axes?.find((axis) => axis.axisType === "dateAx");
|
|
5817
5582
|
}
|
|
@@ -5819,17 +5584,6 @@ function serialToX(serial5, min, max, layout) {
|
|
|
5819
5584
|
const ratio = max === min ? 0.5 : (serial5 - min) / (max - min);
|
|
5820
5585
|
return layout.plotLeft + ratio * layout.plotWidth;
|
|
5821
5586
|
}
|
|
5822
|
-
function addUnit(date, amount, unit) {
|
|
5823
|
-
const next = new Date(date);
|
|
5824
|
-
if (unit === "days") {
|
|
5825
|
-
next.setUTCDate(next.getUTCDate() + amount);
|
|
5826
|
-
} else if (unit === "months") {
|
|
5827
|
-
next.setUTCMonth(next.getUTCMonth() + amount);
|
|
5828
|
-
} else {
|
|
5829
|
-
next.setUTCFullYear(next.getUTCFullYear() + amount);
|
|
5830
|
-
}
|
|
5831
|
-
return next;
|
|
5832
|
-
}
|
|
5833
5587
|
function tickLine2(x, y, axis, minor) {
|
|
5834
5588
|
const placement = minor ? axis.minorTickMark : axis.majorTickMark;
|
|
5835
5589
|
if (!placement || placement === "none" || isNoLine(axis.spPr)) {
|
|
@@ -5849,15 +5603,6 @@ function tickLine2(x, y, axis, minor) {
|
|
|
5849
5603
|
...chartLineStyle(axis.spPr)
|
|
5850
5604
|
};
|
|
5851
5605
|
}
|
|
5852
|
-
function calendarTicks(min, max, date1904, unit, step) {
|
|
5853
|
-
const result = [];
|
|
5854
|
-
let date = excelSerialToDate(min, date1904);
|
|
5855
|
-
for (let guard = 0; guard < 1e3 && date.getTime() <= excelSerialToDate(max, date1904).getTime(); guard++) {
|
|
5856
|
-
result.push(min + (date.getTime() - excelSerialToDate(min, date1904).getTime()) / DAY_MS);
|
|
5857
|
-
date = addUnit(date, step, unit);
|
|
5858
|
-
}
|
|
5859
|
-
return result;
|
|
5860
|
-
}
|
|
5861
5606
|
function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
|
|
5862
5607
|
const dates = chartData.dateCategories;
|
|
5863
5608
|
const axis = selectedAxis ?? primaryDateAxis(chartData);
|
|
@@ -7362,20 +7107,14 @@ function computeBoxWhiskerGeometry(chartData, rawCategories, layout, range, colo
|
|
|
7362
7107
|
const observations = rows.map((row) => ({ row, value: series.values[row] })).filter((item) => item.value !== void 0);
|
|
7363
7108
|
const values = observations.map((item) => item.value);
|
|
7364
7109
|
const options = series.boxWhiskerOptions;
|
|
7365
|
-
const
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
const iqr = stats.q3 - stats.q1;
|
|
7370
|
-
const lowerFence = stats.q1 - 1.5 * iqr;
|
|
7371
|
-
const upperFence = stats.q3 + 1.5 * iqr;
|
|
7372
|
-
const inlierValues = values.filter(
|
|
7373
|
-
(value) => !options || value >= lowerFence && value <= upperFence
|
|
7110
|
+
const distribution = boxWhiskerDistribution(
|
|
7111
|
+
values,
|
|
7112
|
+
options?.quartileMethod ?? "exclusive",
|
|
7113
|
+
options !== void 0
|
|
7374
7114
|
);
|
|
7375
|
-
|
|
7376
|
-
const
|
|
7115
|
+
if (!distribution) return;
|
|
7116
|
+
const { stats, whiskerMin, whiskerMax, mean } = distribution;
|
|
7377
7117
|
const boxX = layout.plotLeft + groupWidth * categoryIndex + slotWidth * seriesIndex + (slotWidth - boxW) / 2;
|
|
7378
|
-
const mean = values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
7379
7118
|
output.push({
|
|
7380
7119
|
stats,
|
|
7381
7120
|
boxX,
|
|
@@ -7466,11 +7205,8 @@ function whiskerPrimitives(geometry) {
|
|
|
7466
7205
|
}
|
|
7467
7206
|
function optionPrimitives(geometry) {
|
|
7468
7207
|
const options = geometry.options;
|
|
7469
|
-
if (!options) {
|
|
7470
|
-
return [];
|
|
7471
|
-
}
|
|
7472
7208
|
const output = [];
|
|
7473
|
-
if (options
|
|
7209
|
+
if (options?.showMeanLine) {
|
|
7474
7210
|
output.push({
|
|
7475
7211
|
kind: "line",
|
|
7476
7212
|
x1: geometry.boxX,
|
|
@@ -7481,17 +7217,17 @@ function optionPrimitives(geometry) {
|
|
|
7481
7217
|
strokeWidth: 1.5
|
|
7482
7218
|
});
|
|
7483
7219
|
}
|
|
7484
|
-
if (options
|
|
7220
|
+
if (options?.showMeanMarker !== false) {
|
|
7485
7221
|
output.push({
|
|
7486
|
-
kind: "
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7222
|
+
kind: "path",
|
|
7223
|
+
d: boxMeanMarkerPath(geometry.xMid, geometry.yMean),
|
|
7224
|
+
fill: "none",
|
|
7225
|
+
stroke: "#0f766e",
|
|
7226
|
+
strokeWidth: 1.5
|
|
7491
7227
|
});
|
|
7492
7228
|
}
|
|
7493
7229
|
for (const point of geometry.points) {
|
|
7494
|
-
if (point.outlier && !options
|
|
7230
|
+
if (point.outlier && !options?.showOutlierPoints || !point.outlier && !options?.showInnerPoints) {
|
|
7495
7231
|
continue;
|
|
7496
7232
|
}
|
|
7497
7233
|
output.push({
|
|
@@ -7872,15 +7608,17 @@ function computeFunnelSegments(values, plotLeft, plotTop, plotWidth, plotHeight,
|
|
|
7872
7608
|
if (count === 0) {
|
|
7873
7609
|
return [];
|
|
7874
7610
|
}
|
|
7875
|
-
const maxVal = Math.max(...values.map((v) => Math.abs(v)), 1);
|
|
7876
|
-
const segH = plotHeight / Math.max(count, 1);
|
|
7877
|
-
const centerX = plotLeft + plotWidth / 2;
|
|
7878
7611
|
const fill = seriesColorOverride ?? paletteColor2(0, colorPalette);
|
|
7879
7612
|
const out = [];
|
|
7880
|
-
for (
|
|
7613
|
+
for (const bar of computeFunnelGeometry(values, {
|
|
7614
|
+
x: plotLeft,
|
|
7615
|
+
y: plotTop,
|
|
7616
|
+
width: plotWidth,
|
|
7617
|
+
height: plotHeight
|
|
7618
|
+
})) {
|
|
7619
|
+
const i = bar.index;
|
|
7881
7620
|
const val = values[i];
|
|
7882
|
-
const w =
|
|
7883
|
-
const y = plotTop + i * segH;
|
|
7621
|
+
const w = bar.width, y = bar.y, segH = bar.height, centerX = bar.center;
|
|
7884
7622
|
const labelY = y + segH / 2 + 4;
|
|
7885
7623
|
const d = [
|
|
7886
7624
|
`M ${centerX - w / 2} ${y}`,
|
|
@@ -7931,11 +7669,20 @@ function buildFunnelViewModel(element, chartData, categoryLabels) {
|
|
|
7931
7669
|
}
|
|
7932
7670
|
const funnelSeries = chartData.series[0];
|
|
7933
7671
|
segments.forEach((seg, i) => {
|
|
7672
|
+
if (!funnelSeries || !funnelSeries.dataLabelOptions && !chartData.style?.dataLabels && !funnelSeries.dataLabels?.some((label2) => label2.idx === i))
|
|
7673
|
+
return;
|
|
7674
|
+
const label = buildDataLabelText({
|
|
7675
|
+
chartData,
|
|
7676
|
+
series: funnelSeries,
|
|
7677
|
+
pointIndex: i,
|
|
7678
|
+
value: values[i]
|
|
7679
|
+
});
|
|
7680
|
+
if (!label) return;
|
|
7934
7681
|
dataLabels.push({
|
|
7935
7682
|
kind: "text",
|
|
7936
7683
|
x: seg.labelX,
|
|
7937
7684
|
y: seg.labelY,
|
|
7938
|
-
text:
|
|
7685
|
+
text: label.text,
|
|
7939
7686
|
fontSize: seg.fontSize,
|
|
7940
7687
|
fill: "#ffffff",
|
|
7941
7688
|
textAnchor: "middle",
|
|
@@ -7963,7 +7710,7 @@ function buildFunnelViewModel(element, chartData, categoryLabels) {
|
|
|
7963
7710
|
categoryLabels: categoryAxisLabels,
|
|
7964
7711
|
primitives,
|
|
7965
7712
|
dataLabels,
|
|
7966
|
-
//
|
|
7713
|
+
// The PPTX host keeps its existing funnel legend policy.
|
|
7967
7714
|
legend: [],
|
|
7968
7715
|
legendX: layout.svgWidth / 2,
|
|
7969
7716
|
legendY: layout.svgHeight - 8,
|
|
@@ -9536,8 +9283,6 @@ function buildPieViewModel(element, chartData, categoryLabels, isDoughnut) {
|
|
|
9536
9283
|
legendAnchor
|
|
9537
9284
|
};
|
|
9538
9285
|
}
|
|
9539
|
-
|
|
9540
|
-
// src/pptx/render/chart-view-model-layout.ts
|
|
9541
9286
|
function categoryAxisBand(chartData) {
|
|
9542
9287
|
const axis = chartData.axes?.find(
|
|
9543
9288
|
(candidate) => candidate.axisType === "catAx" || candidate.axisType === "dateAx"
|
|
@@ -9586,20 +9331,22 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
9586
9331
|
plotLeft = Math.max(plotLeft, 8 + tableMetrics.keyW);
|
|
9587
9332
|
}
|
|
9588
9333
|
const autoPlotHeight = Math.max(plotBottom - plotTop, 1);
|
|
9589
|
-
const plotLayout = manualLayoutOf(chartData, "plotArea"), manual =
|
|
9334
|
+
const plotLayout = manualLayoutOf(chartData, "plotArea"), manual = resolveManualPlotRect(
|
|
9590
9335
|
plotLayout,
|
|
9591
9336
|
{ width: svgWidth, height: svgHeight },
|
|
9592
|
-
{ x: plotLeft, y: plotTop, width: plotRight - plotLeft, height: plotBottom - plotTop }
|
|
9337
|
+
{ x: plotLeft, y: plotTop, width: plotRight - plotLeft, height: plotBottom - plotTop },
|
|
9338
|
+
{
|
|
9339
|
+
left: hasAxes ? leftAxisBand(options?.leftCategoryLabelWidth) : 0,
|
|
9340
|
+
top: 0,
|
|
9341
|
+
right: 0,
|
|
9342
|
+
bottom: hasAxes ? categoryAxisBand(chartData) - 8 : 0
|
|
9343
|
+
}
|
|
9593
9344
|
);
|
|
9594
9345
|
if (plotLayout && manual) {
|
|
9595
9346
|
plotLeft = manual.x;
|
|
9596
9347
|
plotTop = manual.y;
|
|
9597
9348
|
plotRight = manual.x + manual.width;
|
|
9598
9349
|
plotBottom = manual.y + manual.height;
|
|
9599
|
-
if (hasAxes && plotLayout.layoutTarget !== "inner") {
|
|
9600
|
-
plotLeft += leftAxisBand(options?.leftCategoryLabelWidth);
|
|
9601
|
-
plotBottom -= categoryAxisBand(chartData) - 8;
|
|
9602
|
-
}
|
|
9603
9350
|
}
|
|
9604
9351
|
const plotWidth = Math.max(plotRight - plotLeft, 1), plotHeight = Math.max(plotBottom - plotTop, 1);
|
|
9605
9352
|
return {
|
|
@@ -10970,4 +10717,4 @@ function computeTrendlinePrimitives(chartData, catCount, layout, range, mode = "
|
|
|
10970
10717
|
return out;
|
|
10971
10718
|
}
|
|
10972
10719
|
|
|
10973
|
-
export { AXIS_LABEL_COLOR, CHART_PX_PER_PT, CHART_TITLE_FONT_PX, CHART_TITLE_TOP_INSET_PX, DATA_LABEL_LINE_HEIGHT, DATA_LABEL_PAD_X, DATA_LABEL_PAD_Y, DATA_TABLE_HEADER_H, DATA_TABLE_KEY_W, DATA_TABLE_PADDING, DATA_TABLE_ROW_H, DEFAULT_BODY_INSET_LR_PX, DEFAULT_BODY_INSET_TB_PX, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_CHART_AREA_FILL, DEFAULT_CHART_DATA_LABEL_PX, DEFAULT_CHART_TEXT_PX, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRIDLINE_COLOR3 as GRIDLINE_COLOR, HYPERLINK_COLOR, LEGACY_CHART_TITLE_BAND_PX, LEGEND_LINE_SWATCH_WIDTH, LEGEND_MARKER_RADIUS, OOXML_PATTERN_PRESETS, PIE_AUTO_INSET_PX, TEXT_ORIENTATION_IDENTITY, ZERO_LINE_COLOR, adjustFillForMode, applyDataPointPictureFills,
|
|
10720
|
+
export { AXIS_LABEL_COLOR, CHART_PX_PER_PT, CHART_TITLE_FONT_PX, CHART_TITLE_TOP_INSET_PX, DATA_LABEL_LINE_HEIGHT, DATA_LABEL_PAD_X, DATA_LABEL_PAD_Y, DATA_TABLE_HEADER_H, DATA_TABLE_KEY_W, DATA_TABLE_PADDING, DATA_TABLE_ROW_H, DEFAULT_BODY_INSET_LR_PX, DEFAULT_BODY_INSET_TB_PX, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_CHART_AREA_FILL, DEFAULT_CHART_DATA_LABEL_PX, DEFAULT_CHART_TEXT_PX, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_PALETTE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRIDLINE_COLOR3 as GRIDLINE_COLOR, HYPERLINK_COLOR, LEGACY_CHART_TITLE_BAND_PX, LEGEND_LINE_SWATCH_WIDTH, LEGEND_MARKER_RADIUS, OOXML_PATTERN_PRESETS, PIE_AUTO_INSET_PX, TEXT_ORIENTATION_IDENTITY, ZERO_LINE_COLOR, adjustFillForMode, applyDataPointPictureFills, applyLegendEntryOverrides, applyParetoConversion, axisShowsMajorGridlines, axisTickValues, buildBoxWhiskerViewModel, buildCartesianViewModel, buildCategoryLabels, buildChartViewModel, buildCirclePathGradient, buildComboViewModel, buildCssGradientFromShapeStyle, buildDashArray, buildDataLabelText, buildFallbackViewModel, buildFunnelViewModel, buildGradientCss, buildGridlinesAndLabels, buildHistogramViewModel, buildLegend, buildLineLegendSwatch, buildMarkTooltip, buildPatternFill, buildPatternFillCss, buildPieViewModel, buildPrimaryAxis, buildRadarViewModel, buildRectPathGradient, buildReflectedGradientStops, buildRegionMapEntries, buildRegionMapViewModel, buildSecondaryAxis, buildShapePathGradient, buildStockCloseLabel, buildStockViewModel, buildSubpathFillOverlay, buildSubpathPaints, buildSunburstViewModel, buildSurfaceViewModel, buildTreemapViewModel, buildTrendlineLegendSwatch, buildValueAxisGridlinesAndLabels, buildWaterfallViewModel, buildZeroLine, canvasFontFamily, chartAreaCornerRadius, chartAreaFill, chartAxisIndex, chartFontPx, chartFrameToViewOffset, chartGridlinesPatch, chartGridlinesState, chartPlotBounds, chartPreserveAspectRatio, chartTextBox, chartTextFontFamily, chartTitleBand, chartTitleBandFor, chartTitleFontPx, chartTitleReservePx, clampCropValue, clearBarFacePicturePixelCache, clipStackedSegment, collapseChartTitleRunsForEdit, computeAxisTitlePrimitives, computeBarRects, computeBoxWhiskerGeometry, computeChartLegendLayout, computeDataTableHeight, computeDataTablePrimitives, computeErrorBarPrimitives, computeFunnelSegments, computeGradientCenter, computeHierarchicalSunburstArcs, computeHistogramBars, computeHistogramBins, computeLayout, computeLayoutOptions, computeLinePoints, computePieLayout, computePieSlicePath, computePieSlices, computePlotLayout, computeScatterDots, computeScatterXDomain, computeStackedBarRects, computeStackedValueRange, computeSunburstArcs, computeTrendlinePrimitives, computeValueRange, computeValueRange2, convertOoxmlAngleToCss, createArrayBufferCopy, cumulativePercentOfTotal, dataLabelBox, dataLabelBoxSize, dataLabelFontOverride, decodeFirstPixelColor, ensureBarFacePicturePixelSampled, estimateChartTextWidth, estimateTextWidth, findDataPoint, findPointLabel, findValueAxis, fitTitleBand, formatAxisValue, formatAxisValue2, formatAxisValueWithUnits, formatRegionMapValue, getBarFacePicturePixelSampleVersion, getCachedBarFacePicturePixelColor, getCompoundLineBorderWidth, getCompoundLineBoxShadow, getCompoundLineStyle, getComputedFillStyle, getCssBorderDashStyle, getDisplayUnitDivisor, getDisplayUnitLabel, getElementOrientationMatrix, getElementTransform, getElementTransformWithoutRotation, getGradientTileFlipCss, getGradientTileRectCss, getPatternSvg, getPatternTile, getPptxRenderCacheEpoch, getPrimaryValueAxis, getPrimaryValueAxisId, getSecondaryCategoryAxis, getSecondaryValueAxis, getSecondaryValueAxisId, getSvgStrokeDasharray, getTextCompensationTransform, hasSecondaryCategoryAxis, hasSecondaryValueAxis, invalidatePptxRenderCacheEpoch, isParetoChart, isPrimaryCategoryAxisAtTop, isSeriesOnSecondaryAxis, isTextOrientationMatrix, linePointsToSvgString, manualLayoutOf, manualLegendAnchor, manualTitleAnchor, measureChartTextWidth, multiplyTextOrientationMatrices, normalizeStrokeDashType, normalizeValue, orderParetoEntries, paletteColor, paletteColor2, parseDrawingPercent, plotAreaFill, primaryValueAxis, reserveLegendSpace, resetBarFacePicturePixelCacheForTests, resolveActiveDataPointPicture, resolveBarFacePicturePixelColor, resolveBarFaceTargets, resolveBarLabelAnchor, resolveBarLabelPlacement, resolveCategoryLabels, resolveChartKind, resolveChartPalette, resolveChartStyleDefaults, resolveChartTitleRunSpans, resolveChartTitleTextStyle, resolveDataLabelContent, resolveDataLabelTextStyle, resolveDataPointExplosion, resolveDataPointFill, resolveDataPointMarker, resolveDataPointPictureFill, resolveDisplayedChartType, resolveExtrusionFaceFill, resolveLabelPosition, resolveLegendAnchorPosition, resolveLegendPlacement, resolveLegendSwatchKind, resolveMarkerLabelAnchor, resolveMarkerLabelPlacement, resolveRegionCode, resolveRegionEntityCode, resolveUntargetedBarFaceFill, resolveVaryColorFill, sanitizeGradientStops, sequentialColorScale, seriesColor, seriesColor2, seriesXValues, setBoundedRenderCache, setChartTextMeasurer, shouldRenderMajorGridlines, shouldRenderRegionLabel, splitLabelLines, splitSeriesByAxis, stackedBarWidth, stackedSegmentExtent, subscribeBarFacePicturePixelSamples, suppressesCssFill, surfaceColor, titleBaselineFor, toCssGradientStop, unitsCaptionOffset, upsertDataPoint, valueToY, valueToY2, withChartTitleBand, withManualLayouts, withResolvedPalette, wrapTextByEstimatedWidth };
|
|
@@ -114,7 +114,7 @@ async function loadChart3DThree() {
|
|
|
114
114
|
|
|
115
115
|
// src/pptx/three-view/scene-registry.ts
|
|
116
116
|
var loaders = {
|
|
117
|
-
chart: async () => (await import('./chart-3d-view-scene-
|
|
117
|
+
chart: async () => (await import('./chart-3d-view-scene-OPVBTZL5.cjs')).mountChart3DView,
|
|
118
118
|
smartart: async () => (await import('./view-scene-4ZFUCP6S.cjs')).mountSmartArt3DView
|
|
119
119
|
};
|
|
120
120
|
async function loadThreeViewScene(kind) {
|