beyond-rails 0.0.244 → 0.0.245
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/PieChart.js +17 -3
- data/src/js/decorators/chartCommon.js +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14a11baddc8aa18a29a74c0774442e2b5486b49ad44a7e435497176aa8a0c230
|
4
|
+
data.tar.gz: 92a0ac4ab51c30bac1f93cc092bb05c6ac4fd4e0c53eb792b983e967dd77f0a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 480156108ca39681b88309ac8554648af5d2aa47dfcf9ee077a940f19f4fd87de40a3a630d5a9b81a3a5244529ca07d377ef94f7ff64a3189bd6a065e76c0cff
|
7
|
+
data.tar.gz: 1b458994269fcc000dd7e5b670e7c69cb816fe56e251a51b55ff7ce78a6925c6951df7897c1f21e86dc5d130def90f4d71c60167ec515ff1b3c0eb4d3cf1c482
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import supportDom from '../decorators/supportDom'
|
2
2
|
import chartCommon from '../decorators/chartCommon'
|
3
|
+
import isFn from '../utils/isFn'
|
3
4
|
import isDef from '../utils/isDef'
|
4
5
|
import isUndef from '../utils/isUndef'
|
5
6
|
import { throttle } from '../utils'
|
@@ -209,12 +210,25 @@ export default class PieChart {
|
|
209
210
|
})
|
210
211
|
}
|
211
212
|
|
212
|
-
handleLabelMouseOver(index) {
|
213
|
-
this.
|
213
|
+
handleLabelMouseOver(event, index) {
|
214
|
+
const row = this.data[index]
|
215
|
+
this.drawSliceGlow(row)
|
216
|
+
|
217
|
+
if (isFn(this.options.onLabelMouseOver)) {
|
218
|
+
const canvasMousePos = this.getMousePosInCanvas(event)
|
219
|
+
const mousePos = this.getMousePos(canvasMousePos)
|
220
|
+
this.options.onLabelMouseOver(mousePos, row)
|
221
|
+
}
|
214
222
|
}
|
215
223
|
|
216
|
-
handleLabelMouseLeave(index) {
|
224
|
+
handleLabelMouseLeave(event, index) {
|
217
225
|
this.clearSliceGlow()
|
226
|
+
|
227
|
+
if (isFn(this.options.onLabelMouseOver)) {
|
228
|
+
const canvasMousePos = this.getMousePosInCanvas(event)
|
229
|
+
const mousePos = this.getMousePos(canvasMousePos)
|
230
|
+
this.options.onLabelMouseOver(mousePos)
|
231
|
+
}
|
218
232
|
}
|
219
233
|
|
220
234
|
setData(arr) {
|
@@ -242,11 +242,11 @@ export default function chartCommon(target) {
|
|
242
242
|
labelBox.appendChild(div)
|
243
243
|
|
244
244
|
if (isFn(handleLabelMouseOver)) {
|
245
|
-
const off = this.addEvent(div, 'mouseover',
|
245
|
+
const off = this.addEvent(div, 'mouseover', event => this.handleLabelMouseOver(event, i))
|
246
246
|
this.offLabels.push(off)
|
247
247
|
}
|
248
248
|
if (isFn(handleLabelMouseLeave)) {
|
249
|
-
const off = this.addEvent(div, 'mouseleave',
|
249
|
+
const off = this.addEvent(div, 'mouseleave', event => this.handleLabelMouseLeave(event, i))
|
250
250
|
this.offLabels.push(off)
|
251
251
|
}
|
252
252
|
})
|