@baravak/risloo-profile-cli 4.1.0 → 4.2.3

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.1.0",
3
+ "version": "4.2.3",
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": {
package/src/Profile.js CHANGED
@@ -412,6 +412,15 @@ class Profile {
412
412
  iENV,
413
413
  }));
414
414
  }
415
+ toFixed(number){
416
+ if(Math.round(number) == number){
417
+ return number;
418
+ }
419
+ if(number.toFixed(1) == number){
420
+ return number;
421
+ }
422
+ return number.toFixed(2);
423
+ }
415
424
  }
416
425
 
417
426
  module.exports = { Profile, Dataset, FS, Ticks, Mappings };
@@ -205,7 +205,7 @@ class PMCIEF9A extends Profile {
205
205
 
206
206
  _calcContext() {
207
207
  const { dataset } = this;
208
-
208
+ dataset.score.map((v, i) => {dataset.score[i].mark = Math.round(dataset.score[i].mark || 0) })
209
209
  const section2 = section2circle(dataset);
210
210
  const section3 = {
211
211
  total: Object.assign({}, dataset.score[2], { ml: dataset.score[2].mark * 9 - 9 }),
@@ -249,13 +249,37 @@ class PMCIEF9A extends Profile {
249
249
  has_extend : has_extend
250
250
  }
251
251
  }
252
+ const s71_items = []
253
+ for(let i = 0; i<12; i+=2){
254
+ const score = dataset.score[i+22];
255
+ score.percentage = (parseInt(dataset.score[i+23].mark) || 0);
256
+ score.mark = (parseInt(dataset.score[i+22].mark) || 0);
257
+ s71_items.push(score)
258
+ }
259
+
252
260
  const s72_items = []
253
261
  for(let i = 0; i<16; i+=2){
254
262
  const score = dataset.score[i+42];
255
- score.percentage = (parseInt(dataset.score[i+43].mark));
263
+ score.percentage = (parseInt(dataset.score[i+43].mark) || 0);
264
+ score.mark = (parseInt(dataset.score[i+42].mark) || 0);
256
265
  s72_items.push(score)
257
266
  }
267
+ const s71_max = dataset.questions.slice(103 ,133).reduce((v, q) => q.user_answered ? v+1 : v, 0)
268
+ const gauge1 =section7circle1(dataset, s71_max)
269
+ const gauge2 = section7circle2(dataset,s71_max, gauge1.zeta)
258
270
  const section7 = {
271
+ s1 : {
272
+ max : s71_max,
273
+ fill: dataset.score[38].mark ? '#10B981' : (dataset.score[36].mark == 0 ? '#F43F5E' : '#6366F1'),
274
+ gauge1:gauge1,
275
+ gauge2:gauge2,
276
+ items: s71_items,
277
+ group: [
278
+ Object.assign({}, dataset.score[34], {mark: Math.round(dataset.score[34].mark || 0), percentage: Math.round(dataset.score[35].mark || 0)}),
279
+ Object.assign({}, dataset.score[36], {mark: Math.round(dataset.score[36].mark || 0), percentage: Math.round(dataset.score[37].mark || 0)}),
280
+ Object.assign({}, dataset.score[38], {mark: Math.round(dataset.score[38].mark || 0), percentage: Math.round(dataset.score[39].mark || 0)}),
281
+ ]
282
+ },
259
283
  s2 : {
260
284
  raw:dataset.score[40].mark,
261
285
  percentage: parseInt(dataset.score[41].mark),
@@ -365,7 +389,6 @@ function section2circle(dataset) {
365
389
  -circle.maxValue / (circle.ticks.num - 1),
366
390
  circle.ticks.num
367
391
  ).reverse();
368
-
369
392
  // Gather Required Info for Raw
370
393
  return {
371
394
  circle: circle,
@@ -511,6 +534,101 @@ function section5circle(dataset){
511
534
  }
512
535
  }
513
536
 
537
+ function section7circle1(dataset, max) {
538
+ const raw = dataset.score[34].mark || 0;
539
+ const circle = {
540
+ maxValue: max /* Maximum value of raw mark provided by the dataset */,
541
+ circle: {
542
+ angles: {
543
+ start: FS.toRadians(-90),
544
+ end: FS.toRadians(270),
545
+ } /* Angles of each end of the raw element */,
546
+ direction: false /* Clockwise direction for the raw gauge element */,
547
+ get totalAngle() {
548
+ return this.direction
549
+ ? 2 * Math.PI - (this.angles.end - this.angles.start)
550
+ : this.angles.end - this.angles.start;
551
+ },
552
+ },
553
+ ticks: {
554
+ num: 2 /* Number of ticks */,
555
+ number: {
556
+ offset: 27 /* Offset from the line */,
557
+ },
558
+ },
559
+ };
560
+
561
+ // Calculate Ticks Numbers Array for Raw
562
+ const rawTicksNumbers = FS.createArithmeticSequence(
563
+ circle.maxValue,
564
+ -circle.maxValue / (circle.ticks.num - 1),
565
+ circle.ticks.num
566
+ ).reverse();
567
+ // Gather Required Info for Raw
568
+ return {
569
+ raw: raw,
570
+ circle: circle,
571
+ zeta: (raw / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
572
+ fill: circle.fill,
573
+ opacity: FS.roundTo2(0.5 * (1 + raw / circle.maxValue)),
574
+ start: {
575
+ number: rawTicksNumbers[0],
576
+ angle: (rawTicksNumbers[0] / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
577
+ },
578
+ end: {
579
+ number: rawTicksNumbers[1],
580
+ angle: (rawTicksNumbers[1] / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
581
+ },
582
+ };
583
+ }
584
+ function section7circle2(dataset, max, start) {
585
+ const raw = dataset.score[36].mark || 0;
586
+ const circle = {
587
+ maxValue: max - (dataset.score[34].mark || 0) /* Maximum value of raw mark provided by the dataset */,
588
+ circle: {
589
+ angles: {
590
+ start: start || FS.toRadians(-90),
591
+ end: FS.toRadians(270),
592
+ } /* Angles of each end of the raw element */,
593
+ direction: false /* Clockwise direction for the raw gauge element */,
594
+ get totalAngle() {
595
+ return this.direction
596
+ ? 2 * Math.PI - (this.angles.end - this.angles.start)
597
+ : this.angles.end - this.angles.start;
598
+ },
599
+ },
600
+ ticks: {
601
+ num: 2 /* Number of ticks */,
602
+ number: {
603
+ offset: 27 /* Offset from the line */,
604
+ },
605
+ },
606
+ };
607
+
608
+ // Calculate Ticks Numbers Array for Raw
609
+ const rawTicksNumbers = FS.createArithmeticSequence(
610
+ circle.maxValue,
611
+ -circle.maxValue / (circle.ticks.num - 1),
612
+ circle.ticks.num
613
+ ).reverse();
614
+ // Gather Required Info for Raw
615
+ return {
616
+ raw: raw,
617
+ circle: circle,
618
+ zeta: (raw / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
619
+ fill: circle.fill,
620
+ opacity: FS.roundTo2(0.5 * (1 + raw / circle.maxValue)),
621
+ start: {
622
+ number: rawTicksNumbers[0],
623
+ angle: (rawTicksNumbers[0] / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
624
+ },
625
+ end: {
626
+ number: rawTicksNumbers[1],
627
+ angle: (rawTicksNumbers[1] / circle.maxValue) * circle.circle.totalAngle + circle.circle.angles.start,
628
+ },
629
+ };
630
+ }
631
+
514
632
  function _markToAngle(mark, min, max, angles, direction) {
515
633
  const totalAngle = _calcDiffAngle(angles.end, angles.start, direction);
516
634
  const deltaTheta = ((mark - min) / (max - min)) * totalAngle;
@@ -96,7 +96,7 @@ class YSQ93 extends Profile {
96
96
  }
97
97
  }
98
98
  a6_line.push(start + 2)
99
- const is_critical = a5.length || a6.length ? true : false
99
+ const is_critical = a5.length + a6.length >= 3 ? true : false
100
100
  return Object.assign({}, s, {
101
101
  up:s.label.eng.toUpperCase(),
102
102
  a5:a5,
@@ -16,7 +16,7 @@
16
16
  {{bar 64 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0)}}
17
17
  </clipPath>
18
18
  <clipPath id="bar80x16">
19
- {{bar 64 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0)}}
19
+ {{bar 80 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0)}}
20
20
  </clipPath>
21
21
  <clipPath id="bar329x12">
22
22
  {{bar 329 12 (object tr=12 tl=0 br=0 bl=0) (toRad 0)}}
@@ -37,7 +37,7 @@
37
37
  <g transform="translate(215.5, 168)">
38
38
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
39
39
  <text x="-12.5" y="20" text-anchor="middle" dy="5" font-size="14" font-weight="500" fill="#475569">5 </text>
40
- <text x="-33" y="20" dy="5" font-size="14" font-weight="500" fill="#52525B">دیدگاه‌ها و علایق مشترک</text>
40
+ <text x="-33" y="20" dy=".30em" font-size="14" font-weight="400" fill="#52525B">دیدگاه‌ها و علایق مشترک</text>
41
41
  </g>
42
42
 
43
43
  <g transform="translate(115.5, 116.8)">
@@ -72,7 +72,7 @@
72
72
  <g transform="translate(212, 168)">
73
73
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
74
74
  <text x="-12.5" y="20" text-anchor="middle" dy="5" font-size="14" font-weight="500" fill="#475569">3 </text>
75
- <text x="-33" y="20" dy="5" font-size="14" font-weight="500" fill="#52525B">ملاک‌های انتخاب همسر</text>
75
+ <text x="-33" y="20" dy=".30em" font-size="14" font-weight="400" fill="#52525B">ملاک‌های انتخاب همسر</text>
76
76
  </g>
77
77
  <g transform="translate(26.5, 116)">
78
78
  {{#each (array 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100)}}
@@ -96,7 +96,7 @@
96
96
  <g transform="translate(165.5, 168)">
97
97
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
98
98
  <text x="-12.5" y="20" text-anchor="middle" dy="5" font-size="14" font-weight="500" fill="#475569">2</text>
99
- <text x="-33" y="20" dy="5" font-size="14" font-weight="500" fill="#52525B">آشنایی</text>
99
+ <text x="-33" y="20" dy=".30em" font-size="14" font-weight="400" fill="#52525B">آشنایی</text>
100
100
  </g>
101
101
  <g transform="translate(130, 85)">
102
102
  {{#with section2}}
@@ -127,7 +127,7 @@
127
127
  <g transform="translate(342.5, 362)">
128
128
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
129
129
  <text x="-12.5" y="20" text-anchor="middle" dy="5" font-size="14" font-weight="500" fill="#475569">4</text>
130
- <text x="-33" y="20" dy="5" font-size="14" font-weight="500" fill="#52525B">هماهنگی خانواده‌ها</text>
130
+ <text x="-33" y="20" dy=".30em" font-size="14" font-weight="400" fill="#52525B">هماهنگی خانواده‌ها</text>
131
131
  </g>
132
132
 
133
133
  {{!-- Seperator --}}
@@ -168,37 +168,37 @@
168
168
  {{#with section4.third}}
169
169
  <text x="0" y="29" dy="5" font-size="12" font-weight="400" fill="#4B5563" text-anchor="end">بخش سوم</text>
170
170
  <g transform="translate(100, 0)">
171
- <g transform="translate(0, 3)">
172
- <text x="91" y="10" font-size="14" dy="0.25em" font-weight="400" fill="#4B5563" text-anchor="start">همسانی خانواده‌ها</text>
171
+ <g transform="translate(0, 6)">
172
+ <text x="91" y="10" font-size="14" dy="0.25em" font-weight="400" fill="#4B5563" text-anchor="start">همسانی خانواده</text>
173
173
  <g transform="translate(98, 0)">
174
- {{bar 64 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clipPath="url(#bar64x16)" fill="#EDE9FE"}}
174
+ {{bar 64 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clip-path="url(#bar64x16)" fill="#EDE9FE"}}
175
175
  {{bar (math 2 '*' family.mark) 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clip-path="url(#bar64x16)" fill="#8B5CF6"}}
176
176
  <text x="70" y="10" dy="0.25em" text-anchor="start" direction="ltr">
177
- <tspan font-size="16" font-weight="500" fill="#7C3AED">{{family.mark}}</tspan>
177
+ <tspan font-size="16" font-weight="400" fill="#7C3AED">{{family.mark}}</tspan>
178
178
  <tspan font-size="14" font-weight="400" dx="-3" fill="#4B5563">/ 32 </tspan>
179
179
  </text>
180
180
  <rect x="121" y="0" rx="4" fill="#F5F3FF" width="34" height="16" />
181
181
  <text x="138" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="12" fill="#8B5CF6">%{{family.percentage}}</text>
182
182
  </g>
183
183
  </g>
184
- <g transform="translate(0, 42)">
185
- <text x="91" y="10" font-size="14" dy="0.25em" font-weight="400" fill="#4B5563" text-anchor="start">همسانی خانواده‌ها</text>
184
+ <g transform="translate(0, 37)">
185
+ <text x="91" y="10" font-size="14" dy="0.25em" font-weight="400" fill="#4B5563" text-anchor="start">همسانی تربیتی</text>
186
186
  <g transform="translate(98, 0)">
187
- {{bar 80 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clipPath="url(#bar80x16)" fill="#EDE9FE"}}
187
+ {{bar 80 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clip-path="url(#bar80x16)" fill="#EDE9FE"}}
188
188
  {{bar (math 2 '*' educational.mark) 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) clip-path="url(#bar80x16)" fill="#8B5CF6"}}
189
189
  <text x="88" y="10" dy="0.25em" text-anchor="start" direction="ltr">
190
- <tspan font-size="16" font-weight="500" fill="#7C3AED">{{educational.mark}}</tspan>
190
+ <tspan font-size="16" font-weight="400" fill="#7C3AED">{{educational.mark}}</tspan>
191
191
  <tspan font-size="14" font-weight="400" dx="-3" fill="#4B5563">/ 40</tspan>
192
192
  </text>
193
193
  <rect x="140" y="0" rx="4" fill="#F5F3FF" width="34" height="16" />
194
194
  <text x="157" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="12" fill="#8B5CF6">%{{educational.percentage}}</text>
195
195
  </g>
196
196
  </g>
197
- <rect x="97" y="0" width="1" height="60" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .5));"/>
197
+ <rect x="97" y="0" width="1" height="60" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .8));"/>
198
198
  </g>
199
199
  <g transform="translate(409, 6)">
200
200
  {{bar 48 48 (object tr=8 br=8 bl=8 tl=0) (toRad 0) fill="none" stroke="#EC4899" stroke-width="2"}}
201
- <text x="24" y="10" font-size="20" dy=".75em" font-weight="500" fill="#EC4899" text-anchor="middle">{{total.mark}}</text>
201
+ <text x="24" y="10" font-size="20" dy=".65em" font-weight="500" fill="#EC4899" text-anchor="middle">{{total.mark}}</text>
202
202
 
203
203
  <text x="24" y="29" font-size="12" dy=".75em" font-weight="400" fill="#6B7280" text-anchor="middle">%{{percentage.mark}}</text>
204
204
 
@@ -211,9 +211,9 @@
211
211
  {{!-- Total --}}
212
212
  <g transform="translate(39, 273)">
213
213
  <text x="0" y="31.5" dy=".25em" font-size="14" font-weight="500" fill="#075985" text-anchor="end">نمره کل محور ۴</text>
214
- <text x="448" y="31.5" dy=".25em" font-size="14" font-weight="400" fill="#374151" text-anchor="end">94</text>
214
+ <text x="448" y="31.5" dy=".4em" font-size="14" font-weight="400" fill="#374151" text-anchor="end">94</text>
215
215
  <text x="{{math 103 '+' (math 3.5 '*' section4.total.total.mark)}}" y="50" dy=".75em" font-size="12" font-weight="400" fill="#4B5563" text-anchor="middle">%{{section4.total.total.mark}}</text>
216
- <text x="{{math 103 '+' (math 3.5 '*' section4.total.total.mark)}}" y="0" dy=".75em" font-size="20" font-weight="500" fill="#075985" text-anchor="middle">{{section4.total.percentage.mark}}</text>
216
+ <text x="{{math 103 '+' (math 3.5 '*' section4.total.total.mark)}}" y="0" dy=".75em" font-size="20" font-weight="600" fill="#075985" text-anchor="middle">{{section4.total.percentage.mark}}</text>
217
217
  {{bar 4 24 (object tr=2 br=2 bl=2 tl=2) (toRad 0) fill="#E5E7EB" transform="translate(99, 20)"}}
218
218
  <rect x="103" y="34" width="329" height="4" fill="#F3F4F6" />
219
219
  {{bar (math 3.5 '*' section4.total.total.mark) 12 (object tr=12 tl=0 br=0 bl=0) (toRad 0) fill="url(#line-bar)" clip-path="url(#bar329x12)" transform="translate(103, 26)"}}
@@ -227,7 +227,7 @@
227
227
  <g transform="translate(229.5, 362)">
228
228
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
229
229
  <text x="-12.5" y="20" text-anchor="middle" dy="5" font-size="14" font-weight="500" fill="#475569">6</text>
230
- <text x="-33" y="20" dy="5" font-size="14" font-weight="500" fill="#52525B">احساس علاقه‌مندی و نگرانی‌ها</text>
230
+ <text x="-33" y="20" dy=".30em" font-size="14" font-weight="400" fill="#52525B">احساس علاقه‌مندی و نگرانی‌ها</text>
231
231
  </g>
232
232
  {{!-- SubSection 1 --}}
233
233
  <g transform="translate(24.5, 26)">
@@ -1,15 +1,18 @@
1
1
  {{#> layout}}
2
2
  <defs>
3
3
  <clipPath id="bar240x16">
4
- {{bar 240 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0)}}
4
+ {{bar 150 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0)}}
5
5
  </clipPath>
6
6
  <clipPath id="bar20x246">
7
7
  {{bar 20 246 (object tl=0 tr=0 bl=10 br=10) (toRad 180) }}
8
8
  </clipPath>
9
9
  <linearGradient id="line-bar" x1="0%" y1="0%" x2="100%" y2="0%">
10
- <stop offset="0%" style="stop-color:#88BDFF;stop-opacity:1" />
11
- <stop offset="100%" style="stop-color:#2563EB;stop-opacity:1" />
10
+ <stop offset="0%" style="stop-color:#C4B5FD;stop-opacity:1" />
11
+ <stop offset="100%" style="stop-color:#7C3AED;stop-opacity:1" />
12
12
  </linearGradient>
13
+ <clipPath id="bar150x16">
14
+ {{bar 150 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0)}}
15
+ </clipPath>
13
16
  </defs>
14
17
  <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
15
18
  {{bar 828 40 (object tr=0 tl=0 bl=12 br=12) (toRad 0) fill="#F8FAFC" transform="translate(0, 594)"}}
@@ -17,21 +20,114 @@
17
20
  <g transform="translate(495, 594)">
18
21
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
19
22
  <text x="-12.5" y="20" dy="0.25em" text-anchor="middle" font-size="14" font-weight="400" fill="#475569">7</text>
20
- <text x="-33" y="20" dy="0.25em" text-anchor="start" font-size="14" font-weight="400" fill="#52525B">تفاهم / توافق / اختلاف</text>
23
+ <text x="-33" y="20" dy="0.3em" text-anchor="start" font-size="14" font-weight="400" fill="#52525B">تفاهم / توافق / اختلاف</text>
21
24
  </g>
22
25
  {{!-- Section 1 --}}
23
- <g transform="translate(18.5, 12)">
24
- <rect height="220" width="791" opacity=".1" />
25
- <g transform="translate(16, 16)">
26
- <rect height="188" width="356" opacity=".1" fill="red" />
26
+ <g transform="translate(45.5, 12)">
27
+ <g transform="translate(16, 31)">
28
+ <circle cx="80" cy="80" r="80" fill="{{s1.fill}}" />
29
+ <circle cx="80" cy="80" r="32" fill="#ffffff" />
30
+ <text x="80" y="80" dy="0.25em" text-anchor="middle" font-size="18" font-weight="500" fill="#6B7280">{{s1.max}}</text>
31
+ {{#if s1.gauge1.raw}}
32
+ {{#with s1.gauge1.circle.circle}}
33
+ {{gauge 80 32 (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=@root.s1.gauge1.zeta) direction fill="#F43F5E" transform="translate(80, 80)"}}
34
+ {{/with}}
35
+ {{/if}}
36
+ {{#if s1.gauge2.raw}}
37
+ {{#with s1.gauge2.circle.circle}}
38
+ {{gauge 80 32 (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=@root.s1.gauge2.zeta) direction fill="#6366F1" transform="translate(80, 80)"}}
39
+ {{/with}}
40
+ {{/if}}
41
+
42
+ </g>
43
+ <g transform="translate(507, 24)">
44
+ {{#with s1.items.[0]}}
45
+ <g>
46
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#F43F5E" clip-path="url(#bar150x16)"}}
47
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
48
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#F43F5E">{{mark}}</text>
49
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#FFF1F2" />
50
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#F43F5E">%{{percentage}}</text>
51
+ </g>
52
+ {{/with}}
53
+ {{#with s1.items.[1]}}
54
+ <g transform="translate(0, 25)">
55
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#F43F5E" clip-path="url(#bar150x16)"}}
56
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
57
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#F43F5E">{{mark}}</text>
58
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#FFF1F2" />
59
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#F43F5E">%{{percentage}}</text>
60
+ </g>
61
+ {{/with}}
62
+
63
+ {{#with s1.items.[2]}}
64
+ <g transform="translate(0, 66)">
65
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#6366F1" clip-path="url(#bar150x16)"}}
66
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
67
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#6366F1">{{mark}}</text>
68
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#EEF2FF" />
69
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#6366F1">%{{percentage}}</text>
70
+ </g>
71
+ {{/with}}
72
+ {{#with s1.items.[3]}}
73
+ <g transform="translate(0, 91)">
74
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#6366F1" clip-path="url(#bar150x16)"}}
75
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
76
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#6366F1">{{mark}}</text>
77
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#EEF2FF" />
78
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#6366F1">%{{percentage}}</text>
79
+ </g>
80
+ {{/with}}
81
+
82
+ {{#with s1.items.[4]}}
83
+ <g transform="translate(0, 131)">
84
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#10B981" clip-path="url(#bar150x16)"}}
85
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
86
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#10B981">{{mark}}</text>
87
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#ECFDF5" />
88
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#10B981">%{{percentage}}</text>
89
+ </g>
90
+ {{/with}}
91
+ {{#with s1.items.[5]}}
92
+ <g transform="translate(0, 157)">
93
+ {{bar (math mark '*' 5) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#10B981" clip-path="url(#bar150x16)"}}
94
+ <text x="-6.5" y="0" dy=".85em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">{{label.fr}}</text>
95
+ <text x="{{math 4 '+' (math mark '*' 5)}}" y="0" dy=".85em" text-anchor="end" font-size="16" font-weight="500" fill="#10B981">{{mark}}</text>
96
+ <rect x="{{math 29 '+' (math mark '*' 5)}}" rx="4" width="35" height="16" fill="#ECFDF5" />
97
+ <text x="{{math 46.5 '+' (math mark '*' 5)}}" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#10B981">%{{percentage}}</text>
98
+ </g>
99
+ {{/with}}
100
+ </g>
101
+ <g transform="translate(224, 23)">
27
102
  <g>
28
- <text x="115" y="3" dy="0.75em" text-anchor="start" font-size="14" font-weight="400" fill="#52525B">با هم مخالفیم</text>
103
+ <rect y="12" rx="4" width="35" height="16" fill="#FFF1F2" />
104
+ <text x="17.5" y="20" dy=".3em" text-anchor="middle" font-size="12" font-weight="400" fill="#F43F5E">%{{s1.group.[0].percentage}}</text>
105
+ <text x="60" y="20" dy=".25em" text-anchor="start" font-size="18" font-weight="500" fill="#F43F5E">{{s1.group.[0].mark}}</text>
106
+ <text x="127" y="20" dy=".25em" text-anchor="start" font-size="14" font-weight="500" fill="#F43F5E">{{s1.group.[0].label.fr}}:</text>
107
+ <rect x="136" width="1" height="43" fill="#FB7185" />
108
+ <rect x="135" y="20" width="3" height="3" rx="1" fill="#F43F5E" />
29
109
  </g>
30
- <rect x="121" y="0" width="1" height="188" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .5));"/>
31
- </g>
32
- <g transform="translate(436, 38)">
33
- <rect height="144" width="339" opacity=".1" fill="blue" />
110
+
111
+ <g transform="translate(0, 66)">
112
+ <rect y="12" rx="4" width="35" height="16" fill="#EEF2FF" />
113
+ <text x="17.5" y="20" dy=".3em" text-anchor="middle" font-size="12" font-weight="400" fill="#6366F1">%{{s1.group.[1].percentage}}</text>
114
+ <text x="60" y="20" dy=".25em" text-anchor="start" font-size="18" font-weight="500" fill="#6366F1">{{s1.group.[1].mark}}</text>
115
+ <text x="127" y="20" dy=".25em" text-anchor="start" font-size="14" font-weight="500" fill="#6366F1">{{s1.group.[1].label.fr}}:</text>
116
+ <rect x="136" width="1" height="43" fill="#818CF8" />
117
+ <rect x="135" y="20" width="3" height="3" rx="1" fill="#6366F1" />
118
+ </g>
119
+
120
+ <g transform="translate(0, 132)">
121
+ <rect y="12" rx="4" width="35" height="16" fill="#ECFDF5" />
122
+ <text x="17.5" y="20" dy=".3em" text-anchor="middle" font-size="12" font-weight="400" fill="#10B981">%{{s1.group.[2].percentage}}</text>
123
+ <text x="60" y="20" dy=".25em" text-anchor="start" font-size="18" font-weight="500" fill="#10B981">{{s1.group.[2].mark}}</text>
124
+ <text x="127" y="20" dy=".25em" text-anchor="start" font-size="14" font-weight="500" fill="#10B981">{{s1.group.[2].label.fr}}:</text>
125
+ <rect x="136" width="1" height="43" fill="#34D399" />
126
+ <rect x="135" y="20" width="3" height="3" rx="1" fill="#10B981" />
127
+ </g>
128
+
34
129
  </g>
130
+ <rect x="506" y="16" width="1" height="190" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .5));"/>
35
131
  </g>
36
132
  <text x="749" y="252" dy="-.25em" text-anchor="end" font-size="14" font-weight="400" fill="#9CA3AF">بخش اول</text>
37
133
  <line x1="12" y1="264" y2="264" x2="816" stroke="#CBD5E1" stroke-linecap="round" stroke-dasharray="6 6"/>
@@ -47,12 +143,12 @@
47
143
  {{bar (math item.label.max '*' 10) 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) fill="#F3F4F6" opacity=".8"}}
48
144
  {{bar (math item.mark '*' 10) 16 (object tr=8 tl=0 br=8 bl=0) (toRad 0) fill="url(#line-bar)" clip-path="url(#bar240x16)" opacity=".8"}}
49
145
  <text x="{{math 8 '+' (math item.label.max '*' 10)}}" direction="ltr">
50
- <tspan fill="#2563EB" font-size="18" font-weight="500" dy=".75em" text-anchor="start">{{item.mark}}</tspan>
146
+ <tspan fill="#7C3AED" font-size="18" font-weight="500" dy=".75em" text-anchor="start">{{item.mark}}</tspan>
51
147
  <tspan fill="#4B5563" font-size="12" font-weight="400"> / {{item.label.max}}</tspan>
52
148
  </text>
53
149
  <g transform="translate({{math 57 '+' (math item.label.max '*' 10)}}, 0)">
54
- <rect x="0" y="0" rx="4" fill="#EFF6FF" width="35" height="16" />
55
- <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="12" fill="#2563EB">%{{item.percentage}}</text>
150
+ <rect x="0" y="0" rx="4" fill="#F5F3FF" width="35" height="16" />
151
+ <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="12" fill="#7C3AED">%{{item.percentage}}</text>
56
152
  </g>
57
153
  </g>
58
154
  </g>
@@ -43,7 +43,7 @@
43
43
  <g transform="translate(525, 594)">
44
44
  {{bar 25 25 (object tr=8 br=8 bl=8 tl=8) (toRad 0) fill="none" stroke="#E2E8F0" transform="translate(-25, 7.5)"}}
45
45
  <text x="-12.5" y="20" dy="0.25em" text-anchor="middle" font-size="14" font-weight="400" fill="#475569">8</text>
46
- <text x="-33" y="20" dy="0.25em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">هماهنگی‌های ویژگی‌های شخصیتی</text>
46
+ <text x="-33" y="20" dy="0.3em" text-anchor="start" font-size="14" font-weight="400" fill="#4B5563">هماهنگی‌های ویژگی‌های شخصیتی</text>
47
47
  </g>
48
48
  {{!-- Section 1 --}}
49
49
  <g transform="translate(132, 45)">
@@ -141,7 +141,7 @@
141
141
  </g>
142
142
  {{/each}}
143
143
  </g>
144
- <text x="236" y="0" dy="1em" text-anchor="start" font-size="12" font-weight="400" fill="#52525B">همسر آینده‌م</text>
144
+ <text x="236" y="0" dy="1em" text-anchor="start" font-size="12" font-weight="400" fill="#4F46E5">همسر آینده‌م</text>
145
145
  <text x="421" y="0" dy="1em" text-anchor="end" font-size="12" font-weight="400" fill="#0284C7">من</text>
146
146
  <text x="75" y="0" dy="1em" text-anchor="middle" font-size="12" font-weight="400" fill="#9CA3AF">20</text>
147
147
  <line x1="75" x2="75" y1="19" y2="33" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="3 3"/>
@@ -45,7 +45,7 @@
45
45
  </g>
46
46
  {{#each items as |item index|}}
47
47
  <g transform="translate(0, {{math 32 '*' index}})">
48
- {{bar (math item.mean '*' 100) 16 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=item.params.gr transform="translate(205, 0)" clipPath="url(#bar300x16)"}}
48
+ {{bar (math item.mean '*' 100) 16 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=item.params.gr transform="translate(205, 0)" clip-path="url(#bar300x16)"}}
49
49
  <text x="{{math (math item.mean '*' 100) '+' (ternary (boolean item.params.level '>' 0) 199 211)}}" dy=".85em" text-anchor="{{ternary (boolean item.params.level '>' 0) 'start' 'end'}}" font-weight="500" font-size="16" fill="{{ternary (boolean item.params.level '>' 0) '#FFFFFF' item.params.col}}">{{item.mean}}</text>
50
50
  </g>
51
51
  {{/each}}
@@ -34,13 +34,13 @@
34
34
  {{#if item.a5}}
35
35
  <line x1="{{item.a5_line.[0]}}" x2="{{item.a5_line.[1]}}" y1="8" y2="8" stroke="#D1D5DB" />
36
36
  <g transform="translate(0, 0)">
37
- <rect x="0" y="0" rx="4" fill="#E11D48" width="35" height="16" />
37
+ <rect x="0" y="0" rx="4" fill="{{ternary is_critical '#E11D48' '#4F46E5'}}" width="35" height="16" />
38
38
  <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#FFFFFF">گ5</text>
39
39
  </g>
40
40
  {{#each item.a5 as |aItem aIndex|}}
41
41
  <g transform="translate({{aItem.start}}, 0)">
42
- <rect x="0" y="0" rx="4" fill="#FFF1F2" width="24" height="16" />
43
- <text x="12" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#E11D48">{{aItem.item}}</text>
42
+ <rect x="0" y="0" rx="4" fill="{{ternary ../is_critical '#FFF1F2' '#EEF2FF'}}" width="24" height="16" />
43
+ <text x="12" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="{{ternary ../is_critical '#E11D48' '#4F46E5'}}">{{aItem.item}}</text>
44
44
  </g>
45
45
  {{/each}}
46
46
  {{/if}}
@@ -48,13 +48,13 @@
48
48
  {{#if item.a6}}
49
49
  <line x1="{{item.a6_line.[0]}}" x2="{{item.a6_line.[1]}}" y1="8" y2="8" stroke="#D1D5DB" />
50
50
  <g transform="translate({{item.a6_start}}, 0)">
51
- <rect x="0" y="0" rx="4" fill="#BE123C" width="35" height="16" />
51
+ <rect x="0" y="0" rx="4" fill="{{ternary is_critical '#BE123C' '#4338CA'}}" width="35" height="16" />
52
52
  <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#FFFFFF">گ6</text>
53
53
  </g>
54
54
  {{#each item.a6 as |aItem aIndex|}}
55
55
  <g transform="translate({{aItem.start}}, 0)">
56
- <rect x="0" y="0" rx="4" fill="#FFE4E6" width="24" height="16" />
57
- <text x="12" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#BE123C">{{aItem.item}}</text>
56
+ <rect x="0" y="0" rx="4" fill="{{ternary ../is_critical '#FFE4E6' '#EEF2FF'}}" width="24" height="16" />
57
+ <text x="12" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="{{ternary ../is_critical '#BE123C' '#4338CA'}}">{{aItem.item}}</text>
58
58
  </g>
59
59
  {{/each}}
60
60
  {{/if}}