@openpresentation/opf-render 0.35.0 → 0.35.1

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.
@@ -56,7 +56,9 @@ export function reserveAxisTitles(c, spec, titles) {
56
56
  /**
57
57
  * Draw the axis titles after the chart: the bottom title centered under the plot, the left title rotated 270 degrees
58
58
  * (reading upwards, as PowerPoint draws a vertical axis title) and centered on the plot. `c.plotArea` is the plot the
59
- * renderer laid out; without one the title centers on the reserved band.
59
+ * renderer laid out; without one the title centers on the reserved band. A bar chart drawn on a table's rows (LH-115, `c.alignedRows`)
60
+ * has a plot shorter than its box: its bottom title sits right under the tick labels (core keeps the chart's parts together around the
61
+ * rows, as PowerPoint sets an axis title beside its axis), not at the foot of the box.
60
62
  */
61
63
  export function drawAxisTitles(c) {
62
64
  if (!c.axisTitleBands?.length) return;
@@ -65,7 +67,9 @@ export function drawAxisTitles(c) {
65
67
  const path = `${c.path}.axisTitles.${axis}`;
66
68
  if (side === "bottom") {
67
69
  const span = plot ? { x: plot.x, width: plot.width } : { x: inner.x, width: inner.width };
68
- const rect = { x: span.x, y: outer.y + outer.height - c.lineHeight, width: span.width, height: c.lineHeight };
70
+ const foot = outer.y + outer.height - c.lineHeight;
71
+ const y = c.alignedRows && plot ? Math.min(foot, plot.y + plot.height + (c.valueAxisHidden ? 0 : c.lineHeight)) : foot;
72
+ const rect = { x: span.x, y, width: span.width, height: c.lineHeight };
69
73
  c.text(text, rect, path, "center");
70
74
  } else {
71
75
  const span = plot ? { y: plot.y, height: plot.height } : { y: inner.y, height: inner.height };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpresentation/opf-render",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "description": "Deterministic local OPF renderer for SVG, PNG, and PDF output.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -94,7 +94,7 @@
94
94
  "fontkit": "^3.0.0",
95
95
  "harfbuzzjs": "1.6.4",
96
96
  "pako": "3.0.3",
97
- "@openpresentation/opf": "^0.35.0"
97
+ "@openpresentation/opf": "^0.35.1"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@expo-google-fonts/arimo": "0.4.3",
@@ -343,7 +343,7 @@
343
343
  "pdfjs-dist": "6.5.438",
344
344
  "playwright": "1.65.0",
345
345
  "sharp": "0.35.5",
346
- "@openpresentation/gallery": "0.35.0"
346
+ "@openpresentation/gallery": "0.35.1"
347
347
  },
348
348
  "bin": {
349
349
  "opf-preview-fonts": "./dist/preview-fonts-cli.js"
@@ -400,5 +400,5 @@
400
400
  "test:preview-a11y-browser": "node test/preview-a11y-browser.mjs",
401
401
  "test:forced-colors-browser": "node test/forced-colors-browser.mjs artifacts/forced-colors"
402
402
  },
403
- "gitHead": "7697b266464772a98b57070b0937938d3a12852d"
403
+ "gitHead": "f701ad61e2b608ac7df2cfd76c5ab52272be6200"
404
404
  }