|
|
@@ -320,7 +320,8 @@
|
|
320
|
320
|
<div class="family-tree-diagram">
|
|
321
|
321
|
<div class="family-tree-svg-container">
|
|
322
|
322
|
|
|
323
|
|
- <svg #familyTreeSvg width="1000" height="1000">
|
|
|
323
|
+ <svg #familyTreeSvg width="100%" height="100%" [attr.viewBox]="viewBox"
|
|
|
324
|
+ preserveAspectRatio="xMidYMid meet">
|
|
324
|
325
|
|
|
325
|
326
|
@for (
|
|
326
|
327
|
layout of unitLayouts;
|
|
|
@@ -332,27 +333,19 @@
|
|
332
|
333
|
track child.unit.id
|
|
333
|
334
|
) {
|
|
334
|
335
|
|
|
335
|
|
- @if (
|
|
336
|
|
- getUnitLayout(
|
|
337
|
|
- child.unit.id
|
|
338
|
|
- );
|
|
339
|
|
- as childLayout
|
|
340
|
|
- ) {
|
|
|
336
|
+ @if (getUnitLayout(child.unit.id); as childLayout) {
|
|
341
|
337
|
|
|
342
|
338
|
<!-- 親から中間点 -->
|
|
343
|
|
-
|
|
344
|
339
|
<line [attr.x1]="getCenterX(layout)" [attr.y1]="getBottomCenterY(layout)"
|
|
345
|
340
|
[attr.x2]="getCenterX(layout)" [attr.y2]="getMiddleY(layout, childLayout)" stroke="black"
|
|
346
|
341
|
stroke-width="2" />
|
|
347
|
342
|
|
|
348
|
343
|
<!-- 横線 -->
|
|
349
|
|
-
|
|
350
|
344
|
<line [attr.x1]="getCenterX(layout)" [attr.y1]="getMiddleY(layout, childLayout)"
|
|
351
|
345
|
[attr.x2]="getCenterX(childLayout)" [attr.y2]="getMiddleY(layout, childLayout)" stroke="black"
|
|
352
|
346
|
stroke-width="2" />
|
|
353
|
347
|
|
|
354
|
348
|
<!-- 子へ -->
|
|
355
|
|
-
|
|
356
|
349
|
<line [attr.x1]="getCenterX(childLayout)" [attr.y1]="getMiddleY(layout, childLayout)"
|
|
357
|
350
|
[attr.x2]="getCenterX(childLayout)" [attr.y2]="getTopCenterY(childLayout)" stroke="black"
|
|
358
|
351
|
stroke-width="2" />
|
|
|
@@ -363,68 +356,97 @@
|
|
363
|
356
|
|
|
364
|
357
|
}
|
|
365
|
358
|
|
|
366
|
|
- @for (
|
|
367
|
|
- layout of unitLayouts;
|
|
368
|
|
- track layout.node.unit.id
|
|
369
|
|
- ) {
|
|
|
359
|
+ @for (layout of unitLayouts; track layout.node.unit.id) {
|
|
370
|
360
|
|
|
371
|
361
|
<!-- 夫婦線 -->
|
|
372
|
|
-
|
|
373
|
|
- @if (
|
|
374
|
|
- layout.node.unit.husband &&
|
|
375
|
|
- layout.node.unit.wife
|
|
376
|
|
- ) {
|
|
377
|
|
-
|
|
|
362
|
+ @if (layout.node.unit.husband && layout.node.unit.wife) {
|
|
378
|
363
|
<line [attr.x1]="layout.x + PERSON_WIDTH" [attr.y1]="layout.y + PERSON_HEIGHT / 2"
|
|
379
|
364
|
[attr.x2]="layout.x + PERSON_WIDTH + SPOUSE_GAP" [attr.y2]="layout.y + PERSON_HEIGHT / 2"
|
|
380
|
365
|
stroke="red" stroke-width="2" />
|
|
381
|
|
-
|
|
382
|
366
|
}
|
|
383
|
367
|
|
|
|
368
|
+ <!-- ========================= -->
|
|
384
|
369
|
<!-- 夫 -->
|
|
385
|
|
-
|
|
386
|
|
- @if (
|
|
387
|
|
- layout.node.unit.husband
|
|
388
|
|
- ) {
|
|
|
370
|
+ <!-- ========================= -->
|
|
|
371
|
+ @if (layout.node.unit.husband) {
|
|
389
|
372
|
|
|
390
|
373
|
<rect [attr.x]="getHusbandX(layout)" [attr.y]="layout.y" [attr.width]="PERSON_WIDTH"
|
|
391
|
374
|
[attr.height]="PERSON_HEIGHT" fill="#dbeafe"
|
|
392
|
375
|
[attr.stroke]="selectedFamily?.id === layout.node.unit.husband?.id ? '#2563eb' : 'black'"
|
|
393
|
376
|
class="family-node" (click)="selectFamily(layout.node.unit.husband!)" />
|
|
394
|
377
|
|
|
395
|
|
- <text [attr.x]="getHusbandTextX(layout)" [attr.y]="layout.y + 20"
|
|
396
|
|
- style="writing-mode: vertical-rl;"
|
|
397
|
|
- [attr.stroke-width]="selectedFamily?.id === layout.node.unit.husband?.id ? 3 : 1"
|
|
398
|
|
- class="family-text" (click)="selectFamily(layout.node.unit.husband!)">
|
|
399
|
|
-
|
|
|
378
|
+ <!-- 右:名前(基準) -->
|
|
|
379
|
+ <text [attr.x]="getHusbandTextX(layout)" [attr.y]="layout.y + 15"
|
|
|
380
|
+ style="writing-mode: vertical-rl; text-orientation: upright;" class="family-text"
|
|
|
381
|
+ (click)="selectFamily(layout.node.unit.husband!)">
|
|
400
|
382
|
{{ layout.node.unit.husband.name }}
|
|
|
383
|
+ </text>
|
|
401
|
384
|
|
|
|
385
|
+ <!-- 中央:没年月日(名前の左) -->
|
|
|
386
|
+ @if (getDeathWareki(layout.node.unit.husband)) {
|
|
|
387
|
+
|
|
|
388
|
+ <text [attr.x]="getHusbandTextX(layout) - 26" [attr.y]="getDeathTextY(layout, getDeathWareki(layout.node.unit.husband))"
|
|
|
389
|
+ dominant-baseline="text-after-edge" style="writing-mode: vertical-rl; text-orientation: upright;"
|
|
|
390
|
+ [attr.font-size]="DEATH_FONT_SIZE">
|
|
|
391
|
+ {{ getDeathWareki(layout.node.unit.husband) }}
|
|
402
|
392
|
</text>
|
|
403
|
393
|
|
|
404
|
394
|
}
|
|
405
|
395
|
|
|
406
|
|
- <!-- 妻 -->
|
|
|
396
|
+ <!-- 左:享年 -->
|
|
|
397
|
+ @if (getAgeAtDeathText(layout.node.unit.husband)) {
|
|
407
|
398
|
|
|
408
|
|
- @if (
|
|
409
|
|
- layout.node.unit.wife
|
|
410
|
|
- ) {
|
|
|
399
|
+ <text [attr.x]="getHusbandTextX(layout) - 40" [attr.y]="getDeathTextY(layout, getAgeAtDeathText(layout.node.unit.husband))"
|
|
|
400
|
+ dominant-baseline="text-after-edge" style="writing-mode: vertical-rl; text-orientation: upright;"
|
|
|
401
|
+ [attr.font-size]="DEATH_FONT_SIZE">
|
|
|
402
|
+ {{ getAgeAtDeathText(layout.node.unit.husband) }}
|
|
|
403
|
+ </text>
|
|
|
404
|
+
|
|
|
405
|
+ }
|
|
|
406
|
+
|
|
|
407
|
+ }
|
|
|
408
|
+
|
|
|
409
|
+ <!-- ========================= -->
|
|
|
410
|
+ <!-- 妻 -->
|
|
|
411
|
+ <!-- ========================= -->
|
|
|
412
|
+ @if (layout.node.unit.wife) {
|
|
411
|
413
|
|
|
412
|
414
|
<rect [attr.x]="getWifeX(layout)" [attr.y]="layout.y" [attr.width]="PERSON_WIDTH"
|
|
413
|
415
|
[attr.height]="PERSON_HEIGHT" fill="#fde2e2"
|
|
414
|
416
|
[attr.stroke]="selectedFamily?.id === layout.node.unit.wife?.id ? '#dc2626' : 'black'"
|
|
415
|
417
|
class="family-node" (click)="selectFamily(layout.node.unit.wife!)" />
|
|
416
|
418
|
|
|
417
|
|
- <text [attr.x]="getWifeTextX(layout)" [attr.y]="layout.y + 20"
|
|
418
|
|
- style="writing-mode: vertical-rl;"
|
|
419
|
|
- [attr.stroke-width]="selectedFamily?.id === layout.node.unit.wife?.id ? 3 : 1" class="family-text"
|
|
|
419
|
+ <!-- 右:名前 -->
|
|
|
420
|
+ <text [attr.x]="getWifeTextX(layout)" [attr.y]="layout.y + 15"
|
|
|
421
|
+ style="writing-mode: vertical-rl; text-orientation: upright;" class="family-text"
|
|
420
|
422
|
(click)="selectFamily(layout.node.unit.wife!)">
|
|
421
|
|
-
|
|
422
|
423
|
{{ layout.node.unit.wife.name }}
|
|
|
424
|
+ </text>
|
|
|
425
|
+
|
|
|
426
|
+ <!-- 中央:没年月日 -->
|
|
|
427
|
+ @if (getDeathWareki(layout.node.unit.wife)) {
|
|
423
|
428
|
|
|
|
429
|
+ <text [attr.x]="getWifeTextX(layout) - 26" [attr.y]="getDeathTextY(layout, getDeathWareki(layout.node.unit.wife))"
|
|
|
430
|
+ dominant-baseline="text-after-edge" style="writing-mode: vertical-rl; text-orientation: upright;"
|
|
|
431
|
+ [attr.font-size]="DEATH_FONT_SIZE">
|
|
|
432
|
+ {{ getDeathWareki(layout.node.unit.wife) }}
|
|
424
|
433
|
</text>
|
|
425
|
434
|
|
|
426
|
435
|
}
|
|
427
|
436
|
|
|
|
437
|
+ <!-- 左:享年 -->
|
|
|
438
|
+ @if (getAgeAtDeathText(layout.node.unit.wife)) {
|
|
|
439
|
+
|
|
|
440
|
+ <text [attr.x]="getWifeTextX(layout) - 40" [attr.y]="getDeathTextY(layout, getAgeAtDeathText(layout.node.unit.wife))"
|
|
|
441
|
+ dominant-baseline="text-after-edge" style="writing-mode: vertical-rl; text-orientation: upright;"
|
|
|
442
|
+ [attr.font-size]="DEATH_FONT_SIZE">
|
|
|
443
|
+ {{ getAgeAtDeathText(layout.node.unit.wife) }}
|
|
|
444
|
+ </text>
|
|
|
445
|
+
|
|
|
446
|
+ }
|
|
|
447
|
+
|
|
|
448
|
+ }
|
|
|
449
|
+
|
|
428
|
450
|
}
|
|
429
|
451
|
|
|
430
|
452
|
</svg>
|