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

Method syncModelToBrush

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

Source from the content-addressed store, hash-verified

336 }
337
338 private syncModelToBrush() {
339 // Move and redraw the brush selector, preventing move events to be triggered
340 this.ignoreBrushEvents = true;
341
342 try {
343 if (this.model.get('selected_x') && this.model.get('selected_y')) {
344 const range_x = this.model
345 .get('selected_x')
346 .map((v) => this.x_scale.offset + this.x_scale.scale(v))
347 .sort(sort);
348 const range_y = this.model
349 .get('selected_y')
350 .map((v) => this.y_scale.offset + this.y_scale.scale(v))
351 .sort(sort);
352 this.brush.move(this.d3el, [
353 [range_x[0], range_y[0]],
354 [range_x[1], range_y[1]],
355 ]);
356 } else {
357 this.brush.move(this.d3el, null);
358 }
359
360 this.d3el.call(this.brush);
361 } finally {
362 this.ignoreBrushEvents = false;
363 }
364
365 this.d3el.call(this.brush);
366 }
367
368 // TODO: check that we've properly overridden the mixin.
369 adjust_rectangle() {}

Callers 2

selected_changedMethod · 0.95
relayoutMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected