Skip to content

Commit

Permalink
Fix some CS
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsunday committed Nov 30, 2023
1 parent 9d25f12 commit 79bd6a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
3 changes: 1 addition & 2 deletions resources/js/modules/lib/tree/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ export default class Date
const tspan = col2.append("tspan");

tspan.text(d => this.truncateDate(tspan, d.label, this._text.width - (d.withImage ? this._image.width : 0) - 25))
.attr("dx", (this._orientation.isDocumentRtl ? -1 : 1) * 15)
;
.attr("dx", (this._orientation.isDocumentRtl ? -1 : 1) * 15);
});
}

Expand Down
29 changes: 10 additions & 19 deletions src/Facade/DataFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ private function buildTreeStructure(?Individual $individual, int $generation = 1
}

// Recursively call the method for the parents of the individual
$fatherTree = $this->buildTreeStructure($family->husband(), $generation + 1);
$motherTree = $this->buildTreeStructure($family->wife(), $generation + 1);
$fatherNode = $this->buildTreeStructure($family->husband(), $generation + 1);
$motherNode = $this->buildTreeStructure($family->wife(), $generation + 1);

// Add an array of child nodes
if ($fatherTree !== null) {
$node->addParent($fatherTree);
// $data['parents'][] = $fatherTree;
if ($fatherNode !== null) {
$node->addParent($fatherNode);
}

if ($motherTree !== null) {
$node->addParent($motherTree);
// $data['parents'][] = $motherTree;
if ($motherNode !== null) {
$node->addParent($motherNode);
}

return $node;
Expand All @@ -154,24 +152,17 @@ private function getNodeData(
// Create a unique ID for each individual
static $id = 0;

$treeData = new NodeData();
$treeData->setId(++$id)
->setGeneration($generation);

$nameProcessor = new NameProcessor(
$individual,
null,
false
// $this->configuration->getShowMarriedNames()
);

$nameProcessor = new NameProcessor($individual);
$dateProcessor = new DateProcessor($individual);
$imageProcessor = new ImageProcessor($this->module, $individual);

$fullNN = $nameProcessor->getFullName();
$alternativeName = $nameProcessor->getAlternateName($individual);

$treeData = new NodeData();
$treeData
->setId(++$id)
->setGeneration($generation)
->setXref($individual->xref())
->setUrl($individual->url())
->setUpdateUrl($this->getUpdateRoute($individual))
Expand Down
3 changes: 0 additions & 3 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use Fisharebest\Webtrees\Services\ChartService;
use Fisharebest\Webtrees\Validator;
use Fisharebest\Webtrees\View;
use JsonException;
use MagicSunday\Webtrees\PedigreeChart\Facade\DataFacade;
use MagicSunday\Webtrees\PedigreeChart\Traits\ModuleChartTrait;
use MagicSunday\Webtrees\PedigreeChart\Traits\ModuleConfigTrait;
Expand Down Expand Up @@ -150,8 +149,6 @@ public function resourcesFolder(): string
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*
* @throws JsonException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
Expand Down

0 comments on commit 79bd6a3

Please sign in to comment.