Skip to content

About

Plots family trees using Go, Graphviz and LaTeX

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

216 Commits

Folders and files

Repository files navigation

kingraph

License: MIT contributions welcome CI

👪 Plots family trees using Go, Graphviz and LaTex

A family tree plotter with a very simple syntax. It probably doesn't cover everything bigger tools do, but covers 90% of it for the sake of simplicity.

Example Graph

Getting started

A family tree is a YAML file. To get started, store the following text in a file called family.yaml:

families:
  - parents: [Marge, Homer]
    children: [Bart, Lisa, Maggie]
  - parents: [Lisa, Milhouse]
    children: [Zia]

people:
  Marge:
    fullname: Marjorie Bouvier Simpson

Build the project and then run the CLI application to transform a YAML file into a Graphviz DOT file or SVG:

go mod tidy
go build -o kingraph ./cmd/kingraph
./kingraph -y ./examples/simpsons.yaml -f svg > out.svg

Further Examples

Spoiler alerts, view at your own risk :)

Simpsons (simple)

Source: simpsons.yaml

Simpsons Example

Modern Family (simple with houses)

Source: modernfamily.yaml

Modern Family Example

Harry Potter (larger tree)

Source: potter.yaml

Potter Example

Game of Thrones (overly complicated)

Source: got.yaml

GOT Example

Documentation

For further reading:

Commands

Render DOT:

./kingraph -y ./examples/simpsons.yaml -f dot > out.dot

Render SVG (requires dot):

./kingraph -y ./examples/simpsons.yaml -f svg > out.svg

LaTeX fan chart:

./kingraph latexFanChart -y ./examples/simpsons.yaml --ancestorLeaf Homer --generations 4

Transform to GEDCOM:

./kingraph transform -y ./examples/simpsons.yaml -f gedcom > out.ged

Statistics:

./kingraph stats -y ./examples/simpsons.yaml

Develop

Ensure you have go 1.26+ installed and run the following commands:

go mod tidy
go build -o kingraph ./cmd/kingraph

To execute tests and coverage run the following command:

go test ./...

To format the code run the following command:

go fmt ./...

To run the linter on the code run the following command:

go vet ./...

Thanks

Authored and initially maintained by Rico Sta. Cruz in 2016 with help from contributors.

Forked in 2022 by vorburger.

Forked in 2024 by alxflam, initially modernized and migrated to TypeScript, afterwards migrated to Go in 2026.

About

Plots family trees using Go, Graphviz and LaTeX

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages