Import

BALKAN FamilyTreeJS supports importing from CSV, XML and JSON files:

CSV

 
    
let family = new FamilyTree(document.getElementById("tree"), {
    menu: {
        importCSV: { 
            text: "Import CSV",
            icon: FamilyTree.icon.csv(24,24, '#7A7A7A'),
            onClick: function(){ family.importCSV(); }
        }
    },
    nodes: [
        { id: 1 },
        { id: 2, pid: 1 } 
    ]
});    
    

XML

 
    
let family = new FamilyTree(document.getElementById("tree"), {
    menu: {
        importXML: { 
            text: "Import XML",
            icon: FamilyTree.icon.xml(24,24, '#7A7A7A'),
            onClick: function(){ family.importXML(); }
            }
    },
    nodes: [
        { id: 1 },
        { id: 2, pid: 1 } 
    ]
});    
    

JSON

 
        
  let family = new FamilyTree(document.getElementById("tree"), {
      menu: {
          importXML: { 
              text: "Import XML",
              icon: FamilyTree.icon.xml(24,24, '#7A7A7A'),
              onClick: function(){ family.importXML(); }
          },
      ...
      },

  });    
    

This is a demo for importing. (You could export, edit the file and then import it agian.)