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

Method invert_point

js/src/Boxplot.ts:261–278  ·  view source on GitHub ↗
(pixel)

Source from the content-addressed store, hash-verified

259 }
260
261 invert_point(pixel) {
262 if (pixel === undefined) {
263 this.updateSelectedColors([]);
264 this.model.set('selected', null);
265 this.touch();
266 return;
267 }
268
269 const absDiff = this.xPixels.map((elem) => {
270 return Math.abs(elem - pixel);
271 });
272 const selIndex = absDiff.indexOf(d3.min(absDiff));
273
274 this.model.set('selected', new Uint32Array([selIndex]));
275 this.updateSelectedColors([selIndex]);
276 this.touch();
277 return selIndex;
278 }
279
280 private prepareBoxPlots() {
281 // Sets plot data on this.plotData and this.outlierData

Callers

nothing calls this directly

Calls 1

updateSelectedColorsMethod · 0.95

Tested by

no test coverage detected