w-plot-vue 1.0.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.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +89 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +15 -0
- package/dist/w-geo-vue.umd.js +7 -0
- package/dist/w-geo-vue.umd.js.map +1 -0
- package/docs/examples/app.html +65 -0
- package/docs/examples/app.umd.js +7 -0
- package/docs/examples/app.umd.js.map +1 -0
- package/docs/examples/w-bar_horizontal_multi-set(color).html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set(color, gradient).html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set(series color).html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set(series color, gradient).html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set.html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackNormal).html +495 -0
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackPercent).html +496 -0
- package/docs/examples/w-bar_horizontal_multi-set__hide legned.html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set__show labels.html +492 -0
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor(gradient).html +508 -0
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor.html +506 -0
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio.html +493 -0
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio_barGroupWidthRatio.html +498 -0
- package/docs/examples/w-bar_horizontal_one-set(color).html +490 -0
- package/docs/examples/w-bar_horizontal_one-set(color, gradient).html +490 -0
- package/docs/examples/w-bar_horizontal_one-set.html +490 -0
- package/docs/examples/w-bar_horizontal_one-set_barColor(gradient).html +491 -0
- package/docs/examples/w-bar_horizontal_one-set_barColor.html +491 -0
- package/docs/examples/w-bar_horizontal_one-set_barKpColor(gradient).html +500 -0
- package/docs/examples/w-bar_horizontal_one-set_barKpColor.html +498 -0
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio.html +491 -0
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio_barGroupWidthRatio.html +496 -0
- package/docs/examples/w-bar_horizontal_one-set_hide labels.html +491 -0
- package/docs/examples/w-bar_horizontal_one-set_marginLeft_marginRight.html +495 -0
- package/docs/examples/w-bar_horizontal_one-set_show legned.html +491 -0
- package/docs/examples/w-bar_multi-set(color).html +489 -0
- package/docs/examples/w-bar_multi-set(color, gradient).html +489 -0
- package/docs/examples/w-bar_multi-set(series color).html +489 -0
- package/docs/examples/w-bar_multi-set(series color, gradient).html +489 -0
- package/docs/examples/w-bar_multi-set.html +489 -0
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal).html +490 -0
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal)_.html +492 -0
- package/docs/examples/w-bar_multi-set__barDisplay(stackPercent).html +491 -0
- package/docs/examples/w-bar_multi-set__hide legned.html +489 -0
- package/docs/examples/w-bar_multi-set__show labels.html +489 -0
- package/docs/examples/w-bar_multi-set_barKpColor(gradient).html +503 -0
- package/docs/examples/w-bar_multi-set_barKpColor.html +503 -0
- package/docs/examples/w-bar_multi-set_barWidthRatio.html +490 -0
- package/docs/examples/w-bar_multi-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +495 -0
- package/docs/examples/w-bar_one-set(color).html +487 -0
- package/docs/examples/w-bar_one-set(color, gradient).html +487 -0
- package/docs/examples/w-bar_one-set.html +487 -0
- package/docs/examples/w-bar_one-set_barColor(gradient).html +488 -0
- package/docs/examples/w-bar_one-set_barColor.html +488 -0
- package/docs/examples/w-bar_one-set_barKpColor(gradient).html +495 -0
- package/docs/examples/w-bar_one-set_barKpColor.html +495 -0
- package/docs/examples/w-bar_one-set_barWidthRatio.html +488 -0
- package/docs/examples/w-bar_one-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +493 -0
- package/docs/examples/w-bar_one-set_hide labels.html +488 -0
- package/docs/examples/w-bar_one-set_marginLeft_marginRight_marginTop.html +493 -0
- package/docs/examples/w-bar_one-set_show legned.html +488 -0
- package/docs/examples/w-pie_one-set(color).html +251 -0
- package/docs/examples/w-pie_one-set(color, gradient).html +251 -0
- package/docs/examples/w-pie_one-set.html +251 -0
- package/docs/examples/w-pie_one-set_hide labels.html +252 -0
- package/docs/examples/w-pie_one-set_hide legned.html +252 -0
- package/docs/examples/w-pie_one-set_marginLeft_marginRight_marginTop.html +257 -0
- package/docs/examples/w-pie_one-set_pieBorderRadius.html +252 -0
- package/docs/examples/w-pie_one-set_pieBorderWidth_pieBorderRadius.html +253 -0
- package/docs/examples/w-pie_one-set_pieKpColor(gradient).html +259 -0
- package/docs/examples/w-pie_one-set_pieKpColor.html +259 -0
- package/docs/examples/w-pie_one-set_pieThicknessRatio.html +252 -0
- package/docs/examples/w-plot_default.html +174 -0
- package/docs/examples/w-rose_multi-set(color).html +489 -0
- package/docs/examples/w-rose_multi-set(color, gradient).html +489 -0
- package/docs/examples/w-rose_multi-set(series color).html +489 -0
- package/docs/examples/w-rose_multi-set(series color, gradient).html +489 -0
- package/docs/examples/w-rose_multi-set.html +489 -0
- package/docs/examples/w-rose_multi-set__hide legned.html +489 -0
- package/docs/examples/w-rose_multi-set__show labels.html +489 -0
- package/docs/examples/w-rose_multi-set_roseBorderWidth.html +490 -0
- package/docs/examples/w-rose_multi-set_roseKpColor(gradient).html +503 -0
- package/docs/examples/w-rose_multi-set_roseKpColor.html +503 -0
- package/docs/examples/w-rose_multi-set_roseWidthRatio.html +490 -0
- package/docs/examples/w-rose_one-set(color).html +487 -0
- package/docs/examples/w-rose_one-set(color, gradient).html +487 -0
- package/docs/examples/w-rose_one-set.html +487 -0
- package/docs/examples/w-rose_one-set_marginLeft_marginRight_marginTop.html +493 -0
- package/docs/examples/w-rose_one-set_roseBorderWidth.html +488 -0
- package/docs/examples/w-rose_one-set_roseKpColor(gradient).html +495 -0
- package/docs/examples/w-rose_one-set_roseKpColor.html +495 -0
- package/docs/examples/w-rose_one-set_roseShowLabels.html +488 -0
- package/docs/examples/w-rose_one-set_roseWidthRatio.html +488 -0
- package/docs/examples/w-rose_one-set_showLegend.html +488 -0
- package/docs/examples/w-rose_one-set_showLegend_legendPosition.html +489 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/getDefAxis.mjs.html +157 -0
- package/docs/getDefChart.mjs.html +123 -0
- package/docs/getDefLegend.mjs.html +115 -0
- package/docs/getDefOpt.mjs.html +137 -0
- package/docs/global.html +1088 -0
- package/docs/index.html +84 -0
- package/docs/module-WBar.html +216 -0
- package/docs/module-WPie.html +216 -0
- package/docs/module-WPlot.html +216 -0
- package/docs/module-WRose.html +216 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/setLegendLoc.mjs.html +176 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/g.mjs +0 -0
- package/package.json +68 -0
- package/public/index.html +38 -0
- package/src/App.vue +118 -0
- package/src/AppZoneWBar.vue +1454 -0
- package/src/AppZoneWPie.vue +324 -0
- package/src/AppZoneWPlot.vue +78 -0
- package/src/AppZoneWRose.vue +735 -0
- package/src/components/WBar.vue +107 -0
- package/src/components/WGeoVue.vue +18 -0
- package/src/components/WPie.vue +107 -0
- package/src/components/WPlot.vue +86 -0
- package/src/components/WRose.vue +107 -0
- package/src/components/demolink.vue +105 -0
- package/src/js/genBarOpt.mjs +303 -0
- package/src/js/genPieOpt.mjs +233 -0
- package/src/js/genRoseOpt.mjs +297 -0
- package/src/js/getDefAxis.mjs +85 -0
- package/src/js/getDefChart.mjs +51 -0
- package/src/js/getDefLegend.mjs +43 -0
- package/src/js/getDefOpt.mjs +65 -0
- package/src/js/setLegendLoc.mjs +104 -0
- package/src/main.js +8 -0
- package/test/all.test.mjs +10 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +4 -0
- package/toolg/cvCasename.mjs +43 -0
- package/toolg/gDistApp.mjs +38 -0
- package/toolg/gDistRollupComps.mjs +21 -0
- package/toolg/gDocExams.mjs +47 -0
- package/toolg/gExtractHtml.mjs +263 -0
- package/toolg/gMergeComps.mjs +75 -0
- package/toolg/modifyReadme.mjs +4 -0
- package/vue.config.js +21 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style="display:inline-block;"
|
|
4
|
+
v-if="hasOptBar"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
8
|
+
<slot
|
|
9
|
+
name="top"
|
|
10
|
+
:opt="optBar"
|
|
11
|
+
></slot>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<WPlot
|
|
15
|
+
:options="optBar"
|
|
16
|
+
></WPlot>
|
|
17
|
+
|
|
18
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
19
|
+
<slot
|
|
20
|
+
name="bottom"
|
|
21
|
+
:opt="optBar"
|
|
22
|
+
></slot>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import get from 'lodash-es/get'
|
|
30
|
+
// import map from 'lodash-es/map'
|
|
31
|
+
// import cloneDeep from 'lodash-es/cloneDeep'
|
|
32
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
33
|
+
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
34
|
+
import WPlot from './WPlot.vue'
|
|
35
|
+
import genBarOpt from '../js/genBarOpt.mjs'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @vue-prop {Object} [opt={}] 輸入設定物件,預設{}
|
|
40
|
+
*/
|
|
41
|
+
export default {
|
|
42
|
+
components: {
|
|
43
|
+
WPlot,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
opt: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => {},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data: function() {
|
|
52
|
+
return {
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
|
|
57
|
+
hasOptBar: function() {
|
|
58
|
+
//console.log('computed hasOptBar')
|
|
59
|
+
|
|
60
|
+
let vo = this
|
|
61
|
+
|
|
62
|
+
let b = iseobj(vo.optBar)
|
|
63
|
+
|
|
64
|
+
return b
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
optBar: function() {
|
|
68
|
+
// console.log('computed optBar')
|
|
69
|
+
|
|
70
|
+
let vo = this
|
|
71
|
+
|
|
72
|
+
let r = null
|
|
73
|
+
try {
|
|
74
|
+
let w = vo.getWidth()
|
|
75
|
+
let h = vo.getHeight()
|
|
76
|
+
let keys = get(vo, 'opt.keys', [])
|
|
77
|
+
let rds = get(vo, 'opt.rds', [])
|
|
78
|
+
r = genBarOpt(w, h, keys, rds, vo.opt)
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.log(err)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return r
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
|
|
90
|
+
getWidth: function() {
|
|
91
|
+
let vo = this
|
|
92
|
+
let w = get(vo, 'opt.width', 0)
|
|
93
|
+
return w
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
getHeight: function() {
|
|
97
|
+
let vo = this
|
|
98
|
+
let w = get(vo, 'opt.height', 0)
|
|
99
|
+
return w
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style scoped>
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import WBar from './WBar.vue'
|
|
3
|
+
import WPie from './WPie.vue'
|
|
4
|
+
import WPlot from './WPlot.vue'
|
|
5
|
+
import WRose from './WRose.vue'
|
|
6
|
+
|
|
7
|
+
let WGeoVue = {
|
|
8
|
+
install: function(Vue) {
|
|
9
|
+
Vue.component('w-bar', WBar)
|
|
10
|
+
Vue.component('w-pie', WPie)
|
|
11
|
+
Vue.component('w-plot', WPlot)
|
|
12
|
+
Vue.component('w-rose', WRose)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default WGeoVue
|
|
17
|
+
</script>
|
|
18
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style="display:inline-block;"
|
|
4
|
+
v-if="hasOptPie"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
8
|
+
<slot
|
|
9
|
+
name="top"
|
|
10
|
+
:opt="optPie"
|
|
11
|
+
></slot>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<WPlot
|
|
15
|
+
:options="optPie"
|
|
16
|
+
></WPlot>
|
|
17
|
+
|
|
18
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
19
|
+
<slot
|
|
20
|
+
name="bottom"
|
|
21
|
+
:opt="optPie"
|
|
22
|
+
></slot>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import get from 'lodash-es/get'
|
|
30
|
+
// import map from 'lodash-es/map'
|
|
31
|
+
// import cloneDeep from 'lodash-es/cloneDeep'
|
|
32
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
33
|
+
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
34
|
+
import WPlot from './WPlot.vue'
|
|
35
|
+
import genPieOpt from '../js/genPieOpt.mjs'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @vue-prop {Object} [opt={}] 輸入設定物件,預設{}
|
|
40
|
+
*/
|
|
41
|
+
export default {
|
|
42
|
+
components: {
|
|
43
|
+
WPlot,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
opt: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => {},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data: function() {
|
|
52
|
+
return {
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
|
|
57
|
+
hasOptPie: function() {
|
|
58
|
+
//console.log('computed hasOptPie')
|
|
59
|
+
|
|
60
|
+
let vo = this
|
|
61
|
+
|
|
62
|
+
let b = iseobj(vo.optPie)
|
|
63
|
+
|
|
64
|
+
return b
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
optPie: function() {
|
|
68
|
+
// console.log('computed optPie')
|
|
69
|
+
|
|
70
|
+
let vo = this
|
|
71
|
+
|
|
72
|
+
let r = null
|
|
73
|
+
try {
|
|
74
|
+
let w = vo.getWidth()
|
|
75
|
+
let h = vo.getHeight()
|
|
76
|
+
let keys = get(vo, 'opt.keys', [])
|
|
77
|
+
let rds = get(vo, 'opt.rds', [])
|
|
78
|
+
r = genPieOpt(w, h, keys, rds, vo.opt)
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.log(err)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return r
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
|
|
90
|
+
getWidth: function() {
|
|
91
|
+
let vo = this
|
|
92
|
+
let w = get(vo, 'opt.width', 0)
|
|
93
|
+
return w
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
getHeight: function() {
|
|
97
|
+
let vo = this
|
|
98
|
+
let w = get(vo, 'opt.height', 0)
|
|
99
|
+
return w
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style scoped>
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="`display:inline-block; width:${widthInp}px; min-width:${widthInp}px; height:${heightInp}px; overflow-y:hidden;`"
|
|
4
|
+
v-if="options"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<WHighchartsVueDyn
|
|
8
|
+
:options="options"
|
|
9
|
+
></WHighchartsVueDyn>
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import get from 'lodash-es/get'
|
|
16
|
+
import isnum from 'wsemi/src/isnum.mjs'
|
|
17
|
+
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
18
|
+
import WHighchartsVueDyn from 'w-component-vue/src/components/WHighchartsVueDyn.vue'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @vue-prop {Object} [options={}] 輸入設定物件,預設{}
|
|
23
|
+
*/
|
|
24
|
+
export default {
|
|
25
|
+
components: {
|
|
26
|
+
WHighchartsVueDyn,
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
options: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => {},
|
|
32
|
+
},
|
|
33
|
+
width: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 400,
|
|
36
|
+
},
|
|
37
|
+
height: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 400,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
data: function() {
|
|
43
|
+
return {
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
|
|
48
|
+
widthInp: function() {
|
|
49
|
+
//console.log('computed widthInp')
|
|
50
|
+
|
|
51
|
+
let vo = this
|
|
52
|
+
|
|
53
|
+
//w
|
|
54
|
+
let w = vo.width
|
|
55
|
+
let wOpt = get(vo, 'options.chart.width', '')
|
|
56
|
+
if (isnum(wOpt)) {
|
|
57
|
+
w = cdbl(wOpt)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return w
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
heightInp: function() {
|
|
64
|
+
//console.log('computed heightInp')
|
|
65
|
+
|
|
66
|
+
let vo = this
|
|
67
|
+
|
|
68
|
+
//h
|
|
69
|
+
let h = vo.height
|
|
70
|
+
let hOpt = get(vo, 'options.chart.height', '')
|
|
71
|
+
if (isnum(hOpt)) {
|
|
72
|
+
h = cdbl(hOpt)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return h
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style="display:inline-block;"
|
|
4
|
+
v-if="hasOptRose"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
8
|
+
<slot
|
|
9
|
+
name="top"
|
|
10
|
+
:opt="optRose"
|
|
11
|
+
></slot>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<WPlot
|
|
15
|
+
:options="optRose"
|
|
16
|
+
></WPlot>
|
|
17
|
+
|
|
18
|
+
<div :style="`width:${getWidth}px; max-width:${getWidth}px;`">
|
|
19
|
+
<slot
|
|
20
|
+
name="bottom"
|
|
21
|
+
:opt="optRose"
|
|
22
|
+
></slot>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import get from 'lodash-es/get'
|
|
30
|
+
// import map from 'lodash-es/map'
|
|
31
|
+
// import cloneDeep from 'lodash-es/cloneDeep'
|
|
32
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
33
|
+
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
34
|
+
import WPlot from './WPlot.vue'
|
|
35
|
+
import genRoseOpt from '../js/genRoseOpt.mjs'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @vue-prop {Object} [opt={}] 輸入設定物件,預設{}
|
|
40
|
+
*/
|
|
41
|
+
export default {
|
|
42
|
+
components: {
|
|
43
|
+
WPlot,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
opt: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => {},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data: function() {
|
|
52
|
+
return {
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
|
|
57
|
+
hasOptRose: function() {
|
|
58
|
+
//console.log('computed hasOptRose')
|
|
59
|
+
|
|
60
|
+
let vo = this
|
|
61
|
+
|
|
62
|
+
let b = iseobj(vo.optRose)
|
|
63
|
+
|
|
64
|
+
return b
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
optRose: function() {
|
|
68
|
+
// console.log('computed optRose')
|
|
69
|
+
|
|
70
|
+
let vo = this
|
|
71
|
+
|
|
72
|
+
let r = null
|
|
73
|
+
try {
|
|
74
|
+
let w = vo.getWidth()
|
|
75
|
+
let h = vo.getHeight()
|
|
76
|
+
let keys = get(vo, 'opt.keys', [])
|
|
77
|
+
let rds = get(vo, 'opt.rds', [])
|
|
78
|
+
r = genRoseOpt(w, h, keys, rds, vo.opt)
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.log(err)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return r
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
|
|
90
|
+
getWidth: function() {
|
|
91
|
+
let vo = this
|
|
92
|
+
let w = get(vo, 'opt.width', 0)
|
|
93
|
+
return w
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
getHeight: function() {
|
|
97
|
+
let vo = this
|
|
98
|
+
let w = get(vo, 'opt.height', 0)
|
|
99
|
+
return w
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style scoped>
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="item">
|
|
3
|
+
|
|
4
|
+
<div style="display:inline-block;">
|
|
5
|
+
{{casename}}
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div style="padding-left:5px;"></div>
|
|
9
|
+
|
|
10
|
+
<w-button-circle
|
|
11
|
+
:paddingStyle="{v:3,h:3}"
|
|
12
|
+
:icon="mdiLaunch"
|
|
13
|
+
:iconSize="16"
|
|
14
|
+
:iconColor="'red darken-1'"
|
|
15
|
+
:iconColorHover="'red darken-1'"
|
|
16
|
+
:iconColorFocus="'red darken-1'"
|
|
17
|
+
:backgroundColor="'#fff'"
|
|
18
|
+
:backgroundColorHover="'#fff5f5'"
|
|
19
|
+
:backgroundColorFocus="'#fff2f2'"
|
|
20
|
+
:tooltip="'example'"
|
|
21
|
+
@click="ckExample"
|
|
22
|
+
></w-button-circle>
|
|
23
|
+
|
|
24
|
+
<div style="padding-left:5px;"></div>
|
|
25
|
+
|
|
26
|
+
<w-button-circle
|
|
27
|
+
:paddingStyle="{v:3,h:3}"
|
|
28
|
+
:icon="mdiUnfoldMoreVertical"
|
|
29
|
+
:iconSize="16"
|
|
30
|
+
:iconColor="'red darken-1'"
|
|
31
|
+
:iconColorHover="'red darken-1'"
|
|
32
|
+
:iconColorFocus="'red darken-1'"
|
|
33
|
+
:backgroundColor="'#fff'"
|
|
34
|
+
:backgroundColorHover="'#fff5f5'"
|
|
35
|
+
:backgroundColorFocus="'#fff2f2'"
|
|
36
|
+
:tooltip="'code'"
|
|
37
|
+
@click="ckCode"
|
|
38
|
+
></w-button-circle>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script>
|
|
44
|
+
import { mdiLaunch, mdiUnfoldMoreVertical } from '@mdi/js'
|
|
45
|
+
import cvCasename from '../../toolg/cvCasename.mjs'
|
|
46
|
+
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
components: {
|
|
51
|
+
WButtonCircle,
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
kbname: {
|
|
55
|
+
type: String,
|
|
56
|
+
},
|
|
57
|
+
casename: {
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
data: function() {
|
|
62
|
+
return {
|
|
63
|
+
mdiLaunch,
|
|
64
|
+
mdiUnfoldMoreVertical
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
mounted: function() {
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
|
|
71
|
+
fn: function() {
|
|
72
|
+
let fnc = `${this.casename}`
|
|
73
|
+
return `${this.kbname}_${cvCasename(fnc)}`
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
|
|
79
|
+
ckExample: function() {
|
|
80
|
+
let vo = this
|
|
81
|
+
let url = 'https://yuda-lyu.github.io/w-plot-vue/examples/' + vo.fn + '.html'
|
|
82
|
+
window.open(url, '_blank')
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
ckCode: function() {
|
|
86
|
+
let vo = this
|
|
87
|
+
let url = 'https://github.com/yuda-lyu/w-plot-vue/blob/master/docs/examples/' + vo.fn + '.html'
|
|
88
|
+
window.open(url, '_blank')
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style scoped>
|
|
96
|
+
.item {
|
|
97
|
+
border-left: 3px solid #ffba75;
|
|
98
|
+
margin: 5px 5px 8px 0px;
|
|
99
|
+
padding: 3px 3px 5px 10px;
|
|
100
|
+
font-size: 0.9rem;
|
|
101
|
+
display: flex;
|
|
102
|
+
justify-content: flex-start;
|
|
103
|
+
align-items: center;
|
|
104
|
+
}
|
|
105
|
+
</style>
|