pub struct LiquidityHeatmap {
pub config: LiquidityHeatmapConfig,
/* private fields */
}Expand description
A liquidity heatmap backed by bounded texture tiles. Retain it between frames.
Each column uses logarithmic contrast against its largest resting size unless Self::config
sets a shared full-intensity size. A cell whose largest recorded order reaches a size tier of
the OrderBookView takes that tier’s colour over its
shading. Empty prices and missing time periods stay transparent. Old columns release their
atlas slots; new or changed columns upload only their own texels. Changed colours, tiers or
appearance upload every held column once. No texture side exceeds the backend’s limit.
Fields§
§config: LiquidityHeatmapConfigCell brightness and size range, applied on the next render. Unchanged effective settings upload nothing; changed settings redraw every held column once.
Implementations§
Source§impl LiquidityHeatmap
impl LiquidityHeatmap
Sourcepub fn render(
&mut self,
painter: &Painter,
mapping: &ChartMapping,
history: &DepthHistory,
step: f64,
time_to_x: impl Fn(DateTime<Utc>) -> Option<f32>,
view: &OrderBookView,
colors: [Color32; 2],
)
pub fn render( &mut self, painter: &Painter, mapping: &ChartMapping, history: &DepthHistory, step: f64, time_to_x: impl Fn(DateTime<Utc>) -> Option<f32>, view: &OrderBookView, colors: [Color32; 2], )
Draws the history using the pane’s price mapping and the host’s time-to-x conversion.
step is the instrument tick size times the history’s ticks per row. view gives the size
tiers and their colours, as for the book profile, from the painter’s active theme when the
view sets none; its filter and profile do not apply, since
the history sampled the orders of its own
DepthHistoryConfig::orders. Buy and sell
colours follow the painter’s host; call with the same colours as the price series.
Trait Implementations§
Source§impl Default for LiquidityHeatmap
impl Default for LiquidityHeatmap
Source§fn default() -> LiquidityHeatmap
fn default() -> LiquidityHeatmap
Auto Trait Implementations§
impl !RefUnwindSafe for LiquidityHeatmap
impl !UnwindSafe for LiquidityHeatmap
impl Freeze for LiquidityHeatmap
impl Send for LiquidityHeatmap
impl Sync for LiquidityHeatmap
impl Unpin for LiquidityHeatmap
impl UnsafeUnpin for LiquidityHeatmap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more