Skip to content

Commit

Permalink
v 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DrLoiseau authored Jan 1, 2025
1 parent b6c3c7c commit 07849f4
Show file tree
Hide file tree
Showing 6 changed files with 1,579 additions and 0 deletions.
232 changes: 232 additions & 0 deletions packages/preview/genealotree/0.2.0/LICENSE

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions packages/preview/genealotree/0.2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Presentation

Genealotree is a typst package to draw genealogical trees.
It is developped at https://codeberg.org/drloiseau/genealogy. This is the place you can get the developpement version and send issues and pull requests.

![Example](examples/example.jpg "Example simple tree")

This package is based on [CeTZ]("https://typst.app/universe/package/cetz/") and it provides functions to draw genealogical trees. It is oriented towards medical genealogy to study genetic disorders inheritance, but you might be able to use it to draw your family tree.

**Features :**
- Draw an unlimited number of independant genealogical trees
- Supports consanguinity and unions between different trees (see limitations)
- Supports unlimited number of remarriages
- Auto adjusts position of children to optimize spacing
- Customize all lengths
- Draw as much phenotypes as needed by coloring individuals
- Print genotype and/or phenotype labels under individuals

**Limitations :**
- Must manually adjust individual position in the tree when drawing consanguinity and unions between trees to prevent overlapping of individuals.
- No union between individuals at different generations (might be added in a future version)

**To be implemented :**
- Allow to pass CeTZ arguments to every elements to cutomize their appearance
- Draw optional legends for tree symbols and for phenotypes

# Usage

See example.typ for a simple usage example, and the manual for precise references at [manual.pdf](https://codeberg.org/attachments/cfdad2b7-52ae-4e18-8d7b-453fadc45532)

The steps to produce a tree are :

- Import the package and CeTZ
```typ
#import "@preview/genealotree:0.1.0": *
#import "@preview/cetz:0.3.1": canvas
```

- Create a genealogy object
```typ
let my-geneal = genealogy-init()
```

- Add persons to the object : pass a dictionary mapping a persons name with a dictionary describing its characteristics. See the manual for a full reference.
```typ
let my-geneal = add-persons(
my-geneal,
(
"I1": (sex: "m"),
"I2": (sex: "f"),
"II1": (sex: "f"),
)
)
```

- Set unions between persons : give the parents names as an array of 2 strings, and the children names as an array of strings.
```typ
let my-geneal = add-unions(
my-geneal,
(("I1", "I2"), ("II1",))
)
```

- Open up a CeTZ canva and draw the tree
```typ
#canvas(length: 0.4cm, {
draw-tree(my-geneal)
})
```

Loading

0 comments on commit 07849f4

Please sign in to comment.