@baravak/risloo-profile-cli 4.2.0 → 4.2.4

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.2.0",
3
+ "version": "4.2.4",
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": {
@@ -6,24 +6,28 @@ class YSQ93 extends Profile {
6
6
 
7
7
  // Labels of the sample
8
8
  labels = {
9
- L1: { eng: "ed", fr: "محرومیت هیجانی" },
10
- L2: { eng: "ab", fr: "رهاشدگی / بی‌ثباتی" },
11
- L3: { eng: "ma", fr: "بی‌اعتمادی / بدرفتاری" },
12
- L4: { eng: "si", fr: "انزوای اجتماعی / بی‌گانگی" },
13
- L5: { eng: "ds", fr: "نقص / شرم" },
14
- L6: { eng: "fa", fr: "شکست" },
15
- L7: { eng: "ai", fr: "وابستگی / بی‌کفایتی" },
16
- L8: { eng: "vu", fr: "آسیب‌پذیری نسبت به ضرر یا بیماری" },
17
- L9: { eng: "eu", fr: "گرفتار / خویشتن تحول‌نیافته" },
18
- L10: { eng: "sb", fr: "اطاعت" },
19
- L11: { eng: "ss", fr: "ایثارگری" },
20
- L12: { eng: "ei", fr: "بازداری هیجانی" },
21
- L13: { eng: "us", fr: "معیارهای سخت‌گیرانه" },
22
- L14: { eng: "et", fr: "استحقاق / بزرگ‌منشی" },
23
- L15: { eng: "is", fr: "خویشتن‌داری / خودانضباطی ناکافی" },
24
- L16: { eng: "as", fr: "پذیرش‌جویی / جلب توجه" },
25
- L17: { eng: "np", fr: "منفی‌گرایی / بدبینی" },
26
- L18: { eng: "pu", fr: "تنبیه" },
9
+ L1: { eng: "ab", fr: "رهاشدگی (بی‌ثباتی)" , append_rows:0},
10
+ L2: { eng: "ma", fr: "بی‌اعتمادی (سوءاستفاده)" , append_rows:0},
11
+ L3: { eng: "ed", fr: "محرومیت عاطفی" , append_rows:0},
12
+ L4: { eng: "ds", fr: "نقص (شرم)" , append_rows:0},
13
+ L5: { eng: "si", fr: "انزوای اجتماعی (احساس بیگانگی)", append_rows:0},
14
+
15
+ L6: { eng: "ai", fr: "وابستگی (بی‌کفایتی)" , append_rows:38 * 1},
16
+ L7: { eng: "vu", fr: "آسیب‌پذیری در برابر خطر" , append_rows:38 * 1},
17
+ L8: { eng: "eu", fr: "گرفتارشدگی (خودتحول‌نایافتگی)" , append_rows:38 * 1},
18
+ L9: { eng: "fa", fr: "شکست" , append_rows:38 * 1},
19
+
20
+ L10: { eng: "et", fr: "محق‌بودن (خودبزرگ‌بینی)" , append_rows:38 * 2},
21
+ L11: { eng: "is", fr: "خودمهارگری ناکافی" , append_rows:38 * 2},
22
+
23
+ L12: { eng: "sb", fr: "انقیاد (اطاعت)" , append_rows:38 * 3},
24
+ L13: { eng: "ss", fr: "از خودگذشتگی" , append_rows:38 * 3},
25
+ L14: { eng: "as", fr: "تأییدخواهی یا تصدیق‌خواهی" , append_rows:38 * 3},
26
+
27
+ L15: { eng: "np", fr: "منفی‌خوانی یا بدبینی" , append_rows:38 * 4},
28
+ L16: { eng: "ei", fr: "بیش‌مهارگری (بازداری هیجانی)" , append_rows:38 * 4},
29
+ L17: { eng: "us", fr: "استانداردهای سخت‌گیرانه" , append_rows:38 * 4},
30
+ L18: { eng: "pu", fr: "تنبیه‌گری" , append_rows:38 * 4},
27
31
  };
28
32
 
29
33
  profileSpec = {
@@ -42,13 +46,13 @@ class YSQ93 extends Profile {
42
46
  profile: {
43
47
  get dimensions() {
44
48
  return {
45
- width: 815 + 2 * this.padding.x,
46
- height: 609 + 2 * this.padding.y,
49
+ width: 887 + 2 * this.padding.x,
50
+ height: 666 + 2 * this.padding.y,
47
51
  };
48
52
  },
49
53
  padding: {
50
- x: 44,
51
- y: 52.5,
54
+ x: 8,
55
+ y: 24,
52
56
  },
53
57
  },
54
58
 
@@ -96,7 +100,7 @@ class YSQ93 extends Profile {
96
100
  }
97
101
  }
98
102
  a6_line.push(start + 2)
99
- const is_critical = a5.length || a6.length ? true : false
103
+ const is_critical = a5.length + a6.length >= 3 ? true : false
100
104
  return Object.assign({}, s, {
101
105
  up:s.label.eng.toUpperCase(),
102
106
  a5:a5,
@@ -15,13 +15,9 @@
15
15
  </defs>
16
16
 
17
17
  <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
18
- <g transform="translate(0,41)">
18
+ <g transform="translate(72,41)">
19
19
  {{#each items as |item index|}}
20
- <g transform="translate(0,{{math 32 '*' index}})">
21
- {{!-- <rect height="16" width="148" transform="translate(88,0)" opacity=".1" />
22
- <rect height="16" width="32" transform="translate(204,0)" opacity=".1" />
23
- <rect height="16" width="5" transform="translate(191,0)" opacity=".1" />
24
- <rect height="16" width="50" transform="translate(133,0)" opacity=".1" /> --}}
20
+ <g transform="translate(0,{{math item.label.append_rows '+' (math 26 '*' index)}})">
25
21
  <text x="181" y="0" text-anchor="start" dy=".85em" font-size="13" font-weight="{{ternary item.warn '700' '400'}}" fill="{{ternary item.warn (ternary item.is_critical '#E11D48' '#1F2937') '#4B5563'}}">{{item.label.fr}}</text>
26
22
  <text x="191" y="0" text-anchor="end" dy=".9em" font-size="13" font-weight="{{ternary item.warn '700' '400'}}" fill="{{ternary item.warn (ternary item.is_critical '#E11D48' '#1F2937') '#4B5563'}}">-</text>
27
23
  <text x="220" y="0" text-anchor="middle" dy="1em" font-size="13" font-weight="{{ternary item.warn '700' '400'}}" fill="{{ternary item.warn (ternary item.is_critical '#E11D48' '#1F2937') '#4B5563'}}">{{item.up}}</text>
@@ -34,13 +30,13 @@
34
30
  {{#if item.a5}}
35
31
  <line x1="{{item.a5_line.[0]}}" x2="{{item.a5_line.[1]}}" y1="8" y2="8" stroke="#D1D5DB" />
36
32
  <g transform="translate(0, 0)">
37
- <rect x="0" y="0" rx="4" fill="#E11D48" width="35" height="16" />
33
+ <rect x="0" y="0" rx="4" fill="{{ternary is_critical '#E11D48' '#4F46E5'}}" width="35" height="16" />
38
34
  <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#FFFFFF">گ5</text>
39
35
  </g>
40
36
  {{#each item.a5 as |aItem aIndex|}}
41
37
  <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>
38
+ <rect x="0" y="0" rx="4" fill="{{ternary ../is_critical '#FFF1F2' '#EEF2FF'}}" width="24" height="16" />
39
+ <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
40
  </g>
45
41
  {{/each}}
46
42
  {{/if}}
@@ -48,13 +44,13 @@
48
44
  {{#if item.a6}}
49
45
  <line x1="{{item.a6_line.[0]}}" x2="{{item.a6_line.[1]}}" y1="8" y2="8" stroke="#D1D5DB" />
50
46
  <g transform="translate({{item.a6_start}}, 0)">
51
- <rect x="0" y="0" rx="4" fill="#BE123C" width="35" height="16" />
47
+ <rect x="0" y="0" rx="4" fill="{{ternary is_critical '#BE123C' '#4338CA'}}" width="35" height="16" />
52
48
  <text x="17.5" y="9" dy="0.25em" text-anchor="middle" font-weight="400" font-size="13" fill="#FFFFFF">گ6</text>
53
49
  </g>
54
50
  {{#each item.a6 as |aItem aIndex|}}
55
51
  <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>
52
+ <rect x="0" y="0" rx="4" fill="{{ternary ../is_critical '#FFE4E6' '#EEF2FF'}}" width="24" height="16" />
53
+ <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
54
  </g>
59
55
  {{/each}}
60
56
  {{/if}}
@@ -62,25 +58,53 @@
62
58
  </g>
63
59
  {{/each}}
64
60
  <text x="291" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="400" fill="#9CA3AF">5</text>
65
- <line x1="291" y1="-16" x2="291" y2="568" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
61
+ <line x1="291" y1="-16" x2="291" y2="625" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
66
62
  <text x="341" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="400" fill="#9CA3AF">10</text>
67
- <line x1="341" y1="-16" x2="341" y2="568" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
63
+ <line x1="341" y1="-16" x2="341" y2="625" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
68
64
  <text x="391" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="500" fill="#6B7280">15</text>
69
- <line x1="391" y1="-16" x2="391" y2="568" stroke="#6B7280"/>
65
+ <line x1="391" y1="-16" x2="391" y2="625" stroke="#6B7280"/>
70
66
  <text x="441" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="400" fill="#9CA3AF">20</text>
71
- <line x1="441" y1="-16" x2="441" y2="568" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
67
+ <line x1="441" y1="-16" x2="441" y2="625" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
72
68
  <text x="491" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="400" fill="#9CA3AF">25</text>
73
- <line x1="491" y1="-16" x2="491" y2="568" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
69
+ <line x1="491" y1="-16" x2="491" y2="625" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
74
70
  <text x="541" y="-42" text-anchor="middle" dy="1em" font-size="12" font-weight="400" fill="#9CA3AF">30</text>
75
- <line x1="541" y1="-16" x2="541" y2="568" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
71
+ <line x1="541" y1="-16" x2="541" y2="625" stroke="#E5E7EB" stroke-linecap="round" stroke-dasharray="6 6"/>
76
72
  {{#each items as |item index|}}
77
- <g transform="translate(0,{{math 32 '*' index}})">
73
+ <g transform="translate(0,{{math item.label.append_rows '+' (math 26 '*' index)}})">
78
74
  {{bar (math item.mark '*' 10) 16 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=fill transform="translate(241,0)"}}
79
75
  <text x="{{math (math item.mark '*' 10) '+' 235}}" y="0" text-anchor="start" dy=".85em" font-size="16" font-weight="500" fill="#FFFFFF">{{item.mark}}</text>
80
76
  </g>
81
77
  {{/each}}
82
78
  </g>
83
- <rect x="240" y="25" width="1" height="584" rx="0.25" fill="#FFFFFF" stroke-linecap="round" style="filter: drop-shadow(1px 0px 3px rgba(0,0,0, 1));"/>
79
+ <rect x="312" y="25" width="1" height="641" rx="0.25" fill="#FFFFFF" stroke-linecap="round" style="filter: drop-shadow(1px 0px 3px rgba(0,0,0, 1));"/>
80
+ <g transform="translate(0, 47)">
81
+ {{bar 48 108 (object tr=4 br=4 bl=4 tl=4) (toRad 0) fill="#F9FAFB"}}
82
+ <text transform="rotate(-90, 0, 0)" x="-8" y="16" text-anchor="start" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">انفصال و طردشدگی</text>
83
+ </g>
84
+
85
+ <g transform="translate(0, 212)">
86
+ {{bar 48 85 (object tr=4 br=4 bl=4 tl=4) (toRad 0) fill="#F9FAFB"}}
87
+ <text transform="rotate(-90, 0, 0)" x="-42.5" y="8" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">استقلال و</text>
88
+ <text transform="rotate(-90, 0, 0)" x="-42.5" y="24" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">عملکرد معیوب</text>
89
+ </g>
90
+
91
+ <g transform="translate(0, 328)">
92
+ {{bar 48 85 (object tr=4 br=4 bl=4 tl=4) (toRad 0) fill="#F9FAFB"}}
93
+ <text transform="rotate(-90, 0, 0)" x="-42.5" y="8" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">محدودیت‌های</text>
94
+ <text transform="rotate(-90, 0, 0)" x="-42.5" y="24" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">آسیب‌زا</text>
95
+ </g>
96
+
97
+ <g transform="translate(0, 445)">
98
+ {{bar 48 64 (object tr=4 br=4 bl=4 tl=4) (toRad 0) fill="#F9FAFB"}}
99
+ <text transform="rotate(-90, 0, 0)" x="-32" y="8" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">جهت‌گیری</text>
100
+ <text transform="rotate(-90, 0, 0)" x="-32" y="24" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">دگرسو</text>
101
+ </g>
102
+
103
+ <g transform="translate(0, 557)">
104
+ {{bar 48 91 (object tr=4 br=4 bl=4 tl=4) (toRad 0) fill="#F9FAFB"}}
105
+ <text transform="rotate(-90, 0, 0)" x="-45.5" y="8" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">گوش‌ به زنگیِ</text>
106
+ <text transform="rotate(-90, 0, 0)" x="-45.5" y="24" text-anchor="middle" dy=".85em" font-size="12" font-weight="400" fill="#4B5563">افراطی و بازداری</text>
107
+ </g>
84
108
  </g>
85
109
 
86
110
  {{/layout}}