Package Exports
- react-family-tree
- react-family-tree/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-family-tree) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-family-tree
React component that renders a family tree. Demo.
Install
npm i -S react-family-treeUsage
import ReactFamilyTree from 'react-family-tree';
import FamilyNode from './your-components/FamilyNode';
const WIDTH = 70;
const HEIGHT = 80;
<ReactFamilyTree
nodes={[...]}
rootId={rootId}
width={WIDTH}
height={HEIGHT}
renderNode={(node) => (
<FamilyNode
key={node.id}
node={node}
style={{
width: WIDTH,
height: HEIGHT,
transform: `translate(${node.left * (WIDTH / 2)}px, ${node.top * (HEIGHT / 2)}px)`,
}}
/>
)}
/>