xref: /webtrees/resources/views/modules/pedigree-chart/chart-down.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 flex-column">
19e759aebbSGreg Roach    <div class="position-relative d-flex justify-content-center wt-pedigree-generation wt-generation-fwd-<?= $generation ?> wt-generation-rev-<?= 1 + $generations - $generation ?>">
20e759aebbSGreg Roach        <!-- lines to the next generation -->
21e759aebbSGreg Roach        <?php if ($generation < $generations) : ?>
22e759aebbSGreg Roach            <div class="wt-pedigree-lines position-absolute"></div>
23e759aebbSGreg Roach        <?php endif ?>
24e759aebbSGreg Roach
2512c7ed82SGreg Roach        <div class="d-flex flex-column align-items-center position-relative">
26e759aebbSGreg Roach            <?php if ($sosa === 1) : ?>
27e759aebbSGreg Roach                <?= $links->get(1) ?>
28e759aebbSGreg Roach            <?php endif ?>
29e759aebbSGreg Roach
3039c990acSGreg Roach            <?= view('chart-box', ['individual' => $ancestors->get($sosa)]) ?>
31e759aebbSGreg Roach
32bb1ec7dcSGreg Roach            <?php if ($generation === $generations) : ?>
33bb1ec7dcSGreg Roach                <?= $links->get($sosa, $spacer) ?>
34e759aebbSGreg Roach            <?php endif ?>
35e759aebbSGreg Roach        </div>
36e759aebbSGreg Roach    </div>
37e759aebbSGreg Roach
38e759aebbSGreg Roach    <?php if ($generation < $generations) : ?>
39e759aebbSGreg Roach        <div class="d-flex">
40bb1ec7dcSGreg Roach            <?= view('modules/pedigree-chart/chart-down', ['ancestors' => $ancestors, 'sosa' => $sosa * 2, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
41e759aebbSGreg Roach
42bb1ec7dcSGreg Roach            <?= view('modules/pedigree-chart/chart-down', ['ancestors' => $ancestors, 'sosa' => $sosa * 2 + 1, 'generation' => $generation + 1, 'generations' => $generations, 'links' => $links, 'spacer' => $spacer]) ?>
43e759aebbSGreg Roach        </div>
44e759aebbSGreg Roach    <?php endif ?>
45e759aebbSGreg Roach</div>
46e759aebbSGreg Roach
47