Public API
Public exports from @memoir/tree.
All public exports come from @memoir/tree.
Family Tree
FamilyTreeDefaultFamilyCardrelcreateFamilyIndex(people, relationships)collectFamilyNeighborhood(index, subject)buildFamilyTreeLayout(input)
Org Chart
OrgChartDefaultOrgChartCardcreateOrgChart(root)buildOrgChartLayout(input)
createOrgChart(root) accepts a nested reporting tree and returns:
type OrgChartDefinition<Person> = {
rootId: string;
nodes: OrgChartNode<Person>[];
generations: OrgChartGeneration[];
maxGeneration: number;
reportLines: OrgChartReportLine[];
};Use generations and maxGeneration to show how far the chart goes. Use reportLines to inspect who reports to who without walking the nested input again.
Shared Surface
TreeSurfaceTreeInteractionMode- optional CSS from
@memoir/tree/styles.css
Family Types
PersonIdPeopleById<Person>FamilyRelationshipFamilyParentageRelationshipFamilyPartnershipRelationshipFamilyGuardianshipRelationshipComputedRelationFamilyCardProps<Person>FamilyTreeProps<Person>FamilyTreeLayoutResult<Person>
Org Types
OrgChartNode<Person>OrgChartBranch<Person>OrgChartDefinition<Person>OrgChartGenerationOrgChartReportLineOrgChartCardProps<Person>OrgChartProps<Person>OrgChartLayoutResult<Person>
Relationship Helpers
rel.parents(child, parents, options?)rel.children(parents, children, options?)rel.partner(a, b, options?)rel.guardians(child, guardians, options?)
Use family relationship facts for the ergonomic FamilyTree API.