Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try m4 algo for OHLC flattened line tracer? #324

Open
Tracked by #416
goodboy opened this issue Jun 4, 2022 · 1 comment
Open
Tracked by #416

Try m4 algo for OHLC flattened line tracer? #324

goodboy opened this issue Jun 4, 2022 · 1 comment
Labels
data-layer real-time and historical data processing and storage graphics (charting related) geometry chops

Comments

@goodboy
Copy link
Contributor

goodboy commented Jun 4, 2022

Currently our OHLC sampling (bars) graphics convert to a line curve when the user zooms out enough that you can't visually distinguish a bar's shape (uppx is way too high to represent them per horizonal pixel).

To convert to this line we currently use a structured array flattener routine which uses np.recfunctions.structure_to_unstructured(): ohlc_to_line().

In theory we can actually just use our m4 implementation to post-process either this flattened output or write an OHLC aware version which iterates the ['high', 'low'] fields of the input array when computing max/min values. In other words the y input could be pre-processed from another (numba) routine which flattens only the high/low values from the OHLC struct array and then feeds them into this same function. The caveat will be making sure the x input is sized to match 🤔

This is definitely not a high priority task but may be interesting to tinker with especially in the context of overloading ds_m4() for other types of aggregation schemes (eg. as we still need with vlm in #326).

@goodboy goodboy added data-layer real-time and historical data processing and storage viz graphics (charting related) geometry chops labels Jun 4, 2022
@goodboy goodboy mentioned this issue Jun 4, 2022
7 tasks
@goodboy goodboy removed the viz label Mar 23, 2023
@goodboy
Copy link
Contributor Author

goodboy commented Apr 27, 2023

As follow up after the huge rework in #420 and it's derivative child PRs (ending in #455), the 2 main spots that pertain to this are:

  • piker.data._pathops.ohlc_flatten() which is currently unused
  • and .path_arrays_from_ohlc() which is used in the rendering subsys for OHLC graphics downsampling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-layer real-time and historical data processing and storage graphics (charting related) geometry chops
Projects
None yet
Development

No branches or pull requests

1 participant