diff --git a/pop_sim_rust_gui/src/main.rs b/pop_sim_rust_gui/src/main.rs index b716986..e082754 100644 --- a/pop_sim_rust_gui/src/main.rs +++ b/pop_sim_rust_gui/src/main.rs @@ -42,6 +42,7 @@ pub enum Sex { struct Sim { population: i64, people: Vec, + graph_data: Vec<[f64; 2]>, } #[derive(Debug)] @@ -55,7 +56,6 @@ pub struct World { struct Checks { data: Vec, start_months: i32, - graph_data: Vec<[f64; 2]>, } @@ -241,7 +241,7 @@ fn main() { self.sim_data.update_details(); // Graph data pushing - self.checks.graph_data.push([self.checks.start_months as f64 - self.checks.data[1] as f64, self.sim_data.people.len() as f64]); + self.sim_data.graph_data.push([self.checks.start_months as f64 - self.checks.data[1] as f64, self.sim_data.people.len() as f64]); self.sim_data.people.retain(|person| person.age != -1); self.checks.data[1] -= 1; @@ -270,11 +270,15 @@ fn main() { // Plot which shows population through time egui::Window::new("Plot - Population against months").show(ctx, |ui| { - let data: PlotPoints = PlotPoints::new(self.checks.graph_data.clone()); + let data: PlotPoints = PlotPoints::new(self.sim_data.graph_data.clone()); let line = Line::new(data); - Plot::new("plot").view_aspect(2.0). - allow_drag(false).allow_scroll(false).allow_zoom(false). - show(ui, |plot_ui| plot_ui.line(line)); + Plot::new("plot").view_aspect(2.0) + .allow_drag(false) + .allow_scroll(false) + .allow_zoom(false) + .allow_boxed_zoom(false) + .allow_double_click_reset(false) + .show(ui, |plot_ui| plot_ui.line(line)); }); // A table with all the people in the simulation @@ -321,6 +325,7 @@ fn main() { sim_data: Sim { people: vec![], population: -1, + graph_data: vec![], }, world_data: World { name: "Earth", @@ -331,7 +336,6 @@ fn main() { checks: Checks { data: vec![0, 480, 0], start_months: 0, // To change this val just change Checks::data[1] - graph_data: vec![], }, } } diff --git a/world/target/.rustc_info.json b/world/target/.rustc_info.json index f57da0a..1802c24 100644 --- a/world/target/.rustc_info.json +++ b/world/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":4167461181641110981,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.68.0-nightly (ce85c9857 2022-12-30)\nbinary: rustc\ncommit-hash: ce85c98575e3016cf2007d90a85be321e592aa96\ncommit-date: 2022-12-30\nhost: x86_64-pc-windows-msvc\nrelease: 1.68.0-nightly\nLLVM version: 15.0.6\n","stderr":""},"15697416045686424142":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\n","stderr":""},"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Phonixed\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nwindows\n","stderr":""}},"successes":{}} \ No newline at end of file +{"rustc_fingerprint":3703614116936124184,"outputs":{"15697416045686424142":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.65.0 (897e37553 2022-11-02)\nbinary: rustc\ncommit-hash: 897e37553bba8b42751c67658967889d11ecd120\ncommit-date: 2022-11-02\nhost: x86_64-pc-windows-msvc\nrelease: 1.65.0\nLLVM version: 15.0.0\n","stderr":""},"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Phonixed\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nwindows\n","stderr":""}},"successes":{}} \ No newline at end of file