@baravak/risloo-profile-cli 4.2.8 → 4.3.1

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.
@@ -0,0 +1,106 @@
1
+ const { Profile } = require("../Profile");
2
+
3
+ class JSIQ93 extends Profile {
4
+ // Number of pages
5
+ static pages = 1;
6
+
7
+ // Labels of the sample
8
+ labels = {
9
+ L0 : {eng: "total", fa: "", max: 0},
10
+ L1 : {eng: "section_1_total", fa: "", max: 0},
11
+ L2 : {eng: "section_1_anger", fa: "عصبانیت", max: 0},
12
+ L3 : {eng: "section_1_tasteful", fa: "با سلیقه‌گی", max: 0},
13
+ L4 : {eng: "section_1_homemaker", fa: "کدبانوگری", max: 0},
14
+ L5 : {eng: "section_1_caring", fa: "مراقبت‌کنندگی", max: 0},
15
+ L6 : {eng: "section_1_jealousy", fa: "حسادت", max: 0},
16
+ L7 : {eng: "section_1_bighearted", fa: "دست و دلبازی", max: 0},
17
+ L8 : {eng: "section_1_grudge", fa: "کینه‌ای بودن", max: 0},
18
+ L9 : {eng: "section_1_courage", fa: "شجاعت", max: 0},
19
+ L10 : {eng: "section_1_irritable", fa: "زود رنجی", max: 0},
20
+ L11 : {eng: "section_1_sensitivity", fa: "حساسیت", max: 0},
21
+ L12 : {eng: "section_1_incuriosity", fa: "بی تفاوتی", max: 0},
22
+ L13 : {eng: "section_1_lack_of_understanding_of_the_spouse", fa: "عدم درک همسر", max: 0},
23
+ L14 : {eng: "section_1_reassure", fa: "دلگرمی دادن", max: 0},
24
+ L15 : {eng: "section_1_chaste", fa: "عفیف", max: 0},
25
+ L16 : {eng: "section_1_genial", fa: "خونگرم", max: 0},
26
+ L17 : {eng: "section_1_being_alarming", fa: "تشویق‌گر بودن", max: 0},
27
+ L18 : {eng: "section_1_being_persuasive", fa: "ترغیب‌گر بودن", max: 0},
28
+ L19 : {eng: "section_1_respectable", fa: "اهل احترام", max: 0},
29
+ L20 : {eng: "section_1_blamer", fa: "سرزنش‌گر", max: 0},
30
+ L21 : {eng: "section_1_others_influens", fa: "تأثیرپذیری از دیگران", max: 0},
31
+ L22 : {eng: "section_1_resistant_to_me", fa: "مقاوم بودن در برابر من", max: 0},
32
+ L23 : {eng: "section_1_flexibility", fa: "انعطاف", max: 0},
33
+ L24 : {eng: "section_1_secrecy", fa: "رازداری", max: 0},
34
+ L25 : {eng: "section_1_good_motherhood", fa: "مادرگری خوب", max: 0},
35
+ L26 : {eng: "section_1_hurry", fa: "عجول بودن", max: 0},
36
+ L27 : {eng: "section_1_faithful", fa: "با وفا", max: 0},
37
+ L28 : {eng: "section_1_stable", fa: "با ثبات", max: 0},
38
+ L29 : {eng: "section_1_capricious", fa: "دمدمی‌مزاج", max: 0},
39
+ L30 : {eng: "section_1_starnger_permeability", fa: "نفوذپذیری از غریبه‌ها", max: 0},
40
+ L31 : {eng: "section_1_wisdom", fa: "عاقل", max: 0},
41
+ L32 : {eng: "section_2_total", fa: "", max: 425},
42
+ L33 : {eng: "section_2_awareness_of_the_family_system", fa: "هشیاری نسبت به سیستم خانواده", max: 25},
43
+ L34 : {eng: "section_2_give_love", fa: "مهردهی", max: 140},
44
+ L35 : {eng: "section_2_perception_of_power", fa: "ادراک قدرت", max: 185},
45
+ L36 : {eng: "section_2_attention_sexual_safety", fa: "توجه ایمنی جنسی", max: 75},
46
+ };
47
+
48
+ profileSpec = {
49
+ /* "sample" determines some important info about the sample and profile */
50
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
51
+ /* "prerequisites" is synonym to "fields" in our program */
52
+ sample: {
53
+ name: "پرسشنامه تعامل همسران - ویرایش فرم آقایان" /* Name of the sample */,
54
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
55
+ questions: true /* Determines whether to get questions from inital dataset or not */,
56
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
57
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
58
+ },
59
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
60
+ /* calculating its dimensions carefully is of great importance */
61
+ profile: {
62
+ get dimensions() {
63
+ return {
64
+ width: 863 + (2 * this.padding.x),
65
+ height: 643 + (2 * this.padding.y),
66
+ };
67
+ },
68
+ padding: {
69
+ x: 20,
70
+ y: 33.5,
71
+ },
72
+ },
73
+
74
+ /* "labels" part which has to be provided for each profile */
75
+ labels: Object.values(this.labels),
76
+ };
77
+
78
+ constructor(dataset, options, config = {}) {
79
+ super();
80
+ this._init(dataset, options, config);
81
+ }
82
+
83
+ _calcContext() {
84
+ const {
85
+ spec: { parameters: spec },
86
+ dataset,
87
+ } = this;
88
+ const top = {
89
+ total: {...dataset.score[32], percentage: Math.round((dataset.score[32].mark / dataset.score[32].label.max) * 100)},
90
+ items: dataset.score.slice(33, 37).map(r => {
91
+ r.percentage = Math.round((r.mark / r.label.max) * 100)
92
+ return r
93
+ })
94
+ }
95
+ const items = dataset.score.slice(2, 32).map((r, i) => {
96
+ r.col = Math.floor(i /10)
97
+ r.row = i % 10
98
+ r.fill = r.row % 2 == 1 ? '#FAF5FF' : '#F5F3FF'
99
+ r.color = r.row % 2 == 1 ? '#6B21A8' : '#5B21B6'
100
+ return r
101
+ })
102
+ return [{ top, items }];
103
+ }
104
+ }
105
+
106
+ module.exports = JSIQ93;
@@ -0,0 +1,112 @@
1
+ const { Profile } = require("../Profile");
2
+
3
+ class JSIQ93 extends Profile {
4
+ // Number of pages
5
+ static pages = 1;
6
+
7
+ // Labels of the sample
8
+ labels = {
9
+ L0 : {eng: "total", max:0, fa: ""},
10
+ L1 : {eng: "section_1_total", max:0, fa: ""},
11
+ L2 : {eng: "section_1_anger", max:0, fa: "عصبانیت"},
12
+ L3 : {eng: "section_1_courage", max:0, fa: "شجاعت"},
13
+ L4 : {eng: "section_1_compassion", max:0, fa: "عطوفت"},
14
+ L5 : {eng: "section_1_bighearted", max:0, fa: "دست و دل‌ بازی"},
15
+ L6 : {eng: "section_1_grudge", max:0, fa: "کینه‌ورز بودن"},
16
+ L7 : {eng: "section_1_masculinity", max:0, fa: "مردانگی"},
17
+ L8 : {eng: "section_1_pessimism", max:0, fa: "بدبینی"},
18
+ L9 : {eng: "section_1_incuriosity", max:0, fa: "بی‌تفاوتی"},
19
+ L10 : {eng: "section_1_fidelity", max:0, fa: "وفاداری"},
20
+ L11 : {eng: "section_1_selfishness", max:0, fa: "خودخواهی"},
21
+ L12 : {eng: "section_1_intimacy", max:0, fa: "صمیمیت"},
22
+ L13 : {eng: "section_1_talkative", max:0, fa: "پرگویی"},
23
+ L14 : {eng: "section_1_mindlessness", max:0, fa: "بی‌فکری"},
24
+ L15 : {eng: "section_1_sophist", max:0, fa: "زبان‌بازی"},
25
+ L16 : {eng: "section_1_power", max:0, fa: "قدرت"},
26
+ L17 : {eng: "section_1_silence", max:0, fa: "سکوت"},
27
+ L18 : {eng: "section_1_independence", max:0, fa: "استقلال"},
28
+ L19 : {eng: "section_1_patronage", max:0, fa: "حمایت‌گری"},
29
+ L20 : {eng: "section_1_spouse_friendship", max:0, fa: "همسر دوستی"},
30
+ L21 : {eng: "section_1_forgiveness", max:0, fa: "بخشش"},
31
+ L22 : {eng: "section_2_total", max:525, fa: ""},
32
+ L23 : {eng: "section_2_family_structure", max:40, fa: "ساختار خانواده"},
33
+ L24 : {eng: "section_2_give_power", max:135, fa: "قدرت‌دهی"},
34
+ L25 : {eng: "section_2_perception_of_love", max:155, fa: "ادراک مهر"},
35
+ L26 : {eng: "section_2_attention_sexual_safety", max:100, fa: "توجه ایمنی جنسی"},
36
+ L27 : {eng: "section_2_woman_inattention", max:20, fa: "بی‌توجهی زن"},
37
+ L28 : {eng: "section_2_perceived_inattention", max:25, fa: "بی‌توجهی شوهر"},
38
+ L29 : {eng: "section_2_women_give_safety", max:20, fa: "ایمنی بخشی زن"},
39
+ L30 : {eng: "section_2_perceived_safety", max:30, fa: "ایمنی ادراک‌دشده"},
40
+ L31 : {eng: "section_3_q_1", max:0, fa: "همسران باید بتوانند ذهن یکدیگر را بخوانند."},
41
+ L32 : {eng: "section_3_q_2", max:0, fa: "همسر باید یک شریک جنسی عالی باشد."},
42
+ L33 : {eng: "section_3_q_3", max:0, fa: "اختلاف، رابطه را تخریب می‌کند."},
43
+ L34 : {eng: "section_3_q_4", max:0, fa: "همسران نمی‌توانند خود و یا رابطه‌شان را تغییر دهند."},
44
+ L35 : {eng: "section_3_q_5", max:0, fa: "مردان و زنان شخصیت‌ها و نیازهای بسیار متفاوتی دارند."},
45
+ };
46
+
47
+ profileSpec = {
48
+ /* "sample" determines some important info about the sample and profile */
49
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
50
+ /* "prerequisites" is synonym to "fields" in our program */
51
+ sample: {
52
+ name: "پرسشنامه تعامل همسران - ویرایش فرم زنان" /* Name of the sample */,
53
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
54
+ questions: true /* Determines whether to get questions from inital dataset or not */,
55
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
56
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
57
+ },
58
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
59
+ /* calculating its dimensions carefully is of great importance */
60
+ profile: {
61
+ get dimensions() {
62
+ return {
63
+ width: 865 + (2 * this.padding.x),
64
+ height: 691 + (2 * this.padding.y),
65
+ };
66
+ },
67
+ padding: {
68
+ x: 19,
69
+ y: 11.5,
70
+ },
71
+ },
72
+
73
+ /* "labels" part which has to be provided for each profile */
74
+ labels: Object.values(this.labels),
75
+ };
76
+
77
+ constructor(dataset, options, config = {}) {
78
+ super();
79
+ this._init(dataset, options, config);
80
+ }
81
+
82
+ _calcContext() {
83
+ const {
84
+ spec: { parameters: spec },
85
+ dataset,
86
+ } = this;
87
+ const top = {
88
+ total: {...dataset.score[22], percentage: Math.round((dataset.score[22].mark / dataset.score[22].label.max) * 100)},
89
+ items: dataset.score.slice(23, 31).map(r => {
90
+ r.percentage = Math.round((r.mark / r.label.max) * 100)
91
+ return r
92
+ })
93
+ }
94
+ const items = dataset.score.slice(2, 22).map((r, i) => {
95
+ r.col = Math.floor(i /10)
96
+ r.row = i % 10
97
+ r.fill = r.row % 2 == 1 ? '#FAF5FF' : '#F5F3FF'
98
+ r.color = r.row % 2 == 1 ? '#6B21A8' : '#5B21B6'
99
+ return r
100
+ })
101
+
102
+ const aggrees = dataset.score.slice(31, 36).map((r, i) => {
103
+ r.fa = r.mark === 'agreement'? 'موافق' : 'مخالف'
104
+ r.fill = r.mark === 'agreement' ? '#F0FDFA' : '#FDF2F8'
105
+ r.color = r.mark === 'agreement' ? '#115E59' : '#BE185D'
106
+ return r
107
+ })
108
+ return [{ top, items, aggrees }];
109
+ }
110
+ }
111
+
112
+ module.exports = JSIQ93;
@@ -1,5 +1,4 @@
1
1
  const { Profile, FS, Mappings } = require("../Profile");
