Skip to content

Add time aggregation options for HeatmapChart#48

Merged
akenshaw merged 27 commits intomainfrom
heatmap-aggr-cfg
May 15, 2025
Merged

Add time aggregation options for HeatmapChart#48
akenshaw merged 27 commits intomainfrom
heatmap-aggr-cfg

Conversation

@akenshaw
Copy link
Copy Markdown
Member

@akenshaw akenshaw commented May 12, 2025

This PR brings time aggregation levels to HeatmapChart user 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 efficient

To 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 KlineChart as 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 phase

This also opens up the possibility for a future implementation to use Binance's depth@0ms stream, 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)

image

akenshaw added 27 commits May 8, 2025 10:07
-- prevent interactions setting up the last render time
@akenshaw akenshaw marked this pull request as ready for review May 15, 2025 09:43
@akenshaw akenshaw merged commit 66c8957 into main May 15, 2025
@akenshaw akenshaw deleted the heatmap-aggr-cfg branch May 15, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant