@openpresentation/opf-render 0.19.1 → 0.20.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/dist/charts.js +3 -4
- package/dist/svg.js +3 -3
- package/package.json +5 -5
package/dist/charts.js
CHANGED
|
@@ -723,12 +723,11 @@ function renderCategoryChart(c, spec) {
|
|
|
723
723
|
const rtl = c.bound.geometry?.direction === "rtl" && !horizontal;
|
|
724
724
|
const categorySlot = (i) => rtl ? count - 1 - i : i;
|
|
725
725
|
const stacks = stackCategoryValues(series, count, spec.kind, spec.grouping, c.path);
|
|
726
|
-
//
|
|
727
|
-
//
|
|
728
|
-
// `from`, which must not force zero onto the axis, and a line plots `to` alone.
|
|
726
|
+
// Bar/column lengths and filled areas encode magnitude and must include zero even for near-equal
|
|
727
|
+
// values. Lines retain their existing automatic domain; stacked extents retain totals.
|
|
729
728
|
const stackedGrouping = spec.grouping === "stacked" || percent;
|
|
730
729
|
const extents = stacks.flat().filter(Boolean).flatMap((point) => spec.kind === "line" || !stackedGrouping ? [point.to] : [point.from, point.to]);
|
|
731
|
-
const dataMin = extents.length ? Math.min(...extents) : 0, dataMax = extents.length ? Math.max(...extents) : 1;
|
|
730
|
+
const dataMin = extents.length ? Math.min(...extents, ...((spec.kind === "bar" || spec.kind === "area") ? [0] : [])) : 0, dataMax = extents.length ? Math.max(...extents, ...((spec.kind === "bar" || spec.kind === "area") ? [0] : [])) : 1;
|
|
732
731
|
const legendWidth = seriesLegend(c, series, spec.kind === "line" ? "line" : undefined, spec.markers);
|
|
733
732
|
const right = box.x + box.width - pad - legendWidth;
|
|
734
733
|
const top = box.y + pad + c.lineHeight / 2;
|
package/dist/svg.js
CHANGED
|
@@ -380,7 +380,7 @@ function resolveDesign(presentation, slide, slideContext) {
|
|
|
380
380
|
accent,
|
|
381
381
|
hyperlink: roles.hyperlink,
|
|
382
382
|
followedHyperlink: roles.followedHyperlink,
|
|
383
|
-
border:
|
|
383
|
+
border: roles.border
|
|
384
384
|
},
|
|
385
385
|
fonts: { ...composeOptions.fontFamilies },
|
|
386
386
|
darkBackground,
|
|
@@ -1459,7 +1459,7 @@ function renderTimeline(item, box, bound, options) {
|
|
|
1459
1459
|
|
|
1460
1460
|
function renderTable(item, box, bound, options) {
|
|
1461
1461
|
const scale = Math.min(bound.design.dimensions.width, bound.design.dimensions.height) / 720;
|
|
1462
|
-
const layout = layoutTable(item.value, box, {scale, minFontSize:(bound.composition ?? bound.geometry.composition).minFontSize, fontFamily:bound.design.fonts.body, ...(bound.design.fonts.code ? {codeFontFamily:bound.design.fonts.code} : {}), textMeasurement:options.textMeasurement, path:item.path, presentation:bound.presentation, ...(bound.geometry?.direction === "rtl" ? {direction:"rtl"} : {})});
|
|
1462
|
+
const layout = layoutTable(item.value, box, {scale, minFontSize:(bound.composition ?? bound.geometry.composition).minFontSize, fontFamily:bound.design.fonts.body, ...(bound.design.fonts.code ? {codeFontFamily:bound.design.fonts.code} : {}), textMeasurement:options.textMeasurement, path:item.path, presentation:bound.presentation, alignment:bound.geometry.design.contentAlignment, ...(bound.geometry?.direction === "rtl" ? {direction:"rtl"} : {})});
|
|
1463
1463
|
const children = [];
|
|
1464
1464
|
// RR-54: a dataset table has no rows or columns of its own to point at; every cell reports the table's authored path.
|
|
1465
1465
|
const own = isDatasetTable(item, bound) ? () => item.path : (path) => path;
|
|
@@ -1495,7 +1495,7 @@ function renderTable(item, box, bound, options) {
|
|
|
1495
1495
|
children.push((cell.rich ? renderRichTextBox : renderTextBox)(cell.rich ? cell.value : flattenText(cell.value ?? ""), cell.textBox, bound, {
|
|
1496
1496
|
path:own(cell.path), fontSize:15, fontFamily:bound.design.fonts.body,
|
|
1497
1497
|
fontWeight:cell.header ? 700 : 400, textStyle:cell.textStyle, fit:cell.fit,
|
|
1498
|
-
fill:textFill, align:
|
|
1498
|
+
fill:textFill, align:cell.alignment, options
|
|
1499
1499
|
}));
|
|
1500
1500
|
}
|
|
1501
1501
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpresentation/opf-render",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "Deterministic local OPF renderer for SVG, PNG, and PDF output.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"test:forced-colors-browser": "node test/forced-colors-browser.mjs artifacts/forced-colors"
|
|
143
143
|
},
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@openpresentation/opf": "^0.
|
|
145
|
+
"@openpresentation/opf": "^0.20.2",
|
|
146
146
|
"bidi-js": "1.1.0",
|
|
147
147
|
"fontkit": "^2.0.4",
|
|
148
148
|
"harfbuzzjs": "1.6.3",
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
}
|
|
342
342
|
},
|
|
343
343
|
"devDependencies": {
|
|
344
|
-
"@openpresentation/gallery": "^
|
|
344
|
+
"@openpresentation/gallery": "^3.0.0",
|
|
345
345
|
"@expo-google-fonts/arimo": "0.4.3",
|
|
346
346
|
"@expo-google-fonts/caladea": "0.4.2",
|
|
347
347
|
"@expo-google-fonts/cousine": "0.4.3",
|
|
@@ -388,13 +388,13 @@
|
|
|
388
388
|
"@expo-google-fonts/tinos": "0.4.2",
|
|
389
389
|
"@hyzyla/pdfium": "2.1.13",
|
|
390
390
|
"@jspawn/qpdf-wasm": "0.0.2",
|
|
391
|
-
"@napi-rs/canvas": "1.0.
|
|
391
|
+
"@napi-rs/canvas": "1.0.11",
|
|
392
392
|
"@resvg/resvg-js": "2.6.2",
|
|
393
393
|
"axe-core": "4.14.0",
|
|
394
394
|
"esbuild": "0.28.2",
|
|
395
395
|
"pdf-lib": "1.17.1",
|
|
396
396
|
"pdfjs-dist": "6.4.299",
|
|
397
|
-
"playwright": "1.
|
|
397
|
+
"playwright": "1.64.0",
|
|
398
398
|
"sharp": "0.35.5"
|
|
399
399
|
},
|
|
400
400
|
"bin": {
|