Giter VIP home page Giter VIP logo

phylopic's Introduction

PhyloPic

PhyloPic is an open database of freely reusable silhouettes of life forms. Code for PhyloPic resides in this monorepo.

Most of the code for PhyloPic is TypeScript.

Projects

Apps

Project Path Description
api Serverless API for accessing PhyloPic data
api-docs Documentation for the PhyloPic API
contribute Public webapp for contributing silhouette images
edit Private webapp (run locally) for managing PhyloPic, including contribution review and data editing
publish Code for administrating PhyloPic, including publishing releases and managing source files
www Public webapp for searching for and viewing silhouette images

Packages

Project Path Description
api-models Type declarations and utility files for data models used by the API
eslint-config-phylopic ESLint configurations used throughout the project
source-client Client object for reading and writing source models and files
source-models Type declarations and utility files for data models used in the source bucket
styles Stylesheet values and mixins
tsconfig Typescript configurations used throughout the project
ui Commonly-used React components for user interfaces
utils Common code
utils-api Common code related to using the API in a webapp
utils-aws Common code related to Amazon Web Services

Database scripts

The scripts for creating the project's Postgres databases are in sql.

Getting started

Install Yarn, and then run yarn from the command root to install dependencies.

Formatting and linting

To clean up formatting for all source files in all projects, run:

yarn format

To lint all source files and automatically fix certain issues:

yarn lint

Testing

To run unit tests in all projects that have them:

yarn test

Running locally

To run all apps locally:

yarn dev

Note that some apps require certain environment variables to be set, which are documented in that apps's README file.

Apps will run on the following ports:

App Project Port
api 3003
contribute 3002
edit 3001
www 3000

Releasing versions

The semantic versioning of the monorepo is only updated when root dependencies are updated (for example, turborepo), or potentially when major changes are made. To create a new version:

  • Update version in package.json.
  • Update CHANGELOG.md, moving all [Unreleased] items into a new entry for the new version.
  • Commit the changes.
  • Tag the commit with @phylopic/v[M].[m].[p], where [M], [m], and [p] are integers denoting the major version, minor version, and patch version, respectively. Example: @phylopic/v2.0.9. Push the tag to origin.

Apps and packages

Each subproject (app or package) has its own semantic versioning. To release a new version:

  • Update version in the subproject's package.json.
  • Update the subproject's CHANGELOG.md, moving all [Unreleased] items into a new entry for the new version.
  • Commit the changes.
  • Tag the commit with @phylopic/[subproject]/v[M].[m].[p], where [subproject] is the name of the project (for example, www) and [M], [m], and [p] are integers denoting the major version, minor version, and patch version, respectively. Example: @phylopic/www/v2.6.12. Push the tag to origin.
  • For apps, publish the new version:
    • For api or api-docs, run yarn deploy.
    • For contribute, reset the @phylopic/contribute/prod branch to the release's commit and push to origin. Deployment can be monitored in Vercel.
    • For www, reset the @phylopic/www/prod branch to the release's commit and push to origin. Deployment can be monitored in Vercel.
    • No action is necessary for edit or publish, which are only run locally.

Contributing

To contribute to the development of PhyloPic, please read the guidelines in CONTRIBUTING.md and contact Mike Keesey ([email protected]). The repository is open and may be forked, with pull requests made back into the original repository.

Further documentation

phylopic's People

Contributors

keesey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

phylopic's Issues

Increased incidence of 504 Gateway Timeout errors

I and others are seeing an increase in the number of 504 Gateway Timeout errors from the API lately. The website traffic has not changed significantly recently (and was much higher at launch), and there haven't been any major updates to the API (apart from a couple of new filters for images), so I'm pretty sure it's due to increased usage of the public API. In particular I think it is the /resolve/{authority}/{namespace} method, which, being a POST call, doesn't get cached in CloudFront like most other calls.

I think I am going to have to deprecate POST in favor of a GET alternative for that call.

Some svgs have white backgrounds

I've discovered that some phylopic svgs have white background layers, e.g.:
https://images.phylopic.org/images/eedde61f-3402-4f7c-9350-49b74f5e1dba/vector.svg
https://images.phylopic.org/images/2de1c95c-7e1f-429b-9c08-17f0a27d176f/vector.svg

This isn't normally an issue for general use, but when you try to programmatically change the color of the silhouette (e.g., in rphylopic), there isn't an easy way to identify which layers are the background and which layers are the foreground, so you end up coloring all of them, which makes a lovely colored rectangle.

