heatmap

package
v0.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Yellow = []string{"#FDF3B7", "#F5C670", "#EC7C46", "#C9312B", "#751428"}
	Green  = []string{"#EBEDF0", "#9BE9A8", "#40C463", "#30A14E", "#216E39"}
	Blue   = []string{"#E9F0F9", "#B7D1E5", "#6CA1CC", "#3568AB", "#152F67"}
)

0.15 0.35 0.55 0.75 0.94

Functions

func Build added in v0.5.0

func Build(start, end int64, data map[int64]int, color string) ([]byte, error)

func CurrYear added in v0.5.0

func CurrYear(data map[int64]int, color string) ([]byte, error)

CurrYear 当前年

func Do

func Do(counts map[string]int) ([]byte, error)

func PastYear added in v0.5.0

func PastYear(data map[int64]int, color string) ([]byte, error)

PastYear 过去一年

Types

type CalendarHeatmap added in v0.5.0

type CalendarHeatmap struct {
	Config *CalendarHeatmapConfig
}

func New added in v0.5.0

func (*CalendarHeatmap) Generate added in v0.5.0

func (c *CalendarHeatmap) Generate(dateFrom, dateTo Date, data map[Date]int) *bytes.Buffer

type CalendarHeatmapConfig added in v0.5.0

type CalendarHeatmapConfig struct {
	Colors           []string
	BlockSize        float64
	BlockRoundness   float64
	BlockMargin      float64
	MonthLabels      []string
	MonthLabelHeight float64
	WeekdayLabels    []string

	MonthSpace int // space with month
	// contains filtered or unexported fields
}

type Date added in v0.5.0

type Date struct {
	Year  int
	Month time.Month
	Day   int
}

func (Date) Time added in v0.5.0

func (date Date) Time() time.Time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL