w-geo 1.0.61 → 1.0.63

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.
package/README.md CHANGED
@@ -23,5 +23,5 @@ npm i w-geo
23
23
 
24
24
  Add script for w-geo.
25
25
  ```alias
26
- <script src="https://cdn.jsdelivr.net/npm/w-geo@1.0.61/dist/w-geo.umd.js"></script>
26
+ <script src="https://cdn.jsdelivr.net/npm/w-geo@1.0.63/dist/w-geo.umd.js"></script>
27
27
  ```
@@ -62,7 +62,7 @@
62
62
  <br class="clear">
63
63
 
64
64
  <footer>
65
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
65
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
66
66
  </footer>
67
67
 
68
68
  <script>prettyPrint();</script>
@@ -325,7 +325,7 @@ export default calcDepthStartEndByConnect
325
325
  <br class="clear">
326
326
 
327
327
  <footer>
328
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
328
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
329
329
  </footer>
330
330
 
331
331
  <script>prettyPrint();</script>
@@ -569,7 +569,7 @@ export default calcDepthStartEndByGroup
569
569
  <br class="clear">
570
570
 
571
571
  <footer>
572
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
572
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
573
573
  </footer>
574
574
 
575
575
  <script>prettyPrint();</script>
@@ -349,7 +349,7 @@ export default calcDepthStartEndFromCenter
349
349
  <br class="clear">
350
350
 
351
351
  <footer>
352
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
352
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
353
353
  </footer>
354
354
 
355
355
  <script>prettyPrint();</script>
@@ -6918,7 +6918,7 @@ export default calcLiquefaction
6918
6918
  <br class="clear">
6919
6919
 
6920
6920
  <footer>
6921
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
6921
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
6922
6922
  </footer>
6923
6923
 
6924
6924
  <script>prettyPrint();</script>
@@ -646,7 +646,7 @@ export default calcVerticalStress
646
646
  <br class="clear">
647
647
 
648
648
  <footer>
649
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
649
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
650
650
  </footer>
651
651
 
652
652
  <script>prettyPrint();</script>
@@ -214,7 +214,7 @@ export default checkDepth
214
214
  <br class="clear">
215
215
 
216
216
  <footer>
217
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
217
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
218
218
  </footer>
219
219
 
220
220
  <script>prettyPrint();</script>
@@ -273,7 +273,7 @@ export default checkDepthStartEnd
273
273
  <br class="clear">
274
274
 
275
275
  <footer>
276
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
276
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
277
277
  </footer>
278
278
 
279
279
  <script>prettyPrint();</script>
@@ -506,7 +506,7 @@ export default complementDepthData
506
506
  <br class="clear">
507
507
 
508
508
  <footer>
509
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
509
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
510
510
  </footer>
511
511
 
512
512
  <script>prettyPrint();</script>
@@ -492,7 +492,7 @@ export default groupByDepthStartEnd
492
492
  <br class="clear">
493
493
 
494
494
  <footer>
495
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
495
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
496
496
  </footer>
497
497
 
498
498
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
@@ -519,7 +519,7 @@ export default mergeByDepthStartEnd
519
519
  <br class="clear">
520
520
 
521
521
  <footer>
522
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
522
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
523
523
  </footer>
524
524
 
525
525
  <script>prettyPrint();</script>
@@ -334,7 +334,7 @@ export default relaPlasticityParams
334
334
  <br class="clear">
335
335
 
336
336
  <footer>
337
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
337
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
338
338
  </footer>
339
339
 
340
340
  <script>prettyPrint();</script>
@@ -524,7 +524,7 @@ export default relaPorousParams
524
524
  <br class="clear">
525
525
 
526
526
  <footer>
527
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
527
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
528
528
  </footer>
529
529
 
530
530
  <script>prettyPrint();</script>
@@ -324,7 +324,7 @@ export default sepDepthStartEndByDepth
324
324
  <br class="clear">
325
325
 
326
326
  <footer>
327
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
327
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
328
328
  </footer>
329
329
 
330
330
  <script>prettyPrint();</script>
@@ -280,7 +280,7 @@ export default smoothDepthByKey
280
280
  <br class="clear">
281
281
 
282
282
  <footer>
283
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
283
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
284
284
  </footer>
285
285
 
286
286
  <script>prettyPrint();</script>
package/docs/w-geo.html CHANGED
@@ -8970,7 +8970,7 @@
8970
8970
  <br class="clear">
8971
8971
 
8972
8972
  <footer>
8973
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Apr 08 2023 11:45:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
8973
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Apr 12 2023 22:37:32 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
8974
8974
  </footer>
8975
8975
 
8976
8976
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "w-geo",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "main": "dist/w-geo.umd.js",
5
5
  "dependencies": {
6
6
  "decimal.js": "^10.4.3",
7
7
  "lodash": "^4.17.21",
8
+ "w-highcharts": "^1.0.0",
8
9
  "w-optimization": "^1.0.9",
9
10
  "w-statistic": "^1.0.14",
10
- "wsemi": "^1.7.2"
11
+ "wsemi": "^1.7.3"
11
12
  },
12
13
  "devDependencies": {
13
14
  "w-package-tools": "^1.0.69"
package/src/WGeo.mjs CHANGED
@@ -11,6 +11,7 @@ export { default as checkDepth } from './checkDepth.mjs'
11
11
  export { default as checkDepthStartEnd } from './checkDepthStartEnd.mjs'
12
12
  export { default as cnst } from './cnst.mjs'
13
13
  export { default as complementDepthData } from './complementDepthData.mjs'
14
+ export { default as getCptDepthHcOpt } from './getCptDepthHcOpt.mjs'
14
15
  export { default as getDepthMaxMin } from './getDepthMaxMin.mjs'
15
16
  export { default as groupByDepthStartEnd } from './groupByDepthStartEnd.mjs'
16
17
  export { default as intrpDefParam } from './intrpDefParam.mjs'
@@ -21,5 +22,6 @@ export { default as relaPorousParams } from './relaPorousParams.mjs'
21
22
  export { default as sepDepthStartEndByDepth } from './sepDepthStartEndByDepth.mjs'
22
23
  export { default as smoothDepthByKey } from './smoothDepthByKey.mjs'
23
24
  export { default as _cpt } from './_cpt.mjs'
25
+ export { default as _hc } from './_hc.mjs'
24
26
  export { default as _share } from './_share.mjs'
25
27
  export { default as _soilGroup } from './_soilGroup.mjs'
package/src/_hc.mjs ADDED
@@ -0,0 +1,39 @@
1
+ import cstr from 'wsemi/src/cstr.mjs'
2
+ import isestr from 'wsemi/src/isestr.mjs'
3
+ import getFontfamily from 'w-highcharts/src/getFontfamily.mjs'
4
+
5
+
6
+ function genHtText(c, size = 11) {
7
+ //預設使用中英文混合, 但複製網頁html至word會失效
8
+ let fontFamily = getFontfamily()
9
+ return `<span style="font-family:${fontFamily}; font-size:${size}pt;">${cstr(c)}</span>`
10
+ }
11
+
12
+
13
+ function genHtTextSub(c, size = 11) {
14
+ //預設使用中英文混合, 但複製網頁html至word會失效
15
+ let fontFamily = getFontfamily()
16
+ return `<br><span style="font-family:${fontFamily}; font-size:${size}pt;">${cstr(c)}</span>`
17
+ }
18
+
19
+
20
+ function genTextParentheses(c) {
21
+ if (isestr(c)) {
22
+ return ` (${c})`
23
+ }
24
+ return ''
25
+ }
26
+
27
+
28
+ export {
29
+ genHtText,
30
+ genHtTextSub,
31
+ genTextParentheses,
32
+ getFontfamily
33
+ }
34
+ export default { //整合輸出預設得要有default
35
+ genHtText,
36
+ genHtTextSub,
37
+ genTextParentheses,
38
+ getFontfamily
39
+ }
package/src/_share.mjs CHANGED
@@ -1,28 +1,126 @@
1
1
  import get from 'lodash/get'
2
+ import each from 'lodash/each'
3
+ import sortBy from 'lodash/sortBy'
4
+ import isNumber from 'lodash/isNumber'
5
+ import size from 'lodash/size'
2
6
  import isestr from 'wsemi/src/isestr.mjs'
3
7
  import isnum from 'wsemi/src/isnum.mjs'
4
8
  import isfun from 'wsemi/src/isfun.mjs'
5
9
  import cdbl from 'wsemi/src/cdbl.mjs'
6
10
 
7
11
 
8
- function pickData(d, pickKey) {
12
+ function pickData(dt, pickKey) {
9
13
  let value = null
10
14
  if (isestr(pickKey)) {
11
- let t = get(d, pickKey)
15
+ let t = get(dt, pickKey)
12
16
  if (isnum(t)) {
13
17
  value = cdbl(t) //只有數字才回傳, 否則傳null
14
18
  }
15
19
  }
16
20
  else if (isfun(pickKey)) {
17
- value = pickKey(d)
21
+ value = pickKey(dt)
18
22
  }
19
23
  return value
20
24
  }
21
25
 
22
26
 
27
+ function extractLtdtDepthAndData(ltdt, pickKey1, allowNull = false) {
28
+
29
+ //ps
30
+ let ps = []
31
+ each(ltdt, function (v) {
32
+
33
+ //depthCenter
34
+ let depthCenter = pickData(v, 'depth')
35
+
36
+ //valueX
37
+ let valueX = pickData(v, pickKey1)
38
+
39
+ //check
40
+ if (depthCenter === null) { //因是繪製隨深度指定x值圖, depthCenter不允許null
41
+ return true
42
+ }
43
+
44
+ //check
45
+ if (!allowNull) {
46
+ if (valueX === null) { //若valueX允許null則繪製曲線可跳, 若不允許則曲線自動接續
47
+ return true
48
+ }
49
+ }
50
+
51
+ //push
52
+ ps.push([depthCenter, valueX]) //因點數過多highcharts會出現errors12, 需改使用浮點數陣列
53
+
54
+ })
55
+
56
+ //需偵測是否全部valueX為null
57
+ let numNull = 0
58
+ each(ps, (v) => {
59
+ if (!isNumber(v[1])) {
60
+ numNull += 1
61
+ }
62
+ })
63
+ if (numNull === size(ps)) {
64
+ ps = [] //若數據都為null則清空ps, 視為無任何數據
65
+ }
66
+
67
+ return ps
68
+ }
69
+
70
+
71
+ function extractLtdtDataXY(ltdt, pickKeyX, pickKeyY) {
72
+
73
+ //ps
74
+ let ps = []
75
+ each(ltdt, function (v) {
76
+
77
+ //valueX
78
+ let valueX = pickData(v, pickKeyX)
79
+
80
+ //valueY
81
+ let valueY = pickData(v, pickKeyY)
82
+
83
+ //check
84
+ if (valueX === null || valueY === null) { //因須繪製xy值圖, valueX與valueY不允許null
85
+ return true
86
+ }
87
+
88
+ //push
89
+ ps.push([valueX, valueY]) //因點數過多highcharts會出現errors12, 需改使用浮點數陣列
90
+
91
+ })
92
+
93
+ //sortBy
94
+ ps = sortBy(ps, 0) //highcharts需排序
95
+
96
+ return ps
97
+ }
98
+
99
+
100
+ // function extractData(ltdt, pickKey1, pickKeyY) {
101
+ // let ps = []
102
+ // if (!isestr(pickKeyY)) {
103
+ // //取深度與key1
104
+ // let allowNull = false
105
+ // ps = extractLtdtDepthAndData(ltdt, pickKey1, allowNull)
106
+ // }
107
+ // else {
108
+ // //取key1與key2
109
+ // ps = extractLtdtDataXY(ltdt, pickKey1, pickKeyY)
110
+ // }
111
+ // return ps
112
+ // }
113
+
114
+
23
115
  export {
24
- pickData
116
+ pickData,
117
+ extractLtdtDepthAndData,
118
+ extractLtdtDataXY
119
+ // extractData
25
120
  }
26
121
  export default { //整合輸出預設得要有default
27
- pickData
122
+ pickData,
123
+ extractLtdtDepthAndData,
124
+ extractLtdtDataXY
125
+ // extractData
28
126
  }