Web based family history software

Question Display complex all-in-on-tree with GVExport

  • schucobn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 10 months ago #1 by schucobn
With PhpGedView, the origin of webtrees, there was a 3rd party module available to produce an “all in one tree" of individuals in a family tree and their relationships.

This module called GVExport produced all in one trees starting from single or several selected individuals including selected types of relatives (ancestors, sibs, cousins, offspring and spouses) and selected number of ancestor and offspring generations.
Output could be produced as printable pdf, png or jpg but also be displayed on screen, where SVG-graphic made the graphs “clickable”, i.e. click opened the individual’s or family’s information. The module GVExport just produced dot-files, which needed installation of GraphViz on the server to get the nice graphic output.

After advent of webtrees the author Ferenc Kurucz stated he hadn't worked on the module in over two years and didn’t plan to do any further.

My son migrated GVExport to webtrees 1.7 and recently adopted it to webtrees 2.16. This results in a simplified and reduced input menu for the diagram preferences. His most important modification is that you can produce SVG-graphic on your client’s screen without GraphViz-installation on the server. An open source graph.js module (like GraphViz in JavaScript) for the clients display is included in the new GVExport module for that purpose. However, to get pdf, png or jpg-printable output GraphViz is still required on the server where webtrees is installed.

There are some known limitations:
  • no translations – only English (except of the button-label “Zurücksetzen” = Reset)
  • svg-clickable output does not work on Android (Firefox)
  • photos in decorated diagram type are only displayed in client graphic not in server generated graphic
  • there are some workarounds in the core-program based on the letter “F” to start the family-xref. I am using Vesta Classic Look&Feel, so I could not test for bugs with the new unique “X”-xref-ids.
  • With Classic Look&Feel you can’t avoid to display individual xref-id

As my son can’t provide any more support for GVExport, I hope to find the interest of capable people in the webtrees community to further develop the present state of GVExport:
github.com/tillsc/GVExport

But some of you may find the module useful even in the present state.

To install it on the server:
Download all files from the above GitHub into modules_v4/GVExport directory and enable the plugin via modules administration page.

To use it in webtrees:
Select it under “Diagrams”.
In the “Diagram preferences” you select root individuals (“Include anyone related to”) with the drop down window.
Before you include another root individual, click the CR-like button right below the drop down window. The xref-id of the preceding root-individual is stacked into the window left.
You can add as many root-individuals, as you like. You can even enter and edit xref-ids directly in the window.
“Stop processing on“ can be used to cease selection of ancestors or descendants after a “stop-individual” before the given number of generations has been processed.
The input method for these fields is the same as before in “Include anyone …”

Start the display of the tree on your screen with button “Update”.
Whenever you changed input parameters like number of ancestor generations press “Enter” or button “Update” to get immediate results.

You can hide the input-menu with the “X”-button top-right.

What has been described up to now works without GraphViz installed on the server.
To get printable output you need to have it installed. Then choose output file type and press “Render serverside”. Output type pdf is highly recommended as it provides the smallest files and is easily scalable, especially for big graphs. For very big graphs, e.g. 1x2 meter, it is well suited for plotters used by architects. Such graphs beyond the capacity of your home printer are processed by specialised online shops much cheaper as posters rather than as fotos or posters.

Further documentation on the input parameters can be found in the outdated PGVWiki entry
wiki.phpgedview.net/en/index.php?title=GVExport_module

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago - 2 years 10 months ago #2 by hermann
Replied by hermann on topic Display complex all-in-on-tree with GVExport
Thank you to you and your son! Interesting that so old software can still be reanimated. It promises a great additional value.

