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

@ebi-gene-expression-group/organ-anatomogram

v1.1.0

Published

Organ anatomogram component for Expression Atlas heatmap

Downloads

12

Readme

Single Cell Expression Atlas Organ Anatomogram

Build Status Coverage Status License License: CC BY 4.0

This is an organ anatomogram for Single Cell Expression Atlas that we use to illustrate the experiments.

See demo here.

The ontology IDs are sourced from Uberon, EFO and Plant Ontology.

To install: npm install --save @ebi-gene-expression-group/organ-anatomogram

You can use it as a React component:

import Anatomogram from '@ebi-gene-expression-group/organ-anatomogram'

...

<Anatomogram .../>

Alternatively, if you don’t use React we’re providing a convenience render method:

import {render} from '@ebi-gene-expression-group/organ-anatomogram'

...

render(options, target)

Where options are the props passed as an object, and target is an ID of the DOM element that will contain the anatomogram.

For example code, have a look at the demo component and how we use it in our Expression Atlas Heatmap. If you want to see it in action, go to an organism part experiment in Atlas or a search that returns organism part experiments.

Props

| Name | Type | Default value | Description | |------------------|----------|:--------------:|----------------------------------------------------------------------| | species | string | - | Required. This is the only props needed to be declared for testing. Specify the species or the organ shown in the page | | showIds | array | [] | | | highlightIds | array | [] | | | selectIds | array | [] | | | showColour | string | grey | | | highlightColour | string | red | | | selectColour | string | purple | | | showOpacity | number | 0.4 | | | highlightOpacity | number | 0.4 | | | selectOpacity | number | 0.4 | | | onMouseOver | function | () => {} | Required, but with default value. Callback invoked when the mouse is hovered on a tissue | | onMouseOut | function | () => {} | Required, but with default value. Callback invoked when the mouse is hovered off a tissue | | onClick | function | () => {} | Required, but with default value. Callback invoked when a tissue is clicked | | onInjected | function | () => {} | Callback invoked when SVG is injected |

For a list of available species and IDs have a look at src/json/svgsMetadata.json. The file is automatically generated every time the package is published.

All three callbacks take a single string argument, the ID of the tissue affected by the mouse event.

The state of a tissue is either not shown, shown, highlighted or selected. On mouseover the opacity is increased by 0.2. You can read a more technically inclined description of the anatomogram behaviour in the repository wiki.

Building

To use the anatomogram in a browser you need to build and bundle the package:

npm run dist -- --output-public-path='<URL>'

<URL> is the URL (absolute or relative) from which you’ll be serving the anatomogram (e.g. /anatomogram/dist/ for the gh-pages branch we use to build the demo page). Remember to append a final slash! This is required so that the code knows where to look for static assets (i.e. SVGs and PNGs). You can read more about this option in Webpack’s documentation site.

After building, deployment of anatomogramDemo.bundle.js is optional, only if you want to host the demo component.

Include the following in your HTML:

<script src="<URL>/vendors.bundle.js"></script>
<script src="<URL>/anatomogram.bundle.js"></script>

<script>
anatomogram.render(options, target)
</script>

Building for a particular species

You can take out all the unnecessary SVGs and PNGs and change Anatomogram.defaultProps.species to any of the supported species. You can see an example in the mouse branch.

Contribute

Read carefully our authoring guidelines before adding new tissues or updating IDs in an existing anatomogram or adding a new SVG.

Run npm run parseSvgs to parse the updated IDs. When you are finished run a local copy of the demo page:

rm -rf node-modules
npm install
npx webpack-dev-server -d

Go to localhost:9000 and see that the tissues show up like you want them to.

Licence

Code is distributed under the Apache License version 2.0. All images, anatomograms and switcher icons, are distributed under the Creative Commons Attribution 4.0 International license.