@baravak/risloo-profile-cli 3.1.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.
Files changed (200) hide show
  1. package/.github/workflows/push.yml +14 -0
  2. package/.prettierrc +16 -0
  3. package/.yarn/releases/yarn-1.22.19.cjs +147529 -0
  4. package/.yarnrc.yml +1 -0
  5. package/README.md +98 -0
  6. package/bin/risloo.js +9 -0
  7. package/package.json +44 -0
  8. package/src/Gift.js +29 -0
  9. package/src/Profile.js +405 -0
  10. package/src/cli-commands/Executor.js +118 -0
  11. package/src/cli-commands/ExtractExecutor.js +194 -0
  12. package/src/cli-commands/GiftExecutor.js +56 -0
  13. package/src/cli-commands/utilities/BaseOps.js +71 -0
  14. package/src/cli-commands/utilities/Benchmarker.js +88 -0
  15. package/src/cli-commands/utilities/CustomErrors.js +14 -0
  16. package/src/cli-commands/utilities/Response.js +59 -0
  17. package/src/cli-commands/utilities/STATUSES.js +16 -0
  18. package/src/cli-commands/utilities/Status.js +9 -0
  19. package/src/cli.js +125 -0
  20. package/src/handlebars/helpers/abs.js +8 -0
  21. package/src/handlebars/helpers/addCommas.js +8 -0
  22. package/src/handlebars/helpers/array.js +8 -0
  23. package/src/handlebars/helpers/assignGlobal.js +9 -0
  24. package/src/handlebars/helpers/boolean.js +19 -0
  25. package/src/handlebars/helpers/ceil.js +8 -0
  26. package/src/handlebars/helpers/concat.js +8 -0
  27. package/src/handlebars/helpers/cos.js +8 -0
  28. package/src/handlebars/helpers/displacePoint.js +11 -0
  29. package/src/handlebars/helpers/ellipsisChars.js +10 -0
  30. package/src/handlebars/helpers/ellipsisLines.js +11 -0
  31. package/src/handlebars/helpers/first.js +11 -0
  32. package/src/handlebars/helpers/floor.js +8 -0
  33. package/src/handlebars/helpers/forLoop.js +15 -0
  34. package/src/handlebars/helpers/getArrOfProp.js +8 -0
  35. package/src/handlebars/helpers/isArray.js +8 -0
  36. package/src/handlebars/helpers/join.js +10 -0
  37. package/src/handlebars/helpers/last.js +11 -0
  38. package/src/handlebars/helpers/lineWrap.js +28 -0
  39. package/src/handlebars/helpers/math.js +24 -0
  40. package/src/handlebars/helpers/modulo.js +8 -0
  41. package/src/handlebars/helpers/normalizeAngle.js +7 -0
  42. package/src/handlebars/helpers/object.js +8 -0
  43. package/src/handlebars/helpers/objectEntries.js +8 -0
  44. package/src/handlebars/helpers/polarToCartesian.js +14 -0
  45. package/src/handlebars/helpers/prepend.js +10 -0
  46. package/src/handlebars/helpers/profiles/bar.js +45 -0
  47. package/src/handlebars/helpers/profiles/calcGaugeSidePoints.js +34 -0
  48. package/src/handlebars/helpers/profiles/gauge.js +61 -0
  49. package/src/handlebars/helpers/profiles/polygon.js +40 -0
  50. package/src/handlebars/helpers/reverse.js +9 -0
  51. package/src/handlebars/helpers/roundToTwo.js +8 -0
  52. package/src/handlebars/helpers/setVar.js +8 -0
  53. package/src/handlebars/helpers/sin.js +8 -0
  54. package/src/handlebars/helpers/split.js +8 -0
  55. package/src/handlebars/helpers/tan.js +8 -0
  56. package/src/handlebars/helpers/ternary.js +9 -0
  57. package/src/handlebars/helpers/toDeg.js +8 -0
  58. package/src/handlebars/helpers/toRad.js +8 -0
  59. package/src/handlebars/helpers/withGroup.js +20 -0
  60. package/src/handlebars/helpers/wrapOnNewline.js +11 -0
  61. package/src/handlebars/helpers.js +86 -0
  62. package/src/handlebars/importPartials.js +40 -0
  63. package/src/handlebars/init.js +15 -0
  64. package/src/publish/bot.js +91 -0
  65. package/src/publish/json/gift/gift.json +16 -0
  66. package/src/publish/json/profiles/16PF93.json +201 -0
  67. package/src/publish/json/profiles/AEQ93.json +96 -0
  68. package/src/publish/json/profiles/AMS93.json +102 -0
  69. package/src/publish/json/profiles/AMS9A.json +102 -0
  70. package/src/publish/json/profiles/BAOMEIS93.json +99 -0
  71. package/src/publish/json/profiles/BEQI93.json +1589 -0
  72. package/src/publish/json/profiles/CAATS93.json +11355 -0
  73. package/src/publish/json/profiles/CADS93.json +351 -0
  74. package/src/publish/json/profiles/CARSP93.json +96 -0
  75. package/src/publish/json/profiles/CERQ93.json +106 -0
  76. package/src/publish/json/profiles/CRAAS93.json +98 -0
  77. package/src/publish/json/profiles/CSI93.json +143 -0
  78. package/src/publish/json/profiles/DSWLS93.json +93 -0
  79. package/src/publish/json/profiles/EMSS93.json +116 -0
  80. package/src/publish/json/profiles/FACES93.json +106 -0
  81. package/src/publish/json/profiles/FTEPT93.json +102 -0
  82. package/src/publish/json/profiles/GMIT93.json +98 -0
  83. package/src/publish/json/profiles/HPL93.json +102 -0
  84. package/src/publish/json/profiles/IBT93.json +106 -0
  85. package/src/publish/json/profiles/IUS93.json +93 -0
  86. package/src/publish/json/profiles/JCSI93.json +102 -0
  87. package/src/publish/json/profiles/JPFQ93.json +1 -0
  88. package/src/publish/json/profiles/KJGI93.json +100 -0
  89. package/src/publish/json/profiles/LMIQ93.json +109 -0
  90. package/src/publish/json/profiles/MMFAD93.json +103 -0
  91. package/src/publish/json/profiles/MMFAD9A.json +103 -0
  92. package/src/publish/json/profiles/MOCI93.json +100 -0
  93. package/src/publish/json/profiles/OBQ4493.json +96 -0
  94. package/src/publish/json/profiles/PIES93.json +104 -0
  95. package/src/publish/json/profiles/PIES9A.json +104 -0
  96. package/src/publish/json/profiles/PMCIEF93.json +1 -0
  97. package/src/publish/json/profiles/PSWQ93.json +97 -0
  98. package/src/publish/json/profiles/RIASEC93.json +2511 -0
  99. package/src/publish/json/profiles/SAFE93.json +110 -0
  100. package/src/publish/json/profiles/SASQ93.json +92 -0
  101. package/src/publish/json/profiles/SCASP93.json +611 -0
  102. package/src/publish/json/profiles/SDCAQ93.json +96 -0
  103. package/src/publish/json/profiles/STAIY93.json +98 -0
  104. package/src/publish/json/profiles/WAQ93.json +100 -0
  105. package/src/publish/json/profiles/YBOCS93.json +1322 -0
  106. package/src/publish/json/profiles/empty.json +139 -0
  107. package/src/publish/new-version.hbs +11 -0
  108. package/src/publish/test.js +109 -0
  109. package/src/qrcode/qrCodeGenerator.js +14 -0
  110. package/src/qrcode/qrRender.js +229 -0
  111. package/src/samples/16PF93.js +158 -0
  112. package/src/samples/AEQ93.js +121 -0
  113. package/src/samples/AMS93.js +139 -0
  114. package/src/samples/AMS9A.js +9 -0
  115. package/src/samples/BAOMEIS93.js +146 -0
  116. package/src/samples/BEQI93.js +255 -0
  117. package/src/samples/CAATS93.js +218 -0
  118. package/src/samples/CADS93.js +161 -0
  119. package/src/samples/CARSP93.js +134 -0
  120. package/src/samples/CERQ93.js +195 -0
  121. package/src/samples/CRAAS93.js +141 -0
  122. package/src/samples/CSI93.js +315 -0
  123. package/src/samples/DSWLS93.js +112 -0
  124. package/src/samples/EMSS93.js +178 -0
  125. package/src/samples/FACES93.js +225 -0
  126. package/src/samples/FTEPT93.js +167 -0
  127. package/src/samples/GMIT93.js +142 -0
  128. package/src/samples/HPL93.js +132 -0
  129. package/src/samples/IBT93.js +99 -0
  130. package/src/samples/IUS93.js +204 -0
  131. package/src/samples/JCSI93.js +174 -0
  132. package/src/samples/JPFQ93.js +74 -0
  133. package/src/samples/KJGI93.js +136 -0
  134. package/src/samples/LMIQ93.js +188 -0
  135. package/src/samples/MMFAD93.js +135 -0
  136. package/src/samples/MMFAD9A.js +31 -0
  137. package/src/samples/MOCI93.js +128 -0
  138. package/src/samples/OBQ4493.js +132 -0
  139. package/src/samples/PIES93.js +228 -0
  140. package/src/samples/PIES9A.js +32 -0
  141. package/src/samples/PMCIEF93.js +64 -0
  142. package/src/samples/PSWQ93.js +126 -0
  143. package/src/samples/RIASEC93.js +144 -0
  144. package/src/samples/SAFE93.js +64 -0
  145. package/src/samples/SASQ93.js +130 -0
  146. package/src/samples/SCASP93.js +207 -0
  147. package/src/samples/SDCAQ93.js +174 -0
  148. package/src/samples/STAIY93.js +159 -0
  149. package/src/samples/WAQ93.js +208 -0
  150. package/src/samples/YBOCS93.js +583 -0
  151. package/src/samples/empty.js +53 -0
  152. package/views/gift.hbs +160 -0
  153. package/views/profiles/fonts.css +18 -0
  154. package/views/profiles/layout.hbs +27 -0
  155. package/views/profiles/samples/16PF93.hbs +54 -0
  156. package/views/profiles/samples/AEQ93.hbs +31 -0
  157. package/views/profiles/samples/AMS93.hbs +97 -0
  158. package/views/profiles/samples/AMS9A.hbs +1 -0
  159. package/views/profiles/samples/BAOMEIS93.hbs +48 -0
  160. package/views/profiles/samples/BEQI93.hbs +118 -0
  161. package/views/profiles/samples/CAATS93.hbs +251 -0
  162. package/views/profiles/samples/CADS93.hbs +104 -0
  163. package/views/profiles/samples/CARSP93.hbs +26 -0
  164. package/views/profiles/samples/CERQ93.hbs +115 -0
  165. package/views/profiles/samples/CRAAS93.hbs +88 -0
  166. package/views/profiles/samples/CSI93_1.hbs +110 -0
  167. package/views/profiles/samples/CSI93_2.hbs +76 -0
  168. package/views/profiles/samples/DSWLS93.hbs +26 -0
  169. package/views/profiles/samples/EMSS93.hbs +101 -0
  170. package/views/profiles/samples/FACES93_1.hbs +107 -0
  171. package/views/profiles/samples/FACES93_2.hbs +51 -0
  172. package/views/profiles/samples/FTEPT93.hbs +67 -0
  173. package/views/profiles/samples/GMIT93.hbs +45 -0
  174. package/views/profiles/samples/HPL93.hbs +36 -0
  175. package/views/profiles/samples/IBT93.hbs +67 -0
  176. package/views/profiles/samples/IUS93.hbs +123 -0
  177. package/views/profiles/samples/JCSI93.hbs +65 -0
  178. package/views/profiles/samples/JPFQ93.hbs +44 -0
  179. package/views/profiles/samples/KJGI93.hbs +57 -0
  180. package/views/profiles/samples/LMIQ93.hbs +82 -0
  181. package/views/profiles/samples/MMFAD93.hbs +35 -0
  182. package/views/profiles/samples/MMFAD9A.hbs +1 -0
  183. package/views/profiles/samples/MOCI93.hbs +60 -0
  184. package/views/profiles/samples/OBQ4493.hbs +61 -0
  185. package/views/profiles/samples/PIES93.hbs +67 -0
  186. package/views/profiles/samples/PIES9A.hbs +1 -0
  187. package/views/profiles/samples/PMCIEF93.hbs +8 -0
  188. package/views/profiles/samples/PSWQ93.hbs +32 -0
  189. package/views/profiles/samples/RIASEC93.hbs +38 -0
  190. package/views/profiles/samples/SAFE93.hbs +118 -0
  191. package/views/profiles/samples/SASQ93.hbs +45 -0
  192. package/views/profiles/samples/SCASP93.hbs +94 -0
  193. package/views/profiles/samples/SDCAQ93.hbs +68 -0
  194. package/views/profiles/samples/STAIY93.hbs +67 -0
  195. package/views/profiles/samples/WAQ93.hbs +74 -0
  196. package/views/profiles/samples/YBOCS93_1.hbs +96 -0
  197. package/views/profiles/samples/YBOCS93_2.hbs +115 -0
  198. package/views/profiles/samples/YBOCS93_3.hbs +93 -0
  199. package/views/profiles/samples/empty.hbs +10 -0
  200. package/views/profiles/sidebar.hbs +193 -0
@@ -0,0 +1,118 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <g id="couple">
5
+ <circle cx="13" cy="11.2" r="2.5" fill="#BE185D"/>
6
+ <path d="M18.5582 20.8867L13.4718 18.1806L13.0021 17.9306L12.5324 18.1806L7.44606 20.8868L7.24654 15.1287L7.2281 14.597L6.77682 14.3152L1.89001 11.2634L6.77682 8.21157L7.2281 7.92975L7.24654 7.39802L7.44607 1.64001L12.5324 4.34621L13.0021 4.59612L13.4718 4.34621L18.5582 1.64001L18.7577 7.39802L18.7761 7.92975L19.2274 8.21157L24.1142 11.2634L19.2274 14.3152L18.7761 14.597L18.7577 15.1287L18.5582 20.8867Z" stroke="#BE185D" stroke-width="2"/>
7
+ </g>
8
+ <g id="children">
9
+ <circle cx="11.5" cy="11.5" r="2.5" fill="#7E22CE"/>
10
+ <circle cx="11.5" cy="11.5" r="10.3" stroke="#7E22CE" stroke-width="2"/>
11
+ </g>
12
+ <g id="parents">
13
+ <circle cx="12.8" cy="14" r="2.5" fill="#115E59"/>
14
+ <path d="M1.73999 20.75L12.5653 2L23.3906 20.75H1.73999Z" stroke="#115E59" stroke-width="2"/>
15
+ </g>
16
+ </defs>
17
+
18
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
19
+ <text x="40" y="5" fill="#71717A" font-size="16" font-weight="400" text-anchor="middle" dy="5">ساختار</text>
20
+ <text x="690" y="645" fill="#71717A" font-size="16" font-weight="400" text-anchor="middle" dy="5">تعامل</text>
21
+ <text x="0" y="677" fill="#71717A" font-size="16" font-weight="400" text-anchor="end" dy="4">6</text>
22
+ <g transform="translate(0, {{math 27 '+' 620}})">
23
+ {{#forLoop 1 5 1}}
24
+ <text x="0" y="-{{math @i '*' 149}}" fill="#71717A" font-size="16" font-weight="400" text-anchor="end" dy="4">{{math 6 '+' (math @i '*' 6)}}</text>
25
+ {{/forLoop}}
26
+ </g>
27
+ <g transform="translate(35, {{math (math 27 '+' 620) '+' 30}})">
28
+ {{#forLoop 1 5 1}}
29
+ <text x="{{math @i '*' 149}}" y="0" fill="#71717A" font-size="16" font-weight="400" text-anchor="end" dy="4">{{math 6 '+' (math @i '*' 6)}}</text>
30
+ {{/forLoop}}
31
+ </g>
32
+ <g transform="translate(40, 27)">
33
+ <g transform="translate(0, 620)">
34
+ <g transform="translate(0, -300)">
35
+ <rect x="0" y="0" width="300" height="300" fill="#FDE047" fill-opacity="0.1"/>
36
+ <rect x="300" y="0" width="300" height="300" fill="#06B6D4" fill-opacity="0.1"/>
37
+ </g>
38
+ <g transform="translate(0, -600)">
39
+ <rect x="0" y="0" width="300" height="300" fill="#DC2626" fill-opacity="0.1"/>
40
+ <rect x="300" y="0" width="300" height="300" fill="#15803D" fill-opacity="0.1"/>
41
+ </g>
42
+ {{#forLoop 1 24 1}}
43
+ {{setVar "isMiddle" (boolean @i '===' (ceil (math 23 '/' 2)))}}
44
+ <line x1="{{math @i '*' 25}}" y1="0" x2="{{math @i '*' 25}}" y2="-603" stroke="{{ternary isMiddle '#D4D4D8' '#E4E4E7'}}" stroke-width="{{ternary isMiddle 2 1}}" stroke-linecap="round"/>
45
+ <line x1="0" y1="-{{math @i '*' 25}}" x2="603" y2="-{{math @i '*' 25}}" stroke="{{ternary isMiddle '#D4D4D8' '#E4E4E7'}}" stroke-width="{{ternary isMiddle 2 1}}" stroke-linecap="round"/>
46
+ {{/forLoop}}
47
+ <line x1="0" y1="-620" x2="0" y2="0" stroke="#A1A1AA" stroke-width="3" stroke-linecap="round"/>
48
+ <line x1="0" y1="0" x2="620" y2="0" stroke="#A1A1AA" stroke-width="3" stroke-linecap="round"/>
49
+ <g transform="translate({{items.[0].coordinates.x}}, -{{items.[0].coordinates.y}})">
50
+ <svg width="24.6" height="21" viewBox="13.5 11.5 27 23" overflow="visible" fill="none">
51
+ <use href="#couple"/>
52
+ </svg>
53
+ </g>
54
+ <g transform="translate({{items.[1].coordinates.x}}, -{{items.[1].coordinates.y}})">
55
+ <svg width="23" height="23" viewBox="11.5 11.5 23 23" overflow="visible" fill="none">
56
+ <use href="#children"/>
57
+ </svg>
58
+ </g>
59
+ <g transform="translate({{items.[2].coordinates.x}}, -{{items.[2].coordinates.y}})">
60
+ <svg width="26" height="22" viewBox="13 11 26 22" overflow="visible" fill="none">
61
+ <use href="#parents"/>
62
+ </svg>
63
+ </g>
64
+ </g>
65
+ </g>
66
+ <g transform="translate(851, 60)">
67
+ <g transform="translate(0, 0)">
68
+ <svg x="-24.6" width="24.6" height="21" viewBox="0 0 27 23" fill="none">
69
+ <use href="#couple"/>
70
+ </svg>
71
+ <text x="0" y="37" fill="#BE185D" font-size="14" font-weight="400" text-anchor="start" dy="4">رابطه با شریک جنسی / همسر</text>
72
+ <g transform="translate(0, 63)">
73
+ <text x="0" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">تعامل: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[0].mark.interaction}}</tspan></text>
74
+ <text x="-80" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">ساختار: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[0].mark.structure}}</tspan></text>
75
+ </g>
76
+ </g>
77
+ <g transform="translate(0, 90)">
78
+ <svg x="-23" width="23" height="23" viewBox="0 0 23 23" fill="none">
79
+ <use href="#children"/>
80
+ </svg>
81
+ <text x="0" y="37" fill="#7E22CE" font-size="14" font-weight="400" text-anchor="start" dy="4">رابطه با فرزندان</text>
82
+ <g transform="translate(0, 63)">
83
+ <text x="0" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">تعامل: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[1].mark.interaction}}</tspan></text>
84
+ <text x="-80" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">ساختار: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[1].mark.structure}}</tspan></text>
85
+ </g>
86
+ </g>
87
+ <g transform="translate(0, 180)">
88
+ <svg x="-26" width="26" height="22" viewBox="0 0 26 22" fill="none">
89
+ <use href="#parents"/>
90
+ </svg>
91
+ <text x="0" y="37" fill="#115E59" font-size="14" font-weight="400" text-anchor="start" dy="4">رابطه با والدین</text>
92
+ <g transform="translate(0, 63)">
93
+ <text x="0" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">تعامل: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[2].mark.interaction}}</tspan></text>
94
+ <text x="-80" y="0" fill="#71717A" font-size="12" font-weight="400" text-anchor="start" dy="3">ساختار: <tspan font-size="14" font-weight="600" fill="#3F3F46">{{items.[2].mark.structure}}</tspan></text>
95
+ </g>
96
+ </g>
97
+ </g>
98
+ <g transform="translate(851, 431)">
99
+ <g transform="translate(0, 0)">
100
+ <rect x="-20" y="0" width="20" height="20" fill="#FDE047" fill-opacity="0.15"/>
101
+ <text x="-30" y="10" fill="#71717A" font-size="14" font-weight="400" text-anchor="start" dy="2">بی‌هدف / جهت‌نایافته</text>
102
+ </g>
103
+ <g transform="translate(0, 36)">
104
+ <rect x="-20" y="0" width="20" height="20" fill="#06B6D4" fill-opacity="0.15"/>
105
+ <text x="-30" y="10" fill="#71717A" font-size="14" font-weight="400" text-anchor="start" dy="2">بی‌نظم / هرج و مرج</text>
106
+ </g>
107
+ <g transform="translate(0, 72)">
108
+ <rect x="-20" y="0" width="20" height="20" fill="#DC2626" fill-opacity="0.15"/>
109
+ <text x="-30" y="10" fill="#71717A" font-size="14" font-weight="400" text-anchor="start" dy="2">ناسازگار</text>
110
+ </g>
111
+ <g transform="translate(0, 108)">
112
+ <rect x="-20" y="0" width="20" height="20" fill="#15803D" fill-opacity="0.15"/>
113
+ <text x="-30" y="10" fill="#71717A" font-size="14" font-weight="400" text-anchor="start" dy="2">شایسته</text>
114
+ </g>
115
+ </g>
116
+ </g>
117
+
118
+ {{/layout}}
@@ -0,0 +1,45 @@
1
+ {{#> layout}}
2
+
3
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
4
+ <g transform="translate(391, 322)">
5
+ <text x="0" y="0" font-size="36" font-weight="600" text-anchor="middle" fill="{{spec.raw.fill}}" dy="10">{{raw.mark}}</text>
6
+ {{#with spec.raw.circle as | circle |}}
7
+ {{gauge circle.R circle.r circle.brs circle.angles circle.direction fill="#F4F4F5"}}
8
+
9
+ {{#each @root.raw.stops as | stop stopIndex |}}
10
+ {{setVar "p1" (polarToCartesian circle.r stop.angle)}}
11
+ {{setVar "p2" (polarToCartesian circle.R stop.angle)}}
12
+ <line x1="{{p1.x}}" y1="{{p1.y}}" x2="{{p2.x}}" y2="{{p2.y}}" stroke="white"/>
13
+ {{setVar "p" (polarToCartesian (math circle.r '-' 20) stop.angle)}}
14
+ <text x="{{p.x}}" y="{{p.y}}" text-anchor="middle" fill="#D4D4D8" font-size="14" font-weight="500" dy="3">{{stop.mark}}</text>
15
+
16
+ {{#unless @first}}
17
+ {{setVar "prevStopAngle" (lookup (lookup @root.raw.stops (math stopIndex '-' 1)) 'angle')}}
18
+ {{setVar "thetam" (math (math stop.angle '+' prevStopAngle) '/' 2)}}
19
+ {{setVar "pm" (polarToCartesian (math circle.R '+' 30) thetam)}}
20
+ <g transform="translate({{pm.x}}, {{pm.y}})">
21
+ {{setVar "interpret" (lookup @root.spec.raw.interprets (math stopIndex '-' 1))}}
22
+ {{setVar "isChosen" (boolean interpret.eng '===' @root.raw.interpretation)}}
23
+ {{setVar "betMinus180AndMinus90" (boolean (boolean (toDeg thetam) '>' -180) '&&' (boolean (toDeg thetam) '<' -90))}}
24
+ <circle cx="0" cy="0" r="{{ternary isChosen 3.5 2.5}}" fill="{{ternary isChosen @root.spec.raw.fill '#D4D4D8'}}"/>
25
+ <text x="{{ternary betMinus180AndMinus90 -15 15}}" y="0" text-anchor="{{ternary betMinus180AndMinus90 'start' 'end'}}" fill="{{ternary isChosen @root.spec.raw.fill '#A1A1AA'}}" font-weight="{{ternary isChosen 600 400}}" font-size="{{ternary isChosen 16 14}}" dy="3">{{interpret.fr}}</text>
26
+ </g>
27
+
28
+ {{setVar "halt" false}}
29
+ {{setVar "toAngle" stop.angle}}
30
+ {{#if (ternary circle.direction (boolean @root.raw.angle '>=' stop.angle) (boolean @root.raw.angle '<=' stop.angle))}}
31
+ {{setVar "toAngle" @root.raw.angle}}
32
+ {{#if (ternary circle.direction (boolean @root.raw.angle '>=' prevStopAngle) (boolean @root.raw.angle '<=' prevStopAngle))}}
33
+ {{setVar "halt" true}}
34
+ {{/if}}
35
+ {{/if}}
36
+ {{#unless halt}}
37
+ {{gauge circle.R circle.r circle.brs (object start=prevStopAngle end=toAngle) circle.direction fill=@root.spec.raw.fill fill-opacity=interpret.opacity}}
38
+ {{/unless}}
39
+ {{/unless}}
40
+ {{/each}}
41
+ {{/with}}
42
+ </g>
43
+ </g>
44
+
45
+ {{/layout}}
@@ -0,0 +1,94 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <clipPath id="raw-rect">
5
+ <rect x="0" y="0" width="{{spec.raw.rect.width}}" height="{{spec.raw.rect.height}}" rx="{{spec.raw.rect.br}}"/>
6
+ </clipPath>
7
+ </defs>
8
+
9
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
10
+ <g transform="translate(0, {{spec.items.header.offsetY1}})">
11
+ <g transform="translate(0, 8)" font-size="16" font-weight="400">
12
+ <g transform="translate({{spec.items.leftPosArr.[0]}}, 0)"><text x="0" y="0" text-anchor="start" fill="#A1A1AA">نمره</text></g>
13
+ <g transform="translate({{spec.items.leftPosArr.[1]}}, 0)"><text x="0" y="0" text-anchor="start" fill="#A1A1AA">عنوان</text></g>
14
+ <g transform="translate({{spec.items.leftPosArr.[2]}}, 0)"><text x="0" y="0" text-anchor="end" fill="#A1A1AA">سؤالات</text></g>
15
+ </g>
16
+ <g transform="translate({{spec.items.header.legend.leftPos}}, 0)">
17
+ {{setVar "intensitiesArr" (reverse (objectEntries spec.items.rect.intensities))}}
18
+ {{#each intensitiesArr as | intensity index |}}
19
+ {{#with @root.spec.items.header.legend.rect}}
20
+ <rect x="{{math index '*' distanceX}}" y="0" width="{{width}}" height="{{height}}" rx="{{br}}" fill="{{intensity.[1].fill}}" stroke="{{intensity.[1].stroke}}"/>
21
+ {{/with}}
22
+ {{/each}}
23
+ <g transform="translate({{math spec.items.header.legend.rect.width '/' 2}}, -6)" font-size="12" font-weight="400">
24
+ {{#each intensitiesArr as | intensity index |}}
25
+ <text x="{{math index '*' @root.spec.items.header.legend.rect.distanceX}}" y="0" text-anchor="middle" fill="#A1A1AA">{{intensity.[0]}}</text>
26
+ {{/each}}
27
+ </g>
28
+ </g>
29
+
30
+ <g transform="translate(0, {{spec.items.header.offsetY2}})">
31
+ <line x1="0" y1="0" x2="{{spec.items.separatorLine.length}}" y2="0" stroke="#F4F4F5"/>
32
+
33
+ {{#each items as | item itemIndex |}}
34
+ {{#with @root.spec.items as | itemsSpec |}}
35
+ <g transform="translate(0, {{math itemIndex '*' itemsSpec.offsetY}})">
36
+ <g transform="translate(0, {{itemsSpec.paddingY}})">
37
+ <g transform="translate(0, {{math itemsSpec.rect.height '/' 2}})">
38
+ <g transform="translate({{itemsSpec.leftPosArr.[0]}}, 0)">
39
+ <text x="0" y="0" font-size="16" font-weight="600" text-anchor="start" fill="#3F3F46" dy="5">{{item.mark}}</text>
40
+ <text x="-22" y="0" font-size="10" font-weight="400" text-anchor="start" fill="#71717A" dy="3">از {{item.maxValue}}</text>
41
+ </g>
42
+ <g transform="translate({{itemsSpec.leftPosArr.[1]}}, 0)">
43
+ <text x="0" y="0" font-size="16" font-weight="400" text-anchor="start" fill="#3F3F46" dy="4.5">{{item.label.fr}}</text>
44
+ </g>
45
+ </g>
46
+ <g transform="translate({{itemsSpec.leftPosArr.[2]}}, 0)">
47
+ {{#each item.questions as | question index |}}
48
+ <g transform="translate({{math index '*' itemsSpec.rect.distanceX}}, 0)">
49
+ <rect x="0" y="0" width="{{itemsSpec.rect.width}}" height="{{itemsSpec.rect.height}}" rx="{{itemsSpec.rect.br}}" fill="{{question.intensity.fill}}" stroke="{{question.intensity.stroke}}"/>
50
+ <text x="{{math itemsSpec.rect.width '/' 2}}" y="{{math itemsSpec.rect.height '/' 2}}" font-size="16" font-weight="500" text-anchor="middle" fill="{{question.intensity.textFill}}" dy="5">{{question.number}}</text>
51
+ </g>
52
+ {{/each}}
53
+ </g>
54
+ </g>
55
+ <line x1="0" y1="{{itemsSpec.offsetY}}" x2="{{itemsSpec.separatorLine.length}}" y2="{{itemsSpec.offsetY}}" stroke="#F4F4F5"/>
56
+ </g>
57
+ {{/with}}
58
+ {{/each}}
59
+
60
+ <g transform="translate(0, {{math (math items.length '*' spec.items.offsetY) '+' spec.raw.offsetY}})">
61
+ <g transform="translate({{spec.raw.leftPos}}, 0)">
62
+ <rect x="0" y="0" width="{{spec.raw.rect.width}}" height="{{spec.raw.rect.height}}" fill="#F5F5F4" clip-path="url(#raw-rect)"/>
63
+ <rect x="0" y="0" width="{{raw.width}}" height="{{spec.raw.rect.height}}" fill="#57534E" clip-path="url(#raw-rect)"/>
64
+
65
+ <g transform="translate({{raw.width}}, -{{spec.raw.mark.line.offsetY}})">
66
+ <line x1="0" y1="0" x2="0" y2="-{{spec.raw.mark.line.length}}" stroke="#71717A" stroke-dasharray="2" stroke-linecap="round" stroke-width="1"/>
67
+ <text x="0" y="-{{math spec.raw.mark.line.length '+' spec.raw.mark.number.offsetY}}" font-size="16" font-weight="600" text-anchor="middle" fill="#52525B" dy="4.5">{{raw.mark}}</text>
68
+ </g>
69
+
70
+ <g transform="translate(0, {{math spec.raw.rect.height '/' 2}})">
71
+ <text x="-{{spec.raw.label.offsetX}}" y="0" font-size="16" font-weight="500" text-anchor="start" fill="#44403C" dy="4.5">{{raw.label.fr}}</text>
72
+ <text x="{{math spec.raw.rect.width '+' spec.raw.mark.maxValueOffsetX}}" y="0" font-size="12" font-weight="400" text-anchor="end" fill="#A1A1AA" dy="3">{{spec.raw.maxValue}}</text>
73
+ </g>
74
+ </g>
75
+
76
+ <g transform="translate(0, {{math spec.raw.rect.height '+' spec.descAnswer.offsetY}})">
77
+ <rect x="0" y="0" width="{{spec.descAnswer.rect.width}}" height="{{spec.descAnswer.rect.height}}" rx="{{spec.descAnswer.rect.br}}" fill="#FAFAFA" stroke="#D4D4D8"/>
78
+ <g transform="translate({{math spec.descAnswer.rect.width '-' spec.descAnswer.rect.padding}}, 0)">
79
+ <text x="0" y="28" font-size="14" font-weight="500" text-anchor="start" fill="#52525B">پاسخ سؤال تشریحی:</text>
80
+ {{setVar "descAnswerLines" (ellipsisLines (lineWrap descAnswer 132) 2)}}
81
+ <g transform="translate(0, 56)" fill="#71717A" font-size="14" font-weight="400" text-anchor="start">
82
+ {{#each descAnswerLines as | line index |}}
83
+ <text x="0" y="{{math index '*' @root.spec.descAnswer.content.lineHeight}}">{{line}}</text>
84
+ {{/each}}
85
+ </g>
86
+ </g>
87
+ </g>
88
+ </g>
89
+
90
+ </g>
91
+ </g>
92
+ </g>
93
+
94
+ {{/layout}}
@@ -0,0 +1,68 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <linearGradient id="horizontal-shadow">
5
+ <stop offset="0%" stop-color="black" />
6
+ <stop offset="100%" stop-color="transparent" />
7
+ </linearGradient>
8
+ <linearGradient id="vertical-shadow" gradientTransform="rotate(90)">
9
+ <stop offset="0%" stop-color="black" />
10
+ <stop offset="100%" stop-color="transparent" />
11
+ </linearGradient>
12
+ </defs>
13
+
14
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
15
+ <g transform="translate({{spec.items.offsetX}}, 0)">
16
+ {{setVar "tickTotalHeight" (math (math 2 '*' spec.items.ticks.heightOffset) '+' spec.items.totalHeight)}}
17
+ {{#each itemsTicks as | tick index |}}
18
+ <g transform="translate({{tick.leftPos}}, 0)">
19
+ <line x1="0" y1="0" x2="0" y2="{{../tickTotalHeight}}" stroke="#E4E4E7" stroke-dasharray="3.5" stroke-linecap="round" stroke-width="2"/>
20
+ <text x="-{{@root.spec.items.ticks.numberOffset.x}}" y="{{@root.spec.items.ticks.numberOffset.y}}" fill="#A1A1AA" text-anchor="start" font-size="16" font-weight="500" dy="5">{{tick.number}}</text>
21
+ </g>
22
+ {{/each}}
23
+
24
+ <g transform="translate(0, {{spec.items.ticks.heightOffset}})">
25
+ {{#each items as | item index |}}
26
+ {{#with @root.spec.items as | itemsSpec |}}
27
+ <g transform="translate(0, {{math index '*' itemsSpec.distanceY}})">
28
+ <path d="M 0 0 h {{math item.width '-' itemsSpec.rect.borderRadius}} a {{itemsSpec.rect.borderRadius}} {{itemsSpec.rect.borderRadius}} 180 0 1 0 {{itemsSpec.rect.height}} h -{{math item.width '-' itemsSpec.rect.borderRadius}} z" fill="{{item.fill}}"/>
29
+ <g transform="translate(0, {{math itemsSpec.rect.height '/' 2}})">
30
+ {{#each (wrapOnNewline item.label.fr) as | line index |}}
31
+ <text x="-{{itemsSpec.label.offsetX}}" y="{{math (math (math 2 '*' index) '-' 1) '*' itemsSpec.label.offsetY}}" fill="#52525B" text-anchor="start" font-size="16" font-weight="400" dy="3">{{line}}</text>
32
+ {{/each}}
33
+ <text x="{{math item.width '-' itemsSpec.rect.borderRadius}}" y="0" fill="white" text-anchor="middle" font-size="20" font-weight="600" dy="6">{{item.mark}}</text>
34
+ </g>
35
+ </g>
36
+ {{/with}}
37
+ {{/each}}
38
+
39
+ <g transform="translate(-1, -1)">
40
+ <rect x="0" y="0" width="1" height="{{math spec.items.totalHeight '+' 2}}" fill="#FFFFFF" rx="1"/>
41
+ <rect x="1" y="0" width="5" height="{{math spec.items.totalHeight '+' 2}}" fill="url('#horizontal-shadow')" fill-opacity="0.2"/>
42
+ </g>
43
+ </g>
44
+ </g>
45
+
46
+ {{setVar "rawLeftPos" (math (math spec.items.offsetX '+' (math spec.items.maxValue '*' spec.items.widthCoeff)) '+' spec.raw.offsetX)}}
47
+ <g transform="translate({{rawLeftPos}}, {{tickTotalHeight}})">
48
+ <path d="M 0 0 v -{{math (math spec.raw.heightCoeff '*' spec.raw.maxValue) '-' spec.raw.rect.borderRadius}} a {{spec.raw.rect.borderRadius}} {{spec.raw.rect.borderRadius}} 180 0 1 {{spec.raw.rect.width}} 0 v {{math (math spec.raw.heightCoeff '*' spec.raw.maxValue) '-' spec.raw.rect.borderRadius}} z" fill="#F4F4F5"/>
49
+ <path d="M 0 0 v -{{math raw.height '-' spec.raw.rect.borderRadius}} a {{spec.raw.rect.borderRadius}} {{spec.raw.rect.borderRadius}} 180 0 1 {{spec.raw.rect.width}} 0 v {{math raw.height '-' spec.raw.rect.borderRadius}} z" fill="#52525B"/>
50
+ <text x="{{spec.raw.rect.borderRadius}}" y="-{{math raw.height '-' spec.raw.rect.borderRadius}}" text-anchor="middle" font-size="22" font-weight="700" fill="white" dy="6" transform="translate(0, 9)">{{raw.mark}}</text>
51
+ <text x="0" y="-22" text-anchor="end" font--size="18" font-weight="500" fill="#71717A" dy="5" transform="rotate(-90)">نمره کل</text>
52
+ <g transform="scale(1, -1)">
53
+ <rect x="-1" y="0" width="{{math spec.raw.rect.width '+' 2}}" height="1" fill="#FFFFFF" rx="1"/>
54
+ <rect x="-1" y="0" width="{{math spec.raw.rect.width '+' 2}}" height="5" fill="url('#vertical-shadow')" fill-opacity="0.2"/>
55
+ </g>
56
+
57
+ <g transform="translate({{math spec.raw.rect.width '+' spec.raw.ticks.line.offsetX}}, 0)">
58
+ {{#each rawTicks as | tick index |}}
59
+ <line x1="0" y1="-{{tick.bottomPos}}" x2="{{@root.spec.raw.ticks.line.width}}" y2="-{{tick.bottomPos}}" stroke="#E4E4E7" stroke-dasharray="3" stroke-linecap="round" stroke-width="2"/>
60
+ <g transform="translate({{math @root.spec.raw.ticks.line.width '+' @root.spec.raw.ticks.number.offsetX}}, -{{tick.bottomPos}})">
61
+ <text x="0" y="0" fill="#A1A1AA" text-anchor="end" font-size="14" font-weight="500" dy="4">{{tick.number}}</text>
62
+ </g>
63
+ {{/each}}
64
+ </g>
65
+ </g>
66
+ </g>
67
+
68
+ {{/layout}}
@@ -0,0 +1,67 @@
1
+ {{#> layout}}
2
+
3
+ <g transform="translate({{math spec.profile.dimensions.width '/' 2}}, {{spec.profile.padding.y}})">
4
+ {{#each items as | item itemIndex |}}
5
+ {{#with @root.spec.items.rect as | rect |}}
6
+ <g transform="translate({{math (math (math -2 '*' itemIndex) '+' 1) '*' (math rect.offsetX '/' 2)}}, 0) scale({{ternary (boolean itemIndex '===' 1) -1 1}}, 1)">
7
+ {{#with (lookup @root.spec.items item.label.eng)}}
8
+ <rect x="0" y="0" width="{{rect.width}}" height="{{rect.height}}" rx="{{rect.br}}" fill="{{fill}}"/>
9
+ <g transform="translate({{math rect.width '/' 2}}, {{math rect.height '/' 2}})">
10
+ <text x="0" y="0" font-size="18" font-weight="500" text-anchor="middle" fill="white" dy="6" transform="scale({{ternary (boolean itemIndex '===' 1) -1 1}}, 1)">{{item.label.fr}}</text>
11
+ </g>
12
+ {{/with}}
13
+ </g>
14
+ {{/with}}
15
+ {{/each}}
16
+ <g transform="translate(0, {{math spec.items.rect.distanceY '+' spec.items.trait.circle.R}})">
17
+ <line x1="0" y1="-85" x2="0" y2="+85" stroke="#F4F4F5" stroke-dasharray="4" stroke-linecap="round" stroke-width="2.5"/>
18
+ {{setVar "p" (polarToCartesian (math spec.items.trait.circle.r '-' 20) (toRad -90))}}
19
+ <text x="{{p.x}}" y="{{p.y}}" text-anchor="middle" fill="#A1A1AA" font-size="12" font-weight="500" dy="3">{{spec.items.minValue}}</text>
20
+ {{setVar "p" (polarToCartesian (math spec.items.trait.circle.r '-' 20) (toRad 90))}}
21
+ <text x="{{p.x}}" y="{{p.y}}" text-anchor="middle" fill="#A1A1AA" font-size="12" font-weight="500" dy="3">{{spec.items.maxValue}}</text>
22
+ {{#each items as | item itemIndex |}}
23
+ {{#with @root.spec.items as | itemsSpec |}}
24
+ <g transform="translate({{math (math (math -2 '*' itemIndex) '+' 1) '*' itemsSpec.offsetX}}, 0)">
25
+ {{#with (lookup itemsSpec item.label.eng)}}
26
+ {{gauge circle.R circle.r circle.brs (object start=circle.angles.start end=circle.angles.end) circle.direction fill="#F4F4F5"}}
27
+
28
+ {{#each item.stops as | stop stopIndex |}}
29
+ {{#unless (boolean @first '||' @last)}}
30
+ {{setVar "p1" (polarToCartesian ../circle.r stop.angle)}}
31
+ {{setVar "p2" (polarToCartesian ../circle.R stop.angle)}}
32
+ <line x1="{{p1.x}}" y1="{{p1.y}}" x2="{{p2.x}}" y2="{{p2.y}}" stroke="white"/>
33
+ {{setVar "p" (polarToCartesian (math ../circle.r '-' 20) stop.angle)}}
34
+ <text x="{{p.x}}" y="{{p.y}}" text-anchor="middle" fill="#D4D4D8" font-size="12" font-weight="500" dy="3">{{stop.mark}}</text>
35
+ {{/unless}}
36
+ {{#unless @first}}
37
+ {{setVar "prevStopAngle" (lookup (lookup item.stops (math stopIndex '-' 1)) 'angle')}}
38
+ {{setVar "pm" (polarToCartesian (math ../circle.R '+' 15) (math (math stop.angle '+' prevStopAngle) '/' 2))}}
39
+ <g transform="translate({{pm.x}}, {{pm.y}})">
40
+ {{setVar "interpret" (lookup @root.spec.items.interprets (math stopIndex '-' 1))}}
41
+ {{setVar "isChosen" (boolean interpret.eng '===' item.mark.interpretation)}}
42
+ <circle cx="0" cy="0" r="{{ternary isChosen 3.5 2.5}}" fill="{{ternary isChosen ../fill '#E4E4E7'}}"/>
43
+ <text x="{{math (math (math -2 '*' itemIndex) '+' 1) '*' 15}}" y="0" text-anchor="{{ternary (boolean itemIndex '===' 0) 'end' 'start'}}" fill="{{ternary isChosen ../fill '#A1A1AA'}}" font-weight="{{ternary isChosen 500 400}}" font-size="{{ternary isChosen 16 14}}" dy="3">{{interpret.fr}}</text>
44
+ </g>
45
+
46
+ {{setVar "halt" false}}
47
+ {{setVar "toAngle" stop.angle}}
48
+ {{#if (ternary ../circle.direction (boolean item.angle '>=' stop.angle) (boolean item.angle '<=' stop.angle))}}
49
+ {{setVar "toAngle" item.angle}}
50
+ {{#if (ternary ../circle.direction (boolean item.angle '>=' prevStopAngle) (boolean item.angle '<=' prevStopAngle))}}
51
+ {{setVar "halt" true}}
52
+ {{/if}}
53
+ {{/if}}
54
+ {{#unless halt}}
55
+ {{gauge ../circle.R ../circle.r ../circle.brs (object start=prevStopAngle end=toAngle) ../circle.direction fill=../fill fill-opacity=interpret.opacity}}
56
+ {{/unless}}
57
+ {{/unless}}
58
+ {{/each}}
59
+ <text x="{{math (math (math -2 '*' itemIndex) '+' 1) '*' 30}}" y="0" text-anchor="{{ternary (boolean itemIndex '===' 0) 'end' 'start'}}" fill="{{fill}}" font-size="24" font-weight="600" dy="6.5">{{item.mark.value}}</text>
60
+ {{/with}}
61
+ </g>
62
+ {{/with}}
63
+ {{/each}}
64
+ </g>
65
+ </g>
66
+
67
+ {{/layout}}
@@ -0,0 +1,74 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ {{#with spec.raw.circle}}
5
+ <clipPath id="raw-circle-roll">
6
+ {{gauge R r brs (object start=angles.start end=angles.end) false}}
7
+ </clipPath>
8
+ {{/with}}
9
+ {{#with spec.items.circle}}
10
+ <clipPath id="items-circle-roll">
11
+ {{gauge R r brs (object start=angles.start end=angles.end) false}}
12
+ </clipPath>
13
+ {{/with}}
14
+ </defs>
15
+
16
+ <g transform="translate(0, {{spec.profile.padding.y}})">
17
+ <g transform="translate({{math spec.profile.dimensions.width '/' 2}}, {{spec.raw.circle.R}})">
18
+ {{#with spec.raw.circle}}
19
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=angles.end) direction clip-path="url(#raw-circle-roll)" fill="#F3F4F6"}}
20
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=@root.raw.zeta) direction clip-path="url(#raw-circle-roll)" fill=@root.spec.raw.fill fill-opacity=@root.raw.opacity}}
21
+ {{/with}}
22
+ <text x="0" y="0" text-anchor="middle" font-size="28" font-weight="600" fill="{{spec.raw.fill}}" dy="9">{{raw.mark}}</text>
23
+ {{#each raw.ticks as | tick |}}
24
+ {{setVar "rm" (math (math @root.spec.raw.circle.R '+' @root.spec.raw.circle.r) '/' 2)}}
25
+ {{setVar "p" (polarToCartesian rm tick.angle)}}
26
+ <text x="{{p.x}}" y="{{p.y}}" font-size="16" font-weight="500" fill="#D4D4D8" text-anchor="middle" dy="4" transform="translate(-{{ternary @first @root.spec.raw.ticks.number.offset 0}}, -{{ternary @last @root.spec.raw.ticks.number.offset 0}})">{{tick.number}}</text>
27
+ {{/each}}
28
+ <g transform="translate(0, {{math spec.raw.circle.R '+' spec.raw.label.offsetY}})">
29
+ <text x="0" y="0" font-size="20" font-weight="500" fill="{{raw.fill}}" text-anchor="middle" dy="5">{{raw.label.fr}}</text>
30
+ </g>
31
+
32
+ <g transform="translate(0, {{math (math spec.raw.circle.R '+' spec.items.offsetY1) '+' spec.items.circle.R}})">
33
+ {{#each items.[0] as |item index|}}
34
+ <g transform="translate({{math (lookup (object 0=3 1=1 2=-1 3=-3) index) '*' (math @root.spec.items.distanceX1 '/' 2)}}, 0)">
35
+ {{#with @root.spec.items.circle}}
36
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=angles.end) direction clip-path="url(#items-circle-roll)" fill="#F3F4F6"}}
37
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=item.zeta) direction clip-path="url(#items-circle-roll)" fill=item.fill fill-opacity=item.opacity}}
38
+ {{/with}}
39
+ <text x="0" y="0" text-anchor="middle" font-size="18" font-weight="500" fill="{{item.fill}}" dy="5">{{item.mark}}</text>
40
+ {{#each item.ticks as | tick |}}
41
+ {{setVar "rm" (math (math @root.spec.items.circle.R '+' @root.spec.items.circle.r) '/' 2)}}
42
+ {{setVar "p" (polarToCartesian rm tick.angle)}}
43
+ <text x="{{p.x}}" y="{{p.y}}" font-size="12" font-weight="500" fill="#D4D4D8" text-anchor="middle" dy="2.5" transform="translate(-{{ternary @first @root.spec.items.ticks.number.offset 0}}, -{{ternary @last @root.spec.items.ticks.number.offset 0}})">{{tick.number}}</text>
44
+ {{/each}}
45
+ <g transform="translate(0, {{math @root.spec.items.circle.R '+' @root.spec.items.label.offsetY}})">
46
+ <text x="0" y="0" font-size="14" text-anchor="middle" xml:space="preserve"><tspan font-weight="400" fill="#71717A" dy="5">ارتباط فرد با </tspan><tspan font-weight="500" fill="{{item.fill}}">{{item.label.fr}}</tspan></text>
47
+ </g>
48
+ </g>
49
+ {{/each}}
50
+
51
+ <g transform="translate(0, {{math (math spec.items.circle.R '*' 2) '+' spec.items.offsetY2}})">
52
+ {{#each items.[1] as |item index|}}
53
+ <g transform="translate({{math (lookup (object 0=1 1=0 2=-1) index) '*' @root.spec.items.distanceX2}}, 0)">
54
+ {{#with @root.spec.items.circle}}
55
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=angles.end) direction clip-path="url(#items-circle-roll)" fill="#F3F4F6"}}
56
+ {{gauge R r (object tl=0 tr=0 bl=0 br=0) (object start=angles.start end=item.zeta) direction clip-path="url(#items-circle-roll)" fill=item.fill fill-opacity=item.opacity}}
57
+ {{/with}}
58
+ <text x="0" y="0" text-anchor="middle" font-size="18" font-weight="500" fill="{{item.fill}}" dy="5">{{item.mark}}</text>
59
+ {{#each item.ticks as | tick |}}
60
+ {{setVar "rm" (math (math @root.spec.items.circle.R '+' @root.spec.items.circle.r) '/' 2)}}
61
+ {{setVar "p" (polarToCartesian rm tick.angle)}}
62
+ <text x="{{p.x}}" y="{{p.y}}" font-size="12" font-weight="500" fill="#D4D4D8" text-anchor="middle" dy="2.5" transform="translate(-{{ternary @first @root.spec.items.ticks.number.offset 0}}, -{{ternary @last @root.spec.items.ticks.number.offset 0}})">{{tick.number}}</text>
63
+ {{/each}}
64
+ <g transform="translate(0, {{math @root.spec.items.circle.R '+' @root.spec.items.label.offsetY}})">
65
+ <text x="0" y="0" font-size="14" text-anchor="middle" xml:space="preserve"><tspan font-weight="400" fill="#71717A" dy="5">ارتباط فرد با </tspan><tspan font-weight="500" fill="{{item.fill}}">{{item.label.fr}}</tspan></text>
66
+ </g>
67
+ </g>
68
+ {{/each}}
69
+ </g>
70
+ </g>
71
+ </g>
72
+ </g>
73
+
74
+ {{/layout}}
@@ -0,0 +1,96 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ <clipPath id="first-raw">
5
+ {{bar 70 46 (object tl=4 tr=0 bl=4 br=0) (toRad -90)}}
6
+ </clipPath>
7
+ <clipPath id="last-raw">
8
+ {{bar 230 46 (object tl=0 tr=4 bl=0 br=4) (toRad -90)}}
9
+ </clipPath>
10
+ </defs>
11
+
12
+ <g transform="translate({{spec.profile.padding.[0].x}}, {{spec.profile.padding.[0].y}})">
13
+ <text x="0" y="0" font-size="14" font-weight="500" fill="#4B5563" text-anchor="middle" transform="translate(15, 172) rotate(-90)">وسواس‌ها</text>
14
+ <text x="0" y="0" font-size="14" font-weight="500" fill="#4B5563" text-anchor="middle" transform="translate(15, 503) rotate(-90)">اجبارها یا بی‌اختیاری‌ها</text>
15
+ <g transform="translate(124, 0)">
16
+ <line x1="0" y1="0" x2="0" y2="643" stroke="#D4D4D8" stroke-width="2" stroke-linecap="round" />
17
+ <g transform="translate(1, 20)">
18
+ {{#each (first items 8) as | item index |}}
19
+ {{#with @root.spec.page1.items as | itemsSpec |}}
20
+ <g transform="translate(0, {{math index '*' itemsSpec.distanceY}})">
21
+ <text x="-12" y="8" font-size="14" font-weight="400" fill="#86198F" text-anchor="start">{{item.label.fr}}</text>
22
+ <rect x="0" y="{{math itemsSpec.rect.body.height '-' itemsSpec.rect.base.height}}" width="{{item.width.base}}" height="{{itemsSpec.rect.base.height}}" fill="#E4E4E7" />
23
+ {{#if (boolean item.mark '!==' 0)}}
24
+ {{bar item.width.body itemsSpec.rect.body.height itemsSpec.rect.body.brs 0 fill="#A21CAF"}}
25
+ {{/if}}
26
+ <text x="{{math item.width.base '+' 18}}" y="8" font-size="12" font-weight="400" fill="#D4D4D8" text-anchor="middle">{{item.maxValue}}</text>
27
+ <text x="{{math item.width.body '+' (ternary (boolean item.mark '!==' 0) 0 7)}}" y="-6" font-size="14" font-weight="500" fill="#A21CAF" text-anchor="middle">{{item.mark}}</text>
28
+ </g>
29
+ {{/with}}
30
+ {{/each}}
31
+ <g transform="translate(0, 355)">
32
+ {{#each (last items 7) as | item index |}}
33
+ {{#with @root.spec.page1.items as | itemsSpec |}}
34
+ <g transform="translate(0, {{math index '*' itemsSpec.distanceY}})">
35
+ <text x="-12" y="8" font-size="14" font-weight="400" fill="#86198F" text-anchor="start">{{item.label.fr}}</text>
36
+ <rect x="0" y="{{math itemsSpec.rect.body.height '-' itemsSpec.rect.base.height}}" width="{{item.width.base}}" height="{{itemsSpec.rect.base.height}}" fill="#E4E4E7" />
37
+ {{#if (boolean item.mark '!==' 0)}}
38
+ {{bar item.width.body itemsSpec.rect.body.height itemsSpec.rect.body.brs 0 fill="#A21CAF"}}
39
+ {{/if}}
40
+ <text x="{{math item.width.base '+' 18}}" y="8" font-size="12" font-weight="400" fill="#D4D4D8" text-anchor="middle">{{item.maxValue}}</text>
41
+ <text x="{{math item.width.body '+' (ternary (boolean item.mark '!==' 0) 0 7)}}" y="-6" font-size="14" font-weight="500" fill="#A21CAF" text-anchor="middle">{{item.mark}}</text>
42
+ </g>
43
+ {{/with}}
44
+ {{/each}}
45
+ </g>
46
+ </g>
47
+ </g>
48
+ <g transform="translate(545, 540)">
49
+ <g transform="translate(0, 35)">
50
+ <text x="23" y="0" font-size="28" font-weight="700" fill="#9F1239" text-anchor="middle" dy="5">{{raw.mark}}</text>
51
+ <text x="62" y="0" font-size="16" font-weight="400" fill="#71717A" text-anchor="end" dy="3">شدت وسواس:</text>
52
+ </g>
53
+ <g transform="translate(0, 78)">
54
+ <text x="23" y="0" font-size="18" font-weight="600" fill="#71717A" text-anchor="middle" dy="5">{{suicideThoughts}}</text>
55
+ <text x="62" y="0" font-size="14" font-weight="400" fill="#71717A" text-anchor="end" dy="3">پاسخ افکار خودکشی:</text>
56
+ </g>
57
+ {{bar 540 46 (object tl=4 tr=4 bl=4 br=4) (toRad -90) fill="#F4F4F5"}}
58
+ {{#each spec.raw.stops as | stopMark stopMarkIndex |}}
59
+ {{#with @root.spec.raw as | rawSpec |}}
60
+ {{#unless @first}}
61
+ {{setVar "prevStopMark" (lookup rawSpec.stops (math stopMarkIndex '-' 1))}}
62
+ {{setVar "interpretHeight" (math (math (math prevStopMark '+' stopMark) '/' 2) '*' rawSpec.heightCoeff)}}
63
+ {{setVar "isChosen" (boolean @root.raw.interpret.eng '===' (lookup (lookup (objectEntries rawSpec.interprets) (math stopMarkIndex '-' 1)) 0))}}
64
+ <g transform="translate(62, -{{interpretHeight}})">
65
+ <circle cx="{{ternary isChosen '3.5' '2.5'}}" cy="0" r="{{ternary isChosen '3.5' '2.5'}}" fill="{{ternary isChosen '#991B1B' '#D4D4D8'}}" />
66
+ <text x="16" y="0" font-size="{{ternary isChosen '16' '14'}}" font-weight="{{ternary isChosen '600' '400'}}" fill="{{ternary isChosen '#991B1B' '#A1A1AA'}}" text-anchor="end" dy="4">{{lookup (lookup (objectEntries rawSpec.interprets) (math stopMarkIndex '-' 1)) 1}}</text>
67
+ </g>
68
+ <g transform="translate(0, -{{math stopMark '*' rawSpec.heightCoeff}})">
69
+ {{#unless @last}}<line x1="3" y1="0" x2="43" y2="0" stroke="white" />{{/unless}}
70
+ <text x="-22" y="0" font-size="14" font-weight="400" fill="#D4D4D8" text-anchor="middle" dy="4">{{stopMark}}</text>
71
+ </g>
72
+ {{#if (boolean stopMarkIndex '===' 1)}}
73
+ {{setVar "clipPath" "url(#first-raw)"}}
74
+ {{else if (boolean stopMarkIndex '===' 5)}}
75
+ {{setVar "clipPath" "url(#last-raw)"}}
76
+ {{else}}
77
+ {{setVar "clipPath" ""}}
78
+ {{/if}}
79
+ {{#if (boolean @root.raw.mark '<' stopMark)}}
80
+ {{#if (boolean @root.raw.mark '>' prevStopMark)}}
81
+ <g transform="translate(0, -{{math prevStopMark '*' rawSpec.heightCoeff}})">
82
+ {{bar (math (math @root.raw.mark '-' prevStopMark) '*' rawSpec.heightCoeff) 46 (object tl=0 tr=0 bl=0 br=0) (toRad -90) fill="#991B1B" fill-opacity=(lookup (array 0.6 0.7 0.8 0.9 1) (math stopMarkIndex '-' 1)) clip-path=clipPath}}
83
+ </g>
84
+ {{/if}}
85
+ {{else}}
86
+ <g transform="translate(0, -{{math prevStopMark '*' rawSpec.heightCoeff}})">
87
+ {{bar (math (math stopMark '-' prevStopMark) '*' rawSpec.heightCoeff) 46 (object tl=0 tr=0 bl=0 br=0) (toRad -90) fill="#991B1B" fill-opacity=(lookup (array 0.6 0.7 0.8 0.9 1) (math stopMarkIndex '-' 1)) clip-path=clipPath}}
88
+ </g>
89
+ {{/if}}
90
+ {{/unless}}
91
+ {{/with}}
92
+ {{/each}}
93
+ </g>
94
+ </g>
95
+
96
+ {{/layout}}