Adjust the decoded-position bins to recognize that the position in the data is supposed to be the center of the range, rather than the top of the range.
Accordingly, treat the first position as half the bin width (since it's halfway between 0 and the end of the first bin) and use that value to compute the appropriate width to draw for all other bins.
Note that this isn't strictly accurate, as Eric told me it's theoretically possible that the first position might not be a bin that starts at 0, and it's possible for there to be small variations in the bin widths on different branches of the track. We've agreed that we can avoid worrying about those possibilities for now.
Bump the observed-position overlay down by 2 pixels so it doesn't run into the top of the overall window so much.
This does three things:
https://figurl.org/f?v=gs://figurl/franklab-views-dev1k&d=sha1://5ce6bd6dfce3932d2bde1a79b2a51ef39fab8e14&label=03f1-acausal-posterior&s={} includes all these changes except for the last one (which I didn't bother redeploying, as it's just changing the default of the
useState
hook totrue
instead offalse
; I have confirmed that it still works.)