hayun-vite 0.0.2 → 0.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 (42) hide show
  1. package/assets/styles-test.css +90 -90
  2. package/assets/styles.css +90 -90
  3. package/data/formData1.js +42 -42
  4. package/data/officesObjStore.js +56 -56
  5. package/data/patientsObjStore.js +73 -73
  6. package/data/sampleData.js +94 -94
  7. package/index.js +11 -11
  8. package/package.json +1 -1
  9. package/src/Audiogram/Audiogram.js +194 -197
  10. package/src/Audiogram/dims.js +83 -83
  11. package/src/Form/Form.js +268 -276
  12. package/src/Form/Form_N.js +158 -158
  13. package/src/Form/Forms-Test.html +124 -124
  14. package/src/Form/Forms.js +121 -134
  15. package/src/Form/Header.js +91 -91
  16. package/src/Form/Reflex.js +141 -141
  17. package/src/Form/Sections.js +71 -71
  18. package/src/Form/Speech.js +132 -132
  19. package/src/Form/TextBox.js +66 -80
  20. package/src/Form/Tympanogram.js +355 -355
  21. package/src/Form/formStyles.css +122 -122
  22. package/src/Form/globalinfo.js +68 -68
  23. package/src/Form/grid/drawGrid.js +84 -84
  24. package/src/Form/grid/hideGrid.js +8 -8
  25. package/src/Form/printForm.js +122 -75
  26. package/src/Form/templates/combo.js +248 -248
  27. package/src/Form/templates/dims.js +204 -204
  28. package/src/Form/templates/rasaAud.js +287 -287
  29. package/src/Symbol/Symbols.js +29 -29
  30. package/src/Symbol/createSymbolSVG.js +240 -240
  31. package/src/Symbol/getAllSymbolsSVG.js +21 -21
  32. package/src/Symbol/insertSymbol.js +10 -10
  33. package/src/Symbol/symbolChart.js +47 -47
  34. package/src/common/putLine.js +16 -16
  35. package/src/common/putPoint.js +12 -12
  36. package/src/common/putRect.js +13 -13
  37. package/src/common/putText.js +17 -16
  38. package/src/common/putTopLayer.js +17 -17
  39. package/src/main.js +88 -87
  40. package/src/note.css +62 -0
  41. package/src/style.css +189 -156
  42. package/src/note.html +0 -1
@@ -1,198 +1,195 @@
1
- import putLine from "../common/putLine.js";
2
- import putPoint from "../common/putPoint.js";
3
- import putRect from "../common/putRect.js";
4
- import getAllSymbolsSVG from "../Symbol/getAllSymbolsSVG.js";
5
- // import dims from "./dims.js";
6
- // import '../style.css'
7
-
8
-
9
- const svgNS = "http://www.w3.org/2000/svg";
10
-
11
- export default class AudiogramChart {
12
- constructor({ container, side, x = 0, y = 0, pname, events = true, dims }) {
13
-
14
- const { width, height, chartPadding, symbolDims, vFrequency, vToFreq, freqToV, intensity, styles } = dims;
15
-
16
- x = dims.margin.left
17
- y = dims.margin.top
18
-
19
- this.symbolDims = symbolDims;
20
- this.vFrequency = vFrequency;
21
- this.freqToV = freqToV;
22
- this.intensity = intensity;
23
- this.styles = styles;
24
-
25
-
26
- const symbols = getAllSymbolsSVG();
27
- this.symbols = symbols;
28
- this.side = side;
29
- let style;
30
-
31
-
32
- const xArea = { min: chartPadding.left, max: width - (chartPadding.right) }
33
-
34
- const yArea = { min: chartPadding.top, max: height - (chartPadding.bottom) }
35
- const xAxiosLength = { mm: width - (chartPadding.left + chartPadding.right), hz: 14 }
36
- const yAxiosLength = height
37
-
38
- const vFrequencyAxiosLength = {
39
- mm: width - (chartPadding.left + chartPadding.right),
40
- hz: vFrequency.max - vFrequency.min
41
- }
42
- this.vFrequencyAxiosLength = vFrequencyAxiosLength;
43
-
44
- const intensityAxiosLength = {
45
- mm: height - (chartPadding.top + chartPadding.bottom),
46
- db: intensity.max - intensity.min,
47
- }
48
- this.intensityAxiosLength = intensityAxiosLength;
49
-
50
- const svg = document.createElementNS(svgNS, "svg");
51
- this.svg = svg;
52
-
53
- svg.setAttribute("width", width);
54
- svg.setAttribute("height", height);
55
- svg.setAttribute("x", x);
56
- svg.setAttribute("y", y);
57
- svg.setAttribute("viewBox", [-chartPadding.left, -chartPadding.top, width, height]);
58
-
59
- // محدوده مختصات خطوط جدول
60
- const chartArea = putRect({
61
- container: svg,
62
- x: this.getX(vFrequency.min), y: this.getY(intensity.min),
63
- width: vFrequencyAxiosLength.mm, height: intensityAxiosLength.mm,
64
- style: 'stroke-width: 0.4; stroke: gray; fill: transparent'
65
- })
66
-
67
- const currentPointer = putPoint({ container: svg, x: 0, y: 0, r: 4, color: 'black' });
68
- this.currentPointer = currentPointer;
69
-
70
- // رسم خطوط افقی از بالا به پایین
71
- let x1 = this.getX(vFrequency.min);
72
- let x2 = this.getX(vFrequency.max);
73
- for (let i = intensity.min; i <= intensity.max; i += intensity.step) {
74
- const y1 = this.getY(i)
75
- const y2 = y1
76
- putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
77
- }
78
-
79
- // رسم خطوط عمودی از چپ به راست
80
- let y1 = this.getY(intensity.min)
81
- let y2 = this.getY(intensity.max)
82
- for (let f = vFrequency.min; f <= vFrequency.max; f += vFrequency.step) {
83
- const x1 = this.getX(f)
84
- const x2 = x1
85
- putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
86
- }
87
-
88
- // یک بوردر راهنمای توسعه برای اس‌ وی جی به تمام پهنا و ارتفاع رسم می‌کنیم
89
- // این مربع مرزی را آخرین ایجاد میکنیم تا بالاترین لایه باشد و روی ریودادها درست عمل کند
90
- const borderRect = putRect({ container: svg, x: -chartPadding.left, y: -chartPadding.top, width, height, name: 'RAudiogram' });
91
- this.borderRect = borderRect;
92
-
93
- // ایجاد رویدادها روی فقط چارت جدول
94
- borderRect.addEventListener('mousemove', (e) => {
95
- const x = e.offsetX
96
- const y = e.offsetY
97
-
98
- currentPointer.setAttribute('cx', x - chartPadding.left)
99
- currentPointer.setAttribute('cy', y - chartPadding.top)
100
- console.log('x:', x, 'f:', getFreq(x));
101
- // تبدیل مختصات به مختصات فرکانس و شدت
102
-
103
- })
104
-
105
- // تبدیل مقدار ایکس مختصات به فرکانس
106
- function getFreq(x) {
107
- return vToFreq[Math.round((x - xArea.min) * (xAxiosLength.hz / xAxiosLength.mm))]
108
- }
109
-
110
- container && container.appendChild(svg);
111
-
112
- // تست تابع آپدیت
113
- // this.update({
114
- // data: {
115
- // // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
116
- // R_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
117
- // R_AC_NR: { 1500: 85 },
118
- // R_BC_M: { 2000: 25, 6000: 25 },
119
- // R_BC_M_NR: { 3000: 85 },
120
- // R_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
121
- // },
122
- // side: this.side,
123
- // })
124
-
125
- }
126
-
127
- getX(f) {
128
- return ((f - this.vFrequency.min) * (this.vFrequencyAxiosLength.mm / this.vFrequencyAxiosLength.hz)
129
- )
130
- }
131
- // تبدیل مقدار شدت به دسی بل به مقدار میلیمتر مختصات
132
- getY(i) {
133
- return ((i - this.intensity.min) * (this.intensityAxiosLength.mm / this.intensityAxiosLength.db)
134
- )
135
- }
136
-
137
- update({ data, side }) {
138
- const junctions = { AC: {}, BC: {}, side };
139
- this.junctions = junctions;
140
- // console.log(data);
141
-
142
- for (const symbolName in data) {
143
-
144
- for (const freq in data[symbolName]) {
145
- const x = this.getX(this.freqToV[freq]);
146
- const y = this.getY(data[symbolName][freq]);
147
- this.insertSymbol({ symbolName, x, y });
148
- // جمع آوری مختصات برای رسم خط بین سمبل ها اینجا انجام می‌شود
149
- // پراپرتی تایپ فقط راهنمای دیباگ هست و کاربردی ندارد
150
- let NR = (symbolName.at(-1) === 'R') ? true : false;
151
- (symbolName.slice(2, 4) === 'AC') && (junctions.AC[freq] = { x, y, NR, type: symbolName });
152
- (symbolName.slice(2, 4) === 'BC') && (junctions.BC[freq] = { x, y, NR, type: symbolName });
153
- }
154
- }
155
- this.drawJunctions();
156
-
157
- // بالا آوردن مستطیل احاطه کننده به بالاترین لایه برای دریافت صحیح رویدادهای موس
158
- this.svg.appendChild(this.borderRect)
159
-
160
- }
161
-
162
- drawJunctions() {
163
- // console.log(this.junctions);
164
- // رسم خط بین نقاط
165
- const junctions = this.junctions
166
- let color = (junctions.side === 'R') ? 'red' : 'blue';
167
-
168
- for (const type in junctions) {
169
- let x1, y1, x2, y2, NR1, NR2;
170
- for (const freq in junctions[type]) {
171
- x1 = x2; y1 = y2; NR1 = NR2
172
- x2 = junctions[type][freq].x
173
- y2 = junctions[type][freq].y
174
- NR2 = junctions[type][freq].NR
175
- let style =
176
- type === "BC"
177
- ? this.styles.juncDashLine + `stroke: ${color}`
178
- : this.styles.juncLine + `stroke: ${color}`;
179
- x1 && !NR1 && !NR2 && putLine({ container: this.svg, x1, y1, x2, y2, style });
180
- }
181
- }
182
- }
183
-
184
- insertSymbol({ symbolName, x, y }) {
185
- const width = this.symbolDims.width
186
- const symbol = this.getSymbol(symbolName);
187
- symbol.setAttribute('x', x - width / 2)
188
- symbol.setAttribute('y', y - width / 2)
189
- symbol.setAttribute('width', width)
190
- symbol.setAttribute('height', width)
191
- this.svg.appendChild(symbol)
192
- }
193
-
194
- getSymbol(symbolName) {
195
- const point = this.symbols[symbolName].cloneNode(true);
196
- return point
197
- }
1
+ import putLine from "../common/putLine.js";
2
+ import putPoint from "../common/putPoint.js";
3
+ import putRect from "../common/putRect.js";
4
+ import getAllSymbolsSVG from "../Symbol/getAllSymbolsSVG.js";
5
+
6
+ const svgNS = "http://www.w3.org/2000/svg";
7
+
8
+ export default class AudiogramChart {
9
+ constructor({ container, side, x = 0, y = 0, pname, events = true, dims }) {
10
+
11
+ const { width, height, chartPadding, symbolDims, vFrequency, vToFreq, freqToV, intensity, styles } = dims;
12
+
13
+ x = dims.margin.left
14
+ y = dims.margin.top
15
+
16
+ this.symbolDims = symbolDims;
17
+ this.vFrequency = vFrequency;
18
+ this.freqToV = freqToV;
19
+ this.intensity = intensity;
20
+ this.styles = styles;
21
+
22
+
23
+ const symbols = getAllSymbolsSVG();
24
+ this.symbols = symbols;
25
+ this.side = side;
26
+ let style;
27
+
28
+
29
+ const xArea = { min: chartPadding.left, max: width - (chartPadding.right) }
30
+
31
+ const yArea = { min: chartPadding.top, max: height - (chartPadding.bottom) }
32
+ const xAxiosLength = { mm: width - (chartPadding.left + chartPadding.right), hz: 14 }
33
+ const yAxiosLength = height
34
+
35
+ const vFrequencyAxiosLength = {
36
+ mm: width - (chartPadding.left + chartPadding.right),
37
+ hz: vFrequency.max - vFrequency.min
38
+ }
39
+ this.vFrequencyAxiosLength = vFrequencyAxiosLength;
40
+
41
+ const intensityAxiosLength = {
42
+ mm: height - (chartPadding.top + chartPadding.bottom),
43
+ db: intensity.max - intensity.min,
44
+ }
45
+ this.intensityAxiosLength = intensityAxiosLength;
46
+
47
+ const svg = document.createElementNS(svgNS, "svg");
48
+ this.svg = svg;
49
+
50
+ svg.setAttribute("width", width);
51
+ svg.setAttribute("height", height);
52
+ svg.setAttribute("x", x);
53
+ svg.setAttribute("y", y);
54
+ svg.setAttribute("viewBox", [-chartPadding.left, -chartPadding.top, width, height]);
55
+
56
+ // محدوده مختصات خطوط جدول
57
+ const chartArea = putRect({
58
+ container: svg,
59
+ x: this.getX(vFrequency.min), y: this.getY(intensity.min),
60
+ width: vFrequencyAxiosLength.mm, height: intensityAxiosLength.mm,
61
+ style: 'stroke-width: 0.4; stroke: gray; fill: transparent'
62
+ })
63
+
64
+ const currentPointer = putPoint({ container: svg, x: 0, y: 0, r: 4, color: 'black' });
65
+ this.currentPointer = currentPointer;
66
+
67
+ // رسم خطوط افقی از بالا به پایین
68
+ let x1 = this.getX(vFrequency.min);
69
+ let x2 = this.getX(vFrequency.max);
70
+ for (let i = intensity.min; i <= intensity.max; i += intensity.step) {
71
+ const y1 = this.getY(i)
72
+ const y2 = y1
73
+ putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
74
+ }
75
+
76
+ // رسم خطوط عمودی از چپ به راست
77
+ let y1 = this.getY(intensity.min)
78
+ let y2 = this.getY(intensity.max)
79
+ for (let f = vFrequency.min; f <= vFrequency.max; f += vFrequency.step) {
80
+ const x1 = this.getX(f)
81
+ const x2 = x1
82
+ putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
83
+ }
84
+
85
+ // یک بوردر راهنمای توسعه برای اس‌ وی جی به تمام پهنا و ارتفاع رسم می‌کنیم
86
+ // این مربع مرزی را آخرین ایجاد میکنیم تا بالاترین لایه باشد و روی ریودادها درست عمل کند
87
+ const borderRect = putRect({ container: svg, x: -chartPadding.left, y: -chartPadding.top, width, height, name: 'RAudiogram' });
88
+ this.borderRect = borderRect;
89
+
90
+ // ایجاد رویدادها روی فقط چارت جدول
91
+ borderRect.addEventListener('mousemove', (e) => {
92
+ const x = e.offsetX
93
+ const y = e.offsetY
94
+
95
+ currentPointer.setAttribute('cx', x - chartPadding.left)
96
+ currentPointer.setAttribute('cy', y - chartPadding.top)
97
+ console.log('x:', x, 'f:', getFreq(x));
98
+ // تبدیل مختصات به مختصات فرکانس و شدت
99
+
100
+ })
101
+
102
+ // تبدیل مقدار ایکس مختصات به فرکانس
103
+ function getFreq(x) {
104
+ return vToFreq[Math.round((x - xArea.min) * (xAxiosLength.hz / xAxiosLength.mm))]
105
+ }
106
+
107
+ container && container.appendChild(svg);
108
+
109
+ // تست تابع آپدیت
110
+ // this.update({
111
+ // data: {
112
+ // // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
113
+ // R_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
114
+ // R_AC_NR: { 1500: 85 },
115
+ // R_BC_M: { 2000: 25, 6000: 25 },
116
+ // R_BC_M_NR: { 3000: 85 },
117
+ // R_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
118
+ // },
119
+ // side: this.side,
120
+ // })
121
+
122
+ }
123
+
124
+ getX(f) {
125
+ return ((f - this.vFrequency.min) * (this.vFrequencyAxiosLength.mm / this.vFrequencyAxiosLength.hz)
126
+ )
127
+ }
128
+ // تبدیل مقدار شدت به دسی بل به مقدار میلیمتر مختصات
129
+ getY(i) {
130
+ return ((i - this.intensity.min) * (this.intensityAxiosLength.mm / this.intensityAxiosLength.db)
131
+ )
132
+ }
133
+
134
+ update({ data, side }) {
135
+ const junctions = { AC: {}, BC: {}, side };
136
+ this.junctions = junctions;
137
+ // console.log(data);
138
+
139
+ for (const symbolName in data) {
140
+
141
+ for (const freq in data[symbolName]) {
142
+ const x = this.getX(this.freqToV[freq]);
143
+ const y = this.getY(data[symbolName][freq]);
144
+ this.insertSymbol({ symbolName, x, y });
145
+ // جمع آوری مختصات برای رسم خط بین سمبل ها اینجا انجام می‌شود
146
+ // پراپرتی تایپ فقط راهنمای دیباگ هست و کاربردی ندارد
147
+ let NR = (symbolName.at(-1) === 'R') ? true : false;
148
+ (symbolName.slice(2, 4) === 'AC') && (junctions.AC[freq] = { x, y, NR, type: symbolName });
149
+ (symbolName.slice(2, 4) === 'BC') && (junctions.BC[freq] = { x, y, NR, type: symbolName });
150
+ }
151
+ }
152
+ this.drawJunctions();
153
+
154
+ // بالا آوردن مستطیل احاطه کننده به بالاترین لایه برای دریافت صحیح رویدادهای موس
155
+ this.svg.appendChild(this.borderRect)
156
+
157
+ }
158
+
159
+ drawJunctions() {
160
+ // console.log(this.junctions);
161
+ // رسم خط بین نقاط
162
+ const junctions = this.junctions
163
+ let color = (junctions.side === 'R') ? 'red' : 'blue';
164
+
165
+ for (const type in junctions) {
166
+ let x1, y1, x2, y2, NR1, NR2;
167
+ for (const freq in junctions[type]) {
168
+ x1 = x2; y1 = y2; NR1 = NR2
169
+ x2 = junctions[type][freq].x
170
+ y2 = junctions[type][freq].y
171
+ NR2 = junctions[type][freq].NR
172
+ let style =
173
+ type === "BC"
174
+ ? this.styles.juncDashLine + `stroke: ${color}`
175
+ : this.styles.juncLine + `stroke: ${color}`;
176
+ x1 && !NR1 && !NR2 && putLine({ container: this.svg, x1, y1, x2, y2, style });
177
+ }
178
+ }
179
+ }
180
+
181
+ insertSymbol({ symbolName, x, y }) {
182
+ const width = this.symbolDims.width
183
+ const symbol = this.getSymbol(symbolName);
184
+ symbol.setAttribute('x', x - width / 2)
185
+ symbol.setAttribute('y', y - width / 2)
186
+ symbol.setAttribute('width', width)
187
+ symbol.setAttribute('height', width)
188
+ this.svg.appendChild(symbol)
189
+ }
190
+
191
+ getSymbol(symbolName) {
192
+ const point = this.symbols[symbolName].cloneNode(true);
193
+ return point
194
+ }
198
195
  }
@@ -1,84 +1,84 @@
1
- // for
2
- const dims = {
3
- name: 'Audiogram',
4
- // پس از اضافه کردن هر آیتم در زیر این تمپلت رو هم آپدیت کنید
5
- template: {
6
- margin: { left: 0, top: 0, }, // در کانتینر دیو این عمل نمیکنه. مگر در کانتینر اس وی جی بذاریم
7
-
8
- width: 700,
9
- height: 700,
10
-
11
- chartPadding: { left: 30, top: 45, right: 30, bottom: 10 },
12
- symbolDims: { width: 55, height: 55 },
13
- // virtual frequency
14
- vFrequency: { min: 0, max: 14, step: 1 },
15
- vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
16
- freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
17
- intensity: { min: -20, max: 120, step: 10 },
18
-
19
- styles: {
20
- line: ``,
21
- juncDashLine: ``,
22
- juncLine: ``,
23
- }
24
- },
25
-
26
- display: {
27
- margin: { left: 0, top: 0, }, // در کانتینر دیو این عمل نمیکنه. مگر در کانتینر اس وی جی بذاریم
28
-
29
- width: 700,
30
- height: 700,
31
-
32
- chartPadding: { left: 30, top: 45, right: 30, bottom: 10 }, // این فاصله خطوط جدول از لبه ها هست
33
- symbolDims: { width: 55, height: 55 },
34
- // virtual frequency
35
- vFrequency: { min: 0, max: 14, step: 1 },
36
- vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
37
- freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
38
- intensity: { min: -20, max: 130, step: 10 },
39
-
40
- styles: {
41
- line: `stroke: black; stroke-width: 1;`,
42
- juncDashLine: `stroke-width: 1 ; stroke-opacity: 0.8; stroke-dasharray: 4;`,
43
- juncLine: `stroke-width: 1; stroke-opacity: 0.8;`,
44
- }
45
- },
46
- rasa: {
47
- // width: 70.6,
48
- // height: 70,
49
- // margin: { left: 17, top: 18.5, },
50
- chartPadding: { left: 0, top: 0, right: 0, bottom: 0 },
51
- symbolDims: { width: 8, height: 8 },
52
- // virtual frequency
53
- vFrequency: { min: 0, max: 14, step: 1 },
54
- vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
55
- freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
56
- intensity: { min: -20, max: 120, step: 10 },
57
-
58
- styles: {
59
- line: `stroke: black; stroke-width: 0.1;`,
60
- juncDashLine: `stroke-width: 0.1 ; stroke-opacity: 0.8; stroke-dasharray: 0.5;`,
61
- juncLine: `stroke-width: 0.2; stroke-opacity: 0.8;`,
62
- }
63
- },
64
- combo: {
65
- // width: 50,
66
- // height: 40,
67
- // margin: { left: 5, top: 5, right: 5, bottom: 5 },
68
- chartPadding: { left: 8, top: 8, right: 5, bottom: 3 },
69
- symbolDims: { width: 8, height: 8 },
70
- // virtual frequency
71
- vFrequency: { min: 0, max: 14, step: 1 },
72
- vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
73
- freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
74
- intensity: { min: -20, max: 120, step: 10 },
75
-
76
- styles: {
77
- line: `stroke: black; stroke-width: 0.1;`,
78
- juncDashLine: `stroke-width: 0.1 ; stroke-opacity: 0.8; stroke-dasharray: 0.5;`,
79
- juncLine: `stroke-width: 0.2; stroke-opacity: 0.8;`,
80
- }
81
- }
82
- }
83
-
1
+ // for
2
+ const dims = {
3
+ name: 'Audiogram',
4
+ // پس از اضافه کردن هر آیتم در زیر این تمپلت رو هم آپدیت کنید
5
+ template: {
6
+ margin: { left: 0, top: 0, }, // در کانتینر دیو این عمل نمیکنه. مگر در کانتینر اس وی جی بذاریم
7
+
8
+ width: 700,
9
+ height: 700,
10
+
11
+ chartPadding: { left: 30, top: 45, right: 30, bottom: 10 },
12
+ symbolDims: { width: 55, height: 55 },
13
+ // virtual frequency
14
+ vFrequency: { min: 0, max: 14, step: 1 },
15
+ vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
16
+ freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
17
+ intensity: { min: -20, max: 120, step: 10 },
18
+
19
+ styles: {
20
+ line: ``,
21
+ juncDashLine: ``,
22
+ juncLine: ``,
23
+ }
24
+ },
25
+
26
+ display: {
27
+ margin: { left: 0, top: 0, }, // در کانتینر دیو این عمل نمیکنه. مگر در کانتینر اس وی جی بذاریم
28
+
29
+ width: 700,
30
+ height: 700,
31
+
32
+ chartPadding: { left: 30, top: 45, right: 30, bottom: 10 }, // این فاصله خطوط جدول از لبه ها هست
33
+ symbolDims: { width: 55, height: 55 },
34
+ // virtual frequency
35
+ vFrequency: { min: 0, max: 14, step: 1 },
36
+ vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
37
+ freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
38
+ intensity: { min: -20, max: 130, step: 10 },
39
+
40
+ styles: {
41
+ line: `stroke: black; stroke-width: 1;`,
42
+ juncDashLine: `stroke-width: 1 ; stroke-opacity: 0.8; stroke-dasharray: 4;`,
43
+ juncLine: `stroke-width: 1; stroke-opacity: 0.8;`,
44
+ }
45
+ },
46
+ rasa: {
47
+ // width: 70.6,
48
+ // height: 70,
49
+ // margin: { left: 17, top: 18.5, },
50
+ chartPadding: { left: 0, top: 0, right: 0, bottom: 0 },
51
+ symbolDims: { width: 8, height: 8 },
52
+ // virtual frequency
53
+ vFrequency: { min: 0, max: 14, step: 1 },
54
+ vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
55
+ freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
56
+ intensity: { min: -20, max: 120, step: 10 },
57
+
58
+ styles: {
59
+ line: `stroke: black; stroke-width: 0.1;`,
60
+ juncDashLine: `stroke-width: 0.1 ; stroke-opacity: 0.8; stroke-dasharray: 0.5;`,
61
+ juncLine: `stroke-width: 0.2; stroke-opacity: 0.8;`,
62
+ }
63
+ },
64
+ combo: {
65
+ // width: 50,
66
+ // height: 40,
67
+ // margin: { left: 5, top: 5, right: 5, bottom: 5 },
68
+ chartPadding: { left: 8, top: 8, right: 5, bottom: 3 },
69
+ symbolDims: { width: 8, height: 8 },
70
+ // virtual frequency
71
+ vFrequency: { min: 0, max: 14, step: 1 },
72
+ vToFreq: { 0: 125, 2: 250, 4: 500, 5: 750, 6: 1000, 7: 1500, 8: 2000, 9: 3000, 10: 4000, 11: 6000, 12: 8000, 13: 12000, 14: 16000 },
73
+ freqToV: { 125: 0, 250: 2, 500: 4, 750: 5, 1000: 6, 1500: 7, 2000: 8, 3000: 9, 4000: 10, 6000: 11, 8000: 12, 12000: 13, 16000: 14 },
74
+ intensity: { min: -20, max: 120, step: 10 },
75
+
76
+ styles: {
77
+ line: `stroke: black; stroke-width: 0.1;`,
78
+ juncDashLine: `stroke-width: 0.1 ; stroke-opacity: 0.8; stroke-dasharray: 0.5;`,
79
+ juncLine: `stroke-width: 0.2; stroke-opacity: 0.8;`,
80
+ }
81
+ }
82
+ }
83
+
84
84
  export default dims;