Commit c647cb1a authored by Maxym Borodenko's avatar Maxym Borodenko

Include `fullID` property in the downloaded file

- Don't calculate `fullID` if already exist in the uploaded JSON
parent d57101ac
......@@ -838,8 +838,12 @@ export function draw_tree(container, treeData) {
// Layout the tree initially and center on the root node.
update(root);
assignIDs(root);
centerNode(root);
tree_root = root;
if (root.fullID === undefined) {
console.log('Calculating fullID for each node...');
assignIDs(root);
}
updateNodesKeys();
}
......@@ -31,7 +31,7 @@ const TREE_STORAGE_NAME = 'lastTree';
// We need to remove parent property from all nodes to avoid an error with converting circular structure to JSON
const cleanTreeJson = (node) => {
const keepProperties = ['name', 'weight', 'contributors', 'nodeId'];
const keepProperties = ['name', 'weight', 'contributors', 'nodeId', 'fullID'];
// console.log('Cleaning', node);
const copy = {};
......@@ -263,6 +263,8 @@ $('document').ready(function() {
let newTree = {
name: 'Entire genepool',
weight: undefined,
nodeId: undefined,
fullID: undefined,
};
draw_tree($('#tree-container'), newTree);
rememberCurrentTree(newTree);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment