ikeru
The art of arranging data
Usage
Install ikeru by running:
yarn add ikeru
BinarySearchTree
A sorted dictionary of number keys to arbitrary values.
Note that these trees do not self-balance. See RedBlackTree
.
let treetree = tree = tree = console// null for const node of console // 3, 'Three' // 5, 'Five' // 7, 'Seven' console// {// "key": 5,// "value": {// "name": "Five"// },// "left": {// "key": 3,// "value": {// "name": "Three"// },// "left": null// "right": null// }// "right": {// "key": 7,// "value": {// "name": "Seven"// },// "left": null// "right": null// }// } tree = for const node of console // 3, { name: 'Three' } // 7, { name: 'Seven' }
RedBlackTree
A BinarySearchTree
that self-balances after every update,
maintaining O(log n)
reads and writes.
RedBlackTree
follows the same interface as BinarySearchTree
.
let treetree = tree = tree = for const node of console // 3, 'Three' // 5, 'Five' // 7, 'Seven'
TimeSeries
ikeru
provides various utilities for summarizing and transforming time series
data.
const series1 = time: Date time: Date time: Date const series2 = time: Date time: Date time: Date const series3 = time: Date time: Date time: Date time: Date const series = const monthlyMissingApril = const monthly = const everyMonthInYear = const firstThreeMonths = window everyMonthInYear Date Date const parallelSeries1 = time: Date value: 1 time: Date value: 2 time: Date value: 3 const parallelSeries2 = time: Date value: 4 time: Date value: 5 time: Date value: 6 const addedUp =