ooxml-core 1.45.0 → 1.47.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/dist/PptxHandler-JX62VKU4.cjs +14 -0
- package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-NXHZ6ITL.mjs} +2 -2
- package/dist/PptxHandler-SUGLNSZI.mjs +5 -0
- package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-IK6NIK6T.cjs} +6 -6
- package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-LHQ333UL.mjs} +3 -3
- package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-URSPID7L.mjs} +2 -2
- package/dist/automation/index.cjs +12 -7
- package/dist/automation/index.mjs +12 -7
- package/dist/chart/edit/group-options.d.ts +4 -0
- package/dist/chart/edit/group-options.d.ts.map +1 -1
- package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
- package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
- package/dist/chart/edit/new-chart.d.ts +34 -1
- package/dist/chart/edit/new-chart.d.ts.map +1 -1
- package/dist/chart/edit/secondary-axis.d.ts +8 -1
- package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
- package/dist/chart/edit/type.d.ts +2 -0
- package/dist/chart/edit/type.d.ts.map +1 -1
- package/dist/chart/index.cjs +414 -263
- package/dist/chart/index.mjs +412 -264
- package/dist/{chunk-YBSNMVSN.cjs → chunk-4GPLQEEC.cjs} +1604 -1324
- package/dist/{chunk-U5BXJQZG.mjs → chunk-553WFEHD.mjs} +332 -53
- package/dist/{chunk-RVYGAYCP.mjs → chunk-5HNRZOBX.mjs} +1 -1
- package/dist/{chunk-VKFKEVHK.mjs → chunk-6MU4WKHS.mjs} +1 -1
- package/dist/{chunk-GXYK3H4O.mjs → chunk-7L6ZAA5Y.mjs} +82 -17
- package/dist/{chunk-3J6VIKLP.cjs → chunk-APCA7N6Q.cjs} +3 -3
- package/dist/{chunk-IPV3J3I5.mjs → chunk-DEDK2J57.mjs} +68 -1
- package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
- package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
- package/dist/{chunk-GGJUWJXB.mjs → chunk-QHR726W3.mjs} +1 -1
- package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
- package/dist/{chunk-QZPOPUI5.cjs → chunk-WFN6ZU7N.cjs} +69 -0
- package/dist/{chunk-LCXBTJXE.mjs → chunk-XVEJS7HN.mjs} +5 -5
- package/dist/{chunk-CVJX6NNO.mjs → chunk-Z734BYYR.mjs} +334 -54
- package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
- package/dist/docx/index.cjs +300 -144
- package/dist/docx/index.mjs +300 -144
- package/dist/index.cjs +484 -333
- package/dist/index.mjs +484 -333
- package/dist/pptx/automation/index.cjs +2207 -1825
- package/dist/pptx/automation/index.d.ts +4 -4
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts → index--HBUyILF.d.ts} +5 -5
- package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index--HBUyILF.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-BDVzSboe.d.ts} +71 -7
- package/dist/pptx/chunks/{index-DGKI80Hj.d.ts.map → index-BDVzSboe.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-Dr3iIPt9.d.ts} +3 -3
- package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-Dr3iIPt9.d.ts.map} +1 -1
- package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts → text-operations-CVHXOSit.d.ts} +18 -3
- package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +608 -226
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +1 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
- package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
- package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/index.cjs +2605 -2226
- package/dist/pptx/index.d.ts +5 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/xlsx/index.cjs +12 -7
- package/dist/xlsx/index.mjs +12 -7
- package/dist/xlsx/ui/index.cjs +12 -7
- package/dist/xlsx/ui/index.mjs +12 -7
- package/package.json +1 -1
- package/dist/PptxHandler-3RDVJFQV.cjs +0 -14
- package/dist/PptxHandler-EI6DMHPM.mjs +0 -5
package/dist/docx/index.mjs
CHANGED
|
@@ -8005,12 +8005,12 @@ function readScene3DValues(node, read) {
|
|
|
8005
8005
|
["lightRig", light]
|
|
8006
8006
|
]) {
|
|
8007
8007
|
const rot = read.child(source2, "rot");
|
|
8008
|
-
for (const [
|
|
8008
|
+
for (const [axis2, key] of [
|
|
8009
8009
|
["lat", "RotX"],
|
|
8010
8010
|
["lon", "RotY"],
|
|
8011
8011
|
["rev", "RotZ"]
|
|
8012
8012
|
]) {
|
|
8013
|
-
const value = integer2(read.attribute(rot,
|
|
8013
|
+
const value = integer2(read.attribute(rot, axis2));
|
|
8014
8014
|
if (value !== void 0 && value >= 0 && value < 216e5) out[`${prefix2}${key}`] = value;
|
|
8015
8015
|
}
|
|
8016
8016
|
}
|
|
@@ -8023,12 +8023,12 @@ function readScene3DValues(node, read) {
|
|
|
8023
8023
|
["up", "backdropUp", "d"]
|
|
8024
8024
|
]) {
|
|
8025
8025
|
const point = read.child(backdrop, name2);
|
|
8026
|
-
for (const [
|
|
8026
|
+
for (const [axis2, suffix] of [
|
|
8027
8027
|
["x", "X"],
|
|
8028
8028
|
["y", "Y"],
|
|
8029
8029
|
["z", "Z"]
|
|
8030
8030
|
]) {
|
|
8031
|
-
const value = integer2(read.attribute(point, `${attr3}${
|
|
8031
|
+
const value = integer2(read.attribute(point, `${attr3}${axis2}`));
|
|
8032
8032
|
if (value !== void 0) out[`${prefix2}${suffix}`] = value;
|
|
8033
8033
|
}
|
|
8034
8034
|
}
|
|
@@ -8672,12 +8672,12 @@ function writeDrawingTextScene3D(doc, value) {
|
|
|
8672
8672
|
throw new Error("A backdrop point needs three finite coordinates");
|
|
8673
8673
|
const point = child2(backdrop, name2);
|
|
8674
8674
|
const vector = attr3 === "d" ? scaleVectorToIntegers(values[0], values[1], values[2]) : { x: values[0], y: values[1], z: values[2] };
|
|
8675
|
-
for (const [
|
|
8675
|
+
for (const [axis2, suffix] of [
|
|
8676
8676
|
["x", "X"],
|
|
8677
8677
|
["y", "Y"],
|
|
8678
8678
|
["z", "Z"]
|
|
8679
8679
|
])
|
|
8680
|
-
number(point, `${attr3}${
|
|
8680
|
+
number(point, `${attr3}${axis2}`, vector[axis2], before[`${prefix2}${suffix}`]);
|
|
8681
8681
|
}
|
|
8682
8682
|
}
|
|
8683
8683
|
return node;
|
|
@@ -9051,17 +9051,17 @@ function exactDef(name2, avLst, gdLines, rect3, paths) {
|
|
|
9051
9051
|
var Glyph = class {
|
|
9052
9052
|
lines = [];
|
|
9053
9053
|
names = /* @__PURE__ */ new Map();
|
|
9054
|
-
coord(
|
|
9055
|
-
const key = `${
|
|
9054
|
+
coord(axis2, value) {
|
|
9055
|
+
const key = `${axis2}${value}`;
|
|
9056
9056
|
const known = this.names.get(key);
|
|
9057
9057
|
if (known) {
|
|
9058
9058
|
return known;
|
|
9059
9059
|
}
|
|
9060
9060
|
const id = this.names.size;
|
|
9061
|
-
const name2 = `${
|
|
9061
|
+
const name2 = `${axis2}g${id}`;
|
|
9062
9062
|
this.lines.push(
|
|
9063
9063
|
`k${id} */ ss ${Math.round(value * 1e3)} 90000`,
|
|
9064
|
-
`${name2} +- ${
|
|
9064
|
+
`${name2} +- ${axis2 === "x" ? "hc" : "vc"} k${id} 0`
|
|
9065
9065
|
);
|
|
9066
9066
|
this.names.set(key, name2);
|
|
9067
9067
|
return name2;
|
|
@@ -20599,8 +20599,8 @@ function documentOrder(point) {
|
|
|
20599
20599
|
descendants3(all[0], all);
|
|
20600
20600
|
return all;
|
|
20601
20601
|
}
|
|
20602
|
-
function axisPoints(point,
|
|
20603
|
-
switch (
|
|
20602
|
+
function axisPoints(point, axis2) {
|
|
20603
|
+
switch (axis2) {
|
|
20604
20604
|
case "self":
|
|
20605
20605
|
return [point];
|
|
20606
20606
|
case "ch":
|
|
@@ -20619,7 +20619,7 @@ function axisPoints(point, axis) {
|
|
|
20619
20619
|
return point.parent ? [point.parent] : [];
|
|
20620
20620
|
case "ancst":
|
|
20621
20621
|
case "ancstOrSelf": {
|
|
20622
|
-
const out =
|
|
20622
|
+
const out = axis2 === "ancstOrSelf" ? [point] : [];
|
|
20623
20623
|
let current = point.parent;
|
|
20624
20624
|
while (current) {
|
|
20625
20625
|
out.push(current);
|
|
@@ -20634,13 +20634,13 @@ function axisPoints(point, axis) {
|
|
|
20634
20634
|
if (index < 0) {
|
|
20635
20635
|
return [];
|
|
20636
20636
|
}
|
|
20637
|
-
return
|
|
20637
|
+
return axis2 === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index);
|
|
20638
20638
|
}
|
|
20639
20639
|
case "follow":
|
|
20640
20640
|
case "preced": {
|
|
20641
20641
|
const all = documentOrder(point);
|
|
20642
20642
|
const index = all.indexOf(point);
|
|
20643
|
-
return
|
|
20643
|
+
return axis2 === "follow" ? all.slice(index + 1) : all.slice(0, index);
|
|
20644
20644
|
}
|
|
20645
20645
|
case "root":
|
|
20646
20646
|
return [rootOf2(point)];
|
|
@@ -20712,10 +20712,10 @@ function windowPoints(points3, st = 1, cnt = 0, step = 1) {
|
|
|
20712
20712
|
return out;
|
|
20713
20713
|
}
|
|
20714
20714
|
function iterateStep(point, iterator, step) {
|
|
20715
|
-
const
|
|
20715
|
+
const axis2 = iterator.axis[step] ?? "none";
|
|
20716
20716
|
const ptType = iterator.ptType[step] ?? iterator.ptType[iterator.ptType.length - 1] ?? "all";
|
|
20717
|
-
const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(
|
|
20718
|
-
let points3 = axisPoints(point,
|
|
20717
|
+
const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis2);
|
|
20718
|
+
let points3 = axisPoints(point, axis2).filter((candidate) => matchesPointType(candidate, ptType));
|
|
20719
20719
|
if (hideLast) {
|
|
20720
20720
|
points3 = points3.filter((candidate) => !isLastSiblingTransition(candidate));
|
|
20721
20721
|
}
|
|
@@ -20980,8 +20980,8 @@ function valueOf(node, type) {
|
|
|
20980
20980
|
if (direct !== void 0) {
|
|
20981
20981
|
return boundedValue(node, type, direct);
|
|
20982
20982
|
}
|
|
20983
|
-
const
|
|
20984
|
-
return
|
|
20983
|
+
const axis2 = AXIS_LOOKUP[type];
|
|
20984
|
+
return axis2 ? axisValue(node, axis2[0], axis2[1]) : void 0;
|
|
20985
20985
|
}
|
|
20986
20986
|
function boundedValue(node, type, value) {
|
|
20987
20987
|
let out = value;
|
|
@@ -30811,8 +30811,8 @@ function parseGroup(context, element4) {
|
|
|
30811
30811
|
element: element4.localName,
|
|
30812
30812
|
is3D,
|
|
30813
30813
|
series: children(element4, "ser", NS.c).map((ser) => parseSeries(context, ser)),
|
|
30814
|
-
axisIds: children(element4, "axId", NS.c).flatMap((
|
|
30815
|
-
const raw2 = attribute(
|
|
30814
|
+
axisIds: children(element4, "axId", NS.c).flatMap((axis2) => {
|
|
30815
|
+
const raw2 = attribute(axis2, "val")?.trim();
|
|
30816
30816
|
const id = raw2 ? Number(raw2) : Number.NaN;
|
|
30817
30817
|
return Number.isFinite(id) ? [id] : [];
|
|
30818
30818
|
})
|
|
@@ -30961,9 +30961,9 @@ function parsePlotArea(context, element4) {
|
|
|
30961
30961
|
plotArea.groups.push(parseGroup(context, child7));
|
|
30962
30962
|
handled.add(child7.localName);
|
|
30963
30963
|
}
|
|
30964
|
-
const
|
|
30965
|
-
if (
|
|
30966
|
-
plotArea.axes.push(parseAxis(context, child7,
|
|
30964
|
+
const axis2 = AXIS_ELEMENTS[child7.localName];
|
|
30965
|
+
if (axis2) {
|
|
30966
|
+
plotArea.axes.push(parseAxis(context, child7, axis2));
|
|
30967
30967
|
handled.add(child7.localName);
|
|
30968
30968
|
}
|
|
30969
30969
|
}
|
|
@@ -31381,14 +31381,14 @@ var AXIS_ELEMENTS2 = {
|
|
|
31381
31381
|
ser: "serAx"
|
|
31382
31382
|
};
|
|
31383
31383
|
var gridlinesXml = (context, local, present2, shape2) => present2 ? elementXml(local, shapePropertiesXml(context, shape2)) : "";
|
|
31384
|
-
function axisXml(context,
|
|
31385
|
-
const { scaling } =
|
|
31384
|
+
function axisXml(context, axis2) {
|
|
31385
|
+
const { scaling } = axis2;
|
|
31386
31386
|
return elementXml(
|
|
31387
|
-
AXIS_ELEMENTS2[
|
|
31388
|
-
valXml("axId",
|
|
31387
|
+
AXIS_ELEMENTS2[axis2.kind],
|
|
31388
|
+
valXml("axId", axis2.id) + elementXml(
|
|
31389
31389
|
"scaling",
|
|
31390
31390
|
valXml("logBase", scaling.logBase) + valXml("orientation", scaling.orientation) + valXml("max", scaling.max) + valXml("min", scaling.min)
|
|
31391
|
-
) + valXml("delete",
|
|
31391
|
+
) + valXml("delete", axis2.deleted) + valXml("axPos", axis2.position) + gridlinesXml(context, "majorGridlines", axis2.majorGridlines, axis2.majorGridlinesSpPr) + gridlinesXml(context, "minorGridlines", axis2.minorGridlines, axis2.minorGridlinesSpPr) + titleXml(context, axis2.title) + numberFormatXml(axis2.numberFormat) + valXml("majorTickMark", axis2.majorTickMark) + valXml("minorTickMark", axis2.minorTickMark) + valXml("tickLblPos", axis2.tickLabelPosition) + shapePropertiesXml(context, axis2.spPr) + textBodyXml(context, axis2.txPr) + valXml("crossAx", axis2.crossAxisId) + valXml("crosses", axis2.crosses) + valXml("crossesAt", axis2.crossesAt) + valXml("crossBetween", axis2.crossBetween) + valXml("auto", axis2.auto) + valXml("lblAlgn", axis2.labelAlign) + valXml("lblOffset", axis2.labelOffset) + valXml("baseTimeUnit", axis2.baseTimeUnit) + valXml("majorUnit", axis2.majorUnit) + valXml("majorTimeUnit", axis2.majorTimeUnit) + valXml("minorUnit", axis2.minorUnit) + valXml("minorTimeUnit", axis2.minorTimeUnit) + displayUnitsXml(context, axis2.displayUnits) + valXml("tickLblSkip", axis2.tickLabelSkip) + valXml("tickMarkSkip", axis2.tickMarkSkip) + valXml("noMultiLvlLbl", axis2.noMultiLevelLabels) + raw(context, axis2.extLst)
|
|
31392
31392
|
);
|
|
31393
31393
|
}
|
|
31394
31394
|
|
|
@@ -31462,7 +31462,7 @@ function groupXml(context, group3) {
|
|
|
31462
31462
|
function plotAreaXml(context, plotArea) {
|
|
31463
31463
|
return elementXml(
|
|
31464
31464
|
"plotArea",
|
|
31465
|
-
layoutXml(context, plotArea.layout) + plotArea.groups.map((group3) => groupXml(context, group3)).join("") + plotArea.axes.map((
|
|
31465
|
+
layoutXml(context, plotArea.layout) + plotArea.groups.map((group3) => groupXml(context, group3)).join("") + plotArea.axes.map((axis2) => axisXml(context, axis2)).join("") + dataTableXml(context, plotArea.dataTable) + shapePropertiesXml(context, plotArea.spPr) + raw(context, plotArea.extLst)
|
|
31466
31466
|
);
|
|
31467
31467
|
}
|
|
31468
31468
|
|
|
@@ -31815,14 +31815,14 @@ function parseLegend2(context, element4) {
|
|
|
31815
31815
|
}
|
|
31816
31816
|
|
|
31817
31817
|
// chart/ex/parse-axis.ts
|
|
31818
|
-
function parseScaling(context,
|
|
31819
|
-
const category = cxChild(
|
|
31818
|
+
function parseScaling(context, axis2) {
|
|
31819
|
+
const category = cxChild(axis2, "catScaling");
|
|
31820
31820
|
if (category)
|
|
31821
31821
|
return assignDefined(
|
|
31822
31822
|
{ kind: "cat" },
|
|
31823
31823
|
{ gapWidth: autoNumberAttribute(context, category, "gapWidth") }
|
|
31824
31824
|
);
|
|
31825
|
-
const value = cxChild(
|
|
31825
|
+
const value = cxChild(axis2, "valScaling");
|
|
31826
31826
|
if (!value) return void 0;
|
|
31827
31827
|
return assignDefined(
|
|
31828
31828
|
{ kind: "val" },
|
|
@@ -32033,9 +32033,9 @@ function parseSeries2(context, element4) {
|
|
|
32033
32033
|
const labels = cxChild(element4, "dataLabels");
|
|
32034
32034
|
const inline = cxChild(element4, "data");
|
|
32035
32035
|
const layout2 = cxChild(element4, "layoutPr");
|
|
32036
|
-
const
|
|
32036
|
+
const axisIds2 = cxChildren(element4, "axisId").map((axis2) => indexAttribute(context, axis2, "val")).filter((id) => id !== void 0);
|
|
32037
32037
|
return assignDefined(
|
|
32038
|
-
{ layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds },
|
|
32038
|
+
{ layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds: axisIds2 },
|
|
32039
32039
|
{
|
|
32040
32040
|
hidden: boolAttribute(context, element4, "hidden"),
|
|
32041
32041
|
ownerIndex: numberAttribute(context, element4, "ownerIdx"),
|
|
@@ -32077,7 +32077,7 @@ function parsePlotArea2(context, element4) {
|
|
|
32077
32077
|
const regionExtLst = extensionList2(region);
|
|
32078
32078
|
if (regionExtLst) out.regionExtLst = regionExtLst;
|
|
32079
32079
|
}
|
|
32080
|
-
out.axes = cxChildren(element4, "axis").map((
|
|
32080
|
+
out.axes = cxChildren(element4, "axis").map((axis2) => parseAxis2(context, axis2));
|
|
32081
32081
|
return assignDefined(out, { spPr: shapeProperties2(element4), extLst: extensionList2(element4) });
|
|
32082
32082
|
}
|
|
32083
32083
|
function namespaceDeclarations2(root) {
|
|
@@ -32328,19 +32328,19 @@ function scalingXml(scaling) {
|
|
|
32328
32328
|
);
|
|
32329
32329
|
}
|
|
32330
32330
|
var tickMarksXml = (local, marks) => marks ? cxElement(local, "", attributes([["type", marks.type]])) : "";
|
|
32331
|
-
function axisXml2(context,
|
|
32332
|
-
const units2 =
|
|
32331
|
+
function axisXml2(context, axis2) {
|
|
32332
|
+
const units2 = axis2.units;
|
|
32333
32333
|
const gridlines = (local, value) => value ? cxElement(local, shapeXml(context, value.spPr)) : "";
|
|
32334
32334
|
return cxElement(
|
|
32335
32335
|
"axis",
|
|
32336
|
-
scalingXml(
|
|
32336
|
+
scalingXml(axis2.scaling) + titleXml2(context, axis2.title) + (units2 ? cxElement(
|
|
32337
32337
|
"units",
|
|
32338
32338
|
titleXml2(context, units2.label, "unitsLabel") + raw(context, units2.extLst),
|
|
32339
32339
|
attributes([["unit", units2.unit]])
|
|
32340
|
-
) : "") + gridlines("majorGridlines",
|
|
32340
|
+
) : "") + gridlines("majorGridlines", axis2.majorGridlines) + gridlines("minorGridlines", axis2.minorGridlines) + tickMarksXml("majorTickMarks", axis2.majorTickMarks) + tickMarksXml("minorTickMarks", axis2.minorTickMarks) + (axis2.tickLabels ? cxElement("tickLabels", raw(context, axis2.tickLabels.extLst)) : "") + numberFormatXml2(axis2.numberFormat) + shapeXml(context, axis2.spPr) + textBodyXml2(context, axis2.txPr) + raw(context, axis2.extLst),
|
|
32341
32341
|
attributes([
|
|
32342
|
-
["id",
|
|
32343
|
-
["hidden",
|
|
32342
|
+
["id", axis2.id],
|
|
32343
|
+
["hidden", axis2.hidden]
|
|
32344
32344
|
])
|
|
32345
32345
|
);
|
|
32346
32346
|
}
|
|
@@ -32375,7 +32375,7 @@ function writeChartExSpace(space, options2 = {}) {
|
|
|
32375
32375
|
);
|
|
32376
32376
|
const plotArea = cxElement(
|
|
32377
32377
|
"plotArea",
|
|
32378
|
-
region + plot.axes.map((
|
|
32378
|
+
region + plot.axes.map((axis2) => axisXml2(context, axis2)).join("") + shapeXml(context, plot.spPr) + raw(context, plot.extLst)
|
|
32379
32379
|
);
|
|
32380
32380
|
const legend = space.legend;
|
|
32381
32381
|
const legendXml2 = legend ? cxElement(
|
|
@@ -34010,8 +34010,8 @@ function chartSummarySeries(source2, chartType, groupLabels, groupSmooth) {
|
|
|
34010
34010
|
Object.assign(out, summaryAnalysis(source2));
|
|
34011
34011
|
return out;
|
|
34012
34012
|
}
|
|
34013
|
-
function valueAxisId(chartSpace,
|
|
34014
|
-
return
|
|
34013
|
+
function valueAxisId(chartSpace, axisIds2) {
|
|
34014
|
+
return axisIds2.find(
|
|
34015
34015
|
(id) => chartSpace.plotArea.axes.some((a2) => a2.id === id && a2.kind === "val")
|
|
34016
34016
|
);
|
|
34017
34017
|
}
|
|
@@ -34502,35 +34502,35 @@ function chartExSummaryFromModel(space) {
|
|
|
34502
34502
|
showLegend: legend !== void 0
|
|
34503
34503
|
};
|
|
34504
34504
|
if (chartType === "boxWhisker") {
|
|
34505
|
-
summary.axes = space.plotArea.axes.flatMap((
|
|
34506
|
-
const scaling =
|
|
34505
|
+
summary.axes = space.plotArea.axes.flatMap((axis2) => {
|
|
34506
|
+
const scaling = axis2.scaling;
|
|
34507
34507
|
if (!scaling) return [];
|
|
34508
34508
|
const value = scaling.kind === "val";
|
|
34509
34509
|
return [
|
|
34510
34510
|
{
|
|
34511
34511
|
kind: value ? "val" : "cat",
|
|
34512
|
-
...
|
|
34512
|
+
...axis2.id === void 0 ? {} : { id: axis2.id },
|
|
34513
34513
|
position: value ? "l" : "b",
|
|
34514
|
-
deleted:
|
|
34514
|
+
deleted: axis2.hidden ?? false,
|
|
34515
34515
|
scaling: {
|
|
34516
34516
|
...value && typeof scaling.min === "number" ? { min: scaling.min } : {},
|
|
34517
34517
|
...value && typeof scaling.max === "number" ? { max: scaling.max } : {}
|
|
34518
34518
|
},
|
|
34519
|
-
majorGridlines: !!
|
|
34520
|
-
minorGridlines: !!
|
|
34521
|
-
...
|
|
34522
|
-
...
|
|
34519
|
+
majorGridlines: !!axis2.majorGridlines,
|
|
34520
|
+
minorGridlines: !!axis2.minorGridlines,
|
|
34521
|
+
...axis2.majorGridlines?.spPr ? { majorGridlinesSpPr: axis2.majorGridlines.spPr } : {},
|
|
34522
|
+
...axis2.minorGridlines?.spPr ? { minorGridlinesSpPr: axis2.minorGridlines.spPr } : {},
|
|
34523
34523
|
...value && typeof scaling.majorUnit === "number" ? { majorUnit: scaling.majorUnit } : {},
|
|
34524
34524
|
...value && typeof scaling.minorUnit === "number" ? { minorUnit: scaling.minorUnit } : {},
|
|
34525
|
-
...
|
|
34526
|
-
...
|
|
34527
|
-
...
|
|
34525
|
+
...axis2.spPr ? { spPr: axis2.spPr } : {},
|
|
34526
|
+
...axis2.numberFormat ? { numberFormat: axis2.numberFormat } : {},
|
|
34527
|
+
...axis2.tickLabels ? {} : { tickLabelPosition: "none" }
|
|
34528
34528
|
}
|
|
34529
34529
|
];
|
|
34530
34530
|
});
|
|
34531
34531
|
}
|
|
34532
34532
|
if (chartType === "funnel") {
|
|
34533
|
-
const cat = space.plotArea.axes.find((
|
|
34533
|
+
const cat = space.plotArea.axes.find((axis2) => axis2.scaling?.kind === "cat")?.scaling;
|
|
34534
34534
|
if (cat?.kind === "cat" && typeof cat.gapWidth === "number")
|
|
34535
34535
|
summary.funnelGapWidth = cat.gapWidth;
|
|
34536
34536
|
}
|
|
@@ -35468,44 +35468,44 @@ function formatDate(date, unit, format) {
|
|
|
35468
35468
|
|
|
35469
35469
|
// chart/render/chart-svg-date-axis.ts
|
|
35470
35470
|
function chartDateAxis(model, plot, out) {
|
|
35471
|
-
const
|
|
35471
|
+
const axis2 = model.axes?.category?.source;
|
|
35472
35472
|
const values = model.dateCategories;
|
|
35473
|
-
if (
|
|
35473
|
+
if (axis2?.kind !== "date" || !values?.length) return void 0;
|
|
35474
35474
|
const points3 = values.flatMap(
|
|
35475
35475
|
(value, index) => value === null || !Number.isFinite(value) ? [] : [{ value, index }]
|
|
35476
35476
|
).sort((a2, b) => a2.value - b.value);
|
|
35477
35477
|
if (!points3.length) return void 0;
|
|
35478
|
-
const min =
|
|
35479
|
-
const max =
|
|
35478
|
+
const min = axis2.scaling.min ?? points3[0].value;
|
|
35479
|
+
const max = axis2.scaling.max ?? points3.at(-1).value;
|
|
35480
35480
|
if (!Number.isFinite(min) || !Number.isFinite(max) || max < min) return void 0;
|
|
35481
35481
|
const position2 = (value) => {
|
|
35482
35482
|
const ratio = max === min ? 0.5 : (value - min) / (max - min);
|
|
35483
|
-
const t =
|
|
35483
|
+
const t = axis2.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
|
|
35484
35484
|
return model.horizontal ? plot.y + plot.h * (1 - t) : plot.x + plot.w * t;
|
|
35485
35485
|
};
|
|
35486
35486
|
const visible = points3.filter((p2) => p2.value >= min && p2.value <= max);
|
|
35487
35487
|
const unitOf = (unit2) => unit2 === "months" || unit2 === "years" ? unit2 : "days";
|
|
35488
|
-
const unit = unitOf(
|
|
35488
|
+
const unit = unitOf(axis2.majorTimeUnit ?? axis2.baseTimeUnit);
|
|
35489
35489
|
const ticks = calendarTicks(
|
|
35490
35490
|
min,
|
|
35491
35491
|
max,
|
|
35492
35492
|
model.date1904 ?? false,
|
|
35493
35493
|
unit,
|
|
35494
|
-
Math.max(1,
|
|
35494
|
+
Math.max(1, axis2.majorUnit ?? 1)
|
|
35495
35495
|
);
|
|
35496
35496
|
const attrs3 = chartTextAttributes(model, "categoryAxis");
|
|
35497
35497
|
const size = attrs3.size ?? 10;
|
|
35498
|
-
const y =
|
|
35498
|
+
const y = axis2.position === "t" ? plot.y : plot.y + plot.h;
|
|
35499
35499
|
const paint2 = model.axes?.category?.line;
|
|
35500
35500
|
const stroke = { color: paint2?.color ?? "#BFBFBF", width: paint2?.width ?? 1 };
|
|
35501
35501
|
const mark = (serial, placement, length) => {
|
|
35502
|
-
if (!placement || placement === "none" ||
|
|
35503
|
-
const inward =
|
|
35502
|
+
if (!placement || placement === "none" || axis2.deleted) return;
|
|
35503
|
+
const inward = axis2.position === "t" ? length : -length;
|
|
35504
35504
|
const start = placement === "cross" ? -length : 0;
|
|
35505
35505
|
const end = placement === "cross" ? length : placement === "in" ? inward : -inward;
|
|
35506
35506
|
if (model.horizontal) {
|
|
35507
|
-
const x =
|
|
35508
|
-
const direction =
|
|
35507
|
+
const x = axis2.position === "r" ? plot.x + plot.w : plot.x;
|
|
35508
|
+
const direction = axis2.position === "r" ? -1 : 1;
|
|
35509
35509
|
const a2 = placement === "cross" ? -length : 0;
|
|
35510
35510
|
const b = placement === "cross" ? length : placement === "in" ? direction * length : -direction * length;
|
|
35511
35511
|
out.push(
|
|
@@ -35517,19 +35517,19 @@ function chartDateAxis(model, plot, out) {
|
|
|
35517
35517
|
);
|
|
35518
35518
|
};
|
|
35519
35519
|
ticks.forEach((serial, index) => {
|
|
35520
|
-
if (index % Math.max(1,
|
|
35521
|
-
if (
|
|
35520
|
+
if (index % Math.max(1, axis2.tickMarkSkip ?? 1) === 0) mark(serial, axis2.majorTickMark, 4);
|
|
35521
|
+
if (axis2.deleted || model.dataTable || axis2.tickLabelPosition === "none" || index % Math.max(1, axis2.tickLabelSkip ?? 1))
|
|
35522
35522
|
return;
|
|
35523
35523
|
const label = formatDate(
|
|
35524
35524
|
excelSerialToDate(serial, model.date1904),
|
|
35525
35525
|
unit,
|
|
35526
|
-
|
|
35526
|
+
axis2.numberFormat?.formatCode
|
|
35527
35527
|
);
|
|
35528
35528
|
if (model.horizontal)
|
|
35529
35529
|
out.push(text(plot.x - 4, position2(serial) + size * 0.3, label, { ...attrs3, anchor: "end" }));
|
|
35530
35530
|
else {
|
|
35531
|
-
const above =
|
|
35532
|
-
const baseline =
|
|
35531
|
+
const above = axis2.tickLabelPosition === "high" || axis2.tickLabelPosition !== "low" && axis2.position === "t";
|
|
35532
|
+
const baseline = axis2.tickLabelPosition === "high" ? plot.y : axis2.tickLabelPosition === "low" ? plot.y + plot.h : y;
|
|
35533
35533
|
out.push(
|
|
35534
35534
|
text(position2(serial), baseline + (above ? -4 : size + 3), label, {
|
|
35535
35535
|
...attrs3,
|
|
@@ -35538,15 +35538,15 @@ function chartDateAxis(model, plot, out) {
|
|
|
35538
35538
|
);
|
|
35539
35539
|
}
|
|
35540
35540
|
});
|
|
35541
|
-
if (
|
|
35541
|
+
if (axis2.minorTickMark && axis2.minorTickMark !== "none")
|
|
35542
35542
|
for (const serial of calendarTicks(
|
|
35543
35543
|
min,
|
|
35544
35544
|
max,
|
|
35545
35545
|
model.date1904 ?? false,
|
|
35546
|
-
unitOf(
|
|
35547
|
-
Math.max(1,
|
|
35546
|
+
unitOf(axis2.minorTimeUnit ?? axis2.baseTimeUnit ?? unit),
|
|
35547
|
+
Math.max(1, axis2.minorUnit ?? 1)
|
|
35548
35548
|
))
|
|
35549
|
-
mark(serial,
|
|
35549
|
+
mark(serial, axis2.minorTickMark, 2.5);
|
|
35550
35550
|
return {
|
|
35551
35551
|
order: visible.map((p2) => p2.index),
|
|
35552
35552
|
band: (index) => position2(values[index] ?? min),
|
|
@@ -35667,12 +35667,12 @@ function chartLineDashArray(style, width) {
|
|
|
35667
35667
|
}
|
|
35668
35668
|
|
|
35669
35669
|
// chart/render/chart-svg-axes.ts
|
|
35670
|
-
function axisTickText(value,
|
|
35671
|
-
return formatChartNumber(value,
|
|
35670
|
+
function axisTickText(value, axis2, percent = false) {
|
|
35671
|
+
return formatChartNumber(value, axis2?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
|
|
35672
35672
|
}
|
|
35673
|
-
function axisLine(model,
|
|
35674
|
-
if (
|
|
35675
|
-
return styledAxisLine(x1, y1, x2, y2,
|
|
35673
|
+
function axisLine(model, axis2, part, x1, y1, x2, y2) {
|
|
35674
|
+
if (axis2?.source.deleted) return "";
|
|
35675
|
+
return styledAxisLine(x1, y1, x2, y2, axis2?.line, chartStroke(model, part));
|
|
35676
35676
|
}
|
|
35677
35677
|
function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
|
|
35678
35678
|
const color = paint2?.color ?? fallback.color;
|
|
@@ -35684,7 +35684,7 @@ function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
|
|
|
35684
35684
|
dash ? ` stroke-dasharray="${dash}"/>` : "/>"
|
|
35685
35685
|
);
|
|
35686
35686
|
}
|
|
35687
|
-
function axisGridlines(model,
|
|
35687
|
+
function axisGridlines(model, axis2, ticks, position2, plot, vertical) {
|
|
35688
35688
|
const draw2 = (values, paint2, minor2) => {
|
|
35689
35689
|
const fallback = chartStroke(model, minor2 ? "gridlineMinor" : "gridlineMajor");
|
|
35690
35690
|
return values.map((value) => {
|
|
@@ -35692,8 +35692,8 @@ function axisGridlines(model, axis, ticks, position2, plot, vertical) {
|
|
|
35692
35692
|
return vertical ? styledAxisLine(p2, plot.y, p2, plot.y + plot.h, paint2, fallback) : styledAxisLine(plot.x, p2, plot.x + plot.w, p2, paint2, fallback);
|
|
35693
35693
|
}).join("");
|
|
35694
35694
|
};
|
|
35695
|
-
const major = !
|
|
35696
|
-
const minor =
|
|
35695
|
+
const major = !axis2 || axis2.source.majorGridlines ? draw2(ticks, axis2?.majorGrid, false) : "";
|
|
35696
|
+
const minor = axis2?.source.minorGridlines ? draw2(axis2.minorTicks, axis2.minorGrid, true) : "";
|
|
35697
35697
|
return major + minor;
|
|
35698
35698
|
}
|
|
35699
35699
|
|
|
@@ -35716,9 +35716,9 @@ function computeLogValueRange(series2, logBase) {
|
|
|
35716
35716
|
logBase
|
|
35717
35717
|
};
|
|
35718
35718
|
}
|
|
35719
|
-
function withAxisBounds(automatic,
|
|
35720
|
-
const validMin = typeof
|
|
35721
|
-
const validMax = typeof
|
|
35719
|
+
function withAxisBounds(automatic, axis2, logBase) {
|
|
35720
|
+
const validMin = typeof axis2?.min === "number" && Number.isFinite(axis2.min) && (!logBase || axis2.min > 0) ? axis2.min : void 0;
|
|
35721
|
+
const validMax = typeof axis2?.max === "number" && Number.isFinite(axis2.max) && (!logBase || axis2.max > 0) ? axis2.max : void 0;
|
|
35722
35722
|
const min = validMin ?? automatic.min;
|
|
35723
35723
|
let max = validMax ?? automatic.max;
|
|
35724
35724
|
const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
|
|
@@ -35732,7 +35732,7 @@ function withAxisBounds(automatic, axis, logBase) {
|
|
|
35732
35732
|
span: Math.max(span, Number.EPSILON),
|
|
35733
35733
|
...majorUnit !== void 0 ? { majorUnit } : {},
|
|
35734
35734
|
...logBase ? { logScale: true, logBase } : {},
|
|
35735
|
-
...
|
|
35735
|
+
...axis2?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
35736
35736
|
};
|
|
35737
35737
|
}
|
|
35738
35738
|
|
|
@@ -35765,11 +35765,11 @@ function generateIntervalTicks(range2, unit) {
|
|
|
35765
35765
|
const count = Math.min(Math.max(last - first3 + 1, 0), 2e3);
|
|
35766
35766
|
return Array.from({ length: count }, (_, index) => (first3 + index) * unit);
|
|
35767
35767
|
}
|
|
35768
|
-
function generateAxisTicks(range2,
|
|
35768
|
+
function generateAxisTicks(range2, axis2, defaultIntervals) {
|
|
35769
35769
|
if (range2.logScale && range2.logBase) {
|
|
35770
35770
|
return generateLogTicks(range2);
|
|
35771
35771
|
}
|
|
35772
|
-
const explicit = generateIntervalTicks(range2,
|
|
35772
|
+
const explicit = generateIntervalTicks(range2, axis2?.majorUnit ?? 0);
|
|
35773
35773
|
if (explicit.length > 0) {
|
|
35774
35774
|
return explicit;
|
|
35775
35775
|
}
|
|
@@ -35782,12 +35782,12 @@ function generateAxisTicks(range2, axis, defaultIntervals) {
|
|
|
35782
35782
|
(_, index) => range2.min + range2.span / defaultIntervals * index
|
|
35783
35783
|
);
|
|
35784
35784
|
}
|
|
35785
|
-
function generateMinorAxisTicks(range2,
|
|
35786
|
-
const minor = generateIntervalTicks(range2,
|
|
35785
|
+
function generateMinorAxisTicks(range2, axis2) {
|
|
35786
|
+
const minor = generateIntervalTicks(range2, axis2?.minorUnit ?? 0);
|
|
35787
35787
|
if (minor.length === 0) {
|
|
35788
35788
|
return [];
|
|
35789
35789
|
}
|
|
35790
|
-
const majorUnit =
|
|
35790
|
+
const majorUnit = axis2?.majorUnit;
|
|
35791
35791
|
if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
|
|
35792
35792
|
return minor;
|
|
35793
35793
|
}
|
|
@@ -35798,33 +35798,33 @@ function generateMinorAxisTicks(range2, axis) {
|
|
|
35798
35798
|
}
|
|
35799
35799
|
|
|
35800
35800
|
// chart/render/chart-view-axes.ts
|
|
35801
|
-
function chartAxisRatio(value, scale,
|
|
35802
|
-
const range2 =
|
|
35801
|
+
function chartAxisRatio(value, scale, axis2) {
|
|
35802
|
+
const range2 = axis2?.range;
|
|
35803
35803
|
const ratio = range2?.logScale ? Math.log(Math.max(value, range2.min) / range2.min) / Math.log(range2.max / range2.min) : (value - scale.min) / (scale.max - scale.min || 1);
|
|
35804
35804
|
return range2?.reverseOrder ? 1 - ratio : ratio;
|
|
35805
35805
|
}
|
|
35806
|
-
function chartAxisLabels(
|
|
35807
|
-
return
|
|
35806
|
+
function chartAxisLabels(axis2) {
|
|
35807
|
+
return axis2?.source.deleted !== true && axis2?.source.tickLabelPosition !== "none";
|
|
35808
35808
|
}
|
|
35809
|
-
function options(
|
|
35809
|
+
function options(axis2) {
|
|
35810
35810
|
return {
|
|
35811
|
-
...
|
|
35812
|
-
...
|
|
35813
|
-
...
|
|
35814
|
-
...
|
|
35811
|
+
...axis2.scaling,
|
|
35812
|
+
...axis2.scaling.logBase === void 0 ? {} : { logScale: true },
|
|
35813
|
+
...axis2.majorUnit === void 0 ? {} : { majorUnit: axis2.majorUnit },
|
|
35814
|
+
...axis2.minorUnit === void 0 ? {} : { minorUnit: axis2.minorUnit }
|
|
35815
35815
|
};
|
|
35816
35816
|
}
|
|
35817
35817
|
function applyChartAxes(model, chart, color) {
|
|
35818
35818
|
if (!chart.axes?.length) return;
|
|
35819
35819
|
const axes = chart.axes;
|
|
35820
|
-
const linked = axes.filter((
|
|
35820
|
+
const linked = axes.filter((axis2) => axis2.id !== void 0 && chart.axisIds?.includes(axis2.id));
|
|
35821
35821
|
const candidates = linked.length ? linked : axes;
|
|
35822
35822
|
const xy = model.type === "scatter" || model.type === "bubble";
|
|
35823
|
-
const value = candidates.find((
|
|
35823
|
+
const value = candidates.find((axis2) => axis2.kind === "val" && !["b", "t"].includes(axis2.position ?? "")) ?? candidates.find((axis2) => axis2.kind === "val");
|
|
35824
35824
|
const category = candidates.find(
|
|
35825
|
-
(
|
|
35825
|
+
(axis2) => xy ? axis2.kind === "val" && axis2 !== value : axis2.kind === "cat" || axis2.kind === "date"
|
|
35826
35826
|
);
|
|
35827
|
-
const secondary = axes.find((
|
|
35827
|
+
const secondary = axes.find((axis2) => axis2.kind === "val" && axis2 !== value && axis2 !== category);
|
|
35828
35828
|
const paint2 = (shape2) => {
|
|
35829
35829
|
const ln = shape2?.line;
|
|
35830
35830
|
const fill = ln?.fill;
|
|
@@ -35835,8 +35835,8 @@ function applyChartAxes(model, chart, color) {
|
|
|
35835
35835
|
...ln?.dash === void 0 ? {} : { dash: ln.dash }
|
|
35836
35836
|
};
|
|
35837
35837
|
};
|
|
35838
|
-
const bind = (
|
|
35839
|
-
const opts = options(
|
|
35838
|
+
const bind = (axis2, scale, values) => {
|
|
35839
|
+
const opts = options(axis2);
|
|
35840
35840
|
const automatic = opts.logScale ? computeLogValueRange(
|
|
35841
35841
|
[{ values: values ?? [] }],
|
|
35842
35842
|
opts.logBase && Number.isFinite(opts.logBase) && opts.logBase > 1 ? opts.logBase : 10
|
|
@@ -35854,12 +35854,12 @@ function applyChartAxes(model, chart, color) {
|
|
|
35854
35854
|
scale.ticks = generateAxisTicks(range2, opts, 5);
|
|
35855
35855
|
}
|
|
35856
35856
|
return {
|
|
35857
|
-
source:
|
|
35857
|
+
source: axis2,
|
|
35858
35858
|
range: range2,
|
|
35859
35859
|
minorTicks: generateMinorAxisTicks(range2, opts),
|
|
35860
|
-
line: paint2(
|
|
35861
|
-
majorGrid: paint2(
|
|
35862
|
-
minorGrid: paint2(
|
|
35860
|
+
line: paint2(axis2.spPr),
|
|
35861
|
+
majorGrid: paint2(axis2.majorGridlinesSpPr),
|
|
35862
|
+
minorGrid: paint2(axis2.minorGridlinesSpPr)
|
|
35863
35863
|
};
|
|
35864
35864
|
};
|
|
35865
35865
|
const out = {};
|
|
@@ -38146,13 +38146,13 @@ function scatter(model, area, out, size) {
|
|
|
38146
38146
|
s.values.forEach((_, i2) => {
|
|
38147
38147
|
reach = Math.max(reach, radiusOf(s.sizes?.[i2] ?? void 0) ?? 0);
|
|
38148
38148
|
});
|
|
38149
|
-
const widen = (s, length,
|
|
38150
|
-
if (
|
|
38149
|
+
const widen = (s, length, axis2) => {
|
|
38150
|
+
if (axis2?.range.logScale) return s;
|
|
38151
38151
|
const pad4 = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
|
|
38152
38152
|
return {
|
|
38153
38153
|
...s,
|
|
38154
|
-
min:
|
|
38155
|
-
max:
|
|
38154
|
+
min: axis2?.source.scaling.min === void 0 ? s.min - pad4 : s.min,
|
|
38155
|
+
max: axis2?.source.scaling.max === void 0 ? s.max + pad4 : s.max
|
|
38156
38156
|
};
|
|
38157
38157
|
};
|
|
38158
38158
|
const xView = widen(xs, plot.w, model.axes?.category);
|
|
@@ -39485,9 +39485,9 @@ var CATEGORY_ONLY = [
|
|
|
39485
39485
|
"minorTimeUnit"
|
|
39486
39486
|
];
|
|
39487
39487
|
var VALUE_ONLY = ["crossBetween", "displayUnits"];
|
|
39488
|
-
function convertChartAxis(
|
|
39489
|
-
if (
|
|
39490
|
-
const next = structuredClone(
|
|
39488
|
+
function convertChartAxis(axis2, kind) {
|
|
39489
|
+
if (axis2.kind === kind) return axis2;
|
|
39490
|
+
const next = structuredClone(axis2);
|
|
39491
39491
|
next.kind = kind;
|
|
39492
39492
|
if (kind === "val") {
|
|
39493
39493
|
for (const key of CATEGORY_ONLY) delete next[key];
|
|
@@ -39520,7 +39520,7 @@ var SWITCHABLE = {
|
|
|
39520
39520
|
stock: false,
|
|
39521
39521
|
surface: true
|
|
39522
39522
|
};
|
|
39523
|
-
function
|
|
39523
|
+
function chartGroupElement(kind, is3D) {
|
|
39524
39524
|
const match = Object.entries(CHART_GROUP_ELEMENTS).find(
|
|
39525
39525
|
([, value]) => value.kind === kind && value.is3D === is3D
|
|
39526
39526
|
);
|
|
@@ -39536,7 +39536,7 @@ function groupingFor(element4, grouping) {
|
|
|
39536
39536
|
var horizontalBars = (group3) => group3.kind === "bar" && group3.barDirection === "bar";
|
|
39537
39537
|
function newGroup(base, target, series2) {
|
|
39538
39538
|
const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
|
|
39539
|
-
const element4 =
|
|
39539
|
+
const element4 = chartGroupElement(target.kind, is3D);
|
|
39540
39540
|
const group3 = { kind: target.kind, element: element4, is3D, series: series2, axisIds: [] };
|
|
39541
39541
|
const allowed = GROUP_FIELDS[element4] ?? [];
|
|
39542
39542
|
for (const key of allowed)
|
|
@@ -39562,11 +39562,11 @@ function newGroup(base, target, series2) {
|
|
|
39562
39562
|
return group3;
|
|
39563
39563
|
}
|
|
39564
39564
|
function withSeriesAxis(space, group3, axes) {
|
|
39565
|
-
if ((group3.element === "line3DChart" || group3.kind === "surface") && !axes.some((
|
|
39565
|
+
if ((group3.element === "line3DChart" || group3.kind === "surface") && !axes.some((axis2) => axis2.kind === "ser")) {
|
|
39566
39566
|
const id = Math.max(
|
|
39567
39567
|
0,
|
|
39568
39568
|
...[...space.plotArea.axes, ...axes].flatMap(
|
|
39569
|
-
(
|
|
39569
|
+
(axis2) => axis2.id === void 0 ? [] : [axis2.id]
|
|
39570
39570
|
)
|
|
39571
39571
|
) + 1;
|
|
39572
39572
|
axes.push({
|
|
@@ -39586,11 +39586,11 @@ function withSeriesAxis(space, group3, axes) {
|
|
|
39586
39586
|
function groupAxes(space, base, group3) {
|
|
39587
39587
|
if (!groupHasAxes(group3.element)) return [];
|
|
39588
39588
|
const xy = isXYChartKind(group3.kind);
|
|
39589
|
-
const byId = (id) => space.plotArea.axes.find((
|
|
39590
|
-
const old = base.axisIds.map(byId).filter((
|
|
39589
|
+
const byId = (id) => space.plotArea.axes.find((axis2) => axis2.id === id);
|
|
39590
|
+
const old = base.axisIds.map(byId).filter((axis2) => axis2 !== void 0);
|
|
39591
39591
|
if (old.length < 2) {
|
|
39592
39592
|
const taken = new Set(
|
|
39593
|
-
space.plotArea.axes.flatMap((
|
|
39593
|
+
space.plotArea.axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id])
|
|
39594
39594
|
);
|
|
39595
39595
|
const free = DEFAULT_CHART_AXIS_IDS.every((id) => !taken.has(id));
|
|
39596
39596
|
const top = Math.max(0, ...taken);
|
|
@@ -39598,9 +39598,9 @@ function groupAxes(space, base, group3) {
|
|
|
39598
39598
|
return withSeriesAxis(space, group3, defaultChartAxes(horizontalBars(group3), xy, ids));
|
|
39599
39599
|
}
|
|
39600
39600
|
const rotate2 = horizontalBars(base) !== horizontalBars(group3);
|
|
39601
|
-
const axes = old.slice(0, group3.element === "line3DChart" || group3.is3D ? 3 : 2).map((
|
|
39602
|
-
const kind = i2 === 0 ? xy ? "val" :
|
|
39603
|
-
const next = convertChartAxis(
|
|
39601
|
+
const axes = old.slice(0, group3.element === "line3DChart" || group3.is3D ? 3 : 2).map((axis2, i2) => {
|
|
39602
|
+
const kind = i2 === 0 ? xy ? "val" : axis2.kind === "val" ? "cat" : axis2.kind : axis2.kind;
|
|
39603
|
+
const next = convertChartAxis(axis2, kind);
|
|
39604
39604
|
if (rotate2) assignOrDelete(next, "position", rotatedAxisPosition(next.position));
|
|
39605
39605
|
if (i2 === 1 && next.kind === "val" && xy !== isXYChartKind(base.kind))
|
|
39606
39606
|
next.crossBetween = xy ? "midCat" : "between";
|
|
@@ -39625,7 +39625,7 @@ function setChartType(space, target) {
|
|
|
39625
39625
|
if (group3.is3D && target.kind === "bar" && group3.grouping === "standard" && base.axisIds.length < 3)
|
|
39626
39626
|
group3.grouping = "clustered";
|
|
39627
39627
|
const axes = groupAxes(draft, base, group3);
|
|
39628
|
-
group3.axisIds = axes.flatMap((
|
|
39628
|
+
group3.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
|
|
39629
39629
|
draft.plotArea.groups = [group3];
|
|
39630
39630
|
draft.plotArea.axes = axes;
|
|
39631
39631
|
if (!group3.is3D) {
|
|
@@ -39638,6 +39638,20 @@ function setChartType(space, target) {
|
|
|
39638
39638
|
});
|
|
39639
39639
|
}
|
|
39640
39640
|
|
|
39641
|
+
// chart/edit/group-options.ts
|
|
39642
|
+
var RANGES = {
|
|
39643
|
+
gapWidth: [0, 500],
|
|
39644
|
+
overlap: [-100, 100],
|
|
39645
|
+
firstSliceAngle: [0, 360],
|
|
39646
|
+
holeSize: [1, 90]
|
|
39647
|
+
};
|
|
39648
|
+
var isChartGroupOption = (key) => Object.hasOwn(RANGES, key);
|
|
39649
|
+
function assertChartGroupOption(key, value) {
|
|
39650
|
+
const [min, max] = RANGES[key];
|
|
39651
|
+
if (!Number.isInteger(value) || value < min || value > max)
|
|
39652
|
+
throw new RangeError(`Chart ${key} must be a whole number from ${min} to ${max}`);
|
|
39653
|
+
}
|
|
39654
|
+
|
|
39641
39655
|
// chart/edit/data-sheet.ts
|
|
39642
39656
|
function chartSpaceDataSheet(space) {
|
|
39643
39657
|
const entries = chartSeriesEntries(space);
|
|
@@ -39716,6 +39730,58 @@ function applyChartSpaceDataSheetEdits(space, edits) {
|
|
|
39716
39730
|
return editChartSpace(next, (draft) => applyStandardChartLayout(draft, layoutSheet, count));
|
|
39717
39731
|
}
|
|
39718
39732
|
|
|
39733
|
+
// chart/edit/new-chart-minimal.ts
|
|
39734
|
+
var VARIED = /* @__PURE__ */ new Set(["pie", "doughnut", "ofPie"]);
|
|
39735
|
+
function schemaGrouping(element4, grouping) {
|
|
39736
|
+
const bar = element4 === "barChart" || element4 === "bar3DChart";
|
|
39737
|
+
if (bar) return grouping ?? "clustered";
|
|
39738
|
+
return grouping === void 0 || grouping === "clustered" ? "standard" : grouping;
|
|
39739
|
+
}
|
|
39740
|
+
function minimalChartGroup(target, series2) {
|
|
39741
|
+
const is3D = target.is3D ?? false;
|
|
39742
|
+
const element4 = chartGroupElement(target.kind, is3D);
|
|
39743
|
+
const allowed = GROUP_FIELDS[element4] ?? [];
|
|
39744
|
+
const own2 = isXYChartKind(target.kind) ? series2.map((item2) => stripSeriesForKind(item2, "bar", target.kind)) : series2;
|
|
39745
|
+
const group3 = { kind: target.kind, element: element4, is3D, series: own2, axisIds: [] };
|
|
39746
|
+
if (target.kind === "bar") group3.barDirection = target.barDirection ?? "col";
|
|
39747
|
+
if (allowed.includes("grouping")) group3.grouping = schemaGrouping(element4, target.grouping);
|
|
39748
|
+
if (allowed.includes("varyColors")) group3.varyColors = VARIED.has(target.kind);
|
|
39749
|
+
if (target.kind === "ofPie") group3.ofPieType = "pie";
|
|
39750
|
+
if (target.kind === "scatter") group3.scatterStyle = "lineMarker";
|
|
39751
|
+
if (target.kind === "radar") group3.radarStyle = "marker";
|
|
39752
|
+
return group3;
|
|
39753
|
+
}
|
|
39754
|
+
function axis(kind, id, crossAxisId, position2) {
|
|
39755
|
+
return {
|
|
39756
|
+
kind,
|
|
39757
|
+
id,
|
|
39758
|
+
crossAxisId,
|
|
39759
|
+
position: position2,
|
|
39760
|
+
scaling: { orientation: "minMax" },
|
|
39761
|
+
deleted: false,
|
|
39762
|
+
majorGridlines: false,
|
|
39763
|
+
minorGridlines: false
|
|
39764
|
+
};
|
|
39765
|
+
}
|
|
39766
|
+
function minimalChartAxes(group3, ids) {
|
|
39767
|
+
if (!groupHasAxes(group3.element)) return [];
|
|
39768
|
+
const [first3, second, third] = ids;
|
|
39769
|
+
const horizontal = group3.kind === "bar" && group3.barDirection === "bar";
|
|
39770
|
+
const axes = [
|
|
39771
|
+
axis(isXYChartKind(group3.kind) ? "val" : "cat", first3, second, horizontal ? "l" : "b"),
|
|
39772
|
+
axis("val", second, first3, horizontal ? "b" : "l")
|
|
39773
|
+
];
|
|
39774
|
+
if (group3.element === "line3DChart" || group3.kind === "surface")
|
|
39775
|
+
axes.push(axis("ser", third, second, "b"));
|
|
39776
|
+
return axes;
|
|
39777
|
+
}
|
|
39778
|
+
function minimalChartTitle(text2) {
|
|
39779
|
+
const rich = chartTextBodyFromXml(
|
|
39780
|
+
`<a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${escapeText2(text2)}</a:t></a:r></a:p>`
|
|
39781
|
+
);
|
|
39782
|
+
return { tx: { rich, text: rich.text }, text: rich.text, overlay: false };
|
|
39783
|
+
}
|
|
39784
|
+
|
|
39719
39785
|
// chart/edit/new-chart.ts
|
|
39720
39786
|
var DEFAULT_CHART_DATA_SHEET = {
|
|
39721
39787
|
categories: ["Category 1", "Category 2", "Category 3", "Category 4"],
|
|
@@ -39725,21 +39791,84 @@ var DEFAULT_CHART_DATA_SHEET = {
|
|
|
39725
39791
|
{ name: "Series 3", values: [2, 2, 3, 5] }
|
|
39726
39792
|
]
|
|
39727
39793
|
};
|
|
39728
|
-
|
|
39794
|
+
var CATEGORY_ONLY2 = [
|
|
39795
|
+
"labelAlign",
|
|
39796
|
+
"noMultiLevelLabels",
|
|
39797
|
+
"tickLabelSkip",
|
|
39798
|
+
"tickMarkSkip"
|
|
39799
|
+
];
|
|
39800
|
+
function withDateAxis(space) {
|
|
39801
|
+
return editChartSpace(space, (draft) => {
|
|
39802
|
+
const axis2 = draft.plotArea.axes[0];
|
|
39803
|
+
if (axis2?.kind !== "cat") return;
|
|
39804
|
+
axis2.kind = "date";
|
|
39805
|
+
for (const key of CATEGORY_ONLY2) delete axis2[key];
|
|
39806
|
+
});
|
|
39807
|
+
}
|
|
39808
|
+
function series(sheet, index, options2, sheetName) {
|
|
39729
39809
|
const entry2 = sheet.series[index];
|
|
39810
|
+
if (options2.data === "literal")
|
|
39811
|
+
return {
|
|
39812
|
+
index,
|
|
39813
|
+
order: index,
|
|
39814
|
+
tx: { value: entry2.name, text: entry2.name },
|
|
39815
|
+
...options2.profile === "minimal" ? {} : { invertIfNegative: false },
|
|
39816
|
+
dataPoints: [],
|
|
39817
|
+
categories: categorySource(sheet.categories, void 0),
|
|
39818
|
+
values: numberSource(entry2.values, void 0)
|
|
39819
|
+
};
|
|
39730
39820
|
const formulas = standardChartFormulas(sheetName, index, sheet.categories.length);
|
|
39731
39821
|
return {
|
|
39732
39822
|
index,
|
|
39733
39823
|
order: index,
|
|
39734
39824
|
tx: { reference: categorySource([entry2.name], void 0, formulas.name), text: entry2.name },
|
|
39735
|
-
invertIfNegative: false,
|
|
39825
|
+
...options2.profile === "minimal" ? {} : { invertIfNegative: false },
|
|
39736
39826
|
dataPoints: [],
|
|
39737
39827
|
categories: categorySource(sheet.categories, void 0, formulas.categories),
|
|
39738
39828
|
values: numberSource(entry2.values, void 0, formulas.values)
|
|
39739
39829
|
};
|
|
39740
39830
|
}
|
|
39741
|
-
function
|
|
39742
|
-
const
|
|
39831
|
+
function axisIds(options2) {
|
|
39832
|
+
const ids = options2.axisIds ?? [];
|
|
39833
|
+
const [first3, second, third] = [
|
|
39834
|
+
ids[0] ?? DEFAULT_CHART_AXIS_IDS[0],
|
|
39835
|
+
ids[1] ?? DEFAULT_CHART_AXIS_IDS[1],
|
|
39836
|
+
ids[2] ?? DEFAULT_CHART_AXIS_IDS[1] + 1
|
|
39837
|
+
];
|
|
39838
|
+
for (const id of [first3, second, third])
|
|
39839
|
+
if (!Number.isSafeInteger(id) || id < 0)
|
|
39840
|
+
throw new RangeError("Chart axis ids must be non-negative whole numbers");
|
|
39841
|
+
if ((/* @__PURE__ */ new Set([first3, second, third])).size !== 3)
|
|
39842
|
+
throw new RangeError("Chart axis ids must differ");
|
|
39843
|
+
return [first3, second, third];
|
|
39844
|
+
}
|
|
39845
|
+
function withAxisIds(space, ids) {
|
|
39846
|
+
return editChartSpace(space, (draft) => {
|
|
39847
|
+
const map = /* @__PURE__ */ new Map();
|
|
39848
|
+
draft.plotArea.axes.forEach((axis2, position2) => {
|
|
39849
|
+
if (axis2.id !== void 0 && ids[position2] !== void 0) map.set(axis2.id, ids[position2]);
|
|
39850
|
+
});
|
|
39851
|
+
const renumber = (id) => map.get(id) ?? id;
|
|
39852
|
+
for (const axis2 of draft.plotArea.axes) {
|
|
39853
|
+
if (axis2.id !== void 0) axis2.id = renumber(axis2.id);
|
|
39854
|
+
if (axis2.crossAxisId !== void 0) axis2.crossAxisId = renumber(axis2.crossAxisId);
|
|
39855
|
+
}
|
|
39856
|
+
for (const group3 of draft.plotArea.groups) group3.axisIds = group3.axisIds.map(renumber);
|
|
39857
|
+
});
|
|
39858
|
+
}
|
|
39859
|
+
function withGroupSettings(space, settings) {
|
|
39860
|
+
return editChartSpace(space, (draft) => {
|
|
39861
|
+
const group3 = draft.plotArea.groups[0];
|
|
39862
|
+
const allowed = GROUP_FIELDS[group3.element] ?? [];
|
|
39863
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
39864
|
+
if (value === void 0) continue;
|
|
39865
|
+
if (!allowed.includes(key)) throw new RangeError(`A ${group3.element} has no ${key} setting`);
|
|
39866
|
+
if (isChartGroupOption(key)) assertChartGroupOption(key, value);
|
|
39867
|
+
Object.assign(group3, { [key]: structuredClone(value) });
|
|
39868
|
+
}
|
|
39869
|
+
});
|
|
39870
|
+
}
|
|
39871
|
+
function officeChartSpace(sheet, target, options2, sheetName) {
|
|
39743
39872
|
const group3 = {
|
|
39744
39873
|
kind: "bar",
|
|
39745
39874
|
element: "barChart",
|
|
@@ -39749,10 +39878,10 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
|
|
|
39749
39878
|
varyColors: false,
|
|
39750
39879
|
gapWidth: 219,
|
|
39751
39880
|
overlap: -27,
|
|
39752
|
-
series: sheet.series.map((_, index) => series(sheet, index, sheetName)),
|
|
39881
|
+
series: sheet.series.map((_, index) => series(sheet, index, options2, sheetName)),
|
|
39753
39882
|
axisIds: [...DEFAULT_CHART_AXIS_IDS]
|
|
39754
39883
|
};
|
|
39755
|
-
|
|
39884
|
+
const space = {
|
|
39756
39885
|
roundedCorners: false,
|
|
39757
39886
|
autoTitleDeleted: options2.title === void 0,
|
|
39758
39887
|
plotArea: { layout: {}, groups: [group3], axes: defaultChartAxes(false, false) },
|
|
@@ -39761,9 +39890,36 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
|
|
|
39761
39890
|
};
|
|
39762
39891
|
const column = !target || target.kind === "bar" && (target.barDirection ?? "col") === "col";
|
|
39763
39892
|
if (target && !(column && !target.is3D && (target.grouping ?? "clustered") === "clustered"))
|
|
39764
|
-
|
|
39765
|
-
|
|
39766
|
-
|
|
39893
|
+
return setChartType(space, target);
|
|
39894
|
+
return space;
|
|
39895
|
+
}
|
|
39896
|
+
function minimalChartSpace(sheet, target, options2, sheetName) {
|
|
39897
|
+
const group3 = minimalChartGroup(
|
|
39898
|
+
target ?? { kind: "bar" },
|
|
39899
|
+
sheet.series.map((_, index) => series(sheet, index, options2, sheetName))
|
|
39900
|
+
);
|
|
39901
|
+
if (group3.kind === "stock" && ![3, 4].includes(group3.series.length))
|
|
39902
|
+
throw new RangeError("A stock chart requires three or four price series");
|
|
39903
|
+
const axes = minimalChartAxes(group3, axisIds(options2));
|
|
39904
|
+
group3.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
|
|
39905
|
+
return {
|
|
39906
|
+
autoTitleDeleted: options2.title === void 0,
|
|
39907
|
+
plotArea: { layout: {}, groups: [group3], axes },
|
|
39908
|
+
plotVisibleOnly: true,
|
|
39909
|
+
displayBlanksAs: "gap"
|
|
39910
|
+
};
|
|
39911
|
+
}
|
|
39912
|
+
function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {}) {
|
|
39913
|
+
const sheetName = options2.sheetName ?? DEFAULT_CHART_SHEET_NAME;
|
|
39914
|
+
let space = options2.profile === "minimal" ? minimalChartSpace(sheet, target, options2, sheetName) : officeChartSpace(sheet, target, options2, sheetName);
|
|
39915
|
+
if (options2.profile !== "minimal" && options2.axisIds !== void 0)
|
|
39916
|
+
space = withAxisIds(space, axisIds(options2));
|
|
39917
|
+
if (options2.dateAxis) space = withDateAxis(space);
|
|
39918
|
+
if (options2.group) space = withGroupSettings(space, options2.group);
|
|
39919
|
+
if (options2.title !== void 0)
|
|
39920
|
+
space = options2.profile === "minimal" ? { ...space, title: minimalChartTitle(options2.title), autoTitleDeleted: false } : setChartTitle(space, options2.title);
|
|
39921
|
+
const legend = options2.legendPosition === void 0 ? "b" : options2.legendPosition;
|
|
39922
|
+
return legend === null ? space : setChartLegend(space, { position: legend });
|
|
39767
39923
|
}
|
|
39768
39924
|
|
|
39769
39925
|
// chart/workbook/package-save.ts
|
|
@@ -40413,8 +40569,8 @@ function wrapElement(doc, placement) {
|
|
|
40413
40569
|
return el2(doc, WP_NS3, "wp:wrapNone");
|
|
40414
40570
|
}
|
|
40415
40571
|
}
|
|
40416
|
-
function position(doc,
|
|
40417
|
-
const node = attrs2(el2(doc, WP_NS3, `wp:position${
|
|
40572
|
+
function position(doc, axis2, relativeFrom, align, offsetPx) {
|
|
40573
|
+
const node = attrs2(el2(doc, WP_NS3, `wp:position${axis2}`), { relativeFrom });
|
|
40418
40574
|
if (align) {
|
|
40419
40575
|
const a2 = el2(doc, WP_NS3, "wp:align");
|
|
40420
40576
|
a2.textContent = align;
|