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

Method convert_and_save

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

Source from the content-addressed store, hash-verified

263 }
264
265 convert_and_save() {
266 const e = d3GetEvent();
267 if (!e.sourceEvent) {
268 return;
269 }
270 if (!e.selection) {
271 this.empty_selection();
272 } else {
273 const d0 = e.selection;
274 const pixel_extent_x = [d0[0][0], d0[1][0]];
275 const pixel_extent_y = [d0[1][1], d0[0][1]];
276
277 const extent_x = pixel_extent_x
278 .map(this.x_scale.invert.bind(this.x_scale))
279 .sort(sort);
280 const extent_y = pixel_extent_y
281 .map(this.y_scale.invert.bind(this.y_scale))
282 .sort(sort);
283
284 this.update_mark_selected(pixel_extent_x, pixel_extent_y);
285 this.set_selected(
286 'selected_x',
287 this.x_scale.model.typedRange(extent_x as number[])
288 );
289 this.set_selected(
290 'selected_y',
291 this.y_scale.model.typedRange(extent_y as number[])
292 );
293 this.touch();
294 }
295 }
296
297 selected_changed() {
298 if (this.brushing) {

Callers 2

brush_moveFunction · 0.45
brush_endFunction · 0.45

Calls 3

empty_selectionMethod · 0.95
d3GetEventFunction · 0.90
update_mark_selectedMethod · 0.45

Tested by

no test coverage detected