xref: /webtrees/resources/views/modules/pedigree-chart/chart-left.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1e759aebbSGreg Roach<?php
2e759aebbSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5e759aebbSGreg Roachuse Fisharebest\Webtrees\Individual;
6e759aebbSGreg Roachuse Illuminate\Support\Collection;
7e759aebbSGreg Roach
8e759aebbSGreg Roach/**
936779af1SGreg Roach * @var Collection<int,Individual> $ancestors   Indexed by sosa number
10e759aebbSGreg Roach * @var int                        $generation  Draw this generation
11e759aebbSGreg Roach * @var int                        $generations Final generation to draw
1236779af1SGreg Roach * @var Collection<int,string>     $links       Links to extend the tree
13e759aebbSGreg Roach * @var int                        $sosa        Draw this individual
14bb1ec7dcSGreg Roach * @var string                     $spacer
15e759aebbSGreg Roach */
16e759aebbSGreg Roach?>
17e759aebbSGreg Roach
18e759aebbSGreg Roach<div class="d-flex">
19e759aebbSGreg Roach    <?php if ($generation < $generations) : ?>
20e759aebbSGreg Roach        <div class="d-flex flex-column">
21bb1ec7dcSGreg Roach            <?= view('modules/pedigree-chart/chart-left', ['ancestors' => $ancestors, 'sosa' => $sosa * 2, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
22e759aebbSGreg Roach
23bb1ec7dcSGreg Roach            <?= view('modules/pedigree-chart/chart-left', ['ancestors' => $ancestors, 'sosa' => $sosa * 2 + 1, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
24e759aebbSGreg Roach        </div>
25e759aebbSGreg Roach    <?php endif ?>
26e759aebbSGreg Roach
27e759aebbSGreg Roach    <div class="position-relative d-flex flex-column justify-content-center wt-pedigree-generation wt-generation-fwd-<?= $generation ?> wt-generation-rev-<?= 1 + $generations - $generation ?>">
28e759aebbSGreg Roach        <!-- lines to the next generation -->
29e759aebbSGreg Roach        <?php if ($generation < $generations) : ?>
30e759aebbSGreg Roach            <div class="wt-pedigree-lines position-absolute"></div>
31e759aebbSGreg Roach        <?php endif ?>
32e759aebbSGreg Roach
33c5d18ce5SGreg Roach        <div class="d-flex align-items-center position-relative">
34bb1ec7dcSGreg Roach            <?php if ($generation === $generations) : ?>
35bb1ec7dcSGreg Roach                <?= $links->get($sosa, $spacer) ?>
36e759aebbSGreg Roach            <?php endif ?>
37e759aebbSGreg Roach
3839c990acSGreg Roach            <?= view('chart-box', ['individual' => $ancestors->get($sosa)]) ?>
39e759aebbSGreg Roach
40e759aebbSGreg Roach            <?php if ($sosa === 1) : ?>
41e759aebbSGreg Roach                <?= $links->get(1) ?>
42e759aebbSGreg Roach            <?php endif ?>
43e759aebbSGreg Roach        </div>
44e759aebbSGreg Roach    </div>
45e759aebbSGreg Roach</div>
46e759aebbSGreg Roach
47