Add time aggregation options for HeatmapChart#48
Merged
Conversation
-- prevent interactions setting up the last render time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings time aggregation levels to
HeatmapChartuser can choose from: 100ms, 200ms, 500ms and 1000ms. This was fixed to 100ms before, and was causing some inaccuracies with Bybit Spot pairs(limited at 200ms exchange side)Exchange connectors will still provide related streams at usual 100ms/200ms, data will still process at these intervals by
HeatmapChart. New aggregation options can provide more time range to be viewed in viewport, but will consume more render time depending on noise on the orderbook. So continuous rendering will rely on the aggregation interval the user has chosen to keep things efficientTo achieve this, i came up with a new "clock" implementation that is ticking at every 100ms on Iced's runtime, which is checking each chart's last render time and render again only if needed. So before, rendering was only happening if charts receive new data, now charts will render at fixed intervals. User interactions are still handled independently.
This should result more stability for
KlineChartas well, as kline streams from exchanges are usually at an irregular frequency, and most of the async operations were dependent on new data arrival to trigger. For example "timer to candle close" will tick more properly, or fetch operations will trigger at an expected phaseThis also opens up the possibility for a future implementation to use Binance's
depth@0msstream, so we can have lower aggregation intervals for Binance pairs, like 50ms or even 10ms(where we can achieve true 60+fps heatmap, not just with animating stuff)