beeminder / road

Beebrain and Visual Graph Editor
http://graph.beeminder.com
Other
13 stars 3 forks source link

Premature happiness #172

Open dreeves opened 3 years ago

dreeves commented 3 years ago
### Desiderata
- [ ] Clarify the expectata for the bb file in privatesuite
- [ ] Fix it
- [ ] Tweet the UVI

HT krugerk

This goal (happy-too-soon.bb in privatesuite) is showing a smiley face despite neither having hit its goal date nor its goal value:

image

Nota Nebulosa

Verbata: watermarks on the graph, goal completion indicators, frozen goals, crossbones vs happyfaces,

saranli commented 3 years ago

Relevant code segment in bgraph.js (setWatermark):

if  (gol.asof >= gol.tfin && !gol.loser) {
  gol.waterbuf = ":)"
  return
}

Seems like this goal satisfies both criteria? Not a loser yet and goal asof is equal to the due date?

dreeves commented 3 years ago

This now says "eke" or "fin" (depending confusingly on asof vs tfin) instead of a happyface. Not that either of those are right either, but at least we're recognizing it as a weird special case now. New relevant code segment:

  const del = bu.chop(gol.yaw*(gol.vcur - gol.vfin))
  const yay = gol.asof >= gol.tfin && del >= 0
  const eke = gol.asof >= gol.tfin && del < 0

  gol.waterbuf = 
    gol.loser           ? ':('                  : // show skull & crossbones
    gol.asof > gol.tfin ? 'fin'                 : // past tfin? shouldn't happen
    yay                 ? ':)'                  : // show happyface
    eke                 ? 'eke'                 : // eking by on last day
    gol.tluz > gol.tfin ? 'inf'                 : // coasting till tfin
    gol.safebuf <= 0    ? TOD(gol.deadline)+'!' : // show deadline time
    gol.safebuf < 7     ? DOW(gol.tluz)         : // show deadline day
    gol.safebuf < 365   ? gol.safebuf+'d'       : // show number of safe days
    gol.safebuf <= 999  ? gol.safebuf+'d'       : // way too much buffer
    gol.safebuf > 999   ? '>999d'               : // quasi-infinite buffer
                          '???'                   // can't actually happen

image