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.
60 stars 17 forks source link

load from js file #88

Closed zeraati closed 11 months ago

zeraati commented 12 months ago

I use this code to load data from json

var nodes = JSON.parse(jsonData); if (FamilyTree.events.publish("import", [family, nodes]) != 0) { family._putInUndoStack(); family.clearRedo(); family.config.nodes = nodes; FamilyTree.events.publish("updated", [family]); family.filterUI.update(); family.draw(); }

is it right?

ZornitsaPesheva commented 12 months ago

Do I understand right that you need to load data from a json file?

zeraati commented 12 months ago

json data! I have an API whose output is Jason When the page is loaded with JS, a request is sent to the API It receives the data and the page nodes are loaded based on it

ZornitsaPesheva commented 12 months ago

family.load(json)

zeraati commented 12 months ago

I think that due to the fact that receiving information from the API is delayed - I think that the load was not done correctly I will check again