Documentation
¶
Index ¶
- func OrderByCount(in []HistogramByCountRow) sort.Interface
- func OrderByFrequency(in []HistogramByCountRow) sort.Interface
- type HeatMap
- func (chm HeatMap) Count(ts time.Time) int
- func (chm HeatMap) Diff(src HeatMap) HeatMap
- func (chm HeatMap) From() time.Time
- func (chm HeatMap) Range() time.Range
- func (chm HeatMap) SetCount(ts time.Time, count int)
- func (chm HeatMap) Subset(scope time.Range) HeatMap
- func (chm HeatMap) To() time.Time
- type HistogramByCountRow
- type HistogramByDateRow
- type HistogramByWeekdayRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OrderByCount ¶
func OrderByCount(in []HistogramByCountRow) sort.Interface
func OrderByFrequency ¶
func OrderByFrequency(in []HistogramByCountRow) sort.Interface
Types ¶
type HeatMap ¶
HeatMap contains how many contributions have been made in a time.
func (HeatMap) Range ¶
Range returns time range of the heatmap, otherwise the zero time range instant.
func (HeatMap) SetCount ¶
SetCount sets how many contributions have been made to the specified time.
type HistogramByCountRow ¶
type HistogramByCountRow struct {
Count, Frequency int
}
func HistogramByCount ¶
func HistogramByCount(chm HeatMap, order ...func([]hbc) sort.Interface) []HistogramByCountRow
HistogramByCount returns the distribution of amount contributions. The first value is an amount, and the second is a frequency. The result is sorted by the first value.
1 # 3 ##### 4 ## 7 ###
type HistogramByDateRow ¶
func HistogramByDate ¶
func HistogramByDate(chm HeatMap, format string) []HistogramByDateRow
HistogramByDate returns the sum of the number of contributions grouped by date. The first value is a date in the specified format, and the second is a sum. The result is sorted by the first value.
format: time.RFC3339Day 2022-01-02 # 2022-01-04 ### 2022-01-05 ## 2022-02-01 # format: time.RFC3339Month 2022-01 ###### 2022-02 #
type HistogramByWeekdayRow ¶
func HistogramByWeekday ¶
func HistogramByWeekday(chm HeatMap, grouped bool) []HistogramByWeekdayRow
HistogramByWeekday returns the sum of the number of contributions grouped by day of week. The first value is a date in the specified format, and the second is a sum. The result is sorted by the first value.
grouped: false Monday # Tuesday ### Friday ## Monday # grouped: true Monday ## Tuesday ### Friday ##