Opinionated, component-based TUI framework for Rust - declarative components, reconciliation, layout engine, focus, overlays, and rich widgets on top of ratatui.
usecrate::widgets::Chart;pubfnmeasure_chart(chart:&Chart)->(u16, u16){let max_points = chart
.series
.iter().map(|series|series.data.len()).max().unwrap_or(0).max(8);letmut w =(max_points asu16).min(120);if chart.y_axis.show {
w = w.saturating_add(8);}if chart.show_legend {
w = w.saturating_add(4);}letmut h =6u16;if chart.x_axis.show {
h = h.saturating_add(1);}if chart.show_legend {
h = h.saturating_add(1);}
w = w.saturating_add(chart.padding.horizontal());
h = h.saturating_add(chart.padding.vertical());if chart.border {
w = w.saturating_add(2);
h = h.saturating_add(2);}(w, h)}