2
-
3
2
  class YSQ93 extends Profile {
4
3
  // Number of pages
5
4
  static pages = 1;
@@ -74,31 +73,31 @@ class YSQ93 extends Profile {
74
73
  const a6 = [];
75
74
  let start = 0;
76
75
  const a5_line = [32]
77
- for(let j = 0; j < 5; j++){
78
- const key = i + (j * 18);
79
- if(dataset.questions[key].user_answered == 5){
80
- if(!a5.length){
81
- start+= 37
82
- }else{
83
- start+= 26
84
- }
85
- a5.push({item: key+1, start:start})
76
+ factors_key[s.label.eng].forEach((e, ei) => {
77
+ e = parseInt(e)
78
+ if(dataset.questions[e - 1].user_answered == 5){
79
+ if(!a5.length){
80
+ start+= 37
81
+ }else{
82
+ start+= 26
86
83
  }
87
- }
84
+ a5.push({item: e, start:start})
85
+ }
86
+ });
88
87
  a5_line.push(start + 2)
89
88
  const a6_start = start ? start + 36 : 0;
90
89
  const a6_line = [a6_start + 32]
91
- for(let j = 0; j < 5; j++){
92
- const key = i + (j * 18);
93
- if(dataset.questions[key].user_answered == 6){
94
- if(!a6.length){
95
- start = a6_start + 37
96
- }else{
97
- start+= 26
98
- }
99
- a6.push({item: key+1, start:start})
90
+ factors_key[s.label.eng].forEach((e, ei) => {
91
+ e = parseInt(e)
92
+ if(dataset.questions[e -1].user_answered == 6){
93
+ if(!a6.length){
94
+ start = a6_start + 37
95
+ }else{
96
+ start+= 26
100
97
  }
98
+ a6.push({item: e, start:start})
101
99
  }
100
+ })
102
101
  a6_line.push(start + 2)
103
102
  const is_critical = a5.length + a6.length >= 3 ? true : false
104
103
  return Object.assign({}, s, {
@@ -118,5 +117,39 @@ class YSQ93 extends Profile {
118
117
  return [{ items }];
119
118
  }
120
119
  }
120
+ const f1= 'ed'
121
+ const f2 = 'ab'
122
+ const f3 = 'ma'
123
+ const f4 = 'si'
124
+ const f5 = 'ds'
125
+ const f6 = 'fa'
126
+ const f7 = 'ai'
127
+ const f8 = 'vu'
128
+ const f9 = 'eu'
129
+ const f10 = 'sb'
130
+ const f11 = 'ss'
131
+ const f12 = 'ei'
132
+ const f13 = 'us'
133
+ const f14 = 'et'
134
+ const f15 = 'is'
135
+ const f16 = 'as'
136
+ const f17 = 'np'
137
+ const f18 = 'pu'
121
138
 
139
+ const factors_item = {
140
+ 1: f1, 2: f2, 3: f3, 4: f4, 5: f5, 6: f6, 7: f7, 8: f8, 9: f9, 10: f10, 11: f11, 12: f12, 13: f13, 14: f14, 15: f15, 16: f16, 17: f17, 18: f18,
141
+ 19: f1, 20: f2, 21: f3, 22: f4, 23: f5, 24: f6, 25: f7, 26: f8, 27: f9, 28: f10, 29: f11, 30: f12, 31: f13, 32: f14, 33: f15, 34: f16, 35: f17, 36: f18,
142
+ 37: f1, 38: f2, 39: f3, 40: f4, 41: f5, 42: f6, 43: f7, 44: f8, 45: f9, 46: f10, 47: f11, 48: f12, 49: f13, 50: f14, 51: f15, 52: f16, 53: f17, 54: f18,
143
+ 55: f1, 56: f2, 57: f3, 58: f4, 59: f5, 60: f6, 61: f7, 62: f8, 63: f9, 64: f10, 65: f11, 66: f12, 67: f13, 68: f14, 69: f15, 70: f16, 71: f17, 72: f18,
144
+ 73: f1, 74: f2, 75: f3, 76: f4, 77: f5, 78: f6, 79: f7, 80: f8, 81: f9, 82: f10, 83: f11, 84: f12, 85: f13, 86: f14, 87: f15, 88: f16, 89: f17, 90: f18
145
+ }
146
+ const factors_key = {}
147
+ for(const fi in factors_item){
148
+ const fk = factors_item[fi]
149
+ if(factors_key[fk] === undefined){
150
+ factors_key[fk] = [fi]
151
+ }else{
152
+ factors_key[fk].push(fi)
153
+ }
154
+ }
122
155
  module.exports = YSQ93;
@@ -0,0 +1,91 @@
1
+ {{#> layout}}
2
+ <defs>
3
+ {{#each top.items}}
4
+ <clipPath id="barTop-{{@index}}">
5
+ {{bar (math 2 '*' label.max) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) }}
6
+ </clipPath>
7
+ {{/each}}
8
+ <clipPath id="barTop-total">
9
+ {{bar 20 212.5 (object tr=0 br=10 bl=10 tl=0) (toRad 180) }}
10
+ </clipPath>
11
+ <linearGradient id="line-bar" x1="0%" y1="0%" x2="100%" y2="0%">
12
+ <stop offset="0%" style="stop-color:#BAE6FD;stop-opacity:1" />
13
+ <stop offset="100%" style="stop-color:#0284C7;stop-opacity:1" />
14
+ </linearGradient>
15
+ </defs>
16
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
17
+ {{!-- <rect width="863" height="643" fill="blue" opacity=".1"/> --}}
18
+ <g transform="translate(26.55, 0)">
19
+ <g transform="translate(0, 8)">
20
+ {{#each top.items}}
21
+ <g transform="translate(0, {{math @index '*' 41}})">
22
+ <text text-anchor="start" x="185" font-weight="400" font-size="14" fill="#475569" dy=".78em">{{label.fa}}</text>
23
+ <g transform="translate(192, 0)">
24
+ {{bar (math 2 '*' label.max) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#F1F5F9" id=(concat 'x' @index)}}
25
+ {{bar (math 2 '*' mark) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="url(#line-bar)" clip-path=(concat "url(#barTop-" (concat @index ')'))}}
26
+ <g transform="translate({{math 8 '+' (math 2 '*' label.max)}}, 0)">
27
+ <text text-anchor="start" dy=".85em" direction="ltr">
28
+ <tspan font-weight="500" font-size="16" fill="#0369A1">{{mark}}</tspan>
29
+ <tspan font-weight="400" font-size="12" fill="#475569">/ {{label.max}}</tspan>
30
+ </text>
31
+ <g transform="translate(70, 0)">
32
+ <rect width="35" height="16" fill="#F0F9FF" rx="4" />
33
+ <text text-anchor="middle" x="17.5" font-weight="400" font-size="12" fill="#0369A1" dy="1em">%{{percentage}}</text>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ </g>
38
+ {{/each}}
39
+ </g>
40
+ <rect x="191" y="0" width="1" height="153" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .5));"/>
41
+ <g transform="translate(746, 0)">
42
+ <text text-anchor="start" x="-8" font-weight="400" font-size="14" fill="#334155" dy=".75em">425</text>
43
+ <text text-anchor="end" x="28" y="{{math 218 '-' (math top.total.mark '/' 2)}}" font-weight="500" font-size="20" fill="#334155">{{top.total.mark}}</text>
44
+ <text text-anchor="end" x="28" y="{{math 218 '-' (math top.total.mark '/' 2)}}" font-weight="400" font-size="12" fill="#334155" dy="1.25em">%{{top.total.percentage}}</text>
45
+ <text text-anchor="end" font-weight="400" font-size="14" fill="#334155" dy="1.25em" transform="rotate(-90) translate(-218, -28)">نمره کل</text>
46
+ {{bar 20 212.5 (object tr=0 br=10 bl=10 tl=0) (toRad 180) fill="#F1F5F9" transform="translate(20, 218)"}}
47
+ {{bar 20 (math top.total.mark '/' 2) (object tr=0 br=10 bl=10 tl=0) (toRad 180) fill="#64748B" transform="translate(20, 218)" clip-path="url(#barTop-total)"}}
48
+ <rect x="-1" y="218" width="22" height="1" rx="1" fill="#FFFFFF" style="filter: drop-shadow(1px 0 2px rgba(0,0,0, .5));"/>
49
+ </g>
50
+ </g>
51
+ <line x1="0" x2="863" y1="251.5" y2="251.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6" />
52
+ <g transform="translate(132.5, 284)">
53
+ {{#each items}}
54
+ <g transform="translate({{math 376 '-' (math 188 '*' col)}}, {{math 28 '*' row}})">
55
+ {{bar 32 24 (object tr=0 br=0 bl=2 tl=2) (toRad 0) fill=fill opacity='.5'}}
56
+ {{bar 146 24 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=fill opacity='.5' transform="translate(34, 0)"}}
57
+ <text text-anchor="middle" x="16" y="12" font-weight="400" font-size="13" fill="{{color}}" dy=".25em">{{ternary (boolean mark '===' undefined) '0' mark}}</text>
58
+ <text text-anchor="start" x="174" y="12" font-weight="400" font-size="13" fill="{{color}}" dy=".25em">{{label.fa}}</text>
59
+ </g>
60
+ {{/each}}
61
+ <line x1="143" x2="423" y1="331.5" y2="331.5" stroke="#E4E4E7"/>
62
+ <g transform="translate(126, 321)">
63
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
64
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">4</text>
65
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">به وضوح وجود دارد</text>
66
+ </g>
67
+ <g transform="translate(199.5, 321)">
68
+ <text text-anchor="middle" x="10" y="-8" font-weight="400" font-size="12" fill="#52525B">معمولا وجود دارد</text>
69
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
70
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">3</text>
71
+ </g>
72
+ <g transform="translate(273, 321)">
73
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
74
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">2</text>
75
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">نظری ندارم</text>
76
+ </g>
77
+ <g transform="translate(346.5, 321)">
78
+ <text text-anchor="middle" x="10" y="-8" font-weight="400" font-size="12" fill="#52525B">معمولا وجود ندارد</text>
79
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
80
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">1</text>
81
+ </g>
82
+ <g transform="translate(420, 321)">
83
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
84
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">0</text>
85
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">اصلا وجود ندارد</text>
86
+ </g>
87
+ <text text-anchor="start" font-weight="400" font-size="14" fill="#334155" transform="rotate(-90) translate(-103, 584)">صفات همسر</text>
88
+ </g>
89
+ </g>
90
+
91
+ {{/layout}}
@@ -0,0 +1,107 @@
1
+ {{#> layout}}
2
+ <defs>
3
+ {{#each top.items}}
4
+ <clipPath id="barTop-{{@index}}">
5
+ {{bar (math 2 '*' label.max) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) }}
6
+ </clipPath>
7
+ {{/each}}
8
+ <clipPath id="barTop-total">
9
+ {{bar 20 262.5 (object tr=0 br=10 bl=10 tl=0) (toRad 180) }}
10
+ </clipPath>
11
+ <linearGradient id="line-bar" x1="0%" y1="0%" x2="100%" y2="0%">
12
+ <stop offset="0%" style="stop-color:#BAE6FD;stop-opacity:1" />
13
+ <stop offset="100%" style="stop-color:#0284C7;stop-opacity:1" />
14
+ </linearGradient>
15
+ </defs>
16
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
17
+ <g transform="translate(22, 0)">
18
+ <g transform="translate(0, 8)">
19
+ {{#each top.items}}
20
+ <g transform="translate(0, {{math @index '*' 34}})">
21
+ <text text-anchor="start" x="103" font-weight="400" font-size="14" fill="#475569" dy=".78em">{{label.fa}}</text>
22
+ <g transform="translate(110, 0)">
23
+ {{bar (math 3 '*' label.max) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="#F1F5F9" id=(concat 'x' @index)}}
24
+ {{bar (math 3 '*' mark) 16 (object tr=8 br=8 bl=0 tl=0) (toRad 0) fill="url(#line-bar)" clip-path=(concat "url(#barTop-" (concat @index ')'))}}
25
+ <g transform="translate({{math 8 '+' (math 3 '*' label.max)}}, 0)">
26
+ <text text-anchor="start" dy=".85em" direction="ltr">
27
+ <tspan font-weight="500" font-size="16" fill="#0369A1">{{mark}}</tspan>
28
+ <tspan font-weight="400" font-size="12" fill="#475569">/ {{label.max}}</tspan>
29
+ </text>
30
+ <g transform="translate(70, 0)">
31
+ <rect width="35" height="16" fill="#F0F9FF" rx="4" />
32
+ <text text-anchor="middle" x="17.5" font-weight="400" font-size="12" fill="#0369A1" dy="1em">%{{percentage}}</text>
33
+ </g>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ {{/each}}
38
+ </g>
39
+ <rect x="109" y="0" width="1" height="270" rx="0.25" fill="#FFFFFF" style="filter: drop-shadow(2px 0px 2px rgba(0,0,0, .5));"/>
40
+ <g transform="translate(759, 0)">
41
+ <text text-anchor="start" x="-8" font-weight="400" font-size="14" fill="#334155" dy=".75em">{{top.total.label.max}}</text>
42
+ <text text-anchor="end" x="28" y="{{math 267 '-' (math top.total.mark '/' 2)}}" font-weight="500" font-size="20" fill="#334155">{{top.total.mark}}</text>
43
+ <text text-anchor="end" x="28" y="{{math 267 '-' (math top.total.mark '/' 2)}}" font-weight="400" font-size="12" fill="#334155" dy="1.25em">%{{top.total.percentage}}</text>
44
+ <text text-anchor="end" font-weight="400" font-size="14" fill="#334155" dy="1.25em" transform="rotate(-90) translate(-267, -28)">نمره کل</text>
45
+ {{bar 20 262.5 (object tr=0 br=10 bl=10 tl=0) (toRad 180) fill="#F1F5F9" transform="translate(20, 267)"}}
46
+ {{bar 20 (math top.total.mark '/' 2) (object tr=0 br=10 bl=10 tl=0) (toRad 180) fill="#64748B" transform="translate(20, 267)" clip-path="url(#barTop-total)"}}
47
+ <rect x="-1" y="267" width="22" height="1" rx="1" fill="#FFFFFF" style="filter: drop-shadow(1px 0 2px rgba(0,0,0, .5));"/>
48
+ </g>
49
+ </g>
50
+ <line x1="0" x2="863" y1="302.5" y2="302.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6" />
51
+ <g transform="translate(451, 326)">
52
+ {{#each items}}
53
+ <g transform="translate({{math 188 '-' (math 188 '*' col)}}, {{math 28 '*' row}})">
54
+ {{bar 32 24 (object tr=0 br=0 bl=2 tl=2) (toRad 0) fill=fill opacity='.5'}}
55
+ {{bar 146 24 (object tr=2 br=2 bl=0 tl=0) (toRad 0) fill=fill opacity='.5' transform="translate(34, 0)"}}
56
+ <text text-anchor="middle" x="16" y="12" font-weight="400" font-size="13" fill="{{color}}" dy=".25em">{{ternary (boolean mark '===' undefined) '0' mark}}</text>
57
+ <text text-anchor="start" x="174" y="12" font-weight="400" font-size="13" fill="{{color}}" dy=".25em">{{label.fa}}</text>
58
+ </g>
59
+ {{/each}}
60
+ <g transform="translate(0, 321)">
61
+ <line x1="40" x2="330" y1="10.5" y2="10.5" stroke="#E4E4E7"/>
62
+ <g transform="translate(36, 0)">
63
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
64
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">4</text>
65
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">به وضوح وجود دارد</text>
66
+ </g>
67
+ <g transform="translate(109.5, 0)">
68
+ <text text-anchor="middle" x="10" y="-8" font-weight="400" font-size="12" fill="#52525B">معمولا وجود دارد</text>
69
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
70
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">3</text>
71
+ </g>
72
+ <g transform="translate(183, 0)">
73
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
74
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">2</text>
75
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">نظری ندارم</text>
76
+ </g>
77
+ <g transform="translate(256.5, 0)">
78
+ <text text-anchor="middle" x="10" y="-8" font-weight="400" font-size="12" fill="#52525B">معمولا وجود ندارد</text>
79
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
80
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">1</text>
81
+ </g>
82
+ <g transform="translate(330, 0)">
83
+ <circle r="10" fill="#FAFAFA" transform="translate(10, 10)"/>
84
+ <text text-anchor="middle" x="10" y="10" font-weight="400" font-size="12" fill="#52525B" dy=".35em">0</text>
85
+ <text text-anchor="middle" x="10" y="24" dy=".85em" font-weight="400" font-size="12" fill="#52525B">اصلا وجود ندارد</text>
86
+ </g>
87
+ </g>
88
+ <text text-anchor="start" font-weight="400" font-size="14" fill="#334155" transform="rotate(-90) translate(-103, 396)">صفات همسر</text>
89
+ </g>
90
+ <line x1="421" x2="421" y1="327" y2="690" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6" />
91
+ <g transform="translate(1, 411)">
92
+ {{#each aggrees}}
93
+ <g transform="translate(0, {{math 42 '*' @index}})">
94
+ <g transform="translate(324, 0)">
95
+ <rect width="72" height="28" r="4" fill="{{fill}}" />
96
+ <text text-anchor="middle" x="36" y="14" dy=".25em" font-weight="400" font-size="13" fill="{{color}}">{{fa}}</text>
97
+ </g>
98
+ <g transform="translate(0, 6)">
99
+ <rect width="328" height="28" r="4" fill="{{fill}}" opacity=".5" />
100
+ <text text-anchor="start" x="312" y="14" dy=".25em" font-weight="400" font-size="13" fill="{{color}}">{{label.fa}}</text>
101
+ </g>
102
+ </g>
103
+ {{/each}}
104
+ </g>
105
+ </g>
106
+
107
+ {{/layout}}