在Crossfilter API reference , bisect
被描述为
The identity bisector; suitable for numbers, dates, strings, and other naturally-comparable objects.`
heapselect
描述为
The identity heapselect function; suitable for numbers, dates, strings, and other naturally-comparable objects.
但是它们的作用是什么,又是如何使用的呢?
最佳答案
bisect
可让您将已排序的数组分成两部分。把它想象成书页掉了下来。如果你想把那页放回去,你需要把书分开,左边的部分是比你的页码小的页面,右边的部分是比你的页码大的页面。
heapselect
允许您从数组中获取前 k 个元素,如果数组满足堆的所有属性,则可以选择在给定数组的子集中。 http://en.wikipedia.org/wiki/Binary_heap
在这两种情况下,身份函数只会返回所有数据。所以身份平分线将被你给它的任何维度平分。标识 heapselect 将按您提供的任何维度进行堆放和堆选择。
这有帮助吗?
关于javascript - Crossfilter中的 "bisect"和 "heapselect"工具有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17762380/