Documentation
¶
Index ¶
Constants ¶
View Source
const ( HP_TOTAL_SCORE = 5 HP_STATE_NAME = "H/P State" )
Variables ¶
This section is empty.
Functions ¶
func HumanStatePage ¶
func HumanStatePage(humanState *HumanState, onKeyDown func(*dom.DOMEvent)) *dom.Node
HumanStatePage renders the complete human state page
Types ¶
type HumanState ¶
type HumanState struct {
HpScores int // 5 bars for the single hp state
FocusedBarIndex int // Which bar is currently focused (0-4)
History []HumanStateHistoryPoint // History of HP scores by date
OnAdjustScore func(delta int) error // Callback for when score is adjusted
Enqueue func(action func(ctx context.Context) error) // Async task enqueue function
LoadStateOnce func() // Load state once on first access
}
HumanState represents the state of human metrics with one hp state having 5 bars
func (*HumanState) AdjustScore ¶
func (hs *HumanState) AdjustScore(delta int)
AdjustScore increases or decreases the focused bar's score
type HumanStateHistoryPoint ¶ added in v0.0.23
type HumanStateHistoryPoint struct {
Date string // Date in YYYY-MM-DD format
Score float64 // HP score for that date
}
HumanStateHistoryPoint represents a single history point with date and score
Click to show internal directories.
Click to hide internal directories.