MCPcopy Create free account
hub / github.com/emilk/egui_plot / thingy

Method thingy

examples/lines/src/app.rs:136–158  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

134 }
135
136 fn thingy(&self) -> Line<'_> {
137 let mut line = Line::new(
138 "parametric",
139 PlotPoints::from_parametric_callback(
140 move |t| ((2.0 * t + self.time).sin(), (3. * t).sin()),
141 0.0..=TAU,
142 256,
143 ),
144 )
145 .style(self.line_style);
146 if self.gradient {
147 line = line.gradient_color(
148 Arc::new(|p| egui::Color32::BLUE.lerp_to_gamma(egui::Color32::ORANGE, p.x.abs().clamp(0., 1.) as f32)),
149 self.gradient_fill,
150 );
151 if self.gradient_fill {
152 line = line.fill(0.);
153 }
154 } else {
155 line = line.color(egui::Color32::from_rgb(100, 150, 250));
156 }
157 line
158 }
159
160 pub fn show_plot(&mut self, ui: &mut egui::Ui) -> Response {
161 if self.animate {

Callers 1

show_plotMethod · 0.80

Calls 5

gradient_colorMethod · 0.80
styleMethod · 0.45
sinMethod · 0.45
fillMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected