MCPcopy Index your code
hub / github.com/bqplot/bqplot / selector_changed

Method selector_changed

js/src/Hist.ts:452–465  ·  view source on GitHub ↗
(point_selector, rect_selector)

Source from the content-addressed store, hash-verified

450 }
451
452 selector_changed(point_selector, rect_selector) {
453 if (point_selector === undefined) {
454 this.model.set('selected', null);
455 this.touch();
456 return [];
457 }
458 const pixels = this.pixel_coords;
459 const indices = new Uint32Array(_.range(pixels.length));
460 const selected_bins = indices.filter((index) => {
461 return rect_selector(pixels[index]);
462 });
463 this.model.set('selected', this.computeDataIndices(selected_bins));
464 this.touch();
465 }
466
467 private computeDataIndices(indices) {
468 //input is a list of indices corresponding to the bars. Output is

Callers 3

update_mark_selectedMethod · 0.45
update_mark_selectedFunction · 0.45
update_mark_selectedMethod · 0.45

Calls 3

computeDataIndicesMethod · 0.95
rect_selectorFunction · 0.85
rangeMethod · 0.80

Tested by

no test coverage detected