But whatever I tried, it never shows more than an error message:
Code:
Trying to access array offset on value of type null …/modules_v4/GVExport/functions_dot.php:741 #0 …/modules_v4/GVExport/functions_dot.php(741): Fisharebest\webtrees\webtrees::Fisharebest\webtrees\{closure}() #1 …/modules_v4/GVExport/functions_dot.php(238): vendor\webtreesModules\gvexport\Dot->printFamily() #2 …/modules_v4/GVExport/functions_dot.php(184): vendor\webtreesModules\gvexport\Dot->createDOTDump() #3 …/modules_v4/GVExport/module.php(470): vendor\webtreesModules\gvexport\Dot->getDOTDump() #4 …/modules_v4/GVExport/module.php(275): vendor\webtreesModules\gvexport\GVExport->createGraphVizDump() #5 …/modules_v4/GVExport/module.php(206): vendor\webtreesModules\gvexport\GVExport->saveDOTFile() #6 …/app/Http/RequestHandlers/ModuleAction.php(88): vendor\webtreesModules\gvexport\GVExport->postChartAction() #7 …/app/Http/Middleware/WrapHandler.php(83): Fisharebest\webtrees\Http\RequestHandlers\ModuleAction->handle()

Hermann
Designer of the custom module "Extended Family"

webtrees 2.1.19 (all custom modules installed, PHP 8.2, MariaDB 10.6) @ ahnen.hartenthaler.eu
Last edit: 2 years 10 months ago by hermann.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #3 by GunnarO
Replied by GunnarO on topic Display complex all-in-on-tree with GVExport
Sadly i got the same issue, too.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #4 by corieltauvi
Replied by corieltauvi on topic Display complex all-in-on-tree with GVExport
To get it working I commented out lines 741, 742, 743 in the file functions_dot.php

The lines now look like this:
// $func="date_localisation_{$lang_short_cut[$LANGUAGE]}";
// if (!function_exists($func))
// $func="DefaultDateLocalisation";

My understanding of PHP is fairly poor so don't ask me what I've changed.

You can test it here if you like: zeffertt.uk/webtrees/

Cheers,
Torven

Please Log in or Create an account to join the conversation.

  • schucobn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #5 by schucobn
Replied by schucobn on topic Display complex all-in-on-tree with GVExport
Thank you Torven to get it working.
I will ask my son to fix it in the version on GitHub
Hermann

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #6 by rasasak
Replied by rasasak on topic Display complex all-in-on-tree with GVExport
I try this plugin... choose root person, set output DOT

but i have these errors
Code:
strlen() expects parameter 1 to be string, array given …/modules_v4/GVExport/utils.php:54 #0 …/modules_v4/GVExport/utils.php(54): Fisharebest\webtrees\webtrees::Fisharebest\webtrees\{closure}(2, 'strlen() expect...', '/data/web/virtu...', 54, Array) #1 …/modules_v4/GVExport/utils.php(17): is__writable(Array, 'TMPDIR') #2 …/modules_v4/GVExport/module.php(269): sys_get_temp_dir_my() #3 …/modules_v4/GVExport/module.php(206): vendor\webtreesModules\gvexport\GVExport->saveDOTFile(Object(Fisharebest\webtrees\Tree), Object(Fisharebest\webtrees\Individual), true) ....

