pub struct Chart(/* private fields */);Expand description
A chart component for data visualization.
Supports line charts (braille rendering with shared axes), vertical bar charts, horizontal bar charts, area charts (filled line), and scatter plots with multiple data series, threshold lines, logarithmic scaling, smart tick labels, LTTB downsampling, and manual Y-axis scaling.
§Key Bindings
Tab— Cycle to next seriesBackTab— Cycle to previous seriesLeft/h— Move crosshair cursor leftRight/l— Move crosshair cursor rightHome— Move crosshair cursor to startEnd— Move crosshair cursor to endc— Toggle crosshair cursor visibilityg— Toggle grid line visibility
Trait Implementations§
Source§impl Component for Chart
impl Component for Chart
Source§type State = ChartState
type State = ChartState
The component’s internal state type. Read more
Source§type Message = ChartMessage
type Message = ChartMessage
Messages this component can receive. Read more
Source§type Output = ChartOutput
type Output = ChartOutput
Messages this component can emit to its parent. Read more
Source§fn handle_event(
_state: &Self::State,
event: &Event,
ctx: &EventContext,
) -> Option<Self::Message>
fn handle_event( _state: &Self::State, event: &Event, ctx: &EventContext, ) -> Option<Self::Message>
Maps an input event to a component message. Read more
Source§fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
Update component state based on a message. Read more
Source§fn view(state: &Self::State, ctx: &mut RenderContext<'_, '_>)
fn view(state: &Self::State, ctx: &mut RenderContext<'_, '_>)
Render the component to the given area. Read more
Source§fn traced_view(state: &Self::State, ctx: &mut RenderContext<'_, '_>)
fn traced_view(state: &Self::State, ctx: &mut RenderContext<'_, '_>)
Renders the component with optional tracing instrumentation. Read more
Source§fn dispatch_event(
state: &mut Self::State,
event: &Event,
ctx: &EventContext,
) -> Option<Self::Output>
fn dispatch_event( state: &mut Self::State, event: &Event, ctx: &EventContext, ) -> Option<Self::Output>
Dispatches an event by mapping it to a message and updating state. Read more
Auto Trait Implementations§
impl Freeze for Chart
impl RefUnwindSafe for Chart
impl Send for Chart
impl Sync for Chart
impl Unpin for Chart
impl UnsafeUnpin for Chart
impl UnwindSafe for Chart
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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