|
11 | 11 |
|
12 | 12 | var polygon = require('../../lib/polygon'); |
13 | 13 | var color = require('../../components/color'); |
| 14 | +var appendArrayPointValue = require('../../components/fx/helpers').appendArrayPointValue; |
14 | 15 |
|
15 | 16 | var axes = require('./axes'); |
16 | 17 | var constants = require('./constants'); |
@@ -151,7 +152,9 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { |
151 | 152 | selection = []; |
152 | 153 | for(i = 0; i < searchTraces.length; i++) { |
153 | 154 | searchInfo = searchTraces[i]; |
154 | | - [].push.apply(selection, searchInfo.selectPoints(searchInfo, poly)); |
| 155 | + [].push.apply(selection, fillSelectionItem( |
| 156 | + searchInfo.selectPoints(searchInfo, poly), searchInfo |
| 157 | + )); |
155 | 158 | } |
156 | 159 |
|
157 | 160 | eventData = {points: selection}; |
@@ -196,3 +199,20 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { |
196 | 199 | } |
197 | 200 | }; |
198 | 201 | }; |
| 202 | + |
| 203 | +function fillSelectionItem(selection, searchInfo) { |
| 204 | + if(Array.isArray(selection)) { |
| 205 | + var trace = searchInfo.cd[0].trace; |
| 206 | + |
| 207 | + for(var i = 0; i < selection.length; i++) { |
| 208 | + var sel = selection[i]; |
| 209 | + |
| 210 | + sel.curveNumber = trace.index; |
| 211 | + sel.data = trace._input; |
| 212 | + sel.fullData = trace; |
| 213 | + appendArrayPointValue(sel, trace, sel.pointNumber); |
| 214 | + } |
| 215 | + } |
| 216 | + |
| 217 | + return selection; |
| 218 | +} |
0 commit comments