@phillipmalboeuf/directus-interface-family-tree
v1.1.1
Published
A Directus interface extension for visualizing family trees with parent-child and marriage relationships
Downloads
430
Maintainers
Readme
Family Tree Interface
A Directus interface extension that displays a visual family tree for Person items, showing parent-child relationships and marriages.
Features
- Automatic Family Tree Visualization: Displays family relationships starting from the current Person item
- Merged Children: Combines children from both
children_fatherandchildren_motherrelationships, removing duplicates - Spouse Display: Shows all spouses from the
married_torelationship - Recursive Tree: Displays children and their descendants in a hierarchical tree structure
- Theme Integration: Uses Directus theme variables for consistent styling
Installation
Via npm (Recommended)
npm install @phillipmalboeuf/directus-interface-family-treeThe extension will be automatically available in your Directus instance after installation and restart.
Local Development
Clone the repository:
git clone https://github.com/phillipmalboeuf/family-tree.git cd family-treeInstall dependencies:
npm installBuild the extension:
npm run buildLink it to your local Directus instance:
npm run link
Usage
- Add the "Family Tree" interface to a Person collection field (must be of type
alias) - When viewing a Person item, the interface will automatically:
- Load the current Person's data
- Fetch related children from
children_fatherandchildren_motherfields - Fetch spouses from the
married_tofield - Display everything in a visual tree structure
Requirements
- Directus 10.10.0 or higher
- A Person collection with the following relationship fields:
children_father(O2M relation to Person)children_mother(O2M relation to Person)married_to(M2M or M2O relation to Person)
Development
# Development mode with watch
npm run dev
# Build for production
npm run build
# Validate extension
npm run validatePublishing to npm
If you want to publish updates to npm:
Login to npm (if not already):
npm loginUpdate version in
package.json:npm version patch # or minor, or majorPublish:
npm publish --access publicNote: The
prepublishOnlyscript will automatically build the extension before publishing.
License
MIT
