Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add top species chart to overview page #580

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

vanessavmac
Copy link
Collaborator

  1. Add the top species chart to the project overview
  2. Flip the chart so the top species count is on top rather than the bottom

@vanessavmac vanessavmac linked an issue Sep 17, 2024 that may be closed by this pull request
@vanessavmac vanessavmac self-assigned this Sep 17, 2024
Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for ami-dev ready!

Name Link
🔨 Latest commit c49176c
🔍 Latest deploy log https://app.netlify.com/sites/ami-dev/deploys/6747dc1849a9060008f9c1d0
😎 Deploy Preview https://deploy-preview-580--ami-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73
Accessibility: 89
Best Practices: 92
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for ami-storybook ready!

Name Link
🔨 Latest commit 634dbbf
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/66eadb2e54c5600008a83866
😎 Deploy Preview https://deploy-preview-580--ami-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

…o 387-add-top-species-chart-to-overview-page
@@ -269,7 +269,7 @@ def event_top_taxa(event_pk: int, top_n: int = 10):
.values("name")
# .annotate(num_detections=models.Count("occurrences__detections"))
.annotate(num_detections=models.Count("occurrences"))
.order_by("-num_detections")[:top_n]
.order_by("num_detections")[:top_n]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this lowest to highest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I just tested out the chart by modifying the species count and made the corrected changes. Here's an example top species chart:
Screenshot 2024-09-18 at 9 51 26 AM

If top_n=1, then it looks like this:
Screenshot 2024-09-18 at 9 53 02 AM

Note, this is what the test data looks like which modified here.
Screenshot 2024-09-18 at 9 54 42 AM

@mihow Is the plot showing the correct data? I thought that the plot would show 2 occurrences of Vanessa atalanta and 1 occurrence of Vanessa itea?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vanessa,

The TEST_TAXA_CSV_DATA is for Taxon entries, not Occurrence entries. So adding duplicates there won't have the effect you are looking for.

The charts are showing which occurrences have been IDed to which Taxa. In the test data, you want to modify the number of occurrences that are generated for each taxon, rather than the taxonomy choices, if that makes sense?

Also if you make your self "is_staff" in the Django admin, then you can modify the occurrence IDs pretty quickly without regenerating. But I like both approaches (the test data should have different numbers of IDs for different species).

@mihow
Copy link
Collaborator

mihow commented Nov 28, 2024

@vanessavmac I'm not seeing the top species chart on the Project overview page. Did it get lost in a merge?

@mihow mihow changed the title 387 add top species chart to overview page Add top species chart to overview page Nov 28, 2024
Copy link
Collaborator

@mihow mihow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not seeing the top species chart in the project overview page, at least in the deploy preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add top species chart to overview page
2 participants