Framework-agnostic biological & biochemical tooltips for HTML documents.
Bio Tooltips provides shared tooltip behavior plus entity-specific tooltip modules for genes, chemicals, and future biology-related entities such as variants.
Currently supported modules:
- Gene tooltips via MyGene.info
- Chemical tooltips via MyChem.info
npm install bio-tooltipsImport the shared stylesheet once:
import 'bio-tooltips/style.css';Use the MyGene.info adapter for gene symbols, species-aware lookup, summaries, pathways, transcripts, structures, and gene model visuals.
<span class="gene-tooltip" data-species="human">TP53</span>
<span class="gene-tooltip" data-species="mouse">Trp53</span>import { GeneTooltip } from 'bio-tooltips/mygene';
GeneTooltip.init({
selector: '.gene-tooltip'
});Use the MyChem.info adapter for chemical names, stable identifiers, structures, properties, pharmacology, safety notes, and source-aware records.
<span class="chemical-tooltip" data-query="2244" data-scope="pubchem">aspirin</span>
<span class="chemical-tooltip" data-query="CHEMBL25" data-scope="chembl">aspirin</span>import { ChemicalTooltip } from 'bio-tooltips/mychem';
ChemicalTooltip.init({
selector: '.chemical-tooltip'
});The root package exports the current tooltip modules:
import { GeneTooltip, ChemicalTooltip } from 'bio-tooltips';Subpath imports remain preferred when an application wants to load only one tooltip module.
Full documentation and examples are available in the docs folder and at the project site:
https://mattjmeier.github.io/bio-tooltips/
Bio Tooltips keeps its user-facing dependency surface intentionally small:
- Runtime npm dependencies:
tom-select, plus its npm dependencies@orchidjs/sifterand@orchidjs/unicode-variants. - Optional peer dependencies:
d3,ideogram, and@rdkit/rdkit. These are not bundled into the package and are only needed for optional visual/structure-rendering features. - Published package contents:
dist,README.md,LICENSE, andpackage.json. - External data/API sources used at runtime: MyGene.info for gene records, MyChem.info for chemical records, and PubChem image URLs for chemical structure images.
The release workflow installs from package-lock.json with npm ci and publishes to npm with provenance. For browser CDN usage, prefer a pinned package version instead of @latest.
Replace package imports:
import { GeneTooltip } from 'gene-tooltips/mygene';with:
import { GeneTooltip } from 'bio-tooltips/mygene';Browser CDN paths also move to the new package and artifact names:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bio-tooltips@1.0.2/dist/bio-tooltips.css">
<script src="https://cdn.jsdelivr.net/npm/bio-tooltips@1.0.2/dist/bio-tooltips.global.js"></script>This package was originally developed as gene-tooltips and renamed to bio-tooltips as chemical and future entity modules were added.