ooxml-ui 1.18.0 → 1.18.2
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 +28 -0
- package/dist/{chunk-CPHFMJOU.js → chunk-EVL7GFC7.js} +1 -1
- package/dist/{chunk-GSWCAZQ3.js → chunk-FHO7TEWA.js} +1 -0
- package/dist/{chunk-GILNGII2.js → chunk-MSXUCINT.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/pptx/{chart-3d-view-scene-6YLA75UQ.mjs → chart-3d-view-scene-6LQRJAM3.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-4GGMVQNN.cjs → chart-3d-view-scene-FAKI4QKT.cjs} +38 -38
- package/dist/pptx/{chunk-6ZMCXJ32.mjs → chunk-73OUATE4.mjs} +1 -1
- package/dist/pptx/{chunk-LF2X2AOK.mjs → chunk-75S3RTSS.mjs} +1 -1
- package/dist/pptx/{chunk-OFGZWYKM.mjs → chunk-AUCJIB3M.mjs} +162 -96
- package/dist/pptx/{chunk-HKHO4GDD.cjs → chunk-G3UVZ5FO.cjs} +122 -404
- package/dist/pptx/{chunk-QG2EEFAW.cjs → chunk-LCB46TH2.cjs} +12 -12
- package/dist/pptx/{chunk-NTWYYXB2.mjs → chunk-PIIYTRLE.mjs} +69 -374
- package/dist/pptx/{chunk-6OK5Z2MQ.cjs → chunk-S2Y3VUNC.cjs} +914 -842
- package/dist/pptx/{chunk-TXMIKRYG.cjs → chunk-W7CBPO77.cjs} +1 -1
- package/dist/pptx/dom/chart-pixel-subscriptions.d.ts +7 -0
- package/dist/pptx/dom/chart-pixel-subscriptions.d.ts.map +1 -0
- package/dist/pptx/dom/elements/chart.d.ts.map +1 -1
- package/dist/pptx/dom/elements/shape-filter-defs.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +340 -285
- package/dist/pptx/dom/index.d.ts +1 -0
- package/dist/pptx/dom/index.d.ts.map +1 -1
- package/dist/pptx/dom/index.mjs +96 -46
- package/dist/pptx/dom/presentation-rerender.d.ts.map +1 -1
- package/dist/pptx/dom/slide-stage.d.ts +5 -0
- package/dist/pptx/dom/slide-stage.d.ts.map +1 -1
- package/dist/pptx/export/html2canvas-clone.cjs +2 -2
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/index.cjs +3202 -3174
- package/dist/pptx/index.mjs +4 -4
- package/dist/pptx/render/chart-axis-range.d.ts +2 -36
- package/dist/pptx/render/chart-axis-range.d.ts.map +1 -1
- package/dist/pptx/render/chart-axis-style.d.ts.map +1 -1
- package/dist/pptx/render/chart-bar3d-face-picture-sample.d.ts +5 -0
- package/dist/pptx/render/chart-bar3d-face-picture-sample.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-helpers.d.ts +2 -1
- package/dist/pptx/render/chart-helpers.d.ts.map +1 -1
- package/dist/pptx/render/chart-marker-shape.d.ts +4 -50
- package/dist/pptx/render/chart-marker-shape.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-scale.d.ts +3 -2
- package/dist/pptx/render/chart-view-model-scale.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/connector-markers.d.ts +3 -1
- package/dist/pptx/render/connector-markers.d.ts.map +1 -1
- package/dist/pptx/render/custom-path-markers.d.ts +11 -0
- package/dist/pptx/render/custom-path-markers.d.ts.map +1 -0
- package/dist/pptx/render/image-color-change.d.ts +3 -1
- package/dist/pptx/render/image-color-change.d.ts.map +1 -1
- package/dist/pptx/render/image-duotone-canvas.d.ts +3 -1
- package/dist/pptx/render/image-duotone-canvas.d.ts.map +1 -1
- package/dist/pptx/render/image-native-size.d.ts +3 -1
- package/dist/pptx/render/image-native-size.d.ts.map +1 -1
- package/dist/pptx/render/image-source-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/render-cache-lifecycle.d.ts +10 -0
- package/dist/pptx/render/render-cache-lifecycle.d.ts.map +1 -0
- package/dist/pptx/render/render-cache.d.ts +8 -0
- package/dist/pptx/render/render-cache.d.ts.map +1 -0
- package/dist/pptx/render/shape-geometry-cascade.d.ts.map +1 -1
- package/dist/pptx/render/stroke-outline.d.ts +3 -0
- package/dist/pptx/render/stroke-outline.d.ts.map +1 -1
- package/dist/pptx/render/text-build-spans.d.ts +1 -0
- package/dist/pptx/render/text-build-spans.d.ts.map +1 -1
- package/dist/{presentation-preview-HMEBDYEL.js → presentation-preview-KY56TONW.js} +1 -1
- package/dist/teams.js +2 -2
- package/dist/xlsx.js +4 -4
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkG3UVZ5FO_cjs = require('./chunk-G3UVZ5FO.cjs');
|
|
4
4
|
|
|
5
5
|
// src/pptx/render/chart-interaction-radar.ts
|
|
6
6
|
function buildRadarDragGeometry(element, chartData, categoryLabels, pointIndex) {
|
|
@@ -11,7 +11,7 @@ function buildRadarDragGeometry(element, chartData, categoryLabels, pointIndex)
|
|
|
11
11
|
if (pointIndex < 0 || pointIndex >= catCount) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
const layout =
|
|
14
|
+
const layout = chunkG3UVZ5FO_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 = chunkG3UVZ5FO_cjs.radarAngle(pointIndex, catCount);
|
|
15
15
|
return { cx, cy, radius, maxVal, angle };
|
|
16
16
|
}
|
|
17
17
|
function resolveRadarDragValue(geometry, pointerX, pointerY) {
|
|
@@ -35,13 +35,13 @@ function buildStackedDragGeometry(element, chartData, seriesIndex, pointIndex) {
|
|
|
35
35
|
chartData.categories.length,
|
|
36
36
|
...seriesValues.map((values) => values.length),
|
|
37
37
|
pointIndex + 1
|
|
38
|
-
), plots =
|
|
38
|
+
), plots = chunkG3UVZ5FO_cjs.computeStackedSeriesPlots(seriesValues, catCount, percent), baseValue = plots[seriesIndex]?.base[pointIndex] ?? 0, otherAbsSum = seriesValues.reduce(
|
|
39
39
|
(sum, values, si) => si === seriesIndex ? sum : sum + Math.abs(values[pointIndex] ?? 0),
|
|
40
40
|
0
|
|
41
|
-
), layoutOpts =
|
|
41
|
+
), layoutOpts = chunkG3UVZ5FO_cjs.computeLayoutOptions(chartData.axes, chartData.dataTable, chartData.series.length), layout = chunkG3UVZ5FO_cjs.computePlotLayout(element.width, element.height, chartData, true, layoutOpts), range = chunkG3UVZ5FO_cjs.computeStackedValueRangeForAxis(
|
|
42
42
|
chartData.series,
|
|
43
43
|
catCount,
|
|
44
|
-
|
|
44
|
+
chunkG3UVZ5FO_cjs.primaryValueAxis(chartData.axes),
|
|
45
45
|
percent,
|
|
46
46
|
layout.autoPlotHeight
|
|
47
47
|
);
|
|
@@ -156,7 +156,7 @@ function dragValueForPart(viewY, drag, seriesIndex) {
|
|
|
156
156
|
return roundDragValue(valueFromY(viewY, range, drag.plotTop, drag.plotBottom), range);
|
|
157
157
|
}
|
|
158
158
|
function dragAnchorViewY(value, drag, seriesIndex) {
|
|
159
|
-
return
|
|
159
|
+
return chunkG3UVZ5FO_cjs.valueToY2(value, rangeForSeries(drag, seriesIndex), drag.plotTop, drag.plotBottom);
|
|
160
160
|
}
|
|
161
161
|
function withChartPointValue(chartData, seriesIndex, pointIndex, value) {
|
|
162
162
|
const series = chartData.series[seriesIndex];
|
|
@@ -177,7 +177,7 @@ function withChartTitle(chartData, title) {
|
|
|
177
177
|
// A multi-run title collapses to one run in its dominant style so this
|
|
178
178
|
// edit does not leave another, now-stale run's text trailing the new
|
|
179
179
|
// title; see `collapseChartTitleRunsForEdit`'s doc.
|
|
180
|
-
...
|
|
180
|
+
...chunkG3UVZ5FO_cjs.collapseChartTitleRunsForEdit(chartData, trimmed),
|
|
181
181
|
style: { ...chartData.style, hasTitle: trimmed.length > 0 }
|
|
182
182
|
};
|
|
183
183
|
}
|
|
@@ -223,7 +223,7 @@ function buildPieDragGeometry(element, chartData, pointIndex) {
|
|
|
223
223
|
if (!series || pointIndex < 0 || pointIndex >= series.values.length) {
|
|
224
224
|
return null;
|
|
225
225
|
}
|
|
226
|
-
const isDoughnut = chartData.chartType === "doughnut", { cx, cy } =
|
|
226
|
+
const isDoughnut = chartData.chartType === "doughnut", { cx, cy } = chunkG3UVZ5FO_cjs.computePieLayout(element.width, element.height, chartData, isDoughnut), startAngle = -Math.PI / 2 + (chartData.firstSliceAngle ?? 0) * Math.PI / 180;
|
|
227
227
|
return { cx, cy, values: series.values, pointIndex, startAngle };
|
|
228
228
|
}
|
|
229
229
|
function resolvePieSliceShareValue(pointerAngle, leadingAngle, values, pointIndex) {
|
|
@@ -628,7 +628,7 @@ function renderChartTextSvg(doc, text) {
|
|
|
628
628
|
return el;
|
|
629
629
|
}
|
|
630
630
|
function appendChartLegendSvg(doc, svg, vm, translate) {
|
|
631
|
-
|
|
631
|
+
chunkG3UVZ5FO_cjs.computeChartLegendLayout(vm, translate).forEach((item) => {
|
|
632
632
|
const g = createSvgEl(doc, "g", {
|
|
633
633
|
class: "pptxv-chart-legend-item",
|
|
634
634
|
transform: `translate(${item.x.toFixed(1)},${item.y.toFixed(1)})`
|
|
@@ -942,7 +942,7 @@ function buildBarChart3DHoverTooltip(hit, data) {
|
|
|
942
942
|
if (!hit) {
|
|
943
943
|
return void 0;
|
|
944
944
|
}
|
|
945
|
-
return
|
|
945
|
+
return chunkG3UVZ5FO_cjs.buildMarkTooltip(
|
|
946
946
|
data.seriesNames[hit.seriesIndex],
|
|
947
947
|
data.categoryLabels[hit.categoryIndex],
|
|
948
948
|
hit.value,
|
|
@@ -955,7 +955,7 @@ function formatValueLabel(chartData, grouping, v) {
|
|
|
955
955
|
if (grouping === "percentStacked") {
|
|
956
956
|
return `${Math.round(v * 100)}%`;
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return chunkG3UVZ5FO_cjs.formatAxisValueWithUnits(
|
|
959
959
|
v,
|
|
960
960
|
chartData.axes?.find((a) => a.axisType === "valAx")
|
|
961
961
|
);
|
|
@@ -1039,7 +1039,7 @@ function buildGridlines(layout) {
|
|
|
1039
1039
|
const { w, h, d } = layout.box;
|
|
1040
1040
|
const lines = [];
|
|
1041
1041
|
const span = layout.range.max - layout.range.min;
|
|
1042
|
-
for (const v of
|
|
1042
|
+
for (const v of chunkG3UVZ5FO_cjs.axisTickValues({ ...layout.range, span })) {
|
|
1043
1043
|
const p = valuePos(layout, v);
|
|
1044
1044
|
if (layout.horizontal) {
|
|
1045
1045
|
lines.push({ from: [p, 0, d], to: [p, h, d] }, { from: [p, 0, 0], to: [p, 0, d] });
|
|
@@ -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, formatCompactAxisValue,
|
|
3
|
-
export { DEFAULT_BAR_GAP_WIDTH, DEFAULT_CHART_PALETTE,
|
|
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, computeBoxStats, computeHistogramBins as computeHistogramBins$1, aggregateByCategory, computeSunburstArcs as computeSunburstArcs$1, computeHierarchicalSunburstArcs as computeHierarchicalSunburstArcs$1, radarRingPoints, radarAngle, computeRadarPoints, buildWaterfallSteps, computeWaterfallRange, buildMarkerPrimitive as buildMarkerPrimitive$1, resolveBlankDisplay, computeStackedSeriesPlots, visibleRuns, maxBubbleSize, medianBubbleRadius, computeBubbleRadius, resolveAutoTitleText, STOCK_DEFAULT_WICK_COLOR, stockCandle, STOCK_DEFAULT_UP_FILL, STOCK_DEFAULT_DOWN_FILL, STOCK_TICK_WIDTH, buildHierarchyRoots, layoutTreemap, hierarchyBranchLabels, placeBestFitLabel, nudgeOutsideLabels, impliesAutoTitle, buildChartGradientDef, chartErrorBarAmount, fitChartTrendline, chartLineDashArray } from 'ooxml-core/chart';
|
|
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';
|
|
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';
|
|
@@ -108,145 +108,8 @@ function reserveLegendSpace(legendPos, rect) {
|
|
|
108
108
|
}
|
|
109
109
|
return rect;
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
// src/pptx/render/chart-marker-shape.ts
|
|
113
|
-
var DEFAULT_MARKER_OUTLINE_PT = 0.75;
|
|
114
|
-
function markerOutline(marker) {
|
|
115
|
-
if (!marker.stroke) {
|
|
116
|
-
return {};
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
stroke: marker.stroke,
|
|
120
|
-
strokeWidth: (marker.strokeWidth ?? DEFAULT_MARKER_OUTLINE_PT) * CHART_PX_PER_PT
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
var AUTOMATIC_MARKER_CYCLE = [
|
|
124
|
-
"diamond",
|
|
125
|
-
"square",
|
|
126
|
-
"triangle",
|
|
127
|
-
"x",
|
|
128
|
-
"star",
|
|
129
|
-
"circle",
|
|
130
|
-
"plus",
|
|
131
|
-
"dot",
|
|
132
|
-
"dash"
|
|
133
|
-
];
|
|
134
|
-
function automaticMarkerSymbol(seriesIdx) {
|
|
135
|
-
const length = AUTOMATIC_MARKER_CYCLE.length;
|
|
136
|
-
const normalized = (seriesIdx % length + length) % length;
|
|
137
|
-
return AUTOMATIC_MARKER_CYCLE[normalized];
|
|
138
|
-
}
|
|
139
|
-
function markerRadius(size, defaultRadius) {
|
|
140
|
-
if (size === void 0 || !Number.isFinite(size) || size <= 0) {
|
|
141
|
-
return defaultRadius;
|
|
142
|
-
}
|
|
143
|
-
return size / 2;
|
|
144
|
-
}
|
|
145
|
-
function polygonPoints(vertices) {
|
|
146
|
-
return vertices.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
147
|
-
}
|
|
148
|
-
function starVertices(cx, cy, r) {
|
|
149
|
-
const inner = r * 0.5;
|
|
150
|
-
const out = [];
|
|
151
|
-
for (let i = 0; i < 10; i++) {
|
|
152
|
-
const radius = i % 2 === 0 ? r : inner;
|
|
153
|
-
const angle = -Math.PI / 2 + Math.PI * i / 5;
|
|
154
|
-
out.push([cx + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);
|
|
155
|
-
}
|
|
156
|
-
return out;
|
|
157
|
-
}
|
|
158
|
-
function rectPolygon(x, y, w, h) {
|
|
159
|
-
return polygonPoints([
|
|
160
|
-
[x, y],
|
|
161
|
-
[x + w, y],
|
|
162
|
-
[x + w, y + h],
|
|
163
|
-
[x, y + h]
|
|
164
|
-
]);
|
|
165
|
-
}
|
|
166
111
|
function buildMarkerPrimitive(input) {
|
|
167
|
-
|
|
168
|
-
if (symbol === "none") {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
const r = markerRadius(input.size, input.defaultRadius);
|
|
172
|
-
const outline = input.stroke ? {
|
|
173
|
-
stroke: input.stroke,
|
|
174
|
-
strokeWidth: input.strokeWidth ?? DEFAULT_MARKER_OUTLINE_PT * CHART_PX_PER_PT
|
|
175
|
-
} : void 0;
|
|
176
|
-
const polygonStroke = outline ?? { stroke: fill, strokeWidth: 0 };
|
|
177
|
-
const lineStroke = input.stroke ?? fill;
|
|
178
|
-
switch (symbol) {
|
|
179
|
-
case "square":
|
|
180
|
-
case "dash": {
|
|
181
|
-
const h = symbol === "dash" ? r * 0.64 : r * 2;
|
|
182
|
-
const y = cy - h / 2;
|
|
183
|
-
if (outline) {
|
|
184
|
-
return {
|
|
185
|
-
kind: "polygon",
|
|
186
|
-
points: rectPolygon(cx - r, y, r * 2, h),
|
|
187
|
-
fill,
|
|
188
|
-
...outline,
|
|
189
|
-
part
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
return { kind: "rect", x: cx - r, y, w: r * 2, h, fill, part };
|
|
193
|
-
}
|
|
194
|
-
case "diamond":
|
|
195
|
-
return {
|
|
196
|
-
kind: "polygon",
|
|
197
|
-
points: polygonPoints([
|
|
198
|
-
[cx, cy - r],
|
|
199
|
-
[cx + r, cy],
|
|
200
|
-
[cx, cy + r],
|
|
201
|
-
[cx - r, cy]
|
|
202
|
-
]),
|
|
203
|
-
fill,
|
|
204
|
-
...polygonStroke,
|
|
205
|
-
part
|
|
206
|
-
};
|
|
207
|
-
case "triangle":
|
|
208
|
-
return {
|
|
209
|
-
kind: "polygon",
|
|
210
|
-
points: polygonPoints([
|
|
211
|
-
[cx, cy - r],
|
|
212
|
-
[cx + r * 0.9, cy + r * 0.75],
|
|
213
|
-
[cx - r * 0.9, cy + r * 0.75]
|
|
214
|
-
]),
|
|
215
|
-
fill,
|
|
216
|
-
...polygonStroke,
|
|
217
|
-
part
|
|
218
|
-
};
|
|
219
|
-
case "star":
|
|
220
|
-
return {
|
|
221
|
-
kind: "polygon",
|
|
222
|
-
points: polygonPoints(starVertices(cx, cy, r)),
|
|
223
|
-
fill,
|
|
224
|
-
...polygonStroke,
|
|
225
|
-
part
|
|
226
|
-
};
|
|
227
|
-
case "plus":
|
|
228
|
-
return {
|
|
229
|
-
kind: "path",
|
|
230
|
-
d: `M${(cx - r).toFixed(2)},${cy.toFixed(2)} L${(cx + r).toFixed(2)},${cy.toFixed(2)} M${cx.toFixed(2)},${(cy - r).toFixed(2)} L${cx.toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
231
|
-
fill: "none",
|
|
232
|
-
stroke: lineStroke,
|
|
233
|
-
strokeWidth: Math.max(1, r * 0.4),
|
|
234
|
-
part
|
|
235
|
-
};
|
|
236
|
-
case "x":
|
|
237
|
-
return {
|
|
238
|
-
kind: "path",
|
|
239
|
-
d: `M${(cx - r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx + r).toFixed(2)},${(cy + r).toFixed(2)} M${(cx + r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx - r).toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
240
|
-
fill: "none",
|
|
241
|
-
stroke: lineStroke,
|
|
242
|
-
strokeWidth: Math.max(1, r * 0.4),
|
|
243
|
-
part
|
|
244
|
-
};
|
|
245
|
-
case "dot":
|
|
246
|
-
return { kind: "circle", cx, cy, r: Math.max(r * 0.6, 1), fill, part, ...outline };
|
|
247
|
-
default:
|
|
248
|
-
return { kind: "circle", cx, cy, r, fill, part, ...outline };
|
|
249
|
-
}
|
|
112
|
+
return buildMarkerPrimitive$1(input);
|
|
250
113
|
}
|
|
251
114
|
|
|
252
115
|
// src/pptx/render/chart-datapoint-style.ts
|
|
@@ -1509,18 +1372,7 @@ function paletteColor(index, styleId, colorPalette) {
|
|
|
1509
1372
|
const palette = getChartStylePalette(styleId);
|
|
1510
1373
|
return palette[index % palette.length];
|
|
1511
1374
|
}
|
|
1512
|
-
|
|
1513
|
-
const allValues = series.flatMap((s) => s.values);
|
|
1514
|
-
if (allValues.length === 0) {
|
|
1515
|
-
return { min: 0, max: 1, span: 1 };
|
|
1516
|
-
}
|
|
1517
|
-
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
1518
|
-
Math.min(...allValues),
|
|
1519
|
-
Math.max(...allValues),
|
|
1520
|
-
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
1521
|
-
);
|
|
1522
|
-
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
1523
|
-
}
|
|
1375
|
+
var computeValueRange = computeAxisValueRange;
|
|
1524
1376
|
function valueToY(val, range, topY, bottomY) {
|
|
1525
1377
|
const usable = bottomY - topY;
|
|
1526
1378
|
let ratio;
|
|
@@ -1600,50 +1452,8 @@ function paletteColor2(index, colorPalette) {
|
|
|
1600
1452
|
function seriesColor2(series, index, colorPalette) {
|
|
1601
1453
|
return series.color ?? series.marker?.spPr?.fillColor ?? paletteColor2(index, colorPalette);
|
|
1602
1454
|
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
for (const item of series) {
|
|
1606
|
-
for (const value of item.values) {
|
|
1607
|
-
if (value < dataMin) {
|
|
1608
|
-
dataMin = value;
|
|
1609
|
-
}
|
|
1610
|
-
if (value > dataMax) {
|
|
1611
|
-
dataMax = value;
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
if (dataMin === Number.POSITIVE_INFINITY) {
|
|
1616
|
-
return { min: 0, max: 1, span: 1 };
|
|
1617
|
-
}
|
|
1618
|
-
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
1619
|
-
dataMin,
|
|
1620
|
-
dataMax,
|
|
1621
|
-
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
1622
|
-
);
|
|
1623
|
-
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
1624
|
-
}
|
|
1625
|
-
function computeStackedValueRange(series, catCount, plotHeightPx) {
|
|
1626
|
-
let maxSum = 0, minSum = 0;
|
|
1627
|
-
for (let ci = 0; ci < catCount; ci++) {
|
|
1628
|
-
let pos = 0, neg = 0;
|
|
1629
|
-
for (const s of series) {
|
|
1630
|
-
const v = s.values[ci] ?? 0;
|
|
1631
|
-
if (v >= 0) {
|
|
1632
|
-
pos += v;
|
|
1633
|
-
} else {
|
|
1634
|
-
neg += v;
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
maxSum = Math.max(maxSum, pos);
|
|
1638
|
-
minSum = Math.min(minSum, neg);
|
|
1639
|
-
}
|
|
1640
|
-
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
1641
|
-
Math.min(minSum, 0),
|
|
1642
|
-
Math.max(maxSum, 0),
|
|
1643
|
-
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
1644
|
-
);
|
|
1645
|
-
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
1646
|
-
}
|
|
1455
|
+
var computeValueRange2 = computeAxisValueRange;
|
|
1456
|
+
var computeStackedValueRange = computeAxisStackedValueRange;
|
|
1647
1457
|
function valueToY2(val, range, topY, bottomY) {
|
|
1648
1458
|
const usable = bottomY - topY;
|
|
1649
1459
|
let ratio;
|
|
@@ -2964,10 +2774,50 @@ function build3DSurfacePanels(prims, surfaces, depth) {
|
|
|
2964
2774
|
);
|
|
2965
2775
|
return [backWall, floor, sideWall].filter((p) => p !== void 0);
|
|
2966
2776
|
}
|
|
2777
|
+
|
|
2778
|
+
// src/pptx/render/render-cache.ts
|
|
2779
|
+
var RENDER_CACHE_MAX_BYTES = 8 * 1024 * 1024;
|
|
2780
|
+
var epoch = 0;
|
|
2781
|
+
function getPptxRenderCacheEpoch() {
|
|
2782
|
+
return epoch;
|
|
2783
|
+
}
|
|
2784
|
+
function invalidatePptxRenderCacheEpoch() {
|
|
2785
|
+
epoch++;
|
|
2786
|
+
}
|
|
2787
|
+
function setBoundedRenderCache(cache, key, value, maxEntries) {
|
|
2788
|
+
const bytesOf = (entryKey, entryValue) => (entryKey.length + (typeof entryValue === "string" ? entryValue.length : 0)) * 2;
|
|
2789
|
+
cache.delete(key);
|
|
2790
|
+
if (bytesOf(key, value) > RENDER_CACHE_MAX_BYTES) return;
|
|
2791
|
+
cache.set(key, value);
|
|
2792
|
+
let bytes = 0;
|
|
2793
|
+
for (const [entryKey, entryValue] of cache) bytes += bytesOf(entryKey, entryValue);
|
|
2794
|
+
while (cache.size > maxEntries || bytes > RENDER_CACHE_MAX_BYTES) {
|
|
2795
|
+
const first = cache.entries().next().value;
|
|
2796
|
+
if (!first) break;
|
|
2797
|
+
bytes -= bytesOf(first[0], first[1]);
|
|
2798
|
+
cache.delete(first[0]);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
// src/pptx/render/chart-bar3d-face-picture-sample.ts
|
|
2803
|
+
var CACHE_MAX = 128;
|
|
2804
|
+
var cacheEpoch = 0;
|
|
2805
|
+
var cacheBytes = 0;
|
|
2806
|
+
var reservedBytes = 0;
|
|
2807
|
+
var COLOR_BYTES = 7 * 2;
|
|
2967
2808
|
var sampleCache = /* @__PURE__ */ new Map();
|
|
2968
2809
|
var inFlight = /* @__PURE__ */ new Map();
|
|
2969
2810
|
var listeners = /* @__PURE__ */ new Set();
|
|
2970
2811
|
var sampleVersion = 0;
|
|
2812
|
+
function rememberSample(imageUrl, color) {
|
|
2813
|
+
if (sampleCache.has(imageUrl) || sampleCache.size + inFlight.size >= CACHE_MAX) return;
|
|
2814
|
+
const keyBytes = imageUrl.length * 2;
|
|
2815
|
+
const remaining = RENDER_CACHE_MAX_BYTES - cacheBytes - reservedBytes;
|
|
2816
|
+
if (keyBytes > remaining) return;
|
|
2817
|
+
const retained = keyBytes + (color?.length ?? 0) * 2 <= remaining ? color : void 0;
|
|
2818
|
+
sampleCache.set(imageUrl, retained);
|
|
2819
|
+
cacheBytes += keyBytes + (retained?.length ?? 0) * 2;
|
|
2820
|
+
}
|
|
2971
2821
|
function getCachedBarFacePicturePixelColor(imageUrl) {
|
|
2972
2822
|
return sampleCache.get(imageUrl);
|
|
2973
2823
|
}
|
|
@@ -3016,16 +2866,17 @@ function decodeFirstPixelColor(imageUrl) {
|
|
|
3016
2866
|
});
|
|
3017
2867
|
}
|
|
3018
2868
|
function ensureBarFacePicturePixelSampled(imageUrl, sampler = decodeFirstPixelColor) {
|
|
3019
|
-
if (sampleCache.has(imageUrl) || inFlight.has(imageUrl))
|
|
2869
|
+
if (sampleCache.has(imageUrl) || inFlight.has(imageUrl)) return;
|
|
2870
|
+
const reservation = imageUrl.length * 2 + COLOR_BYTES;
|
|
2871
|
+
if (sampleCache.size + inFlight.size >= CACHE_MAX || cacheBytes + reservedBytes + reservation > RENDER_CACHE_MAX_BYTES)
|
|
3020
2872
|
return;
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
}).catch(() => {
|
|
3026
|
-
sampleCache.set(imageUrl, void 0);
|
|
3027
|
-
}).finally(() => {
|
|
2873
|
+
const epoch2 = cacheEpoch;
|
|
2874
|
+
reservedBytes += reservation;
|
|
2875
|
+
const pending = Promise.resolve().then(() => sampler(imageUrl)).catch(() => void 0).then((color) => {
|
|
2876
|
+
if (epoch2 !== cacheEpoch || inFlight.get(imageUrl) !== pending) return;
|
|
3028
2877
|
inFlight.delete(imageUrl);
|
|
2878
|
+
reservedBytes -= reservation;
|
|
2879
|
+
rememberSample(imageUrl, color);
|
|
3029
2880
|
notifyBarFacePicturePixelListeners();
|
|
3030
2881
|
});
|
|
3031
2882
|
inFlight.set(imageUrl, pending);
|
|
@@ -3051,15 +2902,21 @@ function resolveBarFacePicturePixelColor(imageUrl) {
|
|
|
3051
2902
|
}
|
|
3052
2903
|
const sync = trySampleFirstPixelColorSync(imageUrl);
|
|
3053
2904
|
if (sync !== void 0) {
|
|
3054
|
-
|
|
2905
|
+
rememberSample(imageUrl, sync);
|
|
3055
2906
|
return sync;
|
|
3056
2907
|
}
|
|
3057
2908
|
ensureBarFacePicturePixelSampled(imageUrl);
|
|
3058
2909
|
return void 0;
|
|
3059
2910
|
}
|
|
3060
|
-
function
|
|
2911
|
+
function clearBarFacePicturePixelCache() {
|
|
2912
|
+
cacheEpoch++;
|
|
3061
2913
|
sampleCache.clear();
|
|
3062
2914
|
inFlight.clear();
|
|
2915
|
+
cacheBytes = 0;
|
|
2916
|
+
reservedBytes = 0;
|
|
2917
|
+
}
|
|
2918
|
+
function resetBarFacePicturePixelCacheForTests() {
|
|
2919
|
+
clearBarFacePicturePixelCache();
|
|
3063
2920
|
listeners.clear();
|
|
3064
2921
|
sampleVersion = 0;
|
|
3065
2922
|
}
|
|
@@ -3454,155 +3311,6 @@ function resolveChartTitleText(chartData) {
|
|
|
3454
3311
|
return resolveAutoTitleText(autoTitleInput(chartData));
|
|
3455
3312
|
}
|
|
3456
3313
|
|
|
3457
|
-
// src/pptx/render/chart-axis-range.ts
|
|
3458
|
-
var LOG_EXPONENT_TOLERANCE = 1e-12;
|
|
3459
|
-
function computeLogValueRange(series, logBase) {
|
|
3460
|
-
const allValues = series.flatMap((item) => item.values).filter((value) => value > 0);
|
|
3461
|
-
if (allValues.length === 0) {
|
|
3462
|
-
return { min: 1, max: logBase, span: 1, logScale: true, logBase };
|
|
3463
|
-
}
|
|
3464
|
-
const dataMin = Math.min(...allValues);
|
|
3465
|
-
const dataMax = Math.max(...allValues);
|
|
3466
|
-
const logMin = Math.floor(Math.log(dataMin) / Math.log(logBase));
|
|
3467
|
-
const logMax = Math.ceil(Math.log(dataMax) / Math.log(logBase));
|
|
3468
|
-
const min = logBase ** logMin;
|
|
3469
|
-
const max = logBase ** Math.max(logMax, logMin + 1);
|
|
3470
|
-
return {
|
|
3471
|
-
min,
|
|
3472
|
-
max,
|
|
3473
|
-
span: Math.max(Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase), 1),
|
|
3474
|
-
logScale: true,
|
|
3475
|
-
logBase
|
|
3476
|
-
};
|
|
3477
|
-
}
|
|
3478
|
-
function computeValueRangeForAxis(series, axis, plotHeightPx) {
|
|
3479
|
-
const requestedLogBase = axis?.logBase ?? 10;
|
|
3480
|
-
const logBase = axis?.logScale && Number.isFinite(requestedLogBase) && requestedLogBase > 1 ? requestedLogBase : axis?.logScale ? 10 : void 0;
|
|
3481
|
-
const automatic = logBase ? computeLogValueRange(series, logBase) : computeValueRange(series, plotHeightPx);
|
|
3482
|
-
return withAxisBounds(automatic, axis, logBase);
|
|
3483
|
-
}
|
|
3484
|
-
function computeStackedValueRangeForAxis(series, catCount, axis, isPercent, plotSizePx) {
|
|
3485
|
-
if (isPercent) {
|
|
3486
|
-
return {
|
|
3487
|
-
...percentStackedRange(series, catCount, plotSizePx),
|
|
3488
|
-
...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
3489
|
-
};
|
|
3490
|
-
}
|
|
3491
|
-
return withAxisBounds(computeStackedValueRange(series, catCount, plotSizePx), axis);
|
|
3492
|
-
}
|
|
3493
|
-
function percentStackedRange(series, catCount, plotSizePx) {
|
|
3494
|
-
const shares = series.map((entry) => ({
|
|
3495
|
-
...entry,
|
|
3496
|
-
values: Array.from({ length: catCount }, (_, ci) => {
|
|
3497
|
-
const total = series.reduce((sum, s) => sum + Math.abs(s.values[ci] ?? 0), 0);
|
|
3498
|
-
return total > 0 ? (entry.values[ci] ?? 0) / total * 100 : 0;
|
|
3499
|
-
})
|
|
3500
|
-
}));
|
|
3501
|
-
const automatic = computeStackedValueRange(shares, catCount, plotSizePx);
|
|
3502
|
-
if (automatic.min >= 0) {
|
|
3503
|
-
return { min: 0, max: 100, span: 100 };
|
|
3504
|
-
}
|
|
3505
|
-
const min = Math.max(automatic.min, -100);
|
|
3506
|
-
const unit = automatic.majorUnit;
|
|
3507
|
-
return {
|
|
3508
|
-
min,
|
|
3509
|
-
max: 100,
|
|
3510
|
-
span: 100 - min,
|
|
3511
|
-
...unit !== void 0 && 100 % unit === 0 && min % unit === 0 ? { majorUnit: unit } : {}
|
|
3512
|
-
};
|
|
3513
|
-
}
|
|
3514
|
-
function withAxisBounds(automatic, axis, logBase) {
|
|
3515
|
-
const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
|
|
3516
|
-
const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
|
|
3517
|
-
const min = validMin ?? automatic.min;
|
|
3518
|
-
let max = validMax ?? automatic.max;
|
|
3519
|
-
const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
|
|
3520
|
-
if (max <= min) {
|
|
3521
|
-
max = logBase ? min * logBase : min + 1;
|
|
3522
|
-
}
|
|
3523
|
-
const span = logBase ? Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase) : max - min;
|
|
3524
|
-
return {
|
|
3525
|
-
min,
|
|
3526
|
-
max,
|
|
3527
|
-
span: Math.max(span, Number.EPSILON),
|
|
3528
|
-
...majorUnit !== void 0 ? { majorUnit } : {},
|
|
3529
|
-
...logBase ? { logScale: true, logBase } : {},
|
|
3530
|
-
...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
3531
|
-
};
|
|
3532
|
-
}
|
|
3533
|
-
function valueToYLog(val, range, topY, bottomY) {
|
|
3534
|
-
const base = range.logBase ?? 10;
|
|
3535
|
-
const logValue = Math.log(Math.max(val, range.min)) / Math.log(base);
|
|
3536
|
-
const logMin = Math.log(range.min) / Math.log(base);
|
|
3537
|
-
const ratio = (logValue - logMin) / range.span;
|
|
3538
|
-
return range.reverseOrder ? topY + ratio * (bottomY - topY) : bottomY - ratio * (bottomY - topY);
|
|
3539
|
-
}
|
|
3540
|
-
function generateLogTicks(range) {
|
|
3541
|
-
if (!range.logScale || !range.logBase) {
|
|
3542
|
-
return [];
|
|
3543
|
-
}
|
|
3544
|
-
const base = range.logBase;
|
|
3545
|
-
const logMin = Math.log(range.min) / Math.log(base);
|
|
3546
|
-
const logMax = Math.log(range.max) / Math.log(base);
|
|
3547
|
-
const firstExponent = Math.ceil(logMin - LOG_EXPONENT_TOLERANCE);
|
|
3548
|
-
const lastExponent = Math.floor(logMax + LOG_EXPONENT_TOLERANCE);
|
|
3549
|
-
if (lastExponent < firstExponent) {
|
|
3550
|
-
return range.min === range.max ? [range.min] : [range.min, range.max];
|
|
3551
|
-
}
|
|
3552
|
-
return Array.from(
|
|
3553
|
-
{ length: lastExponent - firstExponent + 1 },
|
|
3554
|
-
(_unused, index) => base ** (firstExponent + index)
|
|
3555
|
-
);
|
|
3556
|
-
}
|
|
3557
|
-
function generateIntervalTicks(range, unit) {
|
|
3558
|
-
if (!Number.isFinite(unit) || unit <= 0 || range.logScale) {
|
|
3559
|
-
return [];
|
|
3560
|
-
}
|
|
3561
|
-
const tolerance = Math.max(1, Math.abs(range.min), Math.abs(range.max)) * 1e-12;
|
|
3562
|
-
const first = Math.ceil((range.min - tolerance) / unit);
|
|
3563
|
-
const last = Math.floor((range.max + tolerance) / unit);
|
|
3564
|
-
const count = Math.min(Math.max(last - first + 1, 0), 2e3);
|
|
3565
|
-
return Array.from({ length: count }, (_, index) => (first + index) * unit);
|
|
3566
|
-
}
|
|
3567
|
-
function generateAxisTicks(range, axis, defaultIntervals) {
|
|
3568
|
-
if (range.logScale && range.logBase) {
|
|
3569
|
-
return generateLogTicks(range);
|
|
3570
|
-
}
|
|
3571
|
-
const explicit = generateIntervalTicks(range, axis?.majorUnit ?? 0);
|
|
3572
|
-
if (explicit.length > 0) {
|
|
3573
|
-
return explicit;
|
|
3574
|
-
}
|
|
3575
|
-
const automatic = generateIntervalTicks(range, range.majorUnit ?? 0);
|
|
3576
|
-
if (automatic.length > 0) {
|
|
3577
|
-
return automatic;
|
|
3578
|
-
}
|
|
3579
|
-
return Array.from(
|
|
3580
|
-
{ length: defaultIntervals + 1 },
|
|
3581
|
-
(_, index) => range.min + range.span / defaultIntervals * index
|
|
3582
|
-
);
|
|
3583
|
-
}
|
|
3584
|
-
function generateMinorAxisTicks(range, axis) {
|
|
3585
|
-
const minor = generateIntervalTicks(range, axis?.minorUnit ?? 0);
|
|
3586
|
-
if (minor.length === 0) {
|
|
3587
|
-
return [];
|
|
3588
|
-
}
|
|
3589
|
-
const majorUnit = axis?.majorUnit;
|
|
3590
|
-
if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
|
|
3591
|
-
return minor;
|
|
3592
|
-
}
|
|
3593
|
-
const tolerance = Math.max(1, Math.abs(range.min), Math.abs(range.max)) * 1e-10;
|
|
3594
|
-
return minor.filter(
|
|
3595
|
-
(value) => Math.abs(value / majorUnit - Math.round(value / majorUnit)) > tolerance
|
|
3596
|
-
);
|
|
3597
|
-
}
|
|
3598
|
-
function findLogAxis(axes) {
|
|
3599
|
-
return axes?.find((axis) => axis.axisType === "valAx" && axis.logScale);
|
|
3600
|
-
}
|
|
3601
|
-
function computeValueRangeForChart(series, axes, plotHeightPx) {
|
|
3602
|
-
const primaryAxis = axes?.find((axis) => axis.axisType === "valAx" && axis.axPos === "l") ?? axes?.find((axis) => axis.axisType === "valAx" && axis.axPos !== "r");
|
|
3603
|
-
return computeValueRangeForAxis(series, primaryAxis, plotHeightPx);
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
3314
|
// src/pptx/render/chart-axis.ts
|
|
3607
3315
|
var DISPLAY_UNIT_DIVISORS = {
|
|
3608
3316
|
hundreds: 100,
|
|
@@ -4225,22 +3933,7 @@ function polylineRunsPath(runs) {
|
|
|
4225
3933
|
(run) => run.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(" ")
|
|
4226
3934
|
).join(" ");
|
|
4227
3935
|
}
|
|
4228
|
-
|
|
4229
|
-
// src/pptx/render/chart-axis-style.ts
|
|
4230
3936
|
var DEFAULT_COLOR = "#64748b";
|
|
4231
|
-
function dashArray(style, width) {
|
|
4232
|
-
if (!style || style === "solid") {
|
|
4233
|
-
return void 0;
|
|
4234
|
-
}
|
|
4235
|
-
const unit = Math.max(width, 1);
|
|
4236
|
-
if (style === "dot" || style === "sysDot") {
|
|
4237
|
-
return `${unit} ${unit * 2}`;
|
|
4238
|
-
}
|
|
4239
|
-
if (style === "lgDash") {
|
|
4240
|
-
return `${unit * 6} ${unit * 3}`;
|
|
4241
|
-
}
|
|
4242
|
-
return `${unit * 3} ${unit * 2}`;
|
|
4243
|
-
}
|
|
4244
3937
|
function chartAxisTextStyle(axis, defaultFontSizePx = DEFAULT_CHART_TEXT_PX) {
|
|
4245
3938
|
return {
|
|
4246
3939
|
fontSize: axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : defaultFontSizePx,
|
|
@@ -4271,7 +3964,7 @@ function chartLineStyle(shape, fallbackColor = DEFAULT_COLOR, fallbackWidth = 1)
|
|
|
4271
3964
|
return {
|
|
4272
3965
|
stroke: shape?.strokeColor ?? fallbackColor,
|
|
4273
3966
|
strokeWidth,
|
|
4274
|
-
...
|
|
3967
|
+
...chartLineDashArray(shape?.strokeDashStyle, strokeWidth) ? { dashArray: chartLineDashArray(shape?.strokeDashStyle, strokeWidth) } : {}
|
|
4275
3968
|
};
|
|
4276
3969
|
}
|
|
4277
3970
|
|
|
@@ -6116,8 +5809,8 @@ function formatDate(date, unit, format) {
|
|
|
6116
5809
|
// src/pptx/render/chart-date-axis.ts
|
|
6117
5810
|
var DAY_MS = 864e5;
|
|
6118
5811
|
function excelSerialToDate(serial5, date1904 = false) {
|
|
6119
|
-
const
|
|
6120
|
-
return new Date(
|
|
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);
|
|
6121
5814
|
}
|
|
6122
5815
|
function primaryDateAxis(chartData) {
|
|
6123
5816
|
return chartData.axes?.find((axis) => axis.axisType === "dateAx" && axis.axPos !== "t") ?? chartData.axes?.find((axis) => axis.axisType === "dateAx");
|
|
@@ -7947,6 +7640,8 @@ function resolveDisplayedChartType(data) {
|
|
|
7947
7640
|
}
|
|
7948
7641
|
function buildParetoAxis(layout) {
|
|
7949
7642
|
const axis = buildSecondaryAxis({ min: 0, max: 100, span: 100 }, layout, {
|
|
7643
|
+
axisType: "valAx",
|
|
7644
|
+
axPos: "r",
|
|
7950
7645
|
majorUnit: 20,
|
|
7951
7646
|
majorTickMark: "out"
|
|
7952
7647
|
});
|
|
@@ -11275,4 +10970,4 @@ function computeTrendlinePrimitives(chartData, catCount, layout, range, mode = "
|
|
|
11275
10970
|
return out;
|
|
11276
10971
|
}
|
|
11277
10972
|
|
|
11278
|
-
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, applyLabelManualLayout, 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, clipStackedSegment, collapseChartTitleRunsForEdit, computeAxisTitlePrimitives, computeBarRects, computeBoxWhiskerGeometry, computeChartLegendLayout, computeDataTableHeight, computeDataTablePrimitives, computeErrorBarPrimitives, computeFunnelSegments, computeGradientCenter, computeHierarchicalSunburstArcs, computeHistogramBars, computeHistogramBins, computeLayout, computeLayoutOptions, computeLinePoints,
|
|
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, applyLabelManualLayout, 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, wrapTextByEstimatedWidth };
|