@baravak/risloo-profile-cli 4.82.0 → 4.84.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/AGENTS.md CHANGED
@@ -183,6 +183,27 @@ get dimensions() {
183
183
 
184
184
  Padding is layout metadata. Do not apply the same padding again inside the HBS when the layout already owns it.
185
185
 
186
+ #### Subtract the 20 px the layout already owns — every page must resolve to 903 × 714
187
+
188
+ The designs are drawn on a **943 × 754** page, but `layout.hbs` insets the profile `<svg>` by `canvas.profile.padding` (**20 px**) on every side, so the real with-sidebar drawing area is **903 × 714**. Padding is therefore the Chart's inset inside the design page **minus that 20 px**:
189
+
190
+ ```js
191
+ padding: {
192
+ x: (943 - CHART_WIDTH) / 2 - 20,
193
+ y: (754 - CHART_HEIGHT) / 2 - 20,
194
+ },
195
+ ```
196
+
197
+ so `dimensions` comes out at exactly `903 × 714`. Use the Chart's *measured* inset instead of `/2` whenever the Chart is not centred on the design page — the `− 20` still applies.
198
+
199
+ This is not cosmetic. The inner `<svg>` uses the default `preserveAspectRatio="xMidYMid meet"`, so a `943 × 754` viewBox is **shrunk to fit at 0.9469** — the whole page, text and geometry included — while `903 × 714` renders at **scale 1**. Check it after every render:
200
+
201
+ ```bash
202
+ grep -A4 '<svg x=' temp/<NAME>.svg # width/height must equal the viewBox in the with-sidebar variant
203
+ ```
204
+
205
+ The raw variant is a different box and legitimately renders at ~1.056; only the with-sidebar variant is the scale-1 target.
206
+
186
207
  Never introduce a conventional `translate(20,20)`, arbitrary centering transform, or scale. Add an inner translation only when that offset visibly belongs to the Chart layer and is measured from an authorized source.
187
208
 
188
209
  Fix geometry at the layer that owns the error:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baravak/risloo-profile-cli",
3
- "version": "4.82.0",
3
+ "version": "4.84.0",
4
4
  "description": "**Risloo Profile CLI** is a library for creating profiles, reports and sheets for *psychological* samples.",
5
5
  "main": "bin/risloo.js",
6
6
  "publishConfig": {