In my experience most phylopic svgs seem to have no background layers, so this seems like an abnormality, but I don't know how to programmatically find all of the uuids for phylopics that have svgs with backgrounds. Let me know if there's any way I can help further.

External Search shows double names sometimes

Sometimes external search (e.g., Open Tree of Life) returns a name that is the same as the PhyloPic containing taxon's name, e.g., Homo sapiens / Homo sapiens. These should be condensed (including cases where the names are the same when ancillary name info is ignored: comment, citation, rank).

Image misclassified

Not certain if this is the correct place to report misclassified images, but here goes:

https://www.phylopic.org/images/788379fa-8762-4dbd-b486-8632db474b58/monopis-crocicapitella
Is incorrectly listed as a moth when it is a bird.

The following image has been uploaded as both a generic and specific silhouette
https://www.phylopic.org/images/cc3278ac-31b9-44f1-bf93-5bcd5f45b2ff/scaptotrigona
https://www.phylopic.org/images/c516108a-f247-41e9-9252-4e1cc405eace/scaptotrigona-polysticta

Rigid Paging

Instead of passing start and length to list endpoints, pass page

Query API v2 for images modified within a range

Hello! I'm one of the maintainers of Openverse, a search engine for openly licensed media on the web. Phylopic is one of the sources of CC images we ingest regularly, and unfortunately our ingestion broke with the move to the API v2.

In our exploration regarding what it would take to migrate (issue here: WordPress/openverse#1288), it doesn't look like there's a way to query images which were modified within a certain date range. The previous URLs looked something like http://phylopic.org/api/a/image/list/modified/2023-02-12/2023-02-13 (and documentation to the method in question was here http://phylopic.org/api/#method-image-time-range, although that link no longer works after the v2 migration).

I may be misinterpreting what's possible with the new API, and forgive me if this is the wrong place to ask, but - is it possible using v2 to query images by modification date? It seems like that information might be captured on the Image model itself, but I wasn't able to find a field reference for it in the API (I'm also no TypeScript aficionado ๐Ÿ˜…). We'd love to continue updating our index in this fashion if it's possible to do so!

Fetching licenses

Hi Mike,

We have been working a little more on our rphylopic R package and we want to make it easier for users to get attribution data for silhouettes. The API endpoint /licenses helps facilitate this for more recent phylopic submissions, but it does not provide all licenses within the database. I was wondering if there were any plans to make all available licenses accessible? Currently we've hardcoded all licenses available but would prefer to fetch them from phylopic if possible in the future.

Thanks for all your work!

Lewis

Links to https://training.paleobiodb.org/ should go to https://paleobiodb.org/

There are quite a few links on the documentation pages that refer to https://training.paleobiodb.org/. That server is intended for training purposes (as the name suggests) and its database does not contain all of the latest data. All of these links need to be changed so that they point to our main server at https://paleobiodb.org/, which provides the same functionality and executes queries against the latest version of the database.

Error: There is a problem with the website (unexpected data structure).

Dear Mike Keesey,

I wanted to browse through the website today, and while phylogenetic browsing still works (both in phylopic.org as in the beta version), the actual silhouette images don't show up and I get the following error:

Error: There is a problem with the website (unexpected data structure).

Thank you for devoting your time to create Phylopic,
Emmelien

Image warped/cropped wrong

Hello, thanks so much for this wonderful resource. I've recently been uploading some diatoms illustrations to the site.

I noticed that a few of my accepted submissions have some warping/cropping issues.

  1. Thalassiosira pseudonana seems to have gotten warped, a center part of the drawing has been shrunk and shifted over from my original illustration.

  2. When creating my illustrations in inkscape, I left some real microscopy images of diatoms outside of the page. These did not show up in the preview when uploading, but seem to show up on the actual organism pages themselves (see seminavis robusta)

Is there any way to retract or fix the images? I'm happy to remove images at the margins and re-upload, but I have no idea how to fix the issue with T. pseudonana

SVGs with superfluous paths

I was browsing through various SVGs, when I noticed that this one was significantly larger than most other PhyloPic svgs:
https://images.phylopic.org/images/347bc4ab-c1e0-4313-9ea1-939c2ad71232/vector.svg. This fungus one, which (to the untrained eye) just looks like 2 ovals, is ~193 KB, while one for a more complicated (polygon-wise) macaque is only 59KB and one for a chicken is even smaller at 13 KB.

Upon further investigation, I noticed that the fungus SVG has many seemingly superfluous paths which are transparent. When those paths are removed, the SVG reduces in size to only 50 KB, much more in line with the sizes of other PhyloPic SVGs. Perhaps this is related to the auto-svg tool on PhyloPic.org?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.