@baravak/risloo-profile-cli 4.6.2 → 4.7.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 +1 -1
- package/src/publish/json/profiles/JSIQ9Q.json +1797 -0
- package/src/publish/json/profiles/JSIQ9V.json +1797 -0
- package/src/samples/JSIQ9Q.js +224 -0
- package/src/samples/JSIQ9V.js +225 -0
- package/views/profiles/samples/JSIQ9Q_1.hbs +214 -0
- package/views/profiles/samples/JSIQ9Q_2.hbs +129 -0
- package/views/profiles/samples/JSIQ9V_1.hbs +214 -0
- package/views/profiles/samples/JSIQ9V_2.hbs +129 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
const { Profile, FS } = require("../Profile");
|
|
2
|
+
|
|
3
|
+
const firstItemCats = [ 'negative', 'positive', 'negative', 'positive', 'negative', 'positive', 'negative', 'positive', 'negative', 'negative', 'negative', 'negative', 'positive', 'positive', 'positive', 'positive', 'positive', 'positive', 'negative', 'negative', 'negative', 'positive', 'positive', 'positive', 'negative', 'positive', 'positive', 'negative', 'negative', 'negative']
|
|
4
|
+
|
|
5
|
+
class JSIQ9Q extends Profile {
|
|
6
|
+
// Number of pages
|
|
7
|
+
static pages = 2;
|
|
8
|
+
|
|
9
|
+
// Labels of the sample
|
|
10
|
+
labels = {
|
|
11
|
+
L0: { eng: "section_1_positive_total", },
|
|
12
|
+
L1: { eng: "section_1_positive_average", },
|
|
13
|
+
|
|
14
|
+
L2: { eng: "section_1_negative_total", },
|
|
15
|
+
L3: { eng: "section_1_negative_average", },
|
|
16
|
+
|
|
17
|
+
L4 : {eng: "section_2_total", fr: "", max:400},
|
|
18
|
+
L5 : {eng: "section_2_percentage", fr: "", max:0},
|
|
19
|
+
L6 : {eng: "section_2_family_system_consciousness_total", fr: "", max:25},
|
|
20
|
+
L7 : {eng: "section_2_family_system_consciousness_percentage", fr: "", max:0},
|
|
21
|
+
L8 : {eng: "section_2_love_giving_total", fr: "", max:120},
|
|
22
|
+
L9 : {eng: "section_2_love_giving_percentage", fr: "", max:0},
|
|
23
|
+
L10 : {eng: "section_2_power_perception_total", fr: "", max:175},
|
|
24
|
+
L12 : {eng: "section_2_power_perception_percentage", fr: "", max:0},
|
|
25
|
+
L13 : {eng: "section_2_sexual_safety_awareness_total", fr: "", max:80},
|
|
26
|
+
L14 : {eng: "section_2_sexual_safety_awareness_percentage", fr: "", max:0},
|
|
27
|
+
|
|
28
|
+
L15 : {eng: "section_2_male_safety_awareness_total", fr: "", max:40},
|
|
29
|
+
L16 : {eng: "section_2_male_safety_awareness_percentage", fr: "", max:0},
|
|
30
|
+
L17 : {eng: "section_2_perceived_safety_from_spouse_total", fr: "", max:40},
|
|
31
|
+
L18 : {eng: "section_2_perceived_safety_from_spouse_percentage", fr: "", max:0},
|
|
32
|
+
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
profileSpec = {
|
|
36
|
+
/* "sample" determines some important info about the sample and profile */
|
|
37
|
+
/* Default prerequisites: 1. gender, 2. age, 3. education */
|
|
38
|
+
/* "prerequisites" is synonym to "fields" in our program */
|
|
39
|
+
sample: {
|
|
40
|
+
name: "پرسشنامه تعامل همسران - فرم آقایان" /* Name of the sample */,
|
|
41
|
+
multiProfile: false /* Whether the sample has multiple profiles or not */,
|
|
42
|
+
questions: true /* Determines whether to get questions from inital dataset or not */,
|
|
43
|
+
defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
|
|
44
|
+
fields: [] /* In case you want to get some additional fields and show in the profile */,
|
|
45
|
+
},
|
|
46
|
+
/* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
|
|
47
|
+
/* calculating its dimensions carefully is of great importance */
|
|
48
|
+
profile: {
|
|
49
|
+
get dimensions() {
|
|
50
|
+
return {
|
|
51
|
+
width: 851 + 2 * this.padding.x,
|
|
52
|
+
height: 676 + 2 * this.padding.y,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
padding: {
|
|
56
|
+
x: 26,
|
|
57
|
+
y: 20,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
/* "labels" part which has to be provided for each profile */
|
|
61
|
+
labels: Object.values(this.labels),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
constructor(dataset, options, config = {}) {
|
|
65
|
+
super();
|
|
66
|
+
this._init(dataset, options, config);
|
|
67
|
+
}
|
|
68
|
+
f4 (data){
|
|
69
|
+
const {
|
|
70
|
+
spec: { parameters: spec },
|
|
71
|
+
dataset,
|
|
72
|
+
} = this;
|
|
73
|
+
const rawSpec = {
|
|
74
|
+
maxValue: 40,
|
|
75
|
+
circle: {
|
|
76
|
+
R: 55,
|
|
77
|
+
r: 55 * .65,
|
|
78
|
+
angles: {
|
|
79
|
+
start: FS.toRadians(-90),
|
|
80
|
+
end: FS.toRadians(180),
|
|
81
|
+
},
|
|
82
|
+
direction: false,
|
|
83
|
+
get totalAngle() {
|
|
84
|
+
return this.direction
|
|
85
|
+
? 2 * Math.PI - (this.angles.end - this.angles.start)
|
|
86
|
+
: this.angles.end - this.angles.start;
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
rawSpec,
|
|
92
|
+
mark: data.mark,
|
|
93
|
+
percentage: Math.round(data.percentage * 100),
|
|
94
|
+
zeta: (data.mark / rawSpec.maxValue) * rawSpec.circle.totalAngle + rawSpec.circle.angles.start,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
firstPage(){
|
|
98
|
+
const {
|
|
99
|
+
spec: { parameters: spec },
|
|
100
|
+
dataset,
|
|
101
|
+
} = this;
|
|
102
|
+
|
|
103
|
+
const raw = {'negative': [[], [], [], [], []], 'positive': [[], [], [], [], []]};
|
|
104
|
+
const itemOptions = {
|
|
105
|
+
negative: [
|
|
106
|
+
{
|
|
107
|
+
color : "#737373",
|
|
108
|
+
bg : "#FAFAFA",
|
|
109
|
+
opacity : 1
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
color : "#991B1B",
|
|
113
|
+
bg : "#DC2626",
|
|
114
|
+
opacity : 0.03
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
color : "#991B1B",
|
|
118
|
+
bg : "#DC2626",
|
|
119
|
+
opacity : 0.06
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
color : "#991B1B",
|
|
123
|
+
bg : "#DC2626",
|
|
124
|
+
opacity : 0.1
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
color : "#991B1B",
|
|
128
|
+
bg : "#DC2626",
|
|
129
|
+
opacity : 0.15
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
positive: [
|
|
133
|
+
{
|
|
134
|
+
color : "#78716C",
|
|
135
|
+
bg : "#FAFAF9",
|
|
136
|
+
opacity : 1
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
color : "#166534",
|
|
140
|
+
bg : "#16A34A",
|
|
141
|
+
opacity : 0.03
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
color : "#166534",
|
|
145
|
+
bg : "#16A34A",
|
|
146
|
+
opacity : 0.06
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
color : "#166534",
|
|
150
|
+
bg : "#16A34A",
|
|
151
|
+
opacity : 0.1
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
color : "#166534",
|
|
155
|
+
bg : "#16A34A",
|
|
156
|
+
opacity : 0.15
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
dataset.questions.slice(0, 30).forEach((row, i) => {
|
|
162
|
+
const answered = parseInt(row.user_answered)
|
|
163
|
+
const cat = firstItemCats[i]
|
|
164
|
+
const newRow = {
|
|
165
|
+
option: itemOptions[cat][answered],
|
|
166
|
+
value: answered,
|
|
167
|
+
label: i === 10 ? 'بیتفاوتی به مسئولیتهای خانواده' :row.text
|
|
168
|
+
}
|
|
169
|
+
raw[cat][answered].push(newRow)
|
|
170
|
+
});
|
|
171
|
+
const positive = {
|
|
172
|
+
average: dataset.score[1].mark,
|
|
173
|
+
items: [...raw.positive[4],...raw.positive[3],...raw.positive[2],...raw.positive[1],...raw.positive[0]],
|
|
174
|
+
breakpoint: null
|
|
175
|
+
}
|
|
176
|
+
positive.items.forEach((item, i) => {
|
|
177
|
+
if (item.value < positive.average && !positive.breakpoint) {
|
|
178
|
+
positive.breakpoint = i
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
const negative = {
|
|
182
|
+
average: dataset.score[3].mark,
|
|
183
|
+
items: [...raw.negative[4],...raw.negative[3],...raw.negative[2],...raw.negative[1],...raw.negative[0]],
|
|
184
|
+
breakpoint: null
|
|
185
|
+
}
|
|
186
|
+
negative.items.forEach((item, i) => {
|
|
187
|
+
if (item.value < negative.average && !negative.breakpoint) {
|
|
188
|
+
negative.breakpoint = i
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
const items = dataset.score.slice(5, 14).filter((r, i) => i %2 !== 0).map((r, i) => {
|
|
192
|
+
r.percentage = Math.round(dataset.score[7 + (i*2)].mark * 100)
|
|
193
|
+
r.percentagex = dataset.score[7 + (i*2)].mark
|
|
194
|
+
return r
|
|
195
|
+
})
|
|
196
|
+
const total = dataset.score[4]
|
|
197
|
+
total.percentage = Math.round(dataset.score[5].mark * 100)
|
|
198
|
+
const f4_1 = dataset.score[14]
|
|
199
|
+
f4_1.percentage = dataset.score[15].mark
|
|
200
|
+
|
|
201
|
+
const f4_2 = dataset.score[16]
|
|
202
|
+
f4_2.percentage = dataset.score[17].mark
|
|
203
|
+
return { positive, negative, items : {
|
|
204
|
+
family: items[0],
|
|
205
|
+
love: items[1],
|
|
206
|
+
power: items[2],
|
|
207
|
+
sexual: items[3],
|
|
208
|
+
}, total, f4_1: this.f4(f4_1), f4_2: this.f4(f4_2),
|
|
209
|
+
titleAppend: ' - آقایان'
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
_calcContext() {
|
|
213
|
+
const firstPageData = this.firstPage()
|
|
214
|
+
return [firstPageData, {
|
|
215
|
+
love: 1 - firstPageData.items.love.percentagex,
|
|
216
|
+
power: 1 - firstPageData.items.power.percentagex,
|
|
217
|
+
titleAppend: firstPageData.titleAppend
|
|
218
|
+
}];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
module.exports = JSIQ9Q;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
const { Profile, FS } = require("../Profile");
|
|
2
|
+
|
|
3
|
+
const firstItemCats = ["negative", "positive", "positive", "positive", "negative", "positive", "negative", "negative", "positive", "negative", "negative", "negative", "negative", "negative", "negative", "positive", "negative", "negative", "negative", "positive", "positive", "positive", "positive", "positive", "positive", "positive", "negative", "positive", "negative", "negative"]
|
|
4
|
+
|
|
5
|
+
class JSIQ9V extends Profile {
|
|
6
|
+
// Number of pages
|
|
7
|
+
static pages = 2;
|
|
8
|
+
|
|
9
|
+
// Labels of the sample
|
|
10
|
+
labels = {
|
|
11
|
+
L0: { eng: "section_1_positive_total", },
|
|
12
|
+
L1: { eng: "section_1_positive_average", },
|
|
13
|
+
|
|
14
|
+
L2: { eng: "section_1_negative_total", },
|
|
15
|
+
L3: { eng: "section_1_negative_average", },
|
|
16
|
+
|
|
17
|
+
L4 : {eng: "section_2_total", fr: "", max:400},
|
|
18
|
+
L5 : {eng: "section_2_percentage", fr: "", max:0},
|
|
19
|
+
L6 : {eng: "section_2_family_system_consciousness_total", fr: "", max:25},
|
|
20
|
+
L7 : {eng: "section_2_family_system_consciousness_percentage", fr: "", max:0},
|
|
21
|
+
L8 : {eng: "section_2_power_giving_total", fr: "", max:140},
|
|
22
|
+
L9 : {eng: "section_2_power_giving_percentage", fr: "", max:0},
|
|
23
|
+
L10 : {eng: "section_2_perception_of_love_total", fr: "", max:150},
|
|
24
|
+
L12 : {eng: "section_2_perception_of_love_percentage", fr: "", max:0},
|
|
25
|
+
L13 : {eng: "section_2_sexual_safety_awareness_total", fr: "", max:85},
|
|
26
|
+
L14 : {eng: "section_2_sexual_safety_awareness_percentage", fr: "", max:0},
|
|
27
|
+
|
|
28
|
+
L15 : {eng: "section_2_female_safety_awareness_total", fr: "", max:30},
|
|
29
|
+
L16 : {eng: "section_2_female_safety_awareness_percentage", fr: "", max:0},
|
|
30
|
+
L17 : {eng: "section_2_perceived_spousal_safety_total", fr: "", max:70},
|
|
31
|
+
L18 : {eng: "section_2_perceived_spousal_safety_percentage", fr: "", max:0},
|
|
32
|
+
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
profileSpec = {
|
|
36
|
+
/* "sample" determines some important info about the sample and profile */
|
|
37
|
+
/* Default prerequisites: 1. gender, 2. age, 3. education */
|
|
38
|
+
/* "prerequisites" is synonym to "fields" in our program */
|
|
39
|
+
sample: {
|
|
40
|
+
name: "پرسشنامه تعامل همسران - فرم خانمها" /* Name of the sample */,
|
|
41
|
+
multiProfile: false /* Whether the sample has multiple profiles or not */,
|
|
42
|
+
questions: true /* Determines whether to get questions from inital dataset or not */,
|
|
43
|
+
defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
|
|
44
|
+
fields: [] /* In case you want to get some additional fields and show in the profile */,
|
|
45
|
+
},
|
|
46
|
+
/* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
|
|
47
|
+
/* calculating its dimensions carefully is of great importance */
|
|
48
|
+
profile: {
|
|
49
|
+
get dimensions() {
|
|
50
|
+
return {
|
|
51
|
+
width: 851 + 2 * this.padding.x,
|
|
52
|
+
height: 676 + 2 * this.padding.y,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
padding: {
|
|
56
|
+
x: 26,
|
|
57
|
+
y: 20,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
/* "labels" part which has to be provided for each profile */
|
|
61
|
+
labels: Object.values(this.labels),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
constructor(dataset, options, config = {}) {
|
|
65
|
+
super();
|
|
66
|
+
this._init(dataset, options, config);
|
|
67
|
+
}
|
|
68
|
+
f4 (data){
|
|
69
|
+
const {
|
|
70
|
+
spec: { parameters: spec },
|
|
71
|
+
dataset,
|
|
72
|
+
} = this;
|
|
73
|
+
const rawSpec = {
|
|
74
|
+
maxValue: data.label.max,
|
|
75
|
+
circle: {
|
|
76
|
+
R: 55,
|
|
77
|
+
r: 55 * .65,
|
|
78
|
+
angles: {
|
|
79
|
+
start: FS.toRadians(-90),
|
|
80
|
+
end: FS.toRadians(180),
|
|
81
|
+
},
|
|
82
|
+
direction: false,
|
|
83
|
+
get totalAngle() {
|
|
84
|
+
return this.direction
|
|
85
|
+
? 2 * Math.PI - (this.angles.end - this.angles.start)
|
|
86
|
+
: this.angles.end - this.angles.start;
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
rawSpec,
|
|
92
|
+
mark: data.mark,
|
|
93
|
+
percentage: Math.round(data.percentage * 100),
|
|
94
|
+
zeta: (data.mark / rawSpec.maxValue) * rawSpec.circle.totalAngle + rawSpec.circle.angles.start,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
firstPage(){
|
|
98
|
+
const {
|
|
99
|
+
spec: { parameters: spec },
|
|
100
|
+
dataset,
|
|
101
|
+
} = this;
|
|
102
|
+
|
|
103
|
+
const raw = {'negative': [[], [], [], [], []], 'positive': [[], [], [], [], []]};
|
|
104
|
+
const itemOptions = {
|
|
105
|
+
negative: [
|
|
106
|
+
{
|
|
107
|
+
color : "#737373",
|
|
108
|
+
bg : "#FAFAFA",
|
|
109
|
+
opacity : 1
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
color : "#991B1B",
|
|
113
|
+
bg : "#DC2626",
|
|
114
|
+
opacity : 0.03
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
color : "#991B1B",
|
|
118
|
+
bg : "#DC2626",
|
|
119
|
+
opacity : 0.06
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
color : "#991B1B",
|
|
123
|
+
bg : "#DC2626",
|
|
124
|
+
opacity : 0.1
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
color : "#991B1B",
|
|
128
|
+
bg : "#DC2626",
|
|
129
|
+
opacity : 0.15
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
positive: [
|
|
133
|
+
{
|
|
134
|
+
color : "#78716C",
|
|
135
|
+
bg : "#FAFAF9",
|
|
136
|
+
opacity : 1
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
color : "#166534",
|
|
140
|
+
bg : "#16A34A",
|
|
141
|
+
opacity : 0.03
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
color : "#166534",
|
|
145
|
+
bg : "#16A34A",
|
|
146
|
+
opacity : 0.06
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
color : "#166534",
|
|
150
|
+
bg : "#16A34A",
|
|
151
|
+
opacity : 0.1
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
color : "#166534",
|
|
155
|
+
bg : "#16A34A",
|
|
156
|
+
opacity : 0.15
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
dataset.questions.slice(0, 30).forEach((row, i) => {
|
|
162
|
+
const answered = parseInt(row.user_answered)
|
|
163
|
+
const cat = firstItemCats[i]
|
|
164
|
+
|
|
165
|
+
const newRow = {
|
|
166
|
+
option: itemOptions[cat][answered],
|
|
167
|
+
value: answered,
|
|
168
|
+
label: i === 7 ? 'بیتفاوتی به مسئولیتهای خانواده' :row.text
|
|
169
|
+
}
|
|
170
|
+
raw[cat][answered].push(newRow)
|
|
171
|
+
});
|
|
172
|
+
const positive = {
|
|
173
|
+
average: dataset.score[1].mark,
|
|
174
|
+
items: [...raw.positive[4],...raw.positive[3],...raw.positive[2],...raw.positive[1],...raw.positive[0]],
|
|
175
|
+
breakpoint: null
|
|
176
|
+
}
|
|
177
|
+
positive.items.forEach((item, i) => {
|
|
178
|
+
if (item.value < positive.average && !positive.breakpoint) {
|
|
179
|
+
positive.breakpoint = i
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
const negative = {
|
|
183
|
+
average: dataset.score[3].mark,
|
|
184
|
+
items: [...raw.negative[4],...raw.negative[3],...raw.negative[2],...raw.negative[1],...raw.negative[0]],
|
|
185
|
+
breakpoint: null
|
|
186
|
+
}
|
|
187
|
+
negative.items.forEach((item, i) => {
|
|
188
|
+
if (item.value < negative.average && !negative.breakpoint) {
|
|
189
|
+
negative.breakpoint = i
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
const items = dataset.score.slice(5, 14).filter((r, i) => i %2 !== 0).map((r, i) => {
|
|
193
|
+
r.percentage = Math.round(dataset.score[7 + (i*2)].mark * 100)
|
|
194
|
+
r.percentagex = dataset.score[7 + (i*2)].mark
|
|
195
|
+
return r
|
|
196
|
+
})
|
|
197
|
+
const total = dataset.score[4]
|
|
198
|
+
total.percentage = Math.round(dataset.score[5].mark * 100)
|
|
199
|
+
const f4_1 = dataset.score[14]
|
|
200
|
+
f4_1.percentage = dataset.score[15].mark
|
|
201
|
+
|
|
202
|
+
const f4_2 = dataset.score[16]
|
|
203
|
+
f4_2.percentage = dataset.score[17].mark
|
|
204
|
+
return { positive, negative, items : {
|
|
205
|
+
family: items[0],
|
|
206
|
+
love: items[1],
|
|
207
|
+
power: items[2],
|
|
208
|
+
sexual: items[3],
|
|
209
|
+
}, total, f4_1: this.f4(f4_1), f4_2: this.f4(f4_2),
|
|
210
|
+
titleAppend: ' - بانوان'
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
_calcContext() {
|
|
214
|
+
const firstPageData = this.firstPage()
|
|
215
|
+
return [firstPageData, {
|
|
216
|
+
love: 1 - firstPageData.items.love.percentagex,
|
|
217
|
+
power: 1 - firstPageData.items.power.percentagex,
|
|
218
|
+
titleAppend: firstPageData.titleAppend
|
|
219
|
+
}];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
module.exports = JSIQ9V;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{{#> layout}}
|
|
2
|
+
<defs>
|
|
3
|
+
<filter id="baseLine" x="0" y="0" width="341" height="7" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
4
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
5
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
6
|
+
<feOffset dy="-1"/>
|
|
7
|
+
<feGaussianBlur stdDeviation="1.5"/>
|
|
8
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
9
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0"/>
|
|
10
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_291_78418"/>
|
|
11
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_291_78418" result="shape"/>
|
|
12
|
+
</filter>
|
|
13
|
+
<linearGradient id="softblue" gradientTransform="rotate(90)">
|
|
14
|
+
<stop offset="0%" stop-color="#0284C7" stop-opacity="1" />
|
|
15
|
+
<stop offset="100%" stop-color="#BAE6FD" stop-opacity="1" />
|
|
16
|
+
</linearGradient>
|
|
17
|
+
<linearGradient id="hardblue" gradientTransform="rotate(90)">
|
|
18
|
+
<stop offset="0%" stop-color="#1D4ED8" stop-opacity="1" />
|
|
19
|
+
<stop offset="100%" stop-color="#93C5FD" stop-opacity="1" />
|
|
20
|
+
</linearGradient>
|
|
21
|
+
{{#with f4_1}}
|
|
22
|
+
<clipPath id="rchart">
|
|
23
|
+
{{gauge rawSpec.circle.R rawSpec.circle.r (object tl=6 tr=6 bl=6 br=6) (object start=rawSpec.circle.angles.start end=rawSpec.circle.angles.end) direction fill="#F1F5F9" stroke="#E4E4E7"}}
|
|
24
|
+
</clipPath>
|
|
25
|
+
{{/with}}
|
|
26
|
+
</defs>
|
|
27
|
+
<g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
|
|
28
|
+
{{!-- <rect x="0" y="0" width="851" height="676" fill="red" opacity=".1" /> --}}
|
|
29
|
+
<g transform="translate(399, 0)">
|
|
30
|
+
<text text-anchor="middle" x="226" font-weight="500" font-size="16" fill="#3F3F46" dy=".78em">صفات همسر</text>
|
|
31
|
+
<g transform="translate(232, 33)">
|
|
32
|
+
<g>
|
|
33
|
+
<rect x="0" y="0" width="220" height="32" fill="#15803D" rx="4" />
|
|
34
|
+
<text text-anchor="middle" x="16" y="16" font-weight="600" font-size="14" fill="#FFFFFF" dy=".27em">{{positive.average}}</text>
|
|
35
|
+
<text text-anchor="start" x="214" y="16" font-weight="600" font-size="14" fill="#FFFFFF" dy=".27em">نگرش مثبت</text>
|
|
36
|
+
</g>
|
|
37
|
+
<g transform="translate(0, 37)">
|
|
38
|
+
{{#each positive.items}}
|
|
39
|
+
<g transform="translate(0, {{math @index '*' 29}})">
|
|
40
|
+
<rect x="0" y="0" width="220" height="24" fill="{{option.bg}}" opacity="{{option.opacity}}" rx="4" />
|
|
41
|
+
<text text-anchor="middle" x="16" y="12" font-weight="400" font-size="13" fill="{{option.color}}" dy=".27em">{{value}}</text>
|
|
42
|
+
<text text-anchor="start" x="214" y="12" font-weight="400" font-size="13" fill="{{option.color}}" dy=".27em">{{label}}</text>
|
|
43
|
+
{{#if (boolean ../positive.breakpoint '===' @index)}}
|
|
44
|
+
<line x1="0" y1="-2.5" x2="220" y2="-2.5" stroke="#16A34A" stroke-linecap="round" stroke-dasharray="4 4"/>
|
|
45
|
+
{{/if}}
|
|
46
|
+
</g>
|
|
47
|
+
{{/each}}
|
|
48
|
+
</g>
|
|
49
|
+
<line x1="33" x2="33" y1="0" y2="496" stroke-width="2" stroke="#FFFFFF" />
|
|
50
|
+
</g>
|
|
51
|
+
<g transform="translate(0, 33)">
|
|
52
|
+
<g>
|
|
53
|
+
<rect x="0" y="0" width="220" height="32" fill="#B91C1C" rx="4" />
|
|
54
|
+
<text text-anchor="middle" x="16" y="16" font-weight="600" font-size="14" fill="#FFFFFF" dy=".27em">{{negative.average}}</text>
|
|
55
|
+
<text text-anchor="start" x="214" y="16" font-weight="600" font-size="14" fill="#FFFFFF" dy=".27em">نگرش منفی</text>
|
|
56
|
+
</g>
|
|
57
|
+
<g transform="translate(0, 37)">
|
|
58
|
+
{{#each negative.items}}
|
|
59
|
+
<g transform="translate(0, {{math @index '*' 29}})">
|
|
60
|
+
<rect x="0" y="0" width="220" height="24" fill="{{option.bg}}" opacity="{{option.opacity}}" rx="4" />
|
|
61
|
+
<text text-anchor="middle" x="16" y="12" font-weight="400" font-size="13" fill="{{option.color}}" dy=".27em">{{value}}</text>
|
|
62
|
+
<text text-anchor="start" x="214" y="12" font-weight="400" font-size="13" fill="{{option.color}}" dy=".27em">{{label}}</text>
|
|
63
|
+
{{#if (boolean ../negative.breakpoint '===' @index)}}
|
|
64
|
+
<line x1="0" y1="-2.5" x2="220" y2="-2.5" stroke="#DC2626" stroke-linecap="round" stroke-dasharray="4 4"/>
|
|
65
|
+
{{/if}}
|
|
66
|
+
</g>
|
|
67
|
+
{{/each}}
|
|
68
|
+
</g>
|
|
69
|
+
<line x1="33" x2="33" y1="0" y2="496" stroke-width="2" stroke="#FFFFFF" />
|
|
70
|
+
</g>
|
|
71
|
+
<g transform="translate(38, 569)">
|
|
72
|
+
<line x1="53" y1="31" x2="333" y2="31" stroke="#E4E4E7"/>
|
|
73
|
+
<circle cx="46" cy="31" r="10" fill="#FAFAFA" />
|
|
74
|
+
<text text-anchor="middle" x="46" y="31" font-weight="400" font-size="12" fill="#52525B" dy=".27em">4</text>
|
|
75
|
+
<text text-anchor="middle" x="46" y="51" font-weight="400" font-size="12" fill="#52525B" dy=".27em">به وضوح وجود دارد</text>
|
|
76
|
+
<circle cx="119.5" cy="31" r="10" fill="#FAFAFA" />
|
|
77
|
+
<text text-anchor="middle" x="119.5" y="31" font-weight="400" font-size="12" fill="#52525B" dy=".27em">3</text>
|
|
78
|
+
<text text-anchor="middle" x="119.5" y="6" font-weight="400" font-size="12" fill="#52525B" dy=".27em">معمولا وجود دارد</text>
|
|
79
|
+
<circle cx="193" cy="31" r="10" fill="#FAFAFA" />
|
|
80
|
+
<text text-anchor="middle" x="193" y="31" font-weight="400" font-size="12" fill="#52525B" dy=".27em">2</text>
|
|
81
|
+
<text text-anchor="middle" x="193" y="51" font-weight="400" font-size="12" fill="#52525B" dy=".27em">نظری ندارم</text>
|
|
82
|
+
<circle cx="266.5" cy="31" r="10" fill="#FAFAFA" />
|
|
83
|
+
<text text-anchor="middle" x="266.5" y="31" font-weight="400" font-size="12" fill="#52525B" dy=".27em">1</text>
|
|
84
|
+
<text text-anchor="middle" x="266.5" y="6" font-weight="400" font-size="12" fill="#52525B" dy=".27em">معمولا وجود ندارد</text>
|
|
85
|
+
<circle cx="340" cy="31" r="10" fill="#FAFAFA" />
|
|
86
|
+
<text text-anchor="middle" x="340" y="31" font-weight="400" font-size="12" fill="#52525B" dy=".27em">0</text>
|
|
87
|
+
<text text-anchor="middle" x="340" y="51" font-weight="400" font-size="12" fill="#52525B" dy=".27em">اصلا وجود ندارد</text>
|
|
88
|
+
|
|
89
|
+
<text text-anchor="start" x="132" y="97" font-weight="400" font-size="12" fill="#B91C1C" dy=".27em">میانگین نگرش منفی</text>
|
|
90
|
+
<line x1="140" y1="97.5" x2="180" y2="97.5" stroke="#DC2626" stroke-linecap="round" stroke-dasharray="4 4"/>
|
|
91
|
+
<text text-anchor="start" x="339" y="97" font-weight="400" font-size="12" fill="#15803D" dy=".27em">میانگین نگرش مثبت</text>
|
|
92
|
+
<line x1="194" y1="97.5" x2="234" y2="97.5" stroke="#16A34A" stroke-linecap="round" stroke-dasharray="4 4"/>
|
|
93
|
+
</g>
|
|
94
|
+
</g>
|
|
95
|
+
<line x1="367" y1="3" x2="367" y2="676" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
|
|
96
|
+
|
|
97
|
+
<g>
|
|
98
|
+
{{#with items.family as | item |}}
|
|
99
|
+
<g transform="translate({{math 38.5 '+' (math 80.5 '*' 0)}}, 0)">
|
|
100
|
+
<text direction="ltr" x="16" y="{{math 273.5 '-' (math item.label.max '*' 1.5)}}" dy=".27em" text-anchor="middle">
|
|
101
|
+
<tspan fill="#0369A1" font-size="16" font-weight="500">{{item.mark}}</tspan>
|
|
102
|
+
<tspan fill="#475569" font-size="12" font-weight="400">/ {{item.label.max}}</tspan>
|
|
103
|
+
</text>
|
|
104
|
+
{{bar 32 (math item.label.max '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="#F1F5F9" transform="translate(32, 285)"}}
|
|
105
|
+
{{bar 32 (math item.mark '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="url(#softblue)" transform="translate(32, 285)"}}
|
|
106
|
+
<g transform="translate(0, 316)">
|
|
107
|
+
<text y="-12" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">
|
|
108
|
+
<tspan x="17.5">هشیاری نسبت به</tspan>
|
|
109
|
+
<tspan x="17.5" y=".4em">سیستم خانواده</tspan>
|
|
110
|
+
</text>
|
|
111
|
+
<g transform="translate(0, 16)">
|
|
112
|
+
<rect height="16" width="35" fill="#F0F9FF" rx="4" />
|
|
113
|
+
<text x="17.5" y="8" dy=".35em" text-anchor="middle" font-size="12" font-weight="400" fill="#0369A1">%{{item.percentage}}</text>
|
|
114
|
+
</g>
|
|
115
|
+
</g>
|
|
116
|
+
</g>
|
|
117
|
+
{{/with}}
|
|
118
|
+
|
|
119
|
+
{{#with items.love as | item |}}
|
|
120
|
+
<g transform="translate({{math 38.5 '+' (math 80.5 '*' 1)}}, 0)">
|
|
121
|
+
<text direction="ltr" x="16" y="{{math 273.5 '-' (math item.label.max '*' 1.5)}}" dy=".27em" text-anchor="middle">
|
|
122
|
+
<tspan fill="#0369A1" font-size="16" font-weight="500">{{item.mark}}</tspan>
|
|
123
|
+
<tspan fill="#475569" font-size="12" font-weight="400">/ {{item.label.max}}</tspan>
|
|
124
|
+
</text>
|
|
125
|
+
{{bar 32 (math item.label.max '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="#F1F5F9" transform="translate(32, 285)"}}
|
|
126
|
+
{{bar 32 (math item.mark '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="url(#softblue)" transform="translate(32, 285)"}}
|
|
127
|
+
<g transform="translate(0, 316)">
|
|
128
|
+
<text x="17.5" y="-12" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">مهردهی</text>
|
|
129
|
+
<rect height="16" width="35" fill="#F0F9FF" rx="4" />
|
|
130
|
+
<text x="17.5" y="8" dy=".35em" text-anchor="middle" font-size="12" font-weight="400" fill="#0369A1">%{{item.percentage}}</text>
|
|
131
|
+
</g>
|
|
132
|
+
</g>
|
|
133
|
+
{{/with}}
|
|
134
|
+
|
|
135
|
+
{{#with items.power as | item |}}
|
|
136
|
+
<g transform="translate({{math 38.5 '+' (math 80.5 '*' 2)}}, 0)">
|
|
137
|
+
<text direction="ltr" x="16" y="{{math 273.5 '-' (math item.label.max '*' 1.5)}}" dy=".27em" text-anchor="middle">
|
|
138
|
+
<tspan fill="#0369A1" font-size="16" font-weight="500">{{item.mark}}</tspan>
|
|
139
|
+
<tspan fill="#475569" font-size="12" font-weight="400">/ {{item.label.max}}</tspan>
|
|
140
|
+
</text>
|
|
141
|
+
{{bar 32 (math item.label.max '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="#F1F5F9" transform="translate(32, 285)"}}
|
|
142
|
+
{{bar 32 (math item.mark '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="url(#softblue)" transform="translate(32, 285)"}}
|
|
143
|
+
<g transform="translate(0, 316)">
|
|
144
|
+
<text x="17.5" y="-12" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">ادراک قدرت</text>
|
|
145
|
+
<rect height="16" width="35" fill="#F0F9FF" rx="4" />
|
|
146
|
+
<text x="17.5" y="8" dy=".35em" text-anchor="middle" font-size="12" font-weight="400" fill="#0369A1">%{{item.percentage}}</text>
|
|
147
|
+
</g>
|
|
148
|
+
</g>
|
|
149
|
+
{{/with}}
|
|
150
|
+
|
|
151
|
+
{{#with items.sexual as | item |}}
|
|
152
|
+
<g transform="translate({{math 38.5 '+' (math 80.5 '*' 3)}}, 0)">
|
|
153
|
+
<text direction="ltr" x="16" y="{{math 273.5 '-' (math item.label.max '*' 1.5)}}" dy=".27em" text-anchor="middle">
|
|
154
|
+
<tspan fill="#0369A1" font-size="16" font-weight="500">{{item.mark}}</tspan>
|
|
155
|
+
<tspan fill="#475569" font-size="12" font-weight="400">/ {{item.label.max}}</tspan>
|
|
156
|
+
</text>
|
|
157
|
+
{{bar 32 (math item.label.max '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="#F1F5F9" transform="translate(32, 285)"}}
|
|
158
|
+
{{bar 32 (math item.mark '*' 1.5 ) (object tl=0 tr=0 br=8 bl=8) (toRad 180) fill="url(#hardblue)" transform="translate(32, 285)"}}
|
|
159
|
+
<g transform="translate(0, 316)">
|
|
160
|
+
<text y="-12" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">
|
|
161
|
+
<tspan x="17.5">توجه ایمنی</tspan>
|
|
162
|
+
<tspan x="17.5" y=".4em">جنسی</tspan>
|
|
163
|
+
</text>
|
|
164
|
+
<g transform="translate(0, 16)">
|
|
165
|
+
<rect height="16" width="35" fill="#F0F9FF" rx="4" />
|
|
166
|
+
<text x="17.5" y="8" dy=".35em" text-anchor="middle" font-size="12" font-weight="400" fill="#0369A1">%{{item.percentage}}</text>
|
|
167
|
+
</g>
|
|
168
|
+
</g>
|
|
169
|
+
</g>
|
|
170
|
+
{{/with}}
|
|
171
|
+
|
|
172
|
+
<g transform="translate(0, 281)" filter="url(#baseLine)">
|
|
173
|
+
<rect x="3" y="4" width="335" height="1" rx="0.5" fill="white"/>
|
|
174
|
+
</g>
|
|
175
|
+
|
|
176
|
+
<g transform="translate(7.5, 420)">
|
|
177
|
+
<text y="-14" dy=".35em" text-anchor="end" font-size="13" font-weight="400" fill="#334155">نمره کل</text>
|
|
178
|
+
<text y="-14" x="320" dy=".35em" text-anchor="start" font-size="13" font-weight="400" fill="#334155">400</text>
|
|
179
|
+
{{bar 320 20 (object tl=0 tr=10 br=10 bl=0) (toRad 0) fill="#F1F5F9" }}
|
|
180
|
+
{{bar (math total.mark '*' 0.8) 20 (object tl=0 tr=10 br=10 bl=0) (toRad 0) fill="#64748B" }}
|
|
181
|
+
<text y="36" x="{{math total.mark '*' 0.8}}" dy=".35em" text-anchor="middle" font-size="20" font-weight="500" fill="#334155">{{total.mark}}</text>
|
|
182
|
+
<text y="50" x="{{math total.mark '*' 0.8}}" dy=".35em" text-anchor="middle" font-size="12" font-weight="400" fill="#334155">%{{total.percentage}}</text>
|
|
183
|
+
</g>
|
|
184
|
+
</g>
|
|
185
|
+
<g transform="translate(270.5, 575)">
|
|
186
|
+
<text y="-60" text-anchor="end" font-size="12" font-weight="400" fill="#475569">0</text>
|
|
187
|
+
<text x="-45" y="-8" text-anchor="middle" font-size="12" font-weight="400" fill="#475569">40</text>
|
|
188
|
+
<text y="-.2em" text-anchor="middle">
|
|
189
|
+
<tspan x="0" font-size="20" font-weight="500" fill="#2563EB">{{f4_1.mark}}</tspan>
|
|
190
|
+
<tspan x="0" y=".9em" font-size="16" font-weight="400" fill="#64748B">%{{f4_1.percentage}}</tspan>
|
|
191
|
+
</text>
|
|
192
|
+
{{#with f4_1}}
|
|
193
|
+
{{gauge rawSpec.circle.R rawSpec.circle.r (object tl=6 tr=6 bl=6 br=6) (object start=rawSpec.circle.angles.start end=rawSpec.circle.angles.end) direction fill="#F1F5F9"}}
|
|
194
|
+
{{gauge rawSpec.circle.R rawSpec.circle.r (object tl=6 tr=0 bl=6 br=0) (object start=rawSpec.circle.angles.start end=zeta) direction clip-path="url(#rchart)" fill='#6183E4'}}
|
|
195
|
+
{{/with}}
|
|
196
|
+
<text y="75" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">توجه / ایمنیبخشی</text>
|
|
197
|
+
</g>
|
|
198
|
+
|
|
199
|
+
<g transform="translate(92.5, 575)">
|
|
200
|
+
<text y="-60" text-anchor="end" font-size="12" font-weight="400" fill="#475569">0</text>
|
|
201
|
+
<text x="-45" y="-8" text-anchor="middle" font-size="12" font-weight="400" fill="#475569">40</text>
|
|
202
|
+
<text y="-.2em" text-anchor="middle">
|
|
203
|
+
<tspan x="0" font-size="20" font-weight="500" fill="#2563EB">{{f4_2.mark}}</tspan>
|
|
204
|
+
<tspan x="0" y=".9em" font-size="16" font-weight="400" fill="#64748B">%{{f4_2.percentage}}</tspan>
|
|
205
|
+
</text>
|
|
206
|
+
{{#with f4_2}}
|
|
207
|
+
{{gauge rawSpec.circle.R rawSpec.circle.r (object tl=6 tr=6 bl=6 br=6) (object start=rawSpec.circle.angles.start end=rawSpec.circle.angles.end) direction fill="#F1F5F9"}}
|
|
208
|
+
{{gauge rawSpec.circle.R rawSpec.circle.r (object tl=6 tr=0 bl=6 br=0) (object start=rawSpec.circle.angles.start end=zeta) direction clip-path="url(#rchart)" fill='#6183E4'}}
|
|
209
|
+
{{/with}}
|
|
210
|
+
<text y="75" text-anchor="middle" font-size="13" font-weight="400" fill="#475569">توجه / ایمنی ادراکشده از همسر</text>
|
|
211
|
+
</g>
|
|
212
|
+
</g>
|
|
213
|
+
|
|
214
|
+
{{/layout}}
|