any ideas ? :(
Last edit: 2 years 4 months ago by rasasak.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago - 1 year 10 months ago #7 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
I've been using GVExport without issue for months, but with updates to webtrees recently it seems to have broken. I'm unfortunately not skilled enough to narrow down exactly what the problem is. I'd appreciate some help!

I get the following error:
Code:
Call to undefined method Fisharebest\webtrees\Individual::getInstance() …/modules_v4/GVExport/functions_dot.php:1509

This is defined at the top:
Code:
use Fisharebest\webtrees\Individual;

I do get a stack trace if anyone thinks it will help. Here's the code from the line it's failing on (there's obviously more to the function but the error occurs on this first line):
Code:
function addPhotoToIndi($pid) { $i = Individual::getInstance($pid, $this->tree);

And the stacktrace shows this value being passed in, which is a valid ID of the individual:
Code:
#0 …/modules_v4/GVExport/functions_dot.php(936): vendor\webtreesModules\gvexport\Dot->addPhotoToIndi('I504674')

Because this has come about from a webtrees version update and not a change to the extension, and because the failure is on a webtrees class, I suspect that some change in webtrees means this extension needs to be updated (though as it's unmaintained I know this means having to make the change myself).

Is there anyone with experience with extensions that can guide me on how I can resolve this or troubleshoot further?
Last edit: 1 year 10 months ago by Mperates.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #8 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
This module will need some modifications to work with the latest version of webtrees.

The old code would create a new "individual record" using

Individual::getInstance()

The new code uses

Registry::individualFactory()->make()

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #9 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
Thanks, that worked! I have two more questions if you don't mind.

One is what do I need to change for this line to work - it runs now without photos but if I want to add the photos this line fails:
Code:
return './'.$this->file_system->getAdapter()->applyPathPrefix('media/'.$m->filename());
I get this error from it:
Code:
Call to undefined method League\Flysystem\Filesystem::getAdapter() …/modules_v4/GVExport/functions_dot.php:1519

And the second question is: I'm new to this, what would be a normal way for extension developers to find out about these changes? Is there documentation somewhere I should be reading?

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #10 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
> I'm new to this, what would be a normal way for extension developers to find out about these changes?

The functions that are removed get flagged with @deprecated notes before they are removed.

e.g. the function Individual::getInstance() has this note:

> * @deprecated since 2.0.4. Will be removed in 2.1.0 - Use Registry::individualFactory()

github.com/fisharebest/webtrees/blob/2.0...p/Individual.php#L96

If you were using a PHP development tool (I use phpStorm but there are many others), then it will highlight these issues for you.

You would then have plenty of time to update your code to use the new functions.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #11 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
> One is what do I need to change for this line to work

I can't tell from that one line what it intends to do. It is creating a path to a file - but what is it doing with it next?

The filesystems are accessed via an abstraction layer. You can't access them directly.
The reason is that we want to be able to move all our storage elsewhere, without changing the code. For example, you could store all your files/photos in DropBox, GoogleDrive, etc.

(An old version of FlySystem exposed the underlying storage using getAdapter() - this was a bug, and new versions do not allow you to do this).

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #12 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
Thanks for your replies.

Basically it is adding photos into whatever output is chosen, but the function is just returning the path. Here's the full function:
Code:
function addPhotoToIndi($pid) { $i = Registry::individualFactory()->make($pid, $this->tree); $m = $i->findHighlightedMediaFile(); if (empty($m)) { return null; } else if (false && $this->use_urls_for_media) { return $m->downloadUrl('inline'); } else if (!$m->isExternal() && $m->fileExists($this->file_system)) { return './'.$this->file_system->getAdapter()->applyPathPrefix('media/'.$m->filename()); } else { return null; } }

Looking at where this is called, it is set here:
Code:
$this->individuals[$pid]["pic"] = $this->addPhotoToIndi($pid);

And this is referenced here:
Code:
$out .= "<TD ROWSPAN=\"2\" CELLPADDING=\"1\" PORT=\"pic\" WIDTH=\"" . ($this->font_size * 5) . "\" HEIGHT=\"" . ($this->font_size * 6) . "\" FIXEDSIZE=\"true\"><IMG SCALE=\"true\" SRC=\"" . $this->individuals[$pid]["pic"] . "\" /></TD>";

So my understanding is the function is just looking for the path to the main image of a person, then that path is used for the output (either to browser or converted via graphviz).

If it helps, the full code is in this file , but it's quite long so hopefully I've got all the relevant bits to make it easy for you. I appreciate the help!

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #13 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
It looks like it is trying to generate a URL to the image, directly from the /data/media folder.
This won't work, as the /data folder is not (should not be!) accessible externally.

You generate links to images using $media->displayImage()

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #14 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
I think the problem is that it is using a tool installed on the server (graphviz) to generate the output.

If I take that return statement and make it:
Code:
return "./data/media/photo.jpg";

Then it generates the output fine. This will be because the tool using it is on the server. I can't pass it a URL generated with displayImage as it needs the server URL. Even if it could download from a URL it wouldn't be able to as the tool isn't logged in.

Is there a way of getting this server location anymore? It would only need to be the relative location (within the media folder), which seems should still align with it not mattering where the data is stored.

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #15 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
> Is there a way of getting this server location anymore?

No. The filesystem interface no longer provides it.

I plan to allow the filesystem to be moved to cloud storage. When this happens, you really won't be able to read the files from disk.

Until then, you should use the configured value for the data folder, not the hard-coded "data/" using

Site::getPreference('INDEX_DIRECTORY');

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #16 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
Thanks, but I'm not so interested in that half of the equation, but the other half (e.g. in the location "./data/media/folder/photo.jpg", I'm not so interested in there the data folder is, but in where the photo is (in particular the "folder/photo.png" part). In other words, I'm interested in the specific photo, not the location the photos are kept.

I'm honestly getting pretty worried hearing you talk about removing the ability to find the photos. Does this preclude the possibility of generating a family tree chart with photos using a server side tool? Or would you "download" each image to a temporary directory then process them from there? As far as I can tell, this GVExport extension is the only way in webtrees to generate an output of a family tree that includes all relations (not just direct descendants/ancestors). If you were going to print out a copy of the family tree for say a family reunion, you'd want it to include all relations so people could look at how they related to other attendees. Having photos on that is a fantastic addition.

Even if it will be removed in future, is there currently a way to get the location of a specific photo within the /media folder? (e.g. "media/folder/photo.jpg", or even just "folder/photo.jpg")

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #17 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
> e.g. in the location "./data/media/folder/photo.jpg"

It is not always "./data/". This is the default, but it can be changed.

It is not always "media/". This is the default, but it can be changed.

If you want your module to work on other sites, then you should use the configuration settings instead.

> I'm honestly getting pretty worried hearing you talk about removing the ability to find the photos.

I do not plan to do this, and you will always be able to find your own files on your own disk using hard-code folder names.

But I plan to provide an OPTION to store the files on a remote filesystem - instead of the local filesystem.

You might not want that. But many people will prefer to store their files in GoogleDrive/OneDrive/DropBox/etc. than in their web-host.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #18 by fisharebest
Replied by fisharebest on topic Display complex all-in-on-tree with GVExport
> Does this preclude the possibility of generating a family tree chart with photos using a server side tool?

Not at all. If you want to do this on your own server, then you can.

But if you want to take advantage of webtrees features, then you should access them via the API functions. e.g.

* privacy filters
* image cropping/scaling/watermarks
* remote storage

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #19 by Mperates
Replied by Mperates on topic Display complex all-in-on-tree with GVExport
Thanks for your replies. I understand that people may want to use cloud storage and I think it's great to have that option. Using your guidance I have got it working again, using config variables for the location which I'm hoping future proofs it.

I appreciate the help you've given walking me through this.

Please Log in or Create an account to join the conversation.

  • schucobn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 10 months ago #20 by schucobn
Replied by schucobn on topic Display complex all-in-on-tree with GVExport

Using your guidance I have got it working again, using config variables for the location which I'm hoping future proofs it.
Having introduced GVExport one year ago I eagerly followed this discussion which, with patient support by Greg, seems to have ended with a working version of the module.

As far as I can tell, this GVExport extension is the only way in webtrees to generate an output of a family tree that includes all relations (not just direct descendants/ancestors). If you were going to print out a copy of the family tree for say a family reunion, you'd want it to include all relations so people could look at how they related to other attendees. Having photos on that is a fantastic addition.
Also I am pleased to hear that some more webtree-users found the module helpful and are using it, after I had read about several failing attempts in the beginning.

@Mperates, could you please drop some information about your last version of the module
  • where can I download it
  • which version of webtres have you been using

Finally I address the many capable IT-experts in the webtrees community to provide one crucial improvement of GVExport:
At presence it needs GraphViz to be installed at the server to get printable output, whereas it is possible to get screen-display provided by the client. Maybe someone can append a printer extension to run on the client.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}