Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mixedObjectDateBisectorObject = d3Array.bisector((el, x) =>
el.date.valueOf() - x.valueOf());
// bisect left
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14));
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 1);
num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 3, 4);
// bisect right
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14));
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1);
num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4);
// ascending() -----------------------------------------------------------------
num = d3Array.ascending(undefined, 20);
num = d3Array.ascending(10, 20);
num = d3Array.ascending('10', '20');
num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14));
// descending() ----------------------------------------------------------------
num = d3Array.descending(undefined, 20);
num = d3Array.descending(10, 20);
num = d3Array.descending('10', '20');
num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14));
// -----------------------------------------------------------------------------
// Test Transforming Arrays
// -----------------------------------------------------------------------------
// merge() ---------------------------------------------------------------------
(a, b) =>
ascending(accessor(a), accessor(b)) ||
ascending(array.indexOf(a), array.indexOf(b)) // stable sort
)
(a, b) => ascending(a.letter, b.letter) :
(a, b) => b.frequency - a.frequency,
data.sort(function (l, r) {
for (let i = 0; i < sortBy.length; ++i) {
const lVal = l[sortBy[i].idx];
const rVal = r[sortBy[i].idx];
if (lVal !== rVal) {
return sortBy[i].reverse ? d3Descending(lVal, rVal) : d3Ascending(lVal, rVal);
}
}
return 0;
});
}
({ key: a }, { key: b }) =>
ascending(+(a !== group), +(b !== group)) ||
ascending(
groups.findIndex(d => d.key === a),
groups.findIndex(d => d.key === b)
)
)
allCards.sort((a, b) => {
const aSwipe = swipedMap.get(a.id)
const bSwipe = swipedMap.get(b.id)
return aSwipe && bSwipe
? ascending(allSwipes.indexOf(aSwipe), allSwipes.indexOf(bSwipe))
: ascending(!aSwipe, !bSwipe) ||
ascending(allCards.indexOf(a), allCards.indexOf(b))
})
}
.sort((a, b) => ascending(a.name, b.name))
}
.sort((a, b) => ascending(a.date, b.date))
.map((val, i) => ({ ...val, id: i }));
xLines.sort((a, b) => ascending(a.tick, b.tick))
.sort((a, b) => ascending(a.people, b.people))
const goal = goalsByPeople[goalsByPeople.length - 1]