@baravak/risloo-profile-cli 4.75.0 → 4.78.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baravak/risloo-profile-cli",
3
- "version": "4.75.0",
3
+ "version": "4.78.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": {
@@ -58,14 +58,44 @@ class BSSI93 extends Profile {
58
58
  const end = FS.toRadians(180); // 100% at left (9 o'clock)
59
59
  total.zeta = total.p * (end - start) + start; // clockwise 270° sweep
60
60
 
61
- // --- Factors (vertical bars, left → right) ---
62
- // Domain names are drawn under each bar; 2-line ones split as in the design.
63
- const lines = [["تمایل به مرگ"], ["آمادگی برای", "خودکشی"], ["تمایل به", "خودکشی واقعی"]];
64
- const factors = [packItem(s[2], s[3]), packItem(s[4], s[5]), packItem(s[6], s[7])].map((f, i) => ({
65
- ...f,
66
- cx: 120 + i * 100, // bar centres: 120, 220, 320
67
- trackLeft: 106 + i * 100, // track/bar left edges: 106, 206, 306
68
- lines: lines[i],
61
+ // --- Factors (visual order, left → right) ---
62
+ // The scientific score keys stay unchanged. The design places the intent
63
+ // score in the middle slot and the preparation score in the right slot.
64
+ const factorSpecs = [
65
+ {
66
+ raw: s[2],
67
+ percentage: s[3],
68
+ cx: 120,
69
+ trackLeft: 106,
70
+ scoreX: 120.5,
71
+ lines: [{ text: "تمایل به مرگ", x: 120, y: 351.5 }],
72
+ },
73
+ {
74
+ raw: s[6],
75
+ percentage: s[7],
76
+ cx: 220,
77
+ trackLeft: 206,
78
+ scoreX: 221.5,
79
+ lines: [
80
+ { text: "آمادگی برای", x: 219.5, y: 351.5 },
81
+ { text: "خودکشی", x: 219, y: 368 },
82
+ ],
83
+ },
84
+ {
85
+ raw: s[4],
86
+ percentage: s[5],
87
+ cx: 320,
88
+ trackLeft: 306,
89
+ scoreX: 322,
90
+ lines: [
91
+ { text: "تمایل به", x: 322, y: 352.5 },
92
+ { text: "خودکشی واقعی", x: 322, y: 368 },
93
+ ],
94
+ },
95
+ ];
96
+ const factors = factorSpecs.map(({ raw, percentage, ...geometry }) => ({
97
+ ...packItem(raw, percentage),
98
+ ...geometry,
69
99
  }));
70
100
 
71
101
  return [{ total, factors }];
@@ -47,8 +47,8 @@
47
47
  <line x1="69.5" y1="102.5" x2="408.5" y2="102.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
48
48
  <line x1="69.5" y1="177.5" x2="408.5" y2="177.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
49
49
  <line x1="69.5" y1="252.5" x2="408.5" y2="252.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
50
- <text x="53" y="27.5" text-anchor="end" dy=".35em" font-size="12" fill="#94A3B8" direction="ltr">٪ 100</text>
51
- <text x="53" y="177.5" text-anchor="end" dy=".35em" font-size="12" fill="#94A3B8" direction="ltr">٪ 50</text>
50
+ <text x="53" y="25.5" text-anchor="end" dy=".85em" font-size="12" fill="#94A3B8" direction="ltr">٪ 100</text>
51
+ <text x="53" y="175.5" text-anchor="end" dy=".35em" font-size="12" fill="#94A3B8" direction="ltr">٪ 50</text>
52
52
 
53
53
  {{! Value bars + inside/outside percentage label }}
54
54
  {{#each factors as |factor|}}
@@ -66,8 +66,8 @@
66
66
 
67
67
  {{! Domain names under each bar }}
68
68
  {{#each factors as |factor|}}
69
- {{#each factor.lines as |line lineIndex|}}
70
- <text x="{{factor.cx}}" y="{{math 352 '+' (math 18 '*' lineIndex)}}" text-anchor="middle" font-size="14" fill="#334155">{{line}}</text>
69
+ {{#each factor.lines as |line|}}
70
+ <text x="{{line.x}}" y="{{line.y}}" text-anchor="middle" font-size="14" fill="#334155">{{line.text}}</text>
71
71
  {{/each}}
72
72
  {{/each}}
73
73
 
@@ -77,10 +77,10 @@
77
77
  </g>
78
78
 
79
79
  {{! ===== "raw score" header row: legend + per-bar raw/max fractions ===== }}
80
- <text x="38" y="9" text-anchor="start" dy=".3em" font-size="12" fill="#94A3B8">نمره خام</text>
80
+ <text x="38" y="7.5" text-anchor="start" dy=".3em" font-size="12" fill="#94A3B8">نمره خام</text>
81
81
  <path d="M45.5 8L52.5 8M49.5 11L52.5 8L49.5 5" stroke="#94A3B8" stroke-width="0.75" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
82
82
  {{#each factors as |factor|}}
83
- <text x="{{factor.cx}}" y="9" text-anchor="middle" dy=".3em" direction="ltr"><tspan font-weight="700" font-size="16" fill="#BE185D">{{factor.mark}}</tspan><tspan font-weight="300" font-size="12" fill="#64748B"> / </tspan><tspan font-weight="400" font-size="13" fill="#64748B">{{factor.max}}</tspan></text>
83
+ <text x="{{factor.scoreX}}" y="9.5" text-anchor="middle" dy=".3em" direction="ltr"><tspan font-weight="700" font-size="16" fill="#BE185D">{{factor.mark}}</tspan><tspan font-weight="300" font-size="12" fill="#64748B"> / </tspan><tspan font-weight="400" font-size="13" fill="#64748B">{{factor.max}}</tspan></text>
84
84
  {{/each}}
85
85
 
86
86
  {{! ===================== Total score ring gauge ===================== }}
@@ -88,13 +88,13 @@
88
88
  {{gauge 70 49 (object tl=6 tr=6 bl=6 br=6) (object start=(toRad -90) end=(toRad 180)) false clip-path="url(#gauge-roll)" fill="#F1F5F9"}}
89
89
  {{#if total.mark}}{{gauge 70 49 (object tl=6 tr=6 bl=6 br=6) (object start=(toRad -90) end=total.zeta) false clip-path="url(#gauge-roll)" fill="url(#gaugeGrad)"}}{{/if}}
90
90
 
91
- <text x="0" y="-2" text-anchor="middle" font-size="24" font-weight="600" fill="#334155" direction="ltr">٪ {{total.pct}}</text>
92
- <text x="0" y="26" text-anchor="middle" font-size="15" font-weight="500" fill="#64748B">{{total.mark}} از {{total.max}}</text>
91
+ <text x="0" y="-4" text-anchor="middle" font-size="24" font-weight="600" fill="#334155" direction="ltr">٪ {{total.pct}}</text>
92
+ <text x="0" y="22" text-anchor="middle" font-size="15" font-weight="500" fill="#64748B">{{total.mark}} از {{total.max}}</text>
93
93
 
94
- <text x="-52" y="-6" text-anchor="middle" font-size="14" fill="#64748B" direction="ltr">٪ 100</text>
94
+ <text x="-60" y="-8" text-anchor="middle" font-size="14" fill="#64748B" direction="ltr">٪ 100</text>
95
95
  <text x="-11" y="-56" text-anchor="middle" font-size="14" fill="#64748B">0</text>
96
96
 
97
- <text x="0" y="104" text-anchor="middle" font-size="16" font-weight="500" fill="#475569">نمره کل</text>
97
+ <text x="0" y="102" text-anchor="middle" font-size="16" font-weight="500" fill="#475569">نمره کل</text>
98
98
  </g>
99
99
 
100
100
  </g>
@@ -87,7 +87,7 @@
87
87
  <text x="{{math (math 200 '*' item.p) '-' 8}}" y="12" dy=".32em" text-anchor="end" font-size="14" font-weight="500" fill="#FFFFFF" direction="ltr">٪ {{item.percentage}}</text>
88
88
  {{/if}}
89
89
  {{! raw / max fraction (green raw + gray total) }}
90
- <text x="208" y="12" dy=".32em" text-anchor="start" direction="ltr"><tspan font-weight="700" font-size="18" fill="#047857">{{item.mark}}</tspan><tspan font-weight="300" font-size="12" fill="#64748B">/</tspan><tspan font-weight="400" font-size="13" fill="#64748B">{{item.max}}</tspan></text>
90
+ <text x="208" y="12" dy=".32em" text-anchor="start" direction="ltr"><tspan font-weight="700" font-size="18" fill="#047857">{{item.mark}}</tspan><tspan font-weight="300" font-size="12" fill="#64748B"> / </tspan><tspan font-weight="400" font-size="13" fill="#64748B">{{item.max}}</tspan></text>
91
91
  </g>
92
92
  {{/each}}
93
93