![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
pedigree-tree
Advanced tools
The PedigreeTree React component is a powerful and highly customizable solution for rendering hierarchical pedigree trees. Whether you are visualizing genealogical structures, animal lineages, or any hierarchical data, this component provides the flexibil
The PedigreeTree React component is a flexible and customizable solution for rendering hierarchical data structures such as family trees, organizational charts, or any other tree-like structures. This component provides dynamic layout rendering and supports deep hierarchies with rich customization options.
nodeStyle
, nodeTitleStyle
, and custom content rendering using renderNodeContent
.iconComponents
.siblingGap
and familyGap
.Install the package via npm or yarn:
npm install pedigree-tree
or
yarn add pedigree-tree
Here is an example of how to use the PedigreeTree component:
import React from "react";
import PedigreeTree from "pedigree-tree";
const App: React.FC = () => {
const familyData = [
{ id: "1", name: "Root Node", isRoot: true, iconType: "root" },
{ id: "2", name: "Child 1", parentId: "1", iconType: "child" },
{ id: "3", name: "Child 2", parentId: "1", iconType: "child" },
{ id: "4", name: "Grandchild 1", parentId: "2", iconType: "grandchild" },
{ id: "5", name: "Grandchild 2", parentId: "2", iconType: "grandchild" },
{ id: "6", name: "Grandchild 3", parentId: "3", iconType: "grandchild" },
];
return (
<PedigreeTree
record={familyData}
siblingGap={30}
familyGap={50}
nodeStyle={{
width: "120px",
height: "60px",
border: "1px solid #ccc",
borderRadius: "10px",
backgroundColor: "#f9f9f9",
}}
iconComponents={{
root: () => (
<span role="img" aria-label="tree">
🌳
</span>
),
child: () => (
<span role="img" aria-label="child">
👶
</span>
),
grandchild: () => (
<span role="img" aria-label="grandchild">
👦
</span>
),
}}
/>
);
};
export default App;
Prop | Type | Description |
---|---|---|
record | TreeNode[] | An array of hierarchical data representing the tree structure. |
Prop | Type | Default | Description |
---|---|---|---|
title | string | "My Pedigree Tree" | Title displayed above the tree. |
titleStyle | CSSProperties | fontSize: 16px, ... | Styles applied to the tree title. |
nodeStyle | CSSProperties | width: 90px, ... | Styles applied to individual tree nodes. |
nodeTitleStyle | CSSProperties | fontSize: 8px, ... | Styles applied to the text inside nodes. |
pathColor | string | "#d2d2d2" | Color of the lines connecting nodes. |
siblingGap | number | 20 | Horizontal spacing between sibling nodes. |
familyGap | number | 30 | Vertical spacing between parent and child nodes. |
strokeWidth | number | 1 | Thickness of the lines connecting nodes. |
nodeTitleColor | string | "black" | Color of the node title text. |
iconComponents | Record<string, () => ReactNode> | {} | A map of functions returning icons based on node type. |
renderNodeContent | (node: TreeNode) => ReactNode | null | Function to render custom content inside nodes. |
Each item in the record
array should have the following structure:
Property | Type | Required | Description |
---|---|---|---|
id | string | Yes | A unique identifier for the node. |
name | string | Yes | The name of the node to display. |
parentId | string | No | The ID of the parent node. |
isRoot | boolean | No | Indicates if the node is the root node. |
iconType | string | No | A key to identify the icon from the iconComponents map. |
You can use the renderNodeContent
prop to customize the content displayed inside nodes:
<PedigreeTree
record={familyData}
renderNodeContent={(node) => (
<div>
<h4>{node.name}</h4>
<p>ID: {node.id}</p>
</div>
)}
/>
Define custom icons for specific node types using iconComponents
:
iconComponents={{
root: () => <span role="img" aria-label="tree">🌳</span>,
child: () => <span role="img" aria-label="child">👶</span>,
grandchild: () => <span role="img" aria-label="grandchild">👦</span>,
}}
This package is licensed under the MIT License.
Contributions are welcome! If you encounter issues or have feature suggestions, feel free to create an issue or submit a pull request on the GitHub repository.
Start building elegant and customizable pedigree trees with ease! 🎉
FAQs
The PedigreeTree React component is a powerful and highly customizable solution for rendering hierarchical pedigree trees. Whether you are visualizing genealogical structures, animal lineages, or any hierarchical data, this component provides the flexibil
We found that pedigree-tree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.