GenogramMaker
Copy MarkdownBuild family genograms as plain Elixir data, then render them to Graphviz DOT or Mermaid.
A genogram is a family diagram: people (with sex and vital status), the unions between them (marriage, divorce, cohabitation, …) with their children, and the emotional bonds that connect individuals (close, conflict, cutoff, …). Describe one with a small, pipeline-friendly API and turn it into diagram source you can render with Graphviz or drop straight into Markdown.
Installation
Add genogram_maker to your deps in mix.exs:
def deps do
[{:genogram_maker, "~> 0.1.0"}]
endUsage
GenogramMaker.new()
|> GenogramMaker.add_person("dad", :male, name: "John", birth: 1948, death: 2009)
|> GenogramMaker.add_person("mom", :female, name: "Mary", birth: 1950)
|> GenogramMaker.add_person("kid", :female, name: "Ada", proband: true)
|> GenogramMaker.add_union("dad", "mom", type: :marriage, children: ["kid"])
|> GenogramMaker.add_bond("dad", "kid", :conflict)
|> GenogramMaker.to_dot()produces:
digraph genogram {
rankdir=TB;
node [fontname="Helvetica"];
edge [dir=none];
p0 [label="John\n1948–2009", shape=square, style=filled, fillcolor="#dddddd"];
p1 [label="Mary\nb. 1950", shape=circle];
p2 [label="Ada", shape=circle, peripheries=2];
u0 [shape=point, width=0.03, label=""];
{ rank=same; p0; u0; p1; }
p0 -> u0;
p1 -> u0;
u0 -> p2;
p0 -> p2 [color="#c62828", label="conflict", constraint=false];
}Pipe through dot -Tsvg (or any Graphviz renderer) to get the diagram. The same
genogram renders to Mermaid with GenogramMaker.to_mermaid/1, ready to paste into
a Markdown code fence:
flowchart TB
p0["John<br/>1948–2009"]
p1(("Mary<br/>b. 1950"))
p2(("Ada"))
u0(["married"])
p0 --- u0
p1 --- u0
u0 --- p2
p0 ---|conflict| p2Conventions
On render, standard genogram conventions are applied:
- Sex decides the shape —
:maleis a square,:femalea circle,:unknowna diamond. - Vital status — a
:deathyear marks someone deceased; deceased people are shaded and the death year is shown. - Proband —
proband: truemarks the index person with a double outline. - Unions —
:marriage,:divorce,:separation,:cohabitation,:engagement. Divorce and separation add//and/markers; cohabitation is dashed and engagement dotted. - Bonds —
:close,:distant,:conflict,:hostile,:cutoff,:fused, drawn as non-structural coloured lines so they never distort the generational layout.
People referenced by a union or bond are created automatically (with unknown sex) if they have not been added yet, so the pipeline stays compact.
About
GenogramMaker is maintained by the team behind
AutoGenogram, an AI genogram maker and analyzer. If
you would rather describe a family in plain English and let AI draw the diagram,
try the AI genogram generator; this library is its
code-first companion for producing genogram source programmatically.
License
Released under the MIT License.