w-plot-vue 1.0.0 → 1.0.2
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 +4 -4
- package/dist/w-plot-vue.umd.js +7 -0
- package/dist/w-plot-vue.umd.js.map +1 -0
- package/docs/examples/app.html +1 -1
- package/docs/examples/app.umd.js +2 -2
- package/docs/examples/app.umd.js.map +1 -1
- package/docs/examples/w-bar_horizontal_multi-set(color).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set(color, gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set(series color).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set(series color, gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set.html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackNormal).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackPercent).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set__hide legned.html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set__show labels.html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor(gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set_barKpColor.html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set_barUseInnerLabelsForHorizontal_barGroupWidthRatio.html +496 -0
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio.html +10 -10
- package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio_barGroupWidthRatio.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set(color).html +10 -10
- package/docs/examples/w-bar_horizontal_one-set(color, gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_one-set.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barColor(gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barColor.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barKpColor(gradient).html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barKpColor.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barUseInnerLabelsForHorizontal.html +493 -0
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_barWidthRatio_barGroupWidthRatio.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_hide labels.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_marginLeft_marginRight.html +10 -10
- package/docs/examples/w-bar_horizontal_one-set_show legned.html +10 -10
- package/docs/examples/w-bar_multi-set(color).html +10 -10
- package/docs/examples/w-bar_multi-set(color, gradient).html +10 -10
- package/docs/examples/w-bar_multi-set(series color).html +10 -10
- package/docs/examples/w-bar_multi-set(series color, gradient).html +10 -10
- package/docs/examples/w-bar_multi-set.html +10 -10
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal).html +10 -10
- package/docs/examples/w-bar_multi-set__barDisplay(stackNormal)_.html +10 -10
- package/docs/examples/w-bar_multi-set__barDisplay(stackPercent).html +10 -10
- package/docs/examples/w-bar_multi-set__hide legned.html +10 -10
- package/docs/examples/w-bar_multi-set__show labels.html +10 -10
- package/docs/examples/w-bar_multi-set_barKpColor(gradient).html +10 -10
- package/docs/examples/w-bar_multi-set_barKpColor.html +10 -10
- package/docs/examples/w-bar_multi-set_barWidthRatio.html +10 -10
- package/docs/examples/w-bar_multi-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +10 -10
- package/docs/examples/w-bar_one-set(color).html +10 -10
- package/docs/examples/w-bar_one-set(color, gradient).html +10 -10
- package/docs/examples/w-bar_one-set.html +10 -10
- package/docs/examples/w-bar_one-set_barColor(gradient).html +10 -10
- package/docs/examples/w-bar_one-set_barColor.html +10 -10
- package/docs/examples/w-bar_one-set_barKpColor(gradient).html +10 -10
- package/docs/examples/w-bar_one-set_barKpColor.html +10 -10
- package/docs/examples/w-bar_one-set_barWidthRatio.html +10 -10
- package/docs/examples/w-bar_one-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +10 -10
- package/docs/examples/w-bar_one-set_hide labels.html +10 -10
- package/docs/examples/w-bar_one-set_marginLeft_marginRight_marginTop.html +10 -10
- package/docs/examples/w-bar_one-set_show legned.html +10 -10
- package/docs/examples/w-pie_one-set(color).html +5 -5
- package/docs/examples/w-pie_one-set(color, gradient).html +5 -5
- package/docs/examples/w-pie_one-set.html +5 -5
- package/docs/examples/w-pie_one-set_hide labels.html +5 -5
- package/docs/examples/w-pie_one-set_hide legned.html +5 -5
- package/docs/examples/w-pie_one-set_marginLeft_marginRight_marginTop.html +5 -5
- package/docs/examples/w-pie_one-set_pieBorderRadius.html +5 -5
- package/docs/examples/w-pie_one-set_pieBorderWidth_pieBorderRadius.html +5 -5
- package/docs/examples/w-pie_one-set_pieKpColor(gradient).html +5 -5
- package/docs/examples/w-pie_one-set_pieKpColor.html +5 -5
- package/docs/examples/w-pie_one-set_pieThicknessRatio.html +5 -5
- package/docs/examples/w-plot_default.html +1 -1
- package/docs/examples/w-rose_multi-set(color).html +10 -10
- package/docs/examples/w-rose_multi-set(color, gradient).html +10 -10
- package/docs/examples/w-rose_multi-set(series color).html +10 -10
- package/docs/examples/w-rose_multi-set(series color, gradient).html +10 -10
- package/docs/examples/w-rose_multi-set.html +10 -10
- package/docs/examples/w-rose_multi-set__hide legned.html +10 -10
- package/docs/examples/w-rose_multi-set__show labels.html +10 -10
- package/docs/examples/w-rose_multi-set_roseBorderWidth.html +10 -10
- package/docs/examples/w-rose_multi-set_roseKpColor(gradient).html +10 -10
- package/docs/examples/w-rose_multi-set_roseKpColor.html +10 -10
- package/docs/examples/w-rose_multi-set_roseWidthRatio.html +10 -10
- package/docs/examples/w-rose_one-set(color).html +10 -10
- package/docs/examples/w-rose_one-set(color, gradient).html +10 -10
- package/docs/examples/w-rose_one-set.html +10 -10
- package/docs/examples/w-rose_one-set_marginLeft_marginRight_marginTop.html +10 -10
- package/docs/examples/w-rose_one-set_roseBorderWidth.html +10 -10
- package/docs/examples/w-rose_one-set_roseKpColor(gradient).html +10 -10
- package/docs/examples/w-rose_one-set_roseKpColor.html +10 -10
- package/docs/examples/w-rose_one-set_roseShowLabels.html +10 -10
- package/docs/examples/w-rose_one-set_roseWidthRatio.html +10 -10
- package/docs/examples/w-rose_one-set_showLegend.html +10 -10
- package/docs/examples/w-rose_one-set_showLegend_legendPosition.html +10 -10
- package/docs/examples/w-set-multi_default.html +221 -0
- package/docs/examples/w-set-multi_hide labels.html +222 -0
- package/docs/examples/w-set-multi_hide legned.html +222 -0
- package/docs/examples/w-set-multi_keySelect.html +226 -0
- package/docs/examples/w-set-multi_slot head.html +225 -0
- package/docs/examples/w-set-multi_textPlotType_kpSelectText_widthSelect.html +233 -0
- package/docs/examples/w-set-one_default.html +192 -0
- package/docs/examples/w-set-one_hide labels.html +193 -0
- package/docs/examples/w-set-one_keySelect.html +197 -0
- package/docs/examples/w-set-one_show legned.html +193 -0
- package/docs/examples/w-set-one_slot head.html +196 -0
- package/docs/examples/w-set-one_textPlotType_kpSelectText_widthSelect.html +201 -0
- package/docs/getDefAxis.mjs.html +5 -5
- package/docs/getDefChart.mjs.html +3 -3
- package/docs/getDefLegend.mjs.html +2 -2
- package/docs/getDefOpt.mjs.html +2 -2
- package/docs/global.html +2 -2
- package/docs/index.html +2 -2
- package/docs/module-WBar.html +2 -2
- package/docs/module-WPie.html +2 -2
- package/docs/module-WPlot.html +2 -2
- package/docs/module-WRose.html +2 -2
- package/docs/module-WSetMulti.html +216 -0
- package/docs/module-WSetOne.html +216 -0
- package/docs/setLegendLoc.mjs.html +2 -2
- package/package.json +1 -1
- package/src/App.vue +224 -20
- package/src/AppZoneWBar.vue +50 -9
- package/src/AppZoneWPie.vue +4 -4
- package/src/AppZoneWRose.vue +9 -9
- package/src/AppZoneWSetMulti.vue +225 -0
- package/src/AppZoneWSetOne.vue +193 -0
- package/src/components/WBar.vue +128 -18
- package/src/components/WPie.vue +21 -18
- package/src/components/{WGeoVue.vue → WPlotVue.vue} +8 -4
- package/src/components/WRose.vue +21 -18
- package/src/components/WSetMulti.vue +423 -0
- package/src/components/WSetOne.vue +57 -0
- package/src/js/genBarOpt.mjs +54 -7
- package/src/js/genPieOpt.mjs +1 -1
- package/src/js/genRoseOpt.mjs +1 -1
- package/src/js/getDefAxis.mjs +3 -3
- package/src/js/getDefChart.mjs +1 -1
- package/toolg/gDistRollupComps.mjs +1 -1
- package/toolg/gMergeComps.mjs +4 -4
- package/dist/w-geo-vue.umd.js +0 -7
- package/dist/w-geo-vue.umd.js.map +0 -1
package/src/components/WBar.vue
CHANGED
|
@@ -4,18 +4,32 @@
|
|
|
4
4
|
v-if="hasOptBar"
|
|
5
5
|
>
|
|
6
6
|
|
|
7
|
-
<div :style="`width:${
|
|
7
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
8
8
|
<slot
|
|
9
9
|
name="top"
|
|
10
10
|
:opt="optBar"
|
|
11
11
|
></slot>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
<
|
|
15
|
-
:options="optBar"
|
|
16
|
-
></WPlot>
|
|
14
|
+
<div style="position:relative;">
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
<WPlot
|
|
17
|
+
:options="optBar"
|
|
18
|
+
></WPlot>
|
|
19
|
+
|
|
20
|
+
<template v-if="useInnerLabels">
|
|
21
|
+
<div
|
|
22
|
+
:style="`position:absolute; left:${locLeft}px; top:${tk.y}px; font-family:${hTickLableFontFamily}; font-size:${hTickLableFontSize}; color:${hTickLableColor};`"
|
|
23
|
+
:key="'ktk-'+ktk"
|
|
24
|
+
v-for="(tk,ktk) in hTickLabels"
|
|
25
|
+
>
|
|
26
|
+
{{tk.name}}
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
19
33
|
<slot
|
|
20
34
|
name="bottom"
|
|
21
35
|
:opt="optBar"
|
|
@@ -27,7 +41,8 @@
|
|
|
27
41
|
|
|
28
42
|
<script>
|
|
29
43
|
import get from 'lodash-es/get'
|
|
30
|
-
|
|
44
|
+
import map from 'lodash-es/map'
|
|
45
|
+
import size from 'lodash-es/size'
|
|
31
46
|
// import cloneDeep from 'lodash-es/cloneDeep'
|
|
32
47
|
// import isestr from 'wsemi/src/isestr.mjs'
|
|
33
48
|
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
@@ -54,6 +69,24 @@ export default {
|
|
|
54
69
|
},
|
|
55
70
|
computed: {
|
|
56
71
|
|
|
72
|
+
picWidth: function() {
|
|
73
|
+
let vo = this
|
|
74
|
+
let w = get(vo, 'opt.width', 0)
|
|
75
|
+
return w
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
picHeight: function() {
|
|
79
|
+
let vo = this
|
|
80
|
+
let w = get(vo, 'opt.height', 0)
|
|
81
|
+
return w
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
ks: function() {
|
|
85
|
+
let vo = this
|
|
86
|
+
let ks = get(vo, 'opt.keys', [])
|
|
87
|
+
return ks
|
|
88
|
+
},
|
|
89
|
+
|
|
57
90
|
hasOptBar: function() {
|
|
58
91
|
//console.log('computed hasOptBar')
|
|
59
92
|
|
|
@@ -71,11 +104,8 @@ export default {
|
|
|
71
104
|
|
|
72
105
|
let r = null
|
|
73
106
|
try {
|
|
74
|
-
let w = vo.getWidth()
|
|
75
|
-
let h = vo.getHeight()
|
|
76
|
-
let keys = get(vo, 'opt.keys', [])
|
|
77
107
|
let rds = get(vo, 'opt.rds', [])
|
|
78
|
-
r = genBarOpt(
|
|
108
|
+
r = genBarOpt(vo.picWidth, vo.picHeight, vo.ks, rds, vo.opt)
|
|
79
109
|
}
|
|
80
110
|
catch (err) {
|
|
81
111
|
console.log(err)
|
|
@@ -84,21 +114,101 @@ export default {
|
|
|
84
114
|
return r
|
|
85
115
|
},
|
|
86
116
|
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
useInnerLabels: function() {
|
|
118
|
+
let vo = this
|
|
119
|
+
let b1 = get(vo, 'opt.direction', '') === 'horizontal'
|
|
120
|
+
let b2 = get(vo, 'opt.barUseInnerLabelsForHorizontal', false)
|
|
121
|
+
let b = b1 && b2
|
|
122
|
+
return b
|
|
123
|
+
},
|
|
89
124
|
|
|
90
|
-
|
|
125
|
+
locLeft: function() {
|
|
91
126
|
let vo = this
|
|
92
|
-
let
|
|
93
|
-
return
|
|
127
|
+
let r = get(vo, 'optBar.chart.marginLeft', 0)
|
|
128
|
+
return r
|
|
94
129
|
},
|
|
95
130
|
|
|
96
|
-
|
|
131
|
+
locTop: function() {
|
|
97
132
|
let vo = this
|
|
98
|
-
let
|
|
99
|
-
return
|
|
133
|
+
let r = get(vo, 'optBar.chart.marginTop', 0)
|
|
134
|
+
return r
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
locBottom: function() {
|
|
138
|
+
let vo = this
|
|
139
|
+
let r = get(vo, 'optBar.chart.marginBottom', 0)
|
|
140
|
+
return r
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
hTickLableFontFamily: function() {
|
|
144
|
+
let vo = this
|
|
145
|
+
let r = get(vo, 'optBar.xAxis.labels.style.fontFamily', '')
|
|
146
|
+
return r
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
hTickLableFontSize: function() {
|
|
150
|
+
let vo = this
|
|
151
|
+
let r = get(vo, 'optBar.xAxis.labels.style.fontSize', '')
|
|
152
|
+
return r
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
hTickLableColor: function() {
|
|
156
|
+
let vo = this
|
|
157
|
+
let r = get(vo, 'optBar.xAxis.labels.style.color', '')
|
|
158
|
+
return r
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
hAxisMin: function() {
|
|
162
|
+
let vo = this
|
|
163
|
+
let r = get(vo, 'optBar.xAxis.min', 0)
|
|
164
|
+
return r
|
|
100
165
|
},
|
|
101
166
|
|
|
167
|
+
// hAxisMax: function() {
|
|
168
|
+
// let vo = this
|
|
169
|
+
// let r = get(vo, 'optBar.xAxis.max', 0)
|
|
170
|
+
// return r
|
|
171
|
+
// },
|
|
172
|
+
|
|
173
|
+
hTickLabels: function() {
|
|
174
|
+
let vo = this
|
|
175
|
+
|
|
176
|
+
//h
|
|
177
|
+
let h = vo.picHeight - vo.locTop - vo.locBottom
|
|
178
|
+
h = Math.max(h, 0)
|
|
179
|
+
// console.log('h', h)
|
|
180
|
+
|
|
181
|
+
//n
|
|
182
|
+
let n = size(vo.ks)
|
|
183
|
+
// console.log('n', n)
|
|
184
|
+
|
|
185
|
+
//rng
|
|
186
|
+
let rng = n - vo.hAxisMin
|
|
187
|
+
// console.log('rng', rng)
|
|
188
|
+
|
|
189
|
+
//yd
|
|
190
|
+
let yd = 0
|
|
191
|
+
if (rng > 0) {
|
|
192
|
+
yd = h / rng
|
|
193
|
+
}
|
|
194
|
+
// console.log('yd', yd)
|
|
195
|
+
|
|
196
|
+
//tks
|
|
197
|
+
let tks = map(vo.ks, (v, k) => {
|
|
198
|
+
let y = vo.locTop + yd * (k - vo.hAxisMin)
|
|
199
|
+
return {
|
|
200
|
+
name: v,
|
|
201
|
+
y,
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
// console.log('tks', tks)
|
|
205
|
+
|
|
206
|
+
return tks
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
},
|
|
210
|
+
methods: {
|
|
211
|
+
|
|
102
212
|
}
|
|
103
213
|
}
|
|
104
214
|
</script>
|
package/src/components/WPie.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-if="hasOptPie"
|
|
5
5
|
>
|
|
6
6
|
|
|
7
|
-
<div :style="`width:${
|
|
7
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
8
8
|
<slot
|
|
9
9
|
name="top"
|
|
10
10
|
:opt="optPie"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:options="optPie"
|
|
16
16
|
></WPlot>
|
|
17
17
|
|
|
18
|
-
<div :style="`width:${
|
|
18
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
19
19
|
<slot
|
|
20
20
|
name="bottom"
|
|
21
21
|
:opt="optPie"
|
|
@@ -54,6 +54,24 @@ export default {
|
|
|
54
54
|
},
|
|
55
55
|
computed: {
|
|
56
56
|
|
|
57
|
+
picWidth: function() {
|
|
58
|
+
let vo = this
|
|
59
|
+
let w = get(vo, 'opt.width', 0)
|
|
60
|
+
return w
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
picHeight: function() {
|
|
64
|
+
let vo = this
|
|
65
|
+
let w = get(vo, 'opt.height', 0)
|
|
66
|
+
return w
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
ks: function() {
|
|
70
|
+
let vo = this
|
|
71
|
+
let ks = get(vo, 'opt.keys', [])
|
|
72
|
+
return ks
|
|
73
|
+
},
|
|
74
|
+
|
|
57
75
|
hasOptPie: function() {
|
|
58
76
|
//console.log('computed hasOptPie')
|
|
59
77
|
|
|
@@ -71,11 +89,8 @@ export default {
|
|
|
71
89
|
|
|
72
90
|
let r = null
|
|
73
91
|
try {
|
|
74
|
-
let w = vo.getWidth()
|
|
75
|
-
let h = vo.getHeight()
|
|
76
|
-
let keys = get(vo, 'opt.keys', [])
|
|
77
92
|
let rds = get(vo, 'opt.rds', [])
|
|
78
|
-
r = genPieOpt(
|
|
93
|
+
r = genPieOpt(vo.picWidth, vo.picHeight, vo.ks, rds, vo.opt)
|
|
79
94
|
}
|
|
80
95
|
catch (err) {
|
|
81
96
|
console.log(err)
|
|
@@ -87,18 +102,6 @@ export default {
|
|
|
87
102
|
},
|
|
88
103
|
methods: {
|
|
89
104
|
|
|
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
105
|
}
|
|
103
106
|
}
|
|
104
107
|
</script>
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
import WBar from './WBar.vue'
|
|
3
3
|
import WPie from './WPie.vue'
|
|
4
4
|
import WPlot from './WPlot.vue'
|
|
5
|
-
import WRose from './WRose.vue'
|
|
5
|
+
import WRose from './WRose.vue'
|
|
6
|
+
import WSetMulti from './WSetMulti.vue'
|
|
7
|
+
import WSetOne from './WSetOne.vue'
|
|
6
8
|
|
|
7
|
-
let
|
|
9
|
+
let WPlotVue = {
|
|
8
10
|
install: function(Vue) {
|
|
9
11
|
Vue.component('w-bar', WBar)
|
|
10
12
|
Vue.component('w-pie', WPie)
|
|
11
13
|
Vue.component('w-plot', WPlot)
|
|
12
|
-
Vue.component('w-rose', WRose)
|
|
14
|
+
Vue.component('w-rose', WRose)
|
|
15
|
+
Vue.component('w-set-multi', WSetMulti)
|
|
16
|
+
Vue.component('w-set-one', WSetOne)
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
export default
|
|
20
|
+
export default WPlotVue
|
|
17
21
|
</script>
|
|
18
22
|
|
package/src/components/WRose.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-if="hasOptRose"
|
|
5
5
|
>
|
|
6
6
|
|
|
7
|
-
<div :style="`width:${
|
|
7
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
8
8
|
<slot
|
|
9
9
|
name="top"
|
|
10
10
|
:opt="optRose"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:options="optRose"
|
|
16
16
|
></WPlot>
|
|
17
17
|
|
|
18
|
-
<div :style="`width:${
|
|
18
|
+
<div :style="`width:${picWidth}px; max-width:${picWidth}px;`">
|
|
19
19
|
<slot
|
|
20
20
|
name="bottom"
|
|
21
21
|
:opt="optRose"
|
|
@@ -54,6 +54,24 @@ export default {
|
|
|
54
54
|
},
|
|
55
55
|
computed: {
|
|
56
56
|
|
|
57
|
+
picWidth: function() {
|
|
58
|
+
let vo = this
|
|
59
|
+
let w = get(vo, 'opt.width', 0)
|
|
60
|
+
return w
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
picHeight: function() {
|
|
64
|
+
let vo = this
|
|
65
|
+
let w = get(vo, 'opt.height', 0)
|
|
66
|
+
return w
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
ks: function() {
|
|
70
|
+
let vo = this
|
|
71
|
+
let ks = get(vo, 'opt.keys', [])
|
|
72
|
+
return ks
|
|
73
|
+
},
|
|
74
|
+
|
|
57
75
|
hasOptRose: function() {
|
|
58
76
|
//console.log('computed hasOptRose')
|
|
59
77
|
|
|
@@ -71,11 +89,8 @@ export default {
|
|
|
71
89
|
|
|
72
90
|
let r = null
|
|
73
91
|
try {
|
|
74
|
-
let w = vo.getWidth()
|
|
75
|
-
let h = vo.getHeight()
|
|
76
|
-
let keys = get(vo, 'opt.keys', [])
|
|
77
92
|
let rds = get(vo, 'opt.rds', [])
|
|
78
|
-
r = genRoseOpt(
|
|
93
|
+
r = genRoseOpt(vo.picWidth, vo.picHeight, vo.ks, rds, vo.opt)
|
|
79
94
|
}
|
|
80
95
|
catch (err) {
|
|
81
96
|
console.log(err)
|
|
@@ -87,18 +102,6 @@ export default {
|
|
|
87
102
|
},
|
|
88
103
|
methods: {
|
|
89
104
|
|
|
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
105
|
}
|
|
103
106
|
}
|
|
104
107
|
</script>
|