dovy / Pedigree-Viewer

Real-Time Collaboration is open sourcing the effort they made to create a fully html5 pedigree viewer. This works on most modern browsers and features panning, zooming, and view modifications.
GNU Affero General Public License v3.0
23 stars 11 forks source link

Clicking an individual doesn't re-center the tree on them #3

Closed stuporglue closed 11 years ago

stuporglue commented 11 years ago

When loading the tree from a GEDCOM with gedToJson.php, clicking a person's name should recenter the tree on them, loading more of the tree from the GEDCOM as needed.

dovy commented 11 years ago

I think this is a good concept. Perhaps a good middle ground would be an icon/link attached to each person that allows you to "View their Tree" like familysearch has.

If we want to load more via a person click vs a lazy-load method, do we just discard the old nodes to free up the memory?

stuporglue commented 11 years ago

The simplest thing would be to discard the whole tree and just re-initialize it with the new data and I think it would be acceptable to do it this way.

I haven't looked at how easy it is to add new nodes to the tree dynamically so I'm not sure how hard it woudl be to incrementally add to the tree. If it's easy, I think this would be better.

The other complication that relates to this is switching between spouses. If we can't easily draw multiple spouses at once then we should just redraw the whole tree with the newly fetched data as that would make the spouse switching easy.

dovy commented 11 years ago

Agreed. That is a concern and is not built in at all.

The FamilySearch tree does a good job and re-loading the tree at the person, but they have full lazy-load built. We have not implemented Lazy-load at this time. We definitely need to do it. I like the concept of reloading the page at the individual. Right now the pedigree will load as much as you tell it and it can cause, memory issues. heh.

stuporglue commented 11 years ago

https://github.com/dovy/Pedigree-Viewer/blob/master/makeJson.php

makeJson.php lets you load a partial GEDCOM:

Let's say the initial view is a bowtie view with 3 generations on each side. With Lazy Loading, when you click on someone, the existing people will remain, and you will now add what?

Option 1) Extend the original bowtie n more generations in the direction of the new person? Option 2) Draw an additional bowtie centered on the original person?

I'm not sure that drawing two intersecting bowties is going to work very well. If you're clicking on a left-hand ancestor his other ancestors are going to get in the way of where the original descendants were drawn.

In an ancestor/descendant tree doing lazy loading will be relatively easier since the new ancestor placements won't interfere with the existing ancestors.

stuporglue commented 11 years ago

Implemented functions to do this, can now be done with the callback function. The demo does it.