MCPcopy Create free account
hub / github.com/plotly/plotly.js / makeFilter

Function makeFilter

src/traces/parcoords/axisbrush.js:463–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461}
462
463function makeFilter() {
464 var filter = [];
465 var consolidated;
466 var bounds;
467 return {
468 set: function(a) {
469 filter = a
470 .map(function(d) { return d.slice().sort(sortAsc); })
471 .sort(startAsc);
472
473 // handle unselected case
474 if(filter.length === 1 &&
475 filter[0][0] === -Infinity &&
476 filter[0][1] === Infinity) {
477 filter = [[0, -1]];
478 }
479
480 consolidated = dedupeRealRanges(filter);
481 bounds = filter.reduce(function(p, n) {
482 return [Math.min(p[0], n[0]), Math.max(p[1], n[1])];
483 }, [Infinity, -Infinity]);
484 },
485 get: function() { return filter.slice(); },
486 getConsolidated: function() { return consolidated; },
487 getBounds: function() { return bounds; }
488 };
489}
490
491function makeBrush(state, rangeSpecified, initialRange, brushStartCallback, brushCallback, brushEndCallback) {
492 var filter = makeFilter();

Callers 1

makeBrushFunction · 0.85

Calls 1

dedupeRealRangesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…