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

Function update_mark_selected

js/src/BrushSelector.ts:75–105  ·  view source on GitHub ↗
(brush, extent_x?, extent_y?)

Source from the content-addressed store, hash-verified

73}
74
75function update_mark_selected(brush, extent_x?, extent_y?) {
76 if (extent_x === undefined || extent_x.length === 0) {
77 // Reset all the selected in marks
78 _.each(brush.mark_views, (mark_view: any) => {
79 return mark_view.selector_changed();
80 });
81 return;
82 }
83
84 let x, y;
85 if (extent_y === undefined) {
86 // 1d brush
87 const orient = brush.model.get('orientation');
88 (x = orient == 'vertical' ? [] : extent_x),
89 (y = orient == 'vertical' ? extent_x : []);
90 } else {
91 // 2d brush
92 (x = extent_x), (y = extent_y);
93 }
94
95 if (x.length) {
96 x.sort(sort);
97 }
98 if (y.length) {
99 y.sort(sort);
100 }
101
102 _.each(brush.mark_views, (mark_view: any) => {
103 mark_view.selector_changed(point_selector(x, y), rect_selector(x, y));
104 });
105}
106
107function adjust_rectangle(brush) {
108 if (brush.model.get('orientation') == 'vertical') {

Callers

nothing calls this directly

Calls 3

point_selectorFunction · 0.85
rect_selectorFunction · 0.85
selector_changedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…