hayun-vite 0.13.0 → 0.14.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.
@@ -2,11 +2,23 @@ import Tympanogram from "./Tympanogram";
2
2
 
3
3
  document.querySelector('#app').innerHTML = `
4
4
  <div id="test"></div>
5
+ <p>Curve settings:</p>
6
+ <div>
7
+ <input type="range" id="cp" name="cp" min="10" max="150" value="70" step="5" />
8
+ <label for="cp">cp</label>
9
+ <input type="range" id="cpp" name="cpp" min="1" max="10" value="5" step="1" />
10
+ <label for="cpp">cpp</label>
11
+ <div>
12
+ <input type="checkbox" name="extra-sc" id="extra-sc">
13
+ <label for="extra-sc">Extra SC</label>
14
+ </div>
15
+ <div>
16
+ <input type="checkbox" name="compensated" id="compensated">
17
+ <label for="compensated">Compensated</label>
18
+ </div>
19
+ </div>
5
20
  `;
6
-
7
- const container = document.getElementById('test')
8
-
9
- const dims = {
21
+ let dims = {
10
22
  "name": "RTympanogram",
11
23
  "w": 100,
12
24
  "h": 60,
@@ -18,17 +30,56 @@ const dims = {
18
30
  },
19
31
  "display": "inline",
20
32
  "width": 100 * 12,
21
- "height": 60 * 12
33
+ "height": 60 * 12,
22
34
  }
23
- const RTympanogram = new Tympanogram({ container, dims, side: 'R' })
24
- RTympanogram.update({
35
+ let data = {
25
36
  Type: "An",
26
- ECV: '3',
27
- SC: '1.5',
28
- MEP: '-150',
37
+ ECV: '1.30',
38
+ SC: '0.80',
39
+ MEP: '-130',
29
40
  G: 0.2,
30
41
  expanded: false, // by default is false for expand pressure from -600 to +400
31
- // extraCompliance: true // by default is false (0 - 3) and true is: (0 - 6)
32
42
 
43
+ }
44
+ let cp = 70, cpp = 5, extraCompliance, compensated
45
+
46
+ document.querySelector("#compensated").addEventListener("input", e => {
47
+ compensated = e.target.checked
48
+ console.log(e.target.checked);
49
+ dims = { ...dims, compensated }
50
+ RTympanogram.draw({ dims })
51
+
52
+ })
53
+
54
+ document.querySelector("#extra-sc").addEventListener("input", e => {
55
+ extraCompliance = e.target.checked
56
+ console.log(e.target.checked);
57
+ dims = { ...dims, extraCompliance }
58
+ RTympanogram.draw({ dims })
59
+
60
+ })
61
+
62
+ document.querySelector("#cp")
63
+ .addEventListener("input", e => {
64
+ cp = e.target.value
65
+ console.log(cp);
66
+ data = {...data, cp}
67
+
68
+ RTympanogram.update(data)
69
+ })
70
+
71
+
72
+ document.querySelector("#cpp")
73
+ .addEventListener("input", e => {
74
+ cpp = e.target.value
75
+ console.log(cpp);
76
+ data = {...data, cpp}
77
+
78
+ RTympanogram.update(data)
79
+ })
80
+
81
+ const container = document.getElementById('test')
82
+
83
+ const RTympanogram = new Tympanogram({ container, dims, side: 'R' })
84
+ RTympanogram.update(data)
33
85
 
34
- })
@@ -17,7 +17,8 @@ const units = {
17
17
  extra: { min: -0.50, max: 6, step: 0.50 }
18
18
  },
19
19
  padding: { right: 5, left: 8, top: 7, bottom: 14 },
20
-
20
+ extraCompliance: false, // default is false (0-3) | true (0-6)
21
+ compensated: false, // default is false | true
21
22
 
22
23
  styles: {
23
24
  svg: 'user-select: none; direction: ltr !important; font-family: Vazir;',
@@ -0,0 +1,31 @@
1
+ import putLine from "./putLine";
2
+
3
+ export default function putGrid({ container }) {
4
+ const {x, y, width, height} = container.viewBox.baseVal
5
+ console.log(x, y, width, height);
6
+
7
+ const cord = { xStart: x, yStart: y, xEnd: width + x, yEnd: height + y, xStep: 1, yStep: 1 }
8
+ let { xStart, yStart, xEnd, yEnd, xStep, yStep } = cord
9
+
10
+ // رسم خطوط افقی
11
+ let style = 'stroke: blue; stroke-width: 0.05 ; stroke-opacity: 0.8; stroke-dasharray: 0.2;'
12
+ let x1 = xStart
13
+ let y1
14
+
15
+ let x2 = xEnd
16
+ let y2
17
+
18
+ for (let y1 = yStart; y1 <= yEnd; y1 += yStep) {
19
+ y2 = y1
20
+ putLine({ container, x1, y1, x2, y2, style, name: 'grid' })
21
+ }
22
+
23
+ // رسم خطوط عمودی
24
+ y1 = yStart
25
+ for (x1 = xStart; x1 <= xEnd; x1 += xStep) {
26
+ const x2 = x1
27
+ putLine({ container, x1, y1, x2, y2, style, name: 'grid' })
28
+ }
29
+
30
+
31
+ }
package/src/main.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import Audiogram from "./Audiogram/Audiogram.js"
3
3
  import Forms from "./Forms/Forms.js";
4
4
  import { officeData, patientData } from "../assets/data/sampleData.js"
5
- import template from "../assets/templates/template_combo.js";
5
+ import template from "../assets/templates/templCombo.js";
6
6
  import Tympanogram from "./Tympanogram/Tympanogram.js";
7
7
  import Speech from "./Speech/Speech.js";
8
8
  import Reflex from "./Reflex/Reflex.js";
File without changes