Commit Graph

12 Commits (9d3de6ec02429158a22af4a6924683f834f32859)

Author SHA1 Message Date
Tyler Goodlet 9d3de6ec02 Drop x-range query from `ChartPlotWidget.maxmin()`
Move the `Viz.datums_range()` call into `Viz.maxmin()` itself thus
minimizing the chart `.maxmin()` method to an ultra light wrapper around
the viz call. Also move all profiling into the `Viz` method.

Adjust `Viz.maxmin()` to return both the (rounded) x-range values which
correspond to the range containing the y-domain min and max so that
it can be used for up and coming overlay group maxmin calcs.
2023-01-14 16:11:25 -05:00
Tyler Goodlet 63d773d77a Take outer-interval values in `Viz.datums_range()` 2023-01-13 13:24:26 -05:00
Tyler Goodlet 84e2e881d5 Better index step value scanning by checking with our expected set 2023-01-13 13:24:26 -05:00
Tyler Goodlet 6796021663 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-01-13 13:24:26 -05:00
Tyler Goodlet d9df39c458 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-01-13 13:24:25 -05:00
Tyler Goodlet 7455facdde Use `np.diff()` on last 16 samples instead of only last datum pair 2023-01-13 13:24:25 -05:00
Tyler Goodlet 6da6881ec4 Make `Viz.incr_info()` do treading with time-index, and appending with array-index 2023-01-13 13:24:25 -05:00
Tyler Goodlet 5e75b46665 Rename `reset` -> `reset_cache` 2023-01-13 13:24:25 -05:00
Tyler Goodlet a0156f010a 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-01-13 13:24:25 -05:00
Tyler Goodlet 7a2bdfbbb9 `Viz._index_field` a `typing.Literal[str]` 2023-01-13 13:24:25 -05:00
Tyler Goodlet 4caf121242 Move `DisplayState.incr_info()` -> `Viz` 2023-01-13 13:24:25 -05:00
Tyler Goodlet 66cfaa9c4b Move `Viz` layer to new `.ui` mod 2023-01-13 13:24:25 -05:00