npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ai-taxonomist

v0.7.0

Published

Webcomponent ai-taxonomist following open-wc recommendations

Downloads

15,386

Readme


<ai-taxonomist>

A WebComponent within AI-Taxonomist project to identify plants|frog|anything in any web pages.

This WebComponent follows the open-wc recommendation.

Demo

DEMO: plantnet.org/ai-taxonomist-demo/

Recommended usage

  1. Get an API Key for Pl@ntNet here.
  2. Allow the domains on your Pl@ntNet account, for http://localhost:8000 for local development or https://example.com for production website here.
  3. There are several ways to use the web components:
    1. Within a web page in HTML (example: a WordPress or a static website)
    <script src="https://unpkg.com/ai-taxonomist/dist/src/index.js?module" type="module"></script>
    <ai-taxonomist apiKey="YOUR_API_KEY"></ai-taxonomist>
    1. Within a JavaScript project (React, Vue, Svelte, Angular, etc):
      • a. Install the package: npm i ai-taxonomist
      • b. Import the package: import 'ai-taxonomist';
      • c. Add the component: <ai-taxonomist apiKey="YOUR_API_KEY"></ai-taxonomist>

Advanced usage

You can also use your own server, for this you can specify the server endpoint like so:

    <ai-taxonomist apiUrl="https://api.example.com/v2/identify" apiKey="XXXXXXXXX"></ai-taxonomist>    

Options

  • apiUrl: (default: https://my-api.plantnet.org/v2/identify/all) the server url to call, either local or remote
    Example with a Local url (the server will need to add the API key):
    <ai-taxonomist apiUrl="http://localhost:3000"></ai-taxonomist>
  • apiKey: the API key to use, if not added by the server. On Pl@ntNet API you currently cannot use the apiKey directly due to CORS being checked (so you need to add a proxy at least, cf server nginx config).
    Example for Pl@ntNet:
    <ai-taxonomist apiUrl="https://my-api.plantnet.org/v2/identify/all" apiKey="XXXXXXXXX"></ai-taxonomist>
  • backendFormat: (default: pn) backend format of the API: pn (PlantNet), c4c (Cos4Cloud) or carp (CARPESO)
  • maxImages: The number of images the user can upload for a single identification, default to 5.
  • removePlantNetBranding: (default: false) if true, the component will not display the PlantNet logo and the link to the PlantNet website.
  • Attachments: You can attach HTML elements to each result, for example if you want to let the user select the correct taxon. This can be achieve using an HTML <template> as follows:
     <template id="aitaxonomist-attachments-template">
         <style>
             button {
                border: 1px solid #8888FF;
                background: transparent;
             }
             button:hover {
                filter: brightness(1.2);
             }
         </style>
         <button>SELECT SPECIES</button>
     </template>
    <ai-taxonomist> </ai-taxonomist>
    You should NOT attach a click listener on your side. The AiTaxonomist component will listen for the click and fire a new event named aiTaxonomistAttachmentsClick which contain the selected taxon details in event.detail:
    document.addEventListener('aiTaxonomistAttachmentsClick', (e) => {
        alert('Attachments clicked: ' + e.detail.taxonName)
    })
    The detail will contain the properties listed on ResultType.

Styling

  • Dark Mode: you can override dark mode by specifying either prefer-dark or prefer-light in the <ai-taxonomist> class element. Doing so will either force the dark/light mode to stay in dark/light mode no matter what the user preference is.

Development / contributions

Start the development server

npm start

This should open http://localhost:8000 in your browser.

Linting and formatting

To scan the project for linting and formatting errors, run npm run lint

To automatically fix linting and formatting errors, run npm run format

Release

Update the version:

npm version major|minor|patch

Publish the version pn NPM:

npm publish