Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

relatives-tree

SanichKotikov3.3kMIT3.2.2TypeScript support: included

Calculates families and nodes positions for rendering a family tree

family-tree, family, relatives, node, connection

readme

relatives-tree

A tiny library (~3.23 kB br) for calculating specific JSON data to family tree nodes and connectors.

🖥 Here is a demo app with React rendering.

import calcTree from 'relatives-tree';

const tree = calcTree(json, { rootId });

The nodes & the connectors are simple JS objects, so you can use any rendering layer.

Usage

🛠 Canvas example
🛠️ React example (react-family-tree source code)
🛠️ Solid example

📝 JSON data examples.

Contributing

Please read this documentation before contributing.