Commit Graph

11 Commits (92a609275b25c08cbb6f6cf409070d9407d7bbc8)

Author SHA1 Message Date
Tyler Goodlet 92a609275b Take outer-interval values in `Viz.datums_range()` 2023-02-02 16:11:31 -05:00
Tyler Goodlet 6b35484bce Better index step value scanning by checking with our expected set 2023-02-02 16:00:39 -05:00
Tyler Goodlet d7b9c4044e Further fixes `Viz.default_view()` and `.index_step()`
Use proper uppx scaling when either of scaling the data to the x-domain
index-range or when the uppx is < 1 (now that we support it) such that
both the fast and slow chart always appropriately scale and offset to
the y-axis with the last datum graphic just adjacent to the order line
arrow markers.

Further this fixes the `.index_step()` calc to use the "earliest" 16
values to compute the expected sample step diff since the last set often
contained gaps due to start up race conditions and generated
unexpected/incorrect output.

Further this drops the `.curve_width_pxs()` method and replaces it with
`.px_width()`, taken from the graphics object API and instead returns
the pixel account for the whole view width instead of the
x-domain-data-range within the view.
2023-02-02 15:29:56 -05:00
Tyler Goodlet 9a65cbbf5c Just-offset-from-arrow-marker on slow chart
We want the fast and slow chart to behave the same on calls to
`Viz.default_view()` so adjust the offset calc to make both work:
- just offset by the line len regardless of step / uppx
- add back the `should_line: bool` output from `render_bar_items()` (and
  use it to set a new `ds_allowed: bool` guard variable) so that we can
  bypass calling the m4 downsampler unless the bars have been switched
  to the interpolation line graphic (which we normally required before
  any downsampling of OHLC graphics data).

Further, this drops use of the `use_vr: bool` flag from all rendering
since we pretty much always use it by default.
2023-02-02 15:29:56 -05:00
Tyler Goodlet efc16a7fb4 Use `np.diff()` on last 16 samples instead of only last datum pair 2023-02-02 15:06:32 -05:00
Tyler Goodlet 12f61f0d75 Make `Viz.incr_info()` do treading with time-index, and appending with array-index 2023-02-02 15:06:32 -05:00
Tyler Goodlet 359a0e1ae3 Rename `reset` -> `reset_cache` 2023-02-02 15:06:32 -05:00
Tyler Goodlet 00a0caa963 Make `Viz.incr_info()` sample rate agnostic
Mainly it was the global (should we )increment logic that needs to be
independent for the fast vs. slow chart such that the slow isn't
update-shifted by the fast and vice versa. We do this using a new
`'i_last_slow'` key in the `DisplayState.globalz: dict` which is
singleton for each sample-rate-specific chart and works for both time
and array indexing.

Also, we drop some old commented `graphics.draw_last_datum()` code that
never ended up being needed again inside the coordinate cache reset
bloc.
2023-02-02 15:06:32 -05:00
Tyler Goodlet e9ca618fcb `Viz._index_field` a `typing.Literal[str]` 2023-02-02 15:06:32 -05:00
Tyler Goodlet 1a3e2c33d9 Move `DisplayState.incr_info()` -> `Viz` 2023-02-02 15:06:32 -05:00
Tyler Goodlet af3cd9faa0 Move `Viz` layer to new `.ui` mod 2023-02-02 15:06:32 -05:00