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

Method selector_changed

js/src/GridHeatMap.ts:438–459  ·  view source on GitHub ↗
(point_selector, rect_selector)

Source from the content-addressed store, hash-verified

436 }
437
438 selector_changed(point_selector, rect_selector) {
439 if (point_selector === undefined) {
440 this.model.set('selected', null);
441 this.touch();
442 return [];
443 }
444 const rowIndices = _.range(this.numRows);
445 const colIndices = _.range(this.numColumns);
446 const selCols = _.filter(colIndices, (index) => {
447 return rect_selector([this.columnPixels[index], []]);
448 });
449 const selRows = _.filter(rowIndices, (index) => {
450 return rect_selector([[], this.rowPixels[index]]);
451 });
452 let selected = selCols.map((s) => {
453 return selRows.map((r) => [r, s]);
454 });
455 // @ts-ignore
456 selected = _.flatten(selected, true);
457 this.model.set('selected', selected);
458 this.touch();
459 }
460
461 draw() {
462 this.set_ranges();

Callers

nothing calls this directly

Calls 2

rect_selectorFunction · 0.85
rangeMethod · 0.80

Tested by

no test coverage detected