@ebi-gene-expression-group/anatomogram

中文文档
2.4.0发布于 2019/12/12Apache-2.0CommonJS近 30 天下载 1.2万

Anatomogram component for Expression Atlas heatmap

原始使用文档
文档目录4 节
  1. Props
  2. Building
  3. Building for a particular species
  4. Contribute

Expression Atlas Anatomogram

Build Status Coverage Status License License: CC BY 4.0

This is an anatomogram for 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/anatomogram

You can use it as a React component:

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

...

<Anatomogram .../>

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

import {render} from '@ebi-gene-expression-group/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

NameTypeDefault valueDescription
speciesstring-This is the only required attribute of the anatomogram
showIdsarray[]
highlightIdsarray[]
selectIdsarray[]
showColourstringgrey
highlightColourstringred
selectColourstringpurple
showOpacitynumber0.4
highlightOpacitynumber0.4
selectOpacitynumber0.4
onMouseOverfunction() => {}Callback invoked when the mouse is hovered on a tissue
onMouseOutfunction() => {}Callback invoked when the mouse is hovered off a tissue
onClickfunction() => {}Callback invoked when a tissue is clicked
onInjectedfunction() => {}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:

npx webpack-dev-server

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.

版本与发布记录

@ebi-gene-expression-group/anatomogram 共发布 4 个版本,首次发布于 2019/10/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.4.0latest2019/12/126 年前
2.2.12019/11/017 年前
2.2.02019/10/037 年前
2.1.22019/10/027 年前

关于 @ebi-gene-expression-group/anatomogram 的常见问题

@ebi-gene-expression-group/anatomogram 是什么?

Anatomogram component for Expression Atlas heatmap

如何安装 @ebi-gene-expression-group/anatomogram?

在项目目录运行 npm install @ebi-gene-expression-group/anatomogram,或使用 pnpm add / yarn add / bun add。

@ebi-gene-expression-group/anatomogram 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ebi-gene-expression-group__anatomogram 是否存在。

@ebi-gene-expression-group/anatomogram 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@ebi-gene-expression-group/anatomogram 可以商用吗?

@ebi-gene-expression-group/anatomogram 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ebi-gene-expression-group/anatomogram 的下载量有多少?

根据 npm 官方下载统计,@ebi-gene-expression-group/anatomogram 在 2026/10/13 – 2026/11/11 这 30 天内被下载 11,649 次,日均约 388 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ebi-gene-expression-group/anatomogram 还在维护吗?

最新版本 2.4.0 发布于 2019/12/12(6 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。