(point_selector, rect_selector)
| 245 | } |
| 246 | |
| 247 | selector_changed(point_selector, rect_selector) { |
| 248 | if (point_selector === undefined) { |
| 249 | this.model.set('selected', null); |
| 250 | this.touch(); |
| 251 | return []; |
| 252 | } |
| 253 | const pixels = this.pixelCoords; |
| 254 | const indices = new Uint32Array(_.range(pixels.length)); |
| 255 | // Here we only select bar groups. It shouldn't be too hard to select |
| 256 | // individual bars, the `selected` attribute would then be a list of pairs. |
| 257 | const selected_groups = indices.filter((index) => { |
| 258 | const bars = pixels[index]; |
| 259 | for (let i = 0; i < bars.length; i++) { |
| 260 | if (rect_selector(bars[i])) { |
| 261 | return true; |
| 262 | } |
| 263 | } |
| 264 | return false; |
| 265 | }); |
| 266 | this.model.set('selected', selected_groups); |
| 267 | this.touch(); |
| 268 | } |
| 269 | |
| 270 | private updateSelected() { |
| 271 | this.selected_indices = this.model.get('selected'); |
nothing calls this directly
no test coverage detected