@baravak/risloo-profile-cli 4.13.1 → 4.14.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
package/src/samples/RIASEC93.js
CHANGED
|
@@ -2,7 +2,7 @@ const { Profile, Mappings } = require("../Profile");
|
|
|
2
2
|
|
|
3
3
|
class RIASEC93 extends Profile {
|
|
4
4
|
// Number of pages
|
|
5
|
-
static pages =
|
|
5
|
+
static pages = 2;
|
|
6
6
|
|
|
7
7
|
// Labels of the sample
|
|
8
8
|
labels = {
|
|
@@ -29,15 +29,27 @@ class RIASEC93 extends Profile {
|
|
|
29
29
|
/* calculating its dimensions carefully is of great importance */
|
|
30
30
|
profile: {
|
|
31
31
|
get dimensions() {
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
width: 602 + 2 * this.padding[0].x,
|
|
35
|
+
height: 595 + 2 * this.padding[0].y,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
width: 592 + 2 * this.padding[1].x,
|
|
39
|
+
height: 523 + 2 * this.padding[1].y,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
40
42
|
},
|
|
43
|
+
padding: [
|
|
44
|
+
{
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 51,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
x: 147,
|
|
50
|
+
y: 96,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
41
53
|
},
|
|
42
54
|
/* "items" is the general term used for independent data elements to be drawn in the profile */
|
|
43
55
|
items: {
|
|
@@ -136,9 +148,54 @@ class RIASEC93 extends Profile {
|
|
|
136
148
|
marks: dataset.questions.slice(222, 222 + 6).map((q) => +q.user_answered),
|
|
137
149
|
},
|
|
138
150
|
];
|
|
151
|
+
const itemObject = {}
|
|
152
|
+
let last = undefined
|
|
153
|
+
const list = items.map(item => item.mark).sort((a, b) => b - a).filter((mark, i) => {
|
|
154
|
+
if(i <= 2){
|
|
155
|
+
last = mark
|
|
156
|
+
return true
|
|
157
|
+
}
|
|
158
|
+
if(mark === last){
|
|
159
|
+
return true
|
|
160
|
+
}else{
|
|
161
|
+
return false
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
items.forEach(item => itemObject[item.label.eng] = item)
|
|
165
|
+
const itemRadians = [
|
|
166
|
+
itemObject.artistic,
|
|
167
|
+
itemObject.social,
|
|
168
|
+
itemObject.enterprising,
|
|
169
|
+
itemObject.conventional,
|
|
170
|
+
itemObject.realistic,
|
|
171
|
+
itemObject.investigative
|
|
172
|
+
].map((item, i) =>{
|
|
173
|
+
const mark = (item.mark ?? 0) * 207 / 50
|
|
174
|
+
item.rad = pointsToCoordinates(mark, i * 60)
|
|
175
|
+
item.bold = list.includes(item.mark)
|
|
176
|
+
item.percentage = Math.round((item.mark ?? 0) * 100) / 50
|
|
177
|
+
return item
|
|
178
|
+
})
|
|
139
179
|
|
|
140
|
-
return [{ items, questionItems }];
|
|
180
|
+
return [{ items, questionItems, titleAppend: ' - ۱' }, {itemRadians, titleAppend: ' - ۲'}];
|
|
141
181
|
}
|
|
142
182
|
}
|
|
143
183
|
|
|
184
|
+
function pointsToCoordinates(mark, angle) {
|
|
185
|
+
angle = angle * Math.PI / 180
|
|
186
|
+
const start = [
|
|
187
|
+
296 + 31 * Math.cos(angle),
|
|
188
|
+
261.5 + 31 * Math.sin(angle)
|
|
189
|
+
]
|
|
190
|
+
const end = [
|
|
191
|
+
start[0] + mark * Math.cos(angle),
|
|
192
|
+
start[1] + mark * Math.sin(angle)
|
|
193
|
+
]
|
|
194
|
+
const value = [
|
|
195
|
+
end[0] + 12 * Math.cos(angle),
|
|
196
|
+
end[1] + 12 * Math.sin(angle)
|
|
197
|
+
]
|
|
198
|
+
return {start, end, value}
|
|
199
|
+
}
|
|
200
|
+
|
|
144
201
|
module.exports = RIASEC93;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{{#> layout}}
|
|
2
2
|
|
|
3
|
-
<g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
|
|
3
|
+
<g transform="translate({{spec.profile.padding.[0].x}}, {{spec.profile.padding.[0].y}})">
|
|
4
4
|
<g transform="translate(100, 20)">
|
|
5
5
|
<line x1="0" y1="-10" x2="0" y2="214" stroke="#D4D4D8" stroke-width="2" stroke-linecap="round" />
|
|
6
6
|
{{#each items as | item index |}}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{{#> layout}}
|
|
2
|
+
|
|
3
|
+
<g transform="translate({{spec.profile.padding.[1].x}}, {{spec.profile.padding.[1].y}})">
|
|
4
|
+
<g transform="translate(9, 0)">
|
|
5
|
+
<line x1="176.5" y1="54" x2="415.5" y2="468" stroke="#CBD5E1" stroke-width="1" />
|
|
6
|
+
<line x1="176.5" y1="468" x2="415.5" y2="54" stroke="#CBD5E1" stroke-width="1" />
|
|
7
|
+
|
|
8
|
+
<line x1="176.5" y1="468" x2="176.5" y2="54" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
9
|
+
<line x1="415.5" y1="468" x2="415.5" y2="54" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
10
|
+
|
|
11
|
+
<line x1="57" y1="261" x2="415.5" y2="54" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
12
|
+
<line x1="57" y1="261" x2="415.5" y2="468" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
13
|
+
|
|
14
|
+
<line x1="176.5" y1="54" x2="535" y2="261" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
15
|
+
<line x1="176.5" y1="468" x2="535" y2="261" stroke="#E2E8F0" stroke-width="1" stroke-dasharray="5,5" />
|
|
16
|
+
|
|
17
|
+
<line x1="57" y1="261" x2="535" y2="261" stroke="#CBD5E1" stroke-width="1" />
|
|
18
|
+
|
|
19
|
+
<text x="296" y="42" text-anchor="middle" fill="#CBD5E1" font-size="14" font-weight="500">50</text>
|
|
20
|
+
|
|
21
|
+
<g transform="translate(568, 235)">
|
|
22
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[0].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">A</text>
|
|
23
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[0].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">هنری</text>
|
|
24
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[0].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[2].percentage}} ٪</text>
|
|
25
|
+
</g>
|
|
26
|
+
|
|
27
|
+
<g transform="translate(465, 475)">
|
|
28
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[1].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">S</text>
|
|
29
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[1].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">اجتماعی</text>
|
|
30
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[1].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[2].percentage}} ٪</text>
|
|
31
|
+
</g>
|
|
32
|
+
|
|
33
|
+
<g transform="translate(148, 475)">
|
|
34
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[2].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">E</text>
|
|
35
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[2].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">متهور</text>
|
|
36
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[2].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[1].percentage}} ٪</text>
|
|
37
|
+
</g>
|
|
38
|
+
|
|
39
|
+
<g transform="translate(16, 235)">
|
|
40
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[3].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">C</text>
|
|
41
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[3].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">قراردادی</text>
|
|
42
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[3].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[3].percentage}} ٪</text>
|
|
43
|
+
</g>
|
|
44
|
+
|
|
45
|
+
<g transform="translate(148, 0)">
|
|
46
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[4].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">R</text>
|
|
47
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[4].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">واقعگرا</text>
|
|
48
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[4].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[4].percentage}} ٪</text>
|
|
49
|
+
</g>
|
|
50
|
+
<g transform="translate(465, 0)">
|
|
51
|
+
<text y="0" text-anchor="middle" fill="{{ternary itemRadians.[5].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="700">I</text>
|
|
52
|
+
<text y="16" text-anchor="middle" fill="{{ternary itemRadians.[5].bold '#4F46E5' '#475569'}}" font-size="14" dy=".85em" font-weight="500">جستجوگر</text>
|
|
53
|
+
<text y="38" text-anchor="middle" fill="{{ternary itemRadians.[5].bold '#6366F1' '#64748B'}}" font-size="12" dy=".8em" font-weight="500">{{itemRadians.[5].percentage}} ٪</text>
|
|
54
|
+
</g>
|
|
55
|
+
|
|
56
|
+
{{#each itemRadians as |item|}}
|
|
57
|
+
<line x1="{{item.rad.start.[0]}}" y1="{{item.rad.start.[1]}}" x2="{{item.rad.end.[0]}}" y2="{{item.rad.end.[1]}}" stroke="{{ternary item.bold '#4F46E5' '#475569'}}" stroke-width="3" />
|
|
58
|
+
<circle cx="{{item.rad.value.[0]}}" cy="{{item.rad.value.[1]}}" r="12" fill="{{ternary item.bold '#4F46E5' '#475569'}}" />
|
|
59
|
+
<text x="{{item.rad.value.[0]}}" y="{{item.rad.value.[1]}}" text-anchor="middle" fill="#FFFFFF" font-size="14" font-weight="700" dy=".30em">{{item.mark}}</text>
|
|
60
|
+
{{/each}}
|
|
61
|
+
<path transform="translate(56,53)" d="M359.654 0.753893L479.307 208L359.654 415.246L120.346 415.246L0.69283 208L120.346 0.753883L359.654 0.753893Z" stroke="#94A3B8" fill="none" stroke-width="1.2"/>
|
|
62
|
+
<path transform="translate(264,233)" d="M47.6536 0.887187L63.3072 28L47.6536 55.1128L16.3464 55.1128L0.69282 28L16.3464 0.887185L47.6536 0.887187Z" fill="white" stroke="#CBD5E1" stroke-width="1.2"/>
|
|
63
|
+
<text x="296" y="261.5" text-anchor="middle" fill="#CBD5E1" font-size="14" dy=".25em" font-weight="500">0</text>
|
|
64
|
+
</g>
|
|
65
|
+
</g>
|
|
66
|
+
|
|
67
|
+
{{/layout}}
|