package moe.kageru.spektacles import java.time.Month fun ParsedLines.heatMapByHour(): SortedCounter = heatMapBy { it.time.hour } fun ParsedLines.heatMapByMinute(): SortedCounter = heatMapBy { it.time.hour * 100 + it.time.minute } fun ParsedLines.heatMapByMonth(): SortedCounter = heatMapBy { it.time.month } private fun >ParsedLines.heatMapBy(op: (ParsedLine) -> T): SortedCounter { return this.map(op) .asIterable() .toSortedCounter() }