This commit is contained in:
Vargha Csongor
2025-04-29 08:52:34 +00:00
parent 0d998f648c
commit e5061d6b4f
9 changed files with 7668 additions and 6847 deletions

View File

@@ -20,7 +20,6 @@
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.4",
"@cloudflare/workers-types": "^4.20250214.0",
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.18.0",
"@playwright/test": "^1.50.1",

View File

@@ -69,4 +69,4 @@
"openapi-fetch": "^0.13.5",
"pikaday": "^1.8.2"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -24,8 +24,8 @@ export function parseFamilyTree(data: components['schemas']['FamilyTree']): Layo
let relationships: Edge[] = [];
if (data.relationships) {
relationships = data.relationships.map((relationship) => {
let newEdge = { data: { ...relationship.Props } } as Edge;
newEdge.data!.type = relationship.Type?.toLowerCase();
const newEdge = { data: { ...relationship.Props } } as Edge;
newEdge.data!.type = relationship.Type?.toLowerCase();
if (relationship.StartElementId !== null && relationship.StartElementId !== undefined) {
newEdge.source = relationship.StartElementId;
}

View File

@@ -17,7 +17,7 @@ export class FamilyTree extends dagre.graphlib.Graph {
): Layout {
const isHorizontal = direction === 'LR';
this.setGraph({ rankdir: direction });
this.setDefaultEdgeLabel(() => ({}))
this.setDefaultEdgeLabel(() => ({}));
nodes.forEach((node) => {
this.setNode(node.id, { width: nodeWidth, height: nodeHeight });
});
@@ -32,10 +32,10 @@ export class FamilyTree extends dagre.graphlib.Graph {
let newEdges: Edge[] = [];
edges.forEach((edge) => {
let newEdge = {...edge};
let newEdge = { ...edge };
if (edge.data?.type === 'spouse') {
newEdge.style = "dashed; stroke: #000; stroke-width: 2px; color: red;";
newEdge.style = 'dashed; stroke: #000; stroke-width: 2px; color: red;';
const sourceNode = this.node(edge.source);
const targetNode = this.node(edge.target);
if (!sourceNode || !targetNode) {
@@ -76,8 +76,7 @@ export class FamilyTree extends dagre.graphlib.Graph {
targetNode.x = desiredX;
targetNode.y = sourceNode.y;
}
newEdge.type = 'smoothstep'
newEdge.type = 'smoothstep';
newEdges.push(newEdge), newEdge;
});

View File

@@ -103,24 +103,24 @@
<p>
<strong>{born()}:</strong>
{#if editorMode}<input
type="text"
class="pika-single w-full"
id="birth_date"
bind:this={birth_date}
bind:value={person.born}
/>
type="text"
class="pika-single w-full"
id="birth_date"
bind:this={birth_date}
bind:value={person.born}
/>
{:else}{person.born ?? '-'}{/if}
</p>
<p>
<strong>{died()}:</strong>
{#if editorMode}<input
type="text"
class="pika-single w-full"
id="death_date"
placeholder={died()}
bind:this={death_date}
bind:value={person.died}
/>{:else}{person.died ?? '-'}{/if}
type="text"
class="pika-single w-full"
id="death_date"
placeholder={died()}
bind:this={death_date}
bind:value={person.died}
/>{:else}{person.died ?? '-'}{/if}
</p>
<p>
<strong>{biological_sex()}:</strong>

View File

@@ -25,7 +25,7 @@ export async function load(event: RequestEvent) {
const data = (await response.json()) as components['schemas']['FamilyTree'];
let layout = parseFamilyTree(data) as Layout & {id: string};
const layout = parseFamilyTree(data) as Layout & { id: string };
layout.id = event.locals.session.userId;
return layout;

File diff suppressed because it is too large Load Diff

View File

@@ -16,4 +16,4 @@
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
}