w-plot-vue 1.0.9 → 1.0.10

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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/w-plot-vue.umd.js +4 -4
  3. package/dist/w-plot-vue.umd.js.map +1 -1
  4. package/docs/examples/app.html +65 -0
  5. package/docs/examples/app.umd.js +18 -0
  6. package/docs/examples/app.umd.js.map +1 -0
  7. package/docs/examples/w-bar_horizontal_multi-set(color).html +1 -1
  8. package/docs/examples/w-bar_horizontal_multi-set(color, gradient).html +1 -1
  9. package/docs/examples/w-bar_horizontal_multi-set(series color).html +1 -1
  10. package/docs/examples/w-bar_horizontal_multi-set(series color, gradient).html +1 -1
  11. package/docs/examples/w-bar_horizontal_multi-set.html +1 -1
  12. package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackNormal).html +1 -1
  13. package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackPercent).html +1 -1
  14. package/docs/examples/w-bar_horizontal_multi-set__hide legned.html +1 -1
  15. package/docs/examples/w-bar_horizontal_multi-set__show labels.html +1 -1
  16. package/docs/examples/w-bar_horizontal_multi-set_barKpColor(gradient).html +1 -1
  17. package/docs/examples/w-bar_horizontal_multi-set_barKpColor.html +1 -1
  18. package/docs/examples/w-bar_horizontal_multi-set_barUseInnerLabelsForHorizontal_barGroupWidthRatio.html +1 -1
  19. package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio.html +1 -1
  20. package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio_barGroupWidthRatio.html +1 -1
  21. package/docs/examples/w-bar_horizontal_one-set(color).html +1 -1
  22. package/docs/examples/w-bar_horizontal_one-set(color, gradient).html +1 -1
  23. package/docs/examples/w-bar_horizontal_one-set.html +1 -1
  24. package/docs/examples/w-bar_horizontal_one-set_barColor(gradient).html +1 -1
  25. package/docs/examples/w-bar_horizontal_one-set_barColor.html +1 -1
  26. package/docs/examples/w-bar_horizontal_one-set_barKpColor(gradient).html +1 -1
  27. package/docs/examples/w-bar_horizontal_one-set_barKpColor.html +1 -1
  28. package/docs/examples/w-bar_horizontal_one-set_barUseInnerLabelsForHorizontal.html +1 -1
  29. package/docs/examples/w-bar_horizontal_one-set_barWidthRatio.html +1 -1
  30. package/docs/examples/w-bar_horizontal_one-set_barWidthRatio_barGroupWidthRatio.html +1 -1
  31. package/docs/examples/w-bar_horizontal_one-set_hide labels.html +1 -1
  32. package/docs/examples/w-bar_horizontal_one-set_marginLeft_marginRight.html +1 -1
  33. package/docs/examples/w-bar_horizontal_one-set_show legned.html +1 -1
  34. package/docs/examples/w-bar_multi-set(color).html +1 -1
  35. package/docs/examples/w-bar_multi-set(color, gradient).html +1 -1
  36. package/docs/examples/w-bar_multi-set(series color).html +1 -1
  37. package/docs/examples/w-bar_multi-set(series color, gradient).html +1 -1
  38. package/docs/examples/w-bar_multi-set.html +1 -1
  39. package/docs/examples/w-bar_multi-set__barDisplay(stackNormal).html +1 -1
  40. package/docs/examples/w-bar_multi-set__barDisplay(stackNormal)_.html +1 -1
  41. package/docs/examples/w-bar_multi-set__barDisplay(stackPercent).html +1 -1
  42. package/docs/examples/w-bar_multi-set__hide legned.html +1 -1
  43. package/docs/examples/w-bar_multi-set__show labels.html +1 -1
  44. package/docs/examples/w-bar_multi-set_barKpColor(gradient).html +1 -1
  45. package/docs/examples/w-bar_multi-set_barKpColor.html +1 -1
  46. package/docs/examples/w-bar_multi-set_barWidthRatio.html +1 -1
  47. package/docs/examples/w-bar_multi-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
  48. package/docs/examples/w-bar_one-set(color).html +1 -1
  49. package/docs/examples/w-bar_one-set(color, gradient).html +1 -1
  50. package/docs/examples/w-bar_one-set.html +1 -1
  51. package/docs/examples/w-bar_one-set_barColor(gradient).html +1 -1
  52. package/docs/examples/w-bar_one-set_barColor.html +1 -1
  53. package/docs/examples/w-bar_one-set_barKpColor(gradient).html +1 -1
  54. package/docs/examples/w-bar_one-set_barKpColor.html +1 -1
  55. package/docs/examples/w-bar_one-set_barWidthRatio.html +1 -1
  56. package/docs/examples/w-bar_one-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
  57. package/docs/examples/w-bar_one-set_hide labels.html +1 -1
  58. package/docs/examples/w-bar_one-set_marginLeft_marginRight_marginTop.html +1 -1
  59. package/docs/examples/w-bar_one-set_show legned.html +1 -1
  60. package/docs/examples/w-pie_one-set(color).html +1 -1
  61. package/docs/examples/w-pie_one-set(color, gradient).html +1 -1
  62. package/docs/examples/w-pie_one-set.html +1 -1
  63. package/docs/examples/w-pie_one-set_hide labels.html +1 -1
  64. package/docs/examples/w-pie_one-set_hide legned.html +1 -1
  65. package/docs/examples/w-pie_one-set_marginLeft_marginRight_marginTop.html +1 -1
  66. package/docs/examples/w-pie_one-set_pieBorderRadius.html +1 -1
  67. package/docs/examples/w-pie_one-set_pieBorderWidth_pieBorderRadius.html +1 -1
  68. package/docs/examples/w-pie_one-set_pieKpColor(gradient).html +1 -1
  69. package/docs/examples/w-pie_one-set_pieKpColor.html +1 -1
  70. package/docs/examples/w-pie_one-set_pieThicknessRatio.html +1 -1
  71. package/docs/examples/w-plot-2d_default.html +1 -1
  72. package/docs/examples/w-plot-3d_default.html +1 -1
  73. package/docs/examples/w-rose_multi-set(color).html +1 -1
  74. package/docs/examples/w-rose_multi-set(color, gradient).html +1 -1
  75. package/docs/examples/w-rose_multi-set(series color).html +1 -1
  76. package/docs/examples/w-rose_multi-set(series color, gradient).html +1 -1
  77. package/docs/examples/w-rose_multi-set.html +1 -1
  78. package/docs/examples/w-rose_multi-set__hide legned.html +1 -1
  79. package/docs/examples/w-rose_multi-set__show labels.html +1 -1
  80. package/docs/examples/w-rose_multi-set_roseBorderWidth.html +1 -1
  81. package/docs/examples/w-rose_multi-set_roseKpColor(gradient).html +1 -1
  82. package/docs/examples/w-rose_multi-set_roseKpColor.html +1 -1
  83. package/docs/examples/w-rose_multi-set_roseWidthRatio.html +1 -1
  84. package/docs/examples/w-rose_one-set(color).html +1 -1
  85. package/docs/examples/w-rose_one-set(color, gradient).html +1 -1
  86. package/docs/examples/w-rose_one-set.html +1 -1
  87. package/docs/examples/w-rose_one-set_marginLeft_marginRight_marginTop.html +1 -1
  88. package/docs/examples/w-rose_one-set_roseBorderWidth.html +1 -1
  89. package/docs/examples/w-rose_one-set_roseKpColor(gradient).html +1 -1
  90. package/docs/examples/w-rose_one-set_roseKpColor.html +1 -1
  91. package/docs/examples/w-rose_one-set_roseShowLabels.html +1 -1
  92. package/docs/examples/w-rose_one-set_roseWidthRatio.html +1 -1
  93. package/docs/examples/w-rose_one-set_showLegend.html +1 -1
  94. package/docs/examples/w-rose_one-set_showLegend_legendPosition.html +1 -1
  95. package/docs/examples/w-set-multi_default.html +1 -1
  96. package/docs/examples/w-set-multi_hide labels.html +1 -1
  97. package/docs/examples/w-set-multi_hide legned.html +1 -1
  98. package/docs/examples/w-set-multi_keySelect.html +1 -1
  99. package/docs/examples/w-set-multi_slot head.html +1 -1
  100. package/docs/examples/w-set-multi_textPlotType_kpSelectText_widthSelect.html +1 -1
  101. package/docs/examples/w-set-one_default.html +1 -1
  102. package/docs/examples/w-set-one_hide labels.html +1 -1
  103. package/docs/examples/w-set-one_keySelect.html +1 -1
  104. package/docs/examples/w-set-one_show legned.html +1 -1
  105. package/docs/examples/w-set-one_slot head.html +1 -1
  106. package/docs/examples/w-set-one_textPlotType_kpSelectText_widthSelect.html +1 -1
  107. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  108. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  109. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  110. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  111. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  112. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  113. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  114. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  115. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  116. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  117. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  118. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  119. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  120. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  121. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  122. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  123. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  124. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  125. package/docs/getDefAxis.mjs.html +157 -0
  126. package/docs/getDefChart.mjs.html +123 -0
  127. package/docs/getDefLegend.mjs.html +115 -0
  128. package/docs/getDefOpt.mjs.html +137 -0
  129. package/docs/global.html +1088 -0
  130. package/docs/index.html +84 -0
  131. package/docs/module-WBar.html +250 -0
  132. package/docs/module-WPie.html +250 -0
  133. package/docs/module-WPlot2d.html +250 -0
  134. package/docs/module-WPlot3d.html +250 -0
  135. package/docs/module-WRose.html +250 -0
  136. package/docs/module-WSetMulti.html +250 -0
  137. package/docs/module-WSetOne.html +250 -0
  138. package/docs/scripts/collapse.js +39 -0
  139. package/docs/scripts/commonNav.js +28 -0
  140. package/docs/scripts/linenumber.js +25 -0
  141. package/docs/scripts/nav.js +12 -0
  142. package/docs/scripts/polyfill.js +4 -0
  143. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  144. package/docs/scripts/prettify/lang-css.js +2 -0
  145. package/docs/scripts/prettify/prettify.js +28 -0
  146. package/docs/scripts/search.js +99 -0
  147. package/docs/setLegendLoc.mjs.html +176 -0
  148. package/docs/styles/jsdoc.css +776 -0
  149. package/docs/styles/prettify.css +80 -0
  150. package/package.json +2 -2
@@ -0,0 +1,99 @@
1
+
2
+ var searchAttr = 'data-search-mode';
3
+ function contains(a,m){
4
+ return (a.textContent || a.innerText || "").toUpperCase().indexOf(m) !== -1;
5
+ };
6
+
7
+ //on search
8
+ document.getElementById("nav-search").addEventListener("keyup", function(event) {
9
+ var search = this.value.toUpperCase();
10
+
11
+ if (!search) {
12
+ //no search, show all results
13
+ document.documentElement.removeAttribute(searchAttr);
14
+
15
+ document.querySelectorAll("nav > ul > li:not(.level-hide)").forEach(function(elem) {
16
+ elem.style.display = "block";
17
+ });
18
+
19
+ if (typeof hideAllButCurrent === "function"){
20
+ //let's do what ever collapse wants to do
21
+ hideAllButCurrent();
22
+ } else {
23
+ //menu by default should be opened
24
+ document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
25
+ elem.style.display = "block";
26
+ });
27
+ }
28
+ } else {
29
+ //we are searching
30
+ document.documentElement.setAttribute(searchAttr, '');
31
+
32
+ //show all parents
33
+ document.querySelectorAll("nav > ul > li").forEach(function(elem) {
34
+ elem.style.display = "block";
35
+ });
36
+ document.querySelectorAll("nav > ul").forEach(function(elem) {
37
+ elem.style.display = "block";
38
+ });
39
+ //hide all results
40
+ document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
41
+ elem.style.display = "none";
42
+ });
43
+ //show results matching filter
44
+ document.querySelectorAll("nav > ul > li > ul a").forEach(function(elem) {
45
+ if (!contains(elem.parentNode, search)) {
46
+ return;
47
+ }
48
+ elem.parentNode.style.display = "block";
49
+ });
50
+ //hide parents without children
51
+ document.querySelectorAll("nav > ul > li").forEach(function(parent) {
52
+ var countSearchA = 0;
53
+ parent.querySelectorAll("a").forEach(function(elem) {
54
+ if (contains(elem, search)) {
55
+ countSearchA++;
56
+ }
57
+ });
58
+
59
+ var countUl = 0;
60
+ var countUlVisible = 0;
61
+ parent.querySelectorAll("ul").forEach(function(ulP) {
62
+ // count all elements that match the search
63
+ if (contains(ulP, search)) {
64
+ countUl++;
65
+ }
66
+
67
+ // count all visible elements
68
+ var children = ulP.children
69
+ for (i=0; i<children.length; i++) {
70
+ var elem = children[i];
71
+ if (elem.style.display != "none") {
72
+ countUlVisible++;
73
+ }
74
+ }
75
+ });
76
+
77
+ if (countSearchA == 0 && countUl === 0){
78
+ //has no child at all and does not contain text
79
+ parent.style.display = "none";
80
+ } else if(countSearchA == 0 && countUlVisible == 0){
81
+ //has no visible child and does not contain text
82
+ parent.style.display = "none";
83
+ }
84
+ });
85
+ document.querySelectorAll("nav > ul.collapse_top").forEach(function(parent) {
86
+ var countVisible = 0;
87
+ parent.querySelectorAll("li").forEach(function(elem) {
88
+ if (elem.style.display !== "none") {
89
+ countVisible++;
90
+ }
91
+ });
92
+
93
+ if (countVisible == 0) {
94
+ //has no child at all and does not contain text
95
+ parent.style.display = "none";
96
+ }
97
+ });
98
+ }
99
+ });
@@ -0,0 +1,176 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>setLegendLoc.mjs - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-WBar.html">WBar</a></li><li><a href="module-WPie.html">WPie</a></li><li><a href="module-WPlot2d.html">WPlot2d</a></li><li><a href="module-WPlot3d.html">WPlot3d</a></li><li><a href="module-WRose.html">WRose</a></li><li><a href="module-WSetMulti.html">WSetMulti</a></li><li><a href="module-WSetOne.html">WSetOne</a></li></ul><h3>Global</h3><ul><li><a href="global.html#getDefAxis">getDefAxis</a></li><li><a href="global.html#getDefChart">getDefChart</a></li><li><a href="global.html#getDefLegend">getDefLegend</a></li><li><a href="global.html#getDefOpt">getDefOpt</a></li><li><a href="global.html#setLegendLoc">setLegendLoc</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">setLegendLoc.mjs</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+ <article>
48
+ <pre class="prettyprint source linenums"><code>import get from 'lodash-es/get.js'
49
+ import cdbl from 'wsemi/src/cdbl.mjs'
50
+
51
+
52
+ /**
53
+ * 使用繪圖設定物件針對Highcharts物件處理圖例位置
54
+ *
55
+ * @param {Object} [opt={}] 輸入設定物件,預設{}
56
+ * @param {Object} [optPic={}] 輸入繪圖設定物件,預設{}
57
+ * @returns {Object} 回傳物件
58
+ */
59
+ function setLegendLoc(opt, optPic = {}) {
60
+
61
+ let legendPosition = get(optPic, 'legendPosition', 'topright')
62
+
63
+ let ml = get(opt, 'chart.marginLeft') || get(opt, 'chart.margin-left')
64
+ ml = cdbl(ml)
65
+ let mr = get(opt, 'chart.marginRight') || get(opt, 'chart.margin-right')
66
+ mr = cdbl(mr)
67
+ let mt = get(opt, 'chart.marginTop') || get(opt, 'chart.margin-top')
68
+ mt = cdbl(mt)
69
+ let mb = get(opt, 'chart.marginBottom') || get(opt, 'chart.margin-bottom')
70
+ mb = cdbl(mb)
71
+ // console.log('ml', ml)
72
+ // console.log('mr', mr)
73
+ // console.log('mt', mt)
74
+ // console.log('mb', mb)
75
+
76
+ //legendIgnoreMargin
77
+ let legendIgnoreMargin = get(optPic, 'legendIgnoreMargin', false)
78
+
79
+ if (legendIgnoreMargin) {
80
+ ml = 0
81
+ mr = 0
82
+ mt = 0
83
+ mb = 0
84
+ }
85
+
86
+ let sl = get(opt, 'chart.spacingLeft') || get(opt, 'chart.spacing-left')
87
+ sl = cdbl(sl)
88
+ let sr = get(opt, 'chart.spacingRight') || get(opt, 'chart.spacing-right')
89
+ sr = cdbl(sr)
90
+ let st = get(opt, 'chart.spacingTop') || get(opt, 'chart.spacing-top')
91
+ st = cdbl(st)
92
+ let sb = get(opt, 'chart.spacingBottom') || get(opt, 'chart.spacing-bottom')
93
+ sb = cdbl(sb)
94
+ // console.log('sl', sl)
95
+ // console.log('sr', sr)
96
+ // console.log('st', st)
97
+ // console.log('sb', sb)
98
+
99
+ //legendIgnoreSpacing
100
+ let legendIgnoreSpacing = get(optPic, 'legendIgnoreSpacing', false)
101
+
102
+ if (legendIgnoreSpacing) {
103
+ sl = 0
104
+ sr = 0
105
+ st = 0
106
+ sb = 0
107
+ }
108
+
109
+ let lg = get(opt, 'legend', {})
110
+ opt.legend = lg //若無, 則先給予空物件, 避免後續無法直接鏈式給予值
111
+
112
+ //legendPosition
113
+ if (legendPosition === 'topleft') {
114
+ opt.legend.align = 'left'
115
+ opt.legend.verticalAlign = 'top'
116
+ let dx = 5
117
+ let dy = 5
118
+ opt.legend.x = ml - sl + dx
119
+ opt.legend.y = mt - st + dy
120
+ }
121
+ else if (legendPosition === 'bottomleft') {
122
+ opt.legend.align = 'left'
123
+ opt.legend.verticalAlign = 'bottom'
124
+ let dx = 5
125
+ let dy = -5
126
+ opt.legend.x = ml - sl + dx
127
+ opt.legend.y = -mb + sb + dy
128
+ }
129
+ else if (legendPosition === 'bottomright') {
130
+ opt.legend.align = 'right'
131
+ opt.legend.verticalAlign = 'bottom'
132
+ let dx = -5
133
+ let dy = -5
134
+ opt.legend.x = -mr + sr + dx
135
+ opt.legend.y = -mb + sb + dy
136
+ }
137
+ else { //legendPosition==='topright'
138
+ opt.legend.align = 'right'
139
+ opt.legend.verticalAlign = 'top'
140
+ let dx = -5
141
+ let dy = 5
142
+ opt.legend.x = -mr + sr + dx
143
+ opt.legend.y = mt - st + dy
144
+ }
145
+ // console.log('opt.legend', JSON.stringify(opt.legend))
146
+
147
+ return opt
148
+ }
149
+
150
+
151
+ export default setLegendLoc
152
+ </code></pre>
153
+ </article>
154
+ </section>
155
+
156
+
157
+
158
+
159
+
160
+
161
+ </div>
162
+
163
+ <br class="clear">
164
+
165
+ <footer>
166
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Fri Jul 24 2026 13:10:23 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
167
+ </footer>
168
+
169
+ <script>prettyPrint();</script>
170
+ <script src="scripts/polyfill.js"></script>
171
+ <script src="scripts/linenumber.js"></script>
172
+
173
+
174
+
175
+ </body>
176
+ </html>