Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ami/main/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions ami/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions ui/src/data-services/models/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface SummaryData {
ticktext?: string[]
}
type: any
orientation: 'h' | 'v'
}

export class Project {
Expand Down
7 changes: 6 additions & 1 deletion ui/src/pages/overview/summary/summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export const Summary = ({ project }: { project: Project }) => (
<PlotGrid>
{project.summaryData.map((summary, index) => (
<Box key={index}>
<Plot title={summary.title} data={summary.data} type={summary.type} />
<Plot
title={summary.title}
data={summary.data}
orientation={summary.orientation}
type={summary.type}
/>
</Box>
))}
</PlotGrid>
Expand Down