beeminder / road

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

Tare tags: A better way to do odometer resets #216

Open dreeves opened 3 years ago

dreeves commented 3 years ago
### Desiderata
- [ ] Implement this
- [ ] Tweet the UVI(s)
- [ ] Unsnooze https://github.com/beeminder/beeminder/issues/2561

Instead of the odometer reset feature, you should mark datapoints as "TARE". Say a datapoint with value v is marked as a tare and let u be the previous y-value before v was entered. Then the actual value of v is disregarded (but remembered). The plotted value corresponding to v is still u and subsequent datapoints are measured as the delta from v and added to u. For example:

value entered value plotted note
0 TARE 0 doesn't matter if explicit TARE tag on initial "0"
20 20 first real datapoint
50 50 if this were kyoom-y we'd plot "70" but it's not
0 TARE 50 traditional odometer reset
10 60 odometer shows 10 + previous 50 = 60 total
15 65 again, add 50 to current odometer reading
100 TARE 65 ignore current reading of "100" but remember it
140 105 40 added from previous 100 so add it to 65

Or for the case of an initial nonzero datapoint:

value entered value plotted note
30 TARE 0 starting at "30" but treating it as zero
35 5 adding 5 since previous taring
40 10 and another 5 for 10 total
// -----------------------------------------------------------------------------
// Take a list of entered datapoint values, d, and a parallel list of booleans
// for whether to tare the corresponding value, t. Return the list of y-values.
function tareify(d, t) {
  let cd = 0 // cumulative delta to subtract
  return d.map((x, i) => {
    if (t[i]) cd += x - (i === 0 ? 0 : d[i-1])
    return x - cd
  })
}

This is a much better way to do the things described at https://forum.beeminder.com/t/restarting-odometer-to-non-zero-value/299/17?u=dreev

Cognata

Verbata: tare tags, death to the magical odometer reset feature, anti-magic violations,

dreeves commented 3 years ago

HT Madge Castle for possible syntax for this (and making an exhaustive list of the possibilities!).

The best candidate is like =120 which you can think of as overriding what's there with 120.

Madge's exhaustive list

* `=120` seems like the obvious choice; interpret as override what's there with 120 * `@120` like setting it "at" 120, though also reads as tagging/at-mentioning * `+120` no, arithmetic symbol * `-120` no, arithmetic symbol * `.120` no, arithmetic symbol * `/120` no, arithmetic symbol * `*120` no, arithmetic symbol * `~120` reads as "approximately" * `?120` seems like a tentative data point * `!120` reads as both "not" and, like, "alt-universe fanfic" (like barista!Draco), but also, "force it to this" * `#120` conflicts with hashtagging * `$120` conflicts with the money side of Beeminder aesthetically * `^120` conflicts with "today" syntax * `&120` i would interpret as "don't reset my odometer but i'm adding an extra 120" * `"120` conflicts with datapoint comment syntax (and looks ugly) * `'120` no, unbalanced * `` `120 `` no, unbalanced * `(120` no, unbalanced * `)120` no, unbalanced * `[120` no, unbalanced * `]120` no, unbalanced * `{120` no, unbalanced * `}120` no, unbalanced * `<120` no, unbalanced * `>120` no, unbalanced * `_120` sets the new "floor" to 120? but parses as a variable name; seems weird * `:120` conflicts with HH:MM:SS * `;120` kinda ugly * `|120` no * `,120` no, especially since commas are decimal points in some places

But... the expedient way to do this is with a magic hashtag (not to be confused with the bad kind of magic) in the datapoint comment.

dreeves commented 6 months ago

This has been coming up more lately. Bee is beeminding reading a stack of books, which mostly the existing odometer reset feature works fine for but one of the books she previously read like a 100 pages of so she wants to hit tare at page 100.

And then talking about this in the Discord today, how we really want the old feature from Draft for beeminding words added plus words deleted. I said:

if we add this #TARE tags feature, i think the workflow would be like so:

  1. have an URLminder goal for wordcount on a document
  2. compose, indite, lucubrate
  3. hit auto-fetch to make sure beeminder has the latest wordcount
  4. delete a chunk of text
  5. hit TARE
  6. go to step 2
  7. if you forget step 3, retrieve it or paste an equivalent block of text into a scratch area and then go to step 3