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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@captiveorigins/onepedigree-core

v0.1.0-alpha.18

Published

OnePedigree core: the species-neutral pedigree data model, validation, bounded traversal, view projections and layout, with no React, Payload or database dependency.

Readme

OnePedigree

A species-neutral pedigree framework for humans and other animals (and plants): a portable data model, graph validation, bounded ancestry traversal, view projections, automatic layout, server-renderable React components and a Payload CMS plugin.

Status: alpha. The schema-version-1 contract is stable in intent; package APIs may still change before the first prerelease.

| Package | Purpose | |---|---| | @captiveorigins/onepedigree-core | Data model, normalization, validation, traversal, projections, layout, serialization. No React, Payload or database dependency. | | @captiveorigins/onepedigree-react | Server-renderable SVG views (all 13), interactive explorer, headless hooks, CSS-variable styling. | | @captiveorigins/payload-plugin-onepedigree | Payload plugin: managed, standard or mapped collections, cycle-safe serialized writes, deletion policies, permission-aware endpoints, Admin preview and color settings. |

Principles

  • Parentage lives on the individual: parentage.parents[{ individual, role }], reproductiveMode (sexual, parthenogenesis, self, asexual, cloning, other) and cohort. Children and siblings are derived, never stored.
  • Unknown stays unknown. Roles are never inferred from sex; a missing parent or mode is not guessed; incomplete pedigrees are valid (they produce notices, not errors).
  • Bounded and cycle-safe. Every traversal has depth and size limits and reports truncation; cycles are rejected.
  • Identity vs occurrence. One stored individual may appear several times in a view; occurrences always map back to the one identity.

Quick start

import { getAncestors, indexPedigree, validatePedigree, type PedigreeDocument } from '@captiveorigins/onepedigree-core'

const pedigree: PedigreeDocument = {
  schemaVersion: 1,
  individuals: [
    { id: 'atlas', label: 'Atlas', sex: 'male' },
    { id: 'nova', label: 'Nova', sex: 'female' },
    {
      id: 'ember',
      label: 'Ember',
      parentage: {
        parents: [
          { individual: 'nova', role: 'mother' },
          { individual: 'atlas', role: 'father' },
        ],
        reproductiveMode: 'sexual',
      },
    },
  ],
}

const { valid, issues } = validatePedigree(pedigree)
const ancestors = getAncestors(indexPedigree(pedigree), 'ember', { maxGenerations: 4 })

Large datasets: implement PedigreeRepository (getByIds, findChildrenOf) and call loadNeighborhood(); it loads a bounded neighborhood one query per generation.

Views

pedigree, fan, ahnentafel, descendants, hourglass, cohort, relationship, timeline, inbreeding, population, compact, maternal, paternal: each with a projection (projectPedigree), a built-in deterministic layout (layoutPedigree; tree, layered or radial, vertical or horizontal) and a React renderer. Custom layout engines (e.g. ELK) plug in through PedigreeLayoutEngine.

For a list instead of a chart ("show all relatives"), relativesByGeneration(projection) groups an hourglass projection's relatives by generation (parents, grandparents, …, siblings, offspring, …); generationKind() gives hosts the kind and number of "great"s to translate, and generationLabel() an English label.

Genetics

Optional and separate from the pedigree document (schema 1 is unchanged): the host supplies a gene catalog (GeneDefinition: recessive, incomplete dominant, dominant, codominant, polygenic or unknown; allelic complexes via a shared locus; Z- or X-linked) and per-individual GenotypeRecords (visual, single, super, het, possible het with a chance, non-carrier, unknown; with how it is known).

  • pairingOdds — expected offspring per locus (super forms, complexes, sex-linked splits by offspring sex); unrecorded genes are assumed absent and reported as assumptions.
  • expectedNormalLookingRecord — e.g. 66% possible het from two hets.
  • checkOffspring — flags offspring the recorded parents can't produce (check parentage).
  • carrierFromOffspring — carriers proven by a visual recessive offspring; suggestions only (basis: 'inferred').
  • genotypeSummary — "Super Pastel 66% possible het Pied" from the records.

Nothing is guessed: polygenic and unproven genes have no odds, and a sex-linked gene needs the sex. In @captiveorigins/onepedigree-react, genotypes draws allele dots for several genes on every node (two dots per gene, one per copy), GenotypeDots draws them anywhere, and geneOverlay focuses on one gene with the usual genetic pedigree symbols and GeneLegend.

Development

pnpm install
pnpm typecheck && pnpm test && pnpm build   # build also writes apps/playground/dist (gallery.html, index.html)

apps/playground shows every view for every fixture: dist/gallery.html (static, server- rendered) and dist/index.html (interactive; serve the folder, e.g. python3 -m http.server).

License

PolyForm Noncommercial 1.0.0. Free for noncommercial use, with attribution; commercial use needs a separate license from Captive Origins. Versions published before this change remain under MIT.