Explorar el Código

feat: footprint chart no longer relies on other charts

Berke hace 1 año
padre
commit
7219104041
Se han modificado 1 ficheros con 8 adiciones y 16 borrados
  1. 8 16
      src/main.rs

+ 8 - 16
src/main.rs

@@ -432,13 +432,9 @@ impl State {
             Message::SetMinTickSize(min_tick_size) => {
                 self.min_tick_size = Some(min_tick_size);
 
-                if let Some(heatmap_chart) = &mut self.heatmap_chart {
-                    let copied_trades = heatmap_chart.get_raw_trades();
-
-                    if let Some(footprint_chart) = &mut self.footprint_chart {
-                        let tick_size = self.tick_multiply.multiply_with_min_tick_size(self.min_tick_size.unwrap_or(1.0));
-                        footprint_chart.change_tick_size(copied_trades, tick_size);
-                    }
+                if let Some(footprint_chart) = &mut self.footprint_chart {
+                    let tick_size = self.tick_multiply.multiply_with_min_tick_size(self.min_tick_size.unwrap_or(1.0));
+                    footprint_chart.change_tick_size(tick_size);
                 }
 
                 Task::none()
@@ -454,15 +450,11 @@ impl State {
                 Task::none()
             },
             Message::TicksizeSelected(tick_multiply) => {
-                if let Some(heatmap_chart) = &mut self.heatmap_chart {
-                    let copied_trades = heatmap_chart.get_raw_trades();
-            
-                    if let Some(footprint_chart) = &mut self.footprint_chart {
-                        let tick_size = tick_multiply.multiply_with_min_tick_size(self.min_tick_size.unwrap_or(1.0));
-                        footprint_chart.change_tick_size(copied_trades, tick_size);
-            
-                        self.tick_multiply = tick_multiply;
-                    }
+                if let Some(footprint_chart) = &mut self.footprint_chart {
+                    let tick_size = tick_multiply.multiply_with_min_tick_size(self.min_tick_size.unwrap_or(1.0));
+                    footprint_chart.change_tick_size(tick_size);
+        
+                    self.tick_multiply = tick_multiply;
                 }
             
                 Task::none()