hayun-vite 0.0.0 → 0.0.2

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 (43) hide show
  1. package/assets/Daco_1154502.png +0 -0
  2. package/assets/ear-logo-1.png +0 -0
  3. package/assets/fonts/Vazirmatn-Regular.woff2 +0 -0
  4. package/assets/hearing-aid-computer-icons-sound-ears-.png +0 -0
  5. package/assets/logo.svg +1 -0
  6. package/assets/logo192.png +0 -0
  7. package/assets/rasa.png +0 -0
  8. package/assets/styles-test.css +90 -0
  9. package/assets/styles.css +90 -0
  10. package/data/formData1.js +42 -0
  11. package/data/officesObjStore.js +57 -0
  12. package/data/patientsObjStore.js +74 -0
  13. package/data/sampleData.js +95 -0
  14. package/index.js +9 -3
  15. package/package.json +1 -1
  16. package/src/{Audiogram.js → Audiogram/Audiogram.js} +6 -4
  17. package/src/Form/Form.js +277 -0
  18. package/src/Form/Form_N.js +159 -0
  19. package/src/Form/Forms-Test.html +125 -0
  20. package/src/Form/Forms.js +135 -0
  21. package/src/Form/Header.js +92 -0
  22. package/src/Form/Reflex.js +142 -0
  23. package/src/Form/Sections.js +72 -0
  24. package/src/Form/Speech.js +133 -0
  25. package/src/Form/TextBox.js +81 -0
  26. package/src/Form/Tympanogram.js +356 -0
  27. package/src/Form/formStyles.css +122 -0
  28. package/src/Form/globalinfo.js +68 -0
  29. package/src/Form/grid/drawGrid.js +84 -0
  30. package/src/Form/grid/hideGrid.js +9 -0
  31. package/src/Form/printForm.js +76 -0
  32. package/src/Form/rasa-audio-208-293.png +0 -0
  33. package/src/Form/templates/combo.js +248 -0
  34. package/src/Form/templates/dims.js +204 -0
  35. package/src/Form/templates/rasaAud.js +287 -0
  36. package/src/Form/templates/rasaAud.png +0 -0
  37. package/src/Form/templates/rasaTymp.jpg +0 -0
  38. package/src/fonts/Vazirmatn-Regular.woff2 +0 -0
  39. package/src/main.js +87 -74
  40. package/src/note.html +1 -0
  41. package/src/style.css +157 -96
  42. package/src/AudiogramChart-Test.html +0 -56
  43. /package/src/{dims.js → Audiogram/dims.js} +0 -0
@@ -0,0 +1,356 @@
1
+ import putRect from "../common/putRect.js";
2
+ import putText from "../common/putText.js";
3
+ const svgNS = "http://www.w3.org/2000/svg";
4
+
5
+ export default class Tympanogram {
6
+ constructor({ container } = {}) {
7
+ this.pressure = { min: -600, max: +400, step: 200 };
8
+ this.compliance = { min: -0.50, max: 3, step: 0.50 };
9
+ this.padding = { right: 5, left: 8, top: 7, bottom: 14 };
10
+ this.container = container;
11
+ }
12
+
13
+ draw({ dims }) {
14
+ let width = dims.width;
15
+ let height = dims.height;
16
+ let x = dims.margin.left;
17
+ let y = dims.margin.top;
18
+ // const labels = items.labels;
19
+
20
+ const { pressure, compliance, padding } = {
21
+ pressure: this.pressure,
22
+ compliance: this.compliance,
23
+ padding: this.padding,
24
+
25
+ };
26
+ const svg = document.createElementNS(svgNS, "svg");
27
+ svg.setAttribute("data-name", "R_Tymp");
28
+ svg.setAttribute("width", width);
29
+ svg.setAttribute("height", height);
30
+ svg.setAttribute("x", x);
31
+ svg.setAttribute("y", y);
32
+ svg.setAttribute("viewBox", [-padding.left, -padding.top, width, height]);
33
+
34
+
35
+
36
+ const pressureAxiosLength = {
37
+ dapa: pressure.max - pressure.min,
38
+ mm: width - padding.left - padding.right
39
+ }
40
+
41
+ const complianceAxiosLength = {
42
+ ml: compliance.max - compliance.min,
43
+ mm: height - padding.top - padding.bottom
44
+ }
45
+
46
+ this.chartInfo = { pressure, compliance, padding, pressureAxiosLength, complianceAxiosLength };
47
+
48
+ // point({ this.container: svg, x: getX(pressure.min), y: getY(compliance.max), color: 'red' });
49
+ // point({ this.container: svg, x: getX(pressure.max), y: getY(compliance.min), color: 'green' });
50
+ // point({ this.container: svg, x: getX(pressure.min), y: getY(compliance.min), color: 'brown' });
51
+ let style;
52
+ // Pressure Axios (Horizontal)
53
+ style = `
54
+ stroke-width: 0.15mm;
55
+ stroke: black;
56
+ `;
57
+ putLine({
58
+ x1: getX(pressure.min), y1: getY(compliance.min),
59
+ x2: getX(pressure.max), y2: getY(compliance.min), style: style
60
+ })
61
+ // Compliance Axios (Vertical)
62
+ putLine({
63
+ x1: getX(pressure.min), y1: getY(compliance.min),
64
+ x2: getX(pressure.min), y2: getY(compliance.max), style: style
65
+ })
66
+ // Pressure Zero Line
67
+ style = `
68
+ stroke-width: 0.07mm;
69
+ stroke: black;
70
+ stroke-dasharray: 0.4;
71
+ stroke-opacity: 0.5;
72
+ `;
73
+ putLine({
74
+ x1: getX(0), y1: getY(compliance.min),
75
+ x2: getX(0), y2: getY(compliance.max), style: style
76
+ })
77
+ // Compliance Zero Line
78
+ putLine({
79
+ x1: getX(pressure.min), y1: getY(0),
80
+ x2: getX(pressure.max), y2: getY(0), style: style
81
+ })
82
+
83
+ // Captions:
84
+ style = `
85
+ user-select: none;
86
+ direction: ltr !important;
87
+ /* text-align: center; */
88
+ font-family: Arial, Helvetica, sans-serif !important;
89
+ font-size: 0.8mm;
90
+ text-anchor: middle; /*تراز افقی*/
91
+ dominant-baseline: middle; /* تراز عمودی*/
92
+ `;
93
+ putText({
94
+ container: svg, value: "Compliance (ml)", style: style,
95
+ x: getX(pressure.min), y: getY(compliance.max), dx: 5, dy: -3
96
+ });
97
+ putText({
98
+ container: svg, value: "Pressure (dapa)", style: style,
99
+ x: getX(pressure.max), y: getY(compliance.min), dx: -8, dy: 6,
100
+ });
101
+ style = `
102
+ user-select: none;
103
+ direction: ltr !important;
104
+ /* text-align: center; */
105
+ font-family: Arial, Helvetica, sans-serif !important;
106
+ font-size: 0.8mm;
107
+ text-anchor: start; /*تراز افقی*/
108
+ dominant-baseline: middle; /* تراز عمودی*/
109
+ `;
110
+ putText({
111
+ container: svg, value: "ECV :", style: style,
112
+ x: getX(pressure.min), y: getY(compliance.min), dy: 10
113
+ });
114
+ putText({
115
+ container: svg, value: "", style: style, name: 'ECV',
116
+ x: getX(pressure.min), y: getY(compliance.min), dy: 10, dx: 9
117
+ });
118
+ putText({
119
+ container: svg, value: "MEP :", style: style,
120
+ x: getX(-300), y: getY(compliance.min), dy: 10
121
+ });
122
+ putText({
123
+ container: svg, value: "", style: style, name: 'MEP',
124
+ x: getX(-300), y: getY(compliance.min), dy: 10, dx: 9
125
+ });
126
+ putText({
127
+ container: svg, value: "SC:", style: style,
128
+ x: getX(0), y: getY(compliance.min), dy: 10
129
+ });
130
+ putText({
131
+ container: svg, value: "", style: style, name: 'SC',
132
+ x: getX(0), y: getY(compliance.min), dy: 10, dx: 6
133
+ });
134
+ putText({
135
+ container: svg, value: "G:", style: style,
136
+ x: getX(300), y: getY(compliance.min), dy: 10
137
+ });
138
+ putText({
139
+ container: svg, value: "", style: style, name: 'G',
140
+ x: getX(300), y: getY(compliance.min), dy: 10, dx: 4
141
+ });
142
+ putText({
143
+ container: svg, value: "Type", style: style,
144
+ x: getX(-500), y: getY(2.5),
145
+ });
146
+ putText({
147
+ container: svg, value: "", style: style, name: 'Type',
148
+ x: getX(-500), y: getY(2.5), dx: 8
149
+ });
150
+
151
+ // Compliance Axios digits
152
+ style = `
153
+ user-select: none;
154
+ direction: ltr !important;
155
+ /* text-align: center; */
156
+ font-family: Arial, Helvetica, sans-serif !important;
157
+ font-size: 0.7mm;
158
+ text-anchor: end; /*تراز افقی*/
159
+ dominant-baseline: middle; /* تراز عمودی*/
160
+
161
+ `;
162
+ x = getX(pressure.min);
163
+ for (let c = compliance.min + compliance.step; c <= compliance.max; c += compliance.step) {
164
+ c = Math.round(c * 10) / 10 // برای اون پدیده اعشاری غیرمنتظر
165
+ putText({
166
+ container: svg, value: c,
167
+ x, y: getY(c), dx: -1,
168
+ style: style,
169
+ });
170
+ }
171
+
172
+ // Pressure Axios digits
173
+ style = `
174
+ user-select: none;
175
+ direction: ltr !important;
176
+ /* text-align: center; */
177
+ font-family: Arial, Helvetica, sans-serif !important;
178
+ font-size: 0.7mm;
179
+ text-anchor: middle; /*تراز افقی*/
180
+ dominant-baseline: hanging; /* تراز عمودی*/
181
+ `;
182
+ for (let p = pressure.min; p <= pressure.max; p += pressure.step) {
183
+ putText({
184
+ container: svg, value: p,
185
+ x: getX(p), y: getY(compliance.min), dy: 1,
186
+ style: style,
187
+ });
188
+
189
+ }
190
+
191
+ // console.log(this.container);
192
+ // مربع احاطه‌کننده کل جدول برای راهنمای توسعه
193
+ style = 'fill: transparent; stroke: green; stroke-width: 0.5;';
194
+ // یک بوردر راهنمای توسعه برای اس‌ وی جی به تمام پهنا و ارتفاع رسم می‌کنیم
195
+ putRect({ container: svg, x: -padding.left, y: -padding.top, width, height, name: dims.name, style })
196
+ this.chart = svg;
197
+ this.container.appendChild(svg);
198
+
199
+ // بلاک توابع داخلی مورد نیاز تابع اصلی
200
+ // توابع تبدیل فشار و کامپلیانس به مختصات میلیمتر
201
+ function getX(p) {
202
+ return (p - pressure.min) * (pressureAxiosLength.mm / pressureAxiosLength.dapa)
203
+ }
204
+
205
+ function getY(c) {
206
+ return (compliance.max - c) * (complianceAxiosLength.mm / complianceAxiosLength.ml)
207
+ }
208
+
209
+ // تابع رسم خط
210
+ function putLine({ x1, y1, x2, y2, style }) {
211
+
212
+ let line = document.createElementNS(svgNS, "line");
213
+ line.setAttribute("x1", x1);
214
+ line.setAttribute("y1", y1);
215
+ line.setAttribute("x2", x2);
216
+ line.setAttribute("y2", y2);
217
+ line.setAttribute("style", style)
218
+ // line.setAttribute("stroke", "black");
219
+ // line.setAttribute("stroke-width", "0.1px");
220
+ svg.appendChild(line);
221
+
222
+ }
223
+
224
+ // تابع ایجاد و رسم نقطه نشانگر رنگی
225
+ function point({ container, x, y, color }) {
226
+ let circle = document.createElementNS(svgNS, "circle");
227
+ circle.setAttribute("cx", x);
228
+ circle.setAttribute("cy", y);
229
+ circle.setAttribute("r", '0.3mm');
230
+ circle.setAttribute("stroke", color);
231
+ container.appendChild(circle);
232
+ }
233
+ }
234
+
235
+ update(data) {
236
+
237
+ // جایگذاری مقادیر تمپانومتری در تکست‌باکس ها
238
+ this.chart.querySelector(`text[data-name="Type"]`).innerHTML = data?.type || "";
239
+ // container.getElementById(container.id + "_Type").innerHTML = data?.Type || "";
240
+ this.chart.querySelector(`text[data-name="ECV"]`).innerHTML = data?.ECV || "";
241
+ this.chart.querySelector(`text[data-name="MEP"]`).innerHTML = data?.MEP || "";
242
+ this.chart.querySelector(`text[data-name="SC"]`).innerHTML = data?.SC || "";
243
+ this.chart.querySelector(`text[data-name="G"]`).innerHTML = data?.G || "";
244
+ // container.getElementById(container.id + "_SC").innerHTML = data?.SC || "";
245
+ // document.getElementById(container + "_G").innerHTML = data.G;
246
+ // پاک کردن منحنی قبلی از کانتینر جاری
247
+ this.chart.querySelector(`path[data-name="curve"]`)?.remove();
248
+ // رسم منحنی
249
+ this.drawCurve(data);
250
+
251
+ }
252
+
253
+ // توابع داخلی
254
+ drawCurve(data) {
255
+ // Ensure to Convert to Numbers //
256
+ const container = this.chart
257
+ const { pressure, compliance, pressureAxiosLength, complianceAxiosLength } = this.chartInfo;
258
+
259
+ // تمرین پیدا کردن نقاط
260
+ point({ x: getX(-400), y: getY(5), color: 'green' })
261
+
262
+ // مقداردهی دستی برای تست شکل منحنی
263
+ // data.SC = 0.5;
264
+ // data.MEP = -75;
265
+ // با توجه به اندازه اس ‌سی میشه برای مقادیر زیر یک سری رل گذاشت با منحنی قشنگ تر باشد
266
+ let cp = 50; // جابجایی نقطه کنترل منحنی های راست و چپ روی محور افقی
267
+ // let k = 0.5; // width and height change [0, 1]
268
+ let cpp = 5; //جابجایی نقطه کنترل قله ها روی محور افقی
269
+ // رل‌هایی برای تغییر مقادیر بالا برای زیبایی بیشتر منحنی در نقطه قله
270
+ // (data.SC <= 0.30)? k=0
271
+ let k = (+data.SC > 0.30) ? 0.5 : 0.1; // width and height change [0, 1]
272
+ k = (+data.SC > 1.0) ? 0.2 : k;
273
+ // k = (data.SC < 1.0) ? 0 : k;
274
+
275
+ let pw = 20 * k; // نصف پهنای قله
276
+ let ph = 0.1 * k; // ارتفاع قله
277
+
278
+ let zone = {
279
+ normal: { min: -300, max: 250 },
280
+ expanded: { min: -600, max: 400 },
281
+ }
282
+ // تعیین کرانه‌های منحنی بر حسب فشار گوش میانی
283
+ let RV = zone.normal;
284
+ if (+data.MEP > -250 && +data.MEP < 200) { RV = zone.normal } else { RV = zone.expanded }
285
+
286
+
287
+ const curve2 = {
288
+ R: {
289
+ P1: { p: RV.max, c: 0 },
290
+ P2: { p: +data.MEP + pw, c: +data.SC - ph },
291
+ C: { p: +data.MEP + cp, c: 0 }
292
+ },
293
+ RM: {
294
+ P2: { p: +data.MEP, c: +data.SC },
295
+ C: { p: +data.MEP + cpp, c: +data.SC }
296
+ },
297
+ LM: {
298
+ P2: { p: +data.MEP - pw, c: +data.SC - ph },
299
+ C: { p: +data.MEP - cpp, c: +data.SC }
300
+ },
301
+ L: {
302
+ P1: {},
303
+ P2: { p: RV.min, c: 0 },
304
+ C: { p: +data.MEP - cp, c: 0 }
305
+ }
306
+ }
307
+
308
+ // به دست آوردن مختصات نقاط کنترل بر حسب مختصات پیک
309
+ curve2.RM.P1 = curve2.R.P2
310
+ curve2.LM.P1 = curve2.RM.P2
311
+ curve2.L.P1 = curve2.LM.P2
312
+ let path = document.createElementNS(svgNS, "path");
313
+ path.setAttribute("fill", "none");
314
+ path.setAttribute("data-name", "curve");
315
+ let color = ("R" == "R") ? "brown" : "blue";
316
+ path.setAttribute("stroke", color);
317
+ path.setAttribute("stroke-width", "0.5px");
318
+ path.setAttribute(
319
+ "d", `
320
+ M ${ctg(curve2.R.P1)}
321
+ Q ${ctg(curve2.R.C)} ${ctg(curve2.R.P2)}
322
+ M ${ctg(curve2.RM.P1)}
323
+ Q ${ctg(curve2.RM.C)} ${ctg(curve2.RM.P2)}
324
+ M ${ctg(curve2.LM.P1)}
325
+ Q ${ctg(curve2.LM.C)} ${ctg(curve2.LM.P2)}
326
+ M ${ctg(curve2.L.P1)}
327
+ Q ${ctg(curve2.L.C)} ${ctg(curve2.L.P2)}
328
+ `
329
+ );
330
+ container.appendChild(path);
331
+
332
+
333
+ // تابع ایجاد و رسم نقطه نشانگر رنگی
334
+ function point({ x, y, color }) {
335
+ let circle = document.createElementNS(svgNS, "circle");
336
+ circle.setAttribute("cx", x);
337
+ circle.setAttribute("cy", y);
338
+ circle.setAttribute("r", 0.1);
339
+ circle.setAttribute("stroke", color);
340
+ container.appendChild(circle);
341
+ }
342
+
343
+ // تابعی که آبجکت مختصات را میگیرد و تبدیل به یک رشته با ترکیب دو عدد با ویرگول میکند
344
+ function ctg(pc) {
345
+ return `${getX(pc.p)} ${getY(pc.c)}`
346
+ }
347
+
348
+ function getX(p) {
349
+ return (p - pressure.min) * (pressureAxiosLength.mm / pressureAxiosLength.dapa)
350
+ }
351
+
352
+ function getY(c) {
353
+ return (compliance.max - c) * (complianceAxiosLength.mm / complianceAxiosLength.ml)
354
+ }
355
+ }
356
+ }
@@ -0,0 +1,122 @@
1
+ @font-face {
2
+ /* src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); */
3
+ src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
4
+ font-family: vazirmatn;
5
+ }
6
+
7
+
8
+ button {
9
+ background-color: #4CAF50;
10
+ /* Green background */
11
+ border: none;
12
+ /* Remove borders */
13
+ color: white;
14
+ /* White text */
15
+ padding: 15px 32px;
16
+ /* Some padding */
17
+ text-align: center;
18
+ /* Centered text */
19
+ text-decoration: none;
20
+ /* Remove underline */
21
+ display: inline-block;
22
+ /* Make the button inline */
23
+ font-size: 16px;
24
+ /* Increase font size */
25
+ margin: 4px 2px;
26
+ /* Add some margin */
27
+ cursor: pointer;
28
+ /* Pointer cursor on hover */
29
+ border-radius: 8px;
30
+ /* Rounded corners */
31
+ transition: background-color 0.3s;
32
+ /* Smooth transition */
33
+ }
34
+
35
+ button:hover {
36
+ background-color: #45a049;
37
+ /* Darker green on hover */
38
+ }
39
+
40
+ button:active {
41
+ background-color: #3e8e41;
42
+ /* Even darker green when clicked */
43
+ }
44
+
45
+
46
+ .header1 {
47
+ user-select: none;
48
+ /* direction: rtl; */
49
+ /* text-align: center; */
50
+ font-family: vazirmatn;
51
+ font-size: 1.6mm;
52
+ font-weight: bolder;
53
+ }
54
+ .header2 {
55
+ user-select: none;
56
+ direction: rtl;
57
+ /* text-align: center; */
58
+ text-anchor: middle;
59
+ /* font-family: sans-serif, Helvetica, Arial;*/
60
+ /* font-family: Verdana, Geneva, Tahoma, sans-serif; */
61
+ font-family: sans-serif !important;
62
+ font-family: 'Courier New', Courier, monospace;
63
+ font-size: 1.1mm;
64
+ font-weight: bold;
65
+ }
66
+ .header3 {
67
+ user-select: none;
68
+ /* direction: rtl; */
69
+ /* text-align: center; */
70
+ font-family: sans-serif !important;
71
+
72
+ /* font-family: vazirmatn; */
73
+ font-size: 1mm;
74
+ font-weight: bold;
75
+ }
76
+ .header4 {
77
+ user-select: none;
78
+ direction: rtl;
79
+ /* text-align: center; */
80
+ font-family: vazirmatn;
81
+ font-size: 1mm;
82
+ /* font-weight: bold; */
83
+ }
84
+ .tymp1 {
85
+ user-select: none;
86
+ direction: ltr !important;
87
+ /* text-align: center; */
88
+ font-family: Arial, Helvetica, sans-serif !important;
89
+ font-size: 1mm;
90
+ /* font-weight: bold; */
91
+ }
92
+ .tymp2 {
93
+ user-select: none;
94
+ direction: ltr !important;
95
+ /* text-align: center; */
96
+ font-family: Arial, Helvetica, sans-serif !important;
97
+ font-size: 0.8mm;
98
+ /* font-weight: bold; */
99
+ }
100
+ /* .mizoon {
101
+ display: table;
102
+ margin-right: auto;
103
+ margin-left: auto;
104
+
105
+ } */
106
+
107
+ /* input {
108
+ display: block;
109
+ width: 60%;
110
+ border: 1px solid antiquewhite;
111
+ padding: 10px 10px;
112
+ margin: 10px auto 10px auto;
113
+ } */
114
+ .header5 {
115
+ /* font: 1.5px Verdana, Helvetica, Arial, sans-serif; */
116
+ user-select: none;
117
+ direction: rtl;
118
+ text-align: right;
119
+ font-family: vazirmatn;
120
+ font-size: 0.9mm;
121
+ font-weight: bold;
122
+ }
@@ -0,0 +1,68 @@
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ // تعریف آبجکت مختصات ایکس - فرکانس در تیبل ادیوگرام
4
+ const xFrequency = {
5
+ // مقدار کلید برابر با مختصات محلی فرکانس هست
6
+ 20: 250,
7
+ 40: 500,
8
+ 53: 750,
9
+ 60: 1000,
10
+ 73: 1500,
11
+ 80: 2000,
12
+ 93: 3000,
13
+ 100: 4000,
14
+ 113: 6000,
15
+ 120: 8000,
16
+ };
17
+ const freqToXObj = {
18
+ // آبجکت تبدیل فرکانس به مختصات ایکس جدول ادیوگرام
19
+ 250: 20,
20
+ 500: 40,
21
+ 750: 53,
22
+ 1000: 60,
23
+ 1500: 73,
24
+ 2000: 80,
25
+ 3000: 93,
26
+ 4000: 100,
27
+ 6000: 113,
28
+ 8000: 120,
29
+ };
30
+ // تعریف آبجکت مختصات ایگرگ - شدت در تیبل ادیوگرام
31
+ const yIntensity = {
32
+ 5: -15,
33
+ 10: -10,
34
+ 15: -5,
35
+ 20: 0,
36
+ 25: 5,
37
+ 30: 10,
38
+ 35: 15,
39
+ 40: 20,
40
+ 45: 25,
41
+ 50: 30,
42
+ 55: 35,
43
+ 60: 40,
44
+ 65: 45,
45
+ 70: 50,
46
+ 75: 55,
47
+ 80: 60,
48
+ 85: 65,
49
+ 90: 70,
50
+ 95: 75,
51
+ 100: 80,
52
+ 105: 85,
53
+ 110: 90,
54
+ 115: 95,
55
+ 120: 100,
56
+ 125: 105,
57
+ 130: 110,
58
+ 135: 115,
59
+ 140: 120,
60
+ 145: 125,
61
+ };
62
+
63
+ export {
64
+ svgNS,
65
+ xFrequency,
66
+ yIntensity,
67
+ freqToXObj,
68
+ };
@@ -0,0 +1,84 @@
1
+ // import { svgNS } from "../../globalinfo.js";
2
+ const svgNS = "http://www.w3.org/2000/svg";
3
+
4
+ // پهنا و ارتفاع ظرف را پیدا کن و آنرا شطرنجی کن
5
+ export default function drawGrid(container) {
6
+ const viewBox = container.getAttribute("viewBox");
7
+ const w = container.getAttribute("width");
8
+ const h = container.getAttribute("height");
9
+ const svg = document.createElementNS(svgNS, "svg");
10
+ svg.setAttribute("viewBox", viewBox);
11
+ // svg.setAttribute("width", 210);
12
+ // svg.setAttribute("height", 297);
13
+
14
+ // مربع احاطه‌کننده کل جدول برای راهنمای توسعه
15
+ let rect = document.createElementNS(svgNS, "rect");
16
+ rect.setAttribute("x", 0);
17
+ rect.setAttribute("y", 0);
18
+ rect.setAttribute("width", 210);
19
+ rect.setAttribute("height", 297);
20
+ rect.setAttribute("style", "fill: transparent; stroke-width: 1;");
21
+ svg.appendChild(rect);
22
+
23
+ let line,
24
+ x,
25
+ y = 0;
26
+ // رسم خطوط افقی با فاصله واحد ویوباکس
27
+ for (y = 1; y <= 296; y++) {
28
+ line = document.createElementNS(svgNS, "line");
29
+ line.setAttribute("x1", 1);
30
+ line.setAttribute("y1", y);
31
+ line.setAttribute("x2", 209);
32
+ line.setAttribute("y2", y);
33
+ line.setAttribute(
34
+ "style",
35
+ "stroke: black; stroke-width: 0.1; stroke-opacity: 0.5; stroke-dasharray: 0.1;"
36
+ );
37
+ line.setAttribute("class", "gridLines");
38
+ svg.appendChild(line);
39
+ }
40
+
41
+ // رسم خطوط عمودی با فاصله واحد ویوباکس
42
+ for (x = 1; x <= 209; x++) {
43
+ line = document.createElementNS(svgNS, "line");
44
+ line.setAttribute("x1", x);
45
+ line.setAttribute("y1", 1);
46
+ line.setAttribute("x2", x);
47
+ line.setAttribute("y2", 296);
48
+ line.setAttribute(
49
+ "style",
50
+ "stroke: black; stroke-width: 0.1; stroke-opacity: 0.5; stroke-dasharray: 0.1;"
51
+ );
52
+ line.setAttribute("class", "gridLines");
53
+
54
+ svg.appendChild(line);
55
+ }
56
+ // رسم خط میانی افقی
57
+ line = document.createElementNS(svgNS, "line");
58
+ line.setAttribute("x1", 1);
59
+ line.setAttribute("y1", 297/2);
60
+ line.setAttribute("x2", 209);
61
+ line.setAttribute("y2", 297/2);
62
+ line.setAttribute(
63
+ "style",
64
+ "stroke: black; stroke-width: 0.2; stroke-opacity: 0.8;"
65
+ );
66
+ line.setAttribute("class", "gridLines");
67
+
68
+ svg.appendChild(line);
69
+
70
+ // رسم خط میانی عمودی
71
+ line = document.createElementNS(svgNS, "line");
72
+ line.setAttribute("x1", 105);
73
+ line.setAttribute("y1", 1);
74
+ line.setAttribute("x2", 105);
75
+ line.setAttribute("y2", 296);
76
+ line.setAttribute(
77
+ "style",
78
+ "stroke: black; stroke-width: 0.2; stroke-opacity: 0.8;"
79
+ );
80
+ line.setAttribute("class", "gridLines");
81
+
82
+ svg.appendChild(line);
83
+ container.appendChild(svg);
84
+ }
@@ -0,0 +1,9 @@
1
+ export default function hideGrid() {
2
+
3
+ let gridLines = document.getElementsByClassName("gridLines");
4
+
5
+ for (const line of gridLines) {
6
+ line.style = "stroke: transparent; fill: transparent;"
7
+ }
8
+
9
+ }