diff --git a/ami/main/charts.py b/ami/main/charts.py index 352e2e2ac..9cdd32d6f 100644 --- a/ami/main/charts.py +++ b/ami/main/charts.py @@ -273,7 +273,7 @@ def event_top_taxa(event_pk: int, top_n: int = 10): ) if top_taxa: - taxa, counts = list(zip(*[(t["name"], t["num_detections"]) for t in top_taxa])) + taxa, counts = list(zip(*[(t["name"], t["num_detections"]) for t in reversed(top_taxa)])) taxa = [t or "Unknown" for t in taxa] counts = [c or 0 for c in counts] else: diff --git a/ami/main/models.py b/ami/main/models.py index 84a7e3bf1..88bd17274 100644 --- a/ami/main/models.py +++ b/ami/main/models.py @@ -133,6 +133,8 @@ def summary_data(self): if self.occurrences.exists(): plots.append(charts.detections_per_hour(project_pk=self.pk)) plots.append(charts.occurrences_accumulated(project_pk=self.pk)) + # print(self.pk) + plots.append(charts.event_top_taxa(event_pk=self.pk)) else: plots.append(charts.events_per_month(project_pk=self.pk)) # plots.append(charts.captures_per_month(project_pk=self.pk)) diff --git a/ui/src/data-services/models/project.ts b/ui/src/data-services/models/project.ts index 463b67fd6..8dc436946 100644 --- a/ui/src/data-services/models/project.ts +++ b/ui/src/data-services/models/project.ts @@ -12,6 +12,7 @@ interface SummaryData { ticktext?: string[] } type: any + orientation: 'h' | 'v' } export class Project { diff --git a/ui/src/pages/overview/summary/summary.tsx b/ui/src/pages/overview/summary/summary.tsx index 975dae7fa..893c2c287 100644 --- a/ui/src/pages/overview/summary/summary.tsx +++ b/ui/src/pages/overview/summary/summary.tsx @@ -7,7 +7,12 @@ export const Summary = ({ project }: { project: Project }) => ( {project.summaryData.map((summary, index) => ( - + ))}