histogram

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package histogram provides visualization of activity patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHistogram

func GenerateHistogram(result *Result, timezone string) string

GenerateHistogram creates a visual representation of user activity.

Types

type ActivityHistogram

type ActivityHistogram struct {
	HourlyActivity map[int]int
	Username       string
	Timezone       string
	QuietHours     []int
	UTCOffset      int
	WorkStart      int
	WorkEnd        int
	LunchStart     float64
	LunchEnd       float64
}

ActivityHistogram represents activity data with visual representation.

type LunchBreak

type LunchBreak struct {
	Start      float64 `json:"start"`
	End        float64 `json:"end"`
	Confidence float64 `json:"confidence"`
}

LunchBreak represents lunch break times.

type OrgActivity

type OrgActivity struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

OrgActivity represents activity for an organization.

type PeakProductivity

type PeakProductivity struct {
	Start float64 `json:"start"`
	End   float64 `json:"end"`
	Count int     `json:"count"`
}

PeakProductivity represents peak productivity hours.

type Result

type Result struct {
	HalfHourlyActivityUTC      map[float64]int        `json:"-"`
	HourlyOrganizationActivity map[int]map[string]int `json:"hourly_organization_activity,omitempty"`
	TopOrganizations           []OrgActivity          `json:"top_organizations"`
	QuietHoursUTC              []int                  `json:"quiet_hours_utc"`
	SleepBucketsUTC            []float64              `json:"sleep_buckets_utc,omitempty"`
	SleepRangesLocal           []SleepRange           `json:"sleep_ranges_local,omitempty"`
	PeakProductivityUTC        PeakProductivity       `json:"peak_productivity_utc,omitempty"`
	PeakProductivityLocal      PeakProductivity       `json:"peak_productivity_local,omitempty"`
	LunchHoursUTC              LunchBreak             `json:"lunch_hours_utc,omitempty"`
	LunchHoursLocal            LunchBreak             `json:"lunch_hours_local,omitempty"`
}

Result represents timezone detection results - imported type needed for histogram.

type SleepRange added in v1.1.0

type SleepRange struct {
	Start    float64 `json:"start"`
	End      float64 `json:"end"`
	Duration float64 `json:"duration"`
}

SleepRange represents a continuous rest/sleep period.

Jump to

Keyboard shortcuts

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