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

Method selected_changed

js/src/BrushSelector.ts:440–457  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438 }
439
440 selected_changed() {
441 if (this.brushing) {
442 return;
443 }
444 //reposition the interval selector and set the selected attribute.
445 const selected = this.model.get('selected') || [];
446 if (selected.length === 0) {
447 this.update_mark_selected();
448 } else if (selected.length != 2) {
449 // invalid value for selected. Ignoring the value
450 return;
451 } else {
452 const extent = [selected[0], selected[1]];
453 const pixel_extent = extent.map((v) => this.scale.scale(v)).sort(sort);
454 this.update_mark_selected(pixel_extent);
455 }
456 this.syncModelToBrush();
457 }
458
459 relayout() {
460 super.relayout();

Callers 2

renderMethod · 0.95
update_scale_domainMethod · 0.95

Calls 2

syncModelToBrushMethod · 0.95
update_mark_selectedMethod · 0.45

Tested by

no test coverage detected