@office-kit/pptx-preview 0.9.4 → 0.9.6
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/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MONO, c as TIMES, d as substituteFamily, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout } from "./src-
|
|
1
|
+
import { a as MONO, c as TIMES, d as substituteFamily, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout } from "./src-Co9vu5ZE.js";
|
|
2
2
|
export { ARIAL, MONO, SANS, SERIF, TIMES, auditTextLayout, defaultMeasurer, renderSlideSvg as renderSlideToSvg, substituteFamily };
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as MONO, c as TIMES, d as substituteFamily, i as AVG_GLYPH_W_RATIO, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout, u as isCjk } from "./src-
|
|
1
|
+
import { a as MONO, c as TIMES, d as substituteFamily, i as AVG_GLYPH_W_RATIO, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout, u as isCjk } from "./src-Co9vu5ZE.js";
|
|
2
2
|
import { getSlideSize } from "@office-kit/pptx";
|
|
3
3
|
import { Resvg } from "@resvg/resvg-js";
|
|
4
4
|
import * as fontkit from "fontkit";
|
|
@@ -3164,7 +3164,7 @@ const renderColumnChart = (f, spec, colors) => {
|
|
|
3164
3164
|
const top = f.plotY + f.plotH - (v - min) / range * f.plotH;
|
|
3165
3165
|
const y0 = Math.min(top, baseY);
|
|
3166
3166
|
const h = Math.abs(top - baseY);
|
|
3167
|
-
const baseColor = spec.varyColors && spec.series.length === 1 ? colors[c % colors.length] : spec.series[s]?.color ?? colors[s % colors.length];
|
|
3167
|
+
const baseColor = spec.series[s]?.pointColors?.[c] ?? (spec.varyColors && spec.series.length === 1 ? colors[c % colors.length] : spec.series[s]?.color ?? colors[s % colors.length]);
|
|
3168
3168
|
const fillColor = v < 0 && spec.series[s]?.invertIfNegative ? mixHex(baseColor, "#000000", .55) : baseColor;
|
|
3169
3169
|
out.push(`<rect x="${px(x0)}" y="${px(y0)}" width="${px(barW)}" height="${px(h)}" fill="${fillColor}"/>`);
|
|
3170
3170
|
if (showLabelFor(s)) {
|
|
@@ -3407,7 +3407,7 @@ const renderBarChart = (f, spec, colors) => {
|
|
|
3407
3407
|
const tip = f.plotX + (v - min) / range * f.plotW;
|
|
3408
3408
|
const x0 = Math.min(tip, baseX);
|
|
3409
3409
|
const w = Math.abs(tip - baseX);
|
|
3410
|
-
const baseColor = spec.varyColors && spec.series.length === 1 ? colors[c % colors.length] : spec.series[s]?.color ?? colors[s % colors.length];
|
|
3410
|
+
const baseColor = spec.series[s]?.pointColors?.[c] ?? (spec.varyColors && spec.series.length === 1 ? colors[c % colors.length] : spec.series[s]?.color ?? colors[s % colors.length]);
|
|
3411
3411
|
const fillColor = v < 0 && spec.series[s]?.invertIfNegative ? mixHex(baseColor, "#000000", .55) : baseColor;
|
|
3412
3412
|
out.push(`<rect x="${px(x0)}" y="${px(y0)}" width="${px(w)}" height="${px(barH)}" fill="${fillColor}"/>`);
|
|
3413
3413
|
if (showLabelForBar(s)) {
|
|
@@ -3745,6 +3745,8 @@ const renderScatterChart = (f, spec, colors) => {
|
|
|
3745
3745
|
if (allX.length === 0) return "";
|
|
3746
3746
|
const xB = scatterAxisBounds(allX);
|
|
3747
3747
|
const yB = scatterAxisBounds(allY);
|
|
3748
|
+
if (spec.categoryAxisScaling?.min !== void 0) xB.min = spec.categoryAxisScaling.min;
|
|
3749
|
+
if (spec.categoryAxisScaling?.max !== void 0) xB.max = spec.categoryAxisScaling.max;
|
|
3748
3750
|
if (spec.valueAxis?.min !== void 0) yB.min = spec.valueAxis.min;
|
|
3749
3751
|
if (spec.valueAxis?.max !== void 0) yB.max = spec.valueAxis.max;
|
|
3750
3752
|
const xRange = xB.max - xB.min || 1;
|
|
@@ -3790,6 +3792,8 @@ const renderBubbleChart = (f, spec, colors) => {
|
|
|
3790
3792
|
if (allX.length === 0) return "";
|
|
3791
3793
|
const xB = scatterAxisBounds(allX);
|
|
3792
3794
|
const yB = scatterAxisBounds(allY);
|
|
3795
|
+
if (spec.categoryAxisScaling?.min !== void 0) xB.min = spec.categoryAxisScaling.min;
|
|
3796
|
+
if (spec.categoryAxisScaling?.max !== void 0) xB.max = spec.categoryAxisScaling.max;
|
|
3793
3797
|
if (spec.valueAxis?.min !== void 0) yB.min = spec.valueAxis.min;
|
|
3794
3798
|
if (spec.valueAxis?.max !== void 0) yB.max = spec.valueAxis.max;
|
|
3795
3799
|
const xRange = xB.max - xB.min || 1;
|
|
@@ -3891,6 +3895,14 @@ const renderChart = (shape, x, y, w, h, transform, theme) => {
|
|
|
3891
3895
|
return null;
|
|
3892
3896
|
}
|
|
3893
3897
|
if (!spec) return null;
|
|
3898
|
+
if (spec.kind === "stock") spec = {
|
|
3899
|
+
...spec,
|
|
3900
|
+
kind: "line"
|
|
3901
|
+
};
|
|
3902
|
+
else if (spec.kind === "surface") spec = {
|
|
3903
|
+
...spec,
|
|
3904
|
+
kind: "column"
|
|
3905
|
+
};
|
|
3894
3906
|
const colors = accentSequence(theme);
|
|
3895
3907
|
const isCartesian = spec.kind === "column" || spec.kind === "bar" || spec.kind === "line" || spec.kind === "area";
|
|
3896
3908
|
const hasAxes = isCartesian || spec.kind === "scatter" || spec.kind === "bubble";
|
|
@@ -4951,4 +4963,4 @@ const auditTextLayout = (pres, options = {}) => {
|
|
|
4951
4963
|
//#endregion
|
|
4952
4964
|
export { MONO as a, TIMES as c, substituteFamily as d, AVG_GLYPH_W_RATIO as i, defaultMeasurer as l, renderSlideSvg as n, SANS as o, ARIAL as r, SERIF as s, auditTextLayout as t, isCjk as u };
|
|
4953
4965
|
|
|
4954
|
-
//# sourceMappingURL=src-
|
|
4966
|
+
//# sourceMappingURL=src-Co9vu5ZE.js.map
|