BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50 stars 16 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'add') #100

Closed unutoiul closed 2 months ago

unutoiul commented 4 months ago

Any idea why i get this error trying to run FamilyTree?

import FamilyTree from "@balkangraph/familytree.js";

console.log("FamilyTree", FamilyTree);

const Charts = () => {
  return (
    <div style={{ height: "100%" }}>
      <FamilyTree
        nodes={[
          {
            id: 1,
            pids: [2],
            name: "Amber McKenzie",
            gender: "female",
            img: "https://cdn.balkan.app/shared/2.jpg",
          },
          {
            id: 2,
            pids: [1],
            name: "Ava Field",
            gender: "male",
            img: "https://cdn.balkan.app/shared/m30/5.jpg",
          },
          {
            id: 3,
            mid: 1,
            fid: 2,
            name: "Peter Stevens",
            gender: "male",
            img: "https://cdn.balkan.app/shared/m10/2.jpg",
          },
          {
            id: 4,
            mid: 1,
            fid: 2,
            name: "Savin Stevens",
            gender: "male",
            img: "https://cdn.balkan.app/shared/m10/1.jpg",
          },
          {
            id: 5,
            mid: 1,
            fid: 2,
            name: "Emma Stevens",
            gender: "female",
            img: "https://cdn.balkan.app/shared/w10/3.jpg",
          },
        ]}
      />
    </div>
  );
};

export default Charts;

![Uploading Screenshot 2024-03-04 at 19.53.14.png…]()

ZornitsaPesheva commented 4 months ago

I cannot see the screenshot. What is the error and what framework do you use?

ZornitsaPesheva commented 2 months ago

I am closing this issue as inactive. Please reopen it or open another one if needed.