Switch Heatmaps to be for each side respectively
The analysis and storage now contain two different heatmaps for the CT and T sides respectively. However on the frontend I currently just have them all listed out with the side as a prefix, which is not very useful and we should more change the data structure to essentially send the two heatmaps for a player as a single data structure and then in the view display them side by side. However I am not 100% how to best achieve this
This commit is contained in:
@@ -305,6 +305,7 @@ async fn heatmap(
|
||||
};
|
||||
|
||||
let data: Vec<common::demo_analysis::PlayerHeatmap> = result.into_iter().map(|(player, heatmap)| {
|
||||
let team = heatmap.team.clone();
|
||||
let mut heatmap: analysis::heatmap::HeatMap = serde_json::from_str(&heatmap.data).unwrap();
|
||||
heatmap.fit(minimap_coords.x_coord(0.0)..minimap_coords.x_coord(1024.0), minimap_coords.y_coord(1024.0)..minimap_coords.y_coord(0.0));
|
||||
let h_image = heatmap.as_image();
|
||||
@@ -314,6 +315,7 @@ async fn heatmap(
|
||||
|
||||
common::demo_analysis::PlayerHeatmap {
|
||||
name: player.name,
|
||||
team,
|
||||
png_data: base64::prelude::BASE64_STANDARD.encode(buffer.into_inner()),
|
||||
}
|
||||
}).collect();
|
||||
|
||||
Reference in New Issue
Block a user