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

Method reset_handler

js/src/BrushSelector.ts:611–640  ·  view source on GitHub ↗
(brush_g)

Source from the content-addressed store, hash-verified

609 }
610
611 reset_handler(brush_g) {
612 const that = this;
613 const old_handler = brush_g.on('mousedown.brush');
614
615 brush_g.on('mousedown.brush', function () {
616 const accelKey = d3GetEvent().ctrlKey || d3GetEvent().metaKey;
617 if (d3GetEvent().shiftKey && accelKey) {
618 that.reset();
619 } else if (accelKey) {
620 add_remove_classes(d3.select(this), ['inactive'], ['active']);
621 that.create_brush();
622 } else if (d3GetEvent().shiftKey && that.selecting_brush === false) {
623 add_remove_classes(
624 that.d3el.selectAll('.selector'),
625 ['visible'],
626 ['active', 'inactive']
627 );
628 that.selecting_brush = true;
629 } else {
630 add_remove_classes(
631 that.d3el.selectAll('.selector'),
632 ['inactive'],
633 ['visible']
634 );
635 add_remove_classes(d3.select(this), ['active'], ['inactive']);
636 old_handler.call(this);
637 that.selecting_brush = false;
638 }
639 });
640 }
641
642 get_label(index, arr?) {
643 //arr is optional. If you do not pass anything, this.names is

Callers 2

create_brushMethod · 0.95
syncModelToBrushMethod · 0.95

Calls 4

d3GetEventFunction · 0.90
add_remove_classesFunction · 0.85
create_brushMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected