Schematex

Genogram

About genograms

A genogram is a family diagram that goes beyond the names-and-dates of a traditional family tree: it records the emotional and medical texture of a family across three or more generations. Therapists, social workers, and genetic counselors use them to surface patterns — cut-offs, over-involvement, recurring illnesses — that are hard to see in prose case notes.

Schematex follows the McGoldrick, Gerson & Petry (2020) standard used in clinical training, plus the widely adopted GenoPro 32-type emotional-relationship taxonomy. For theory and history see Wikipedia: Genogram. This page documents what the parser accepts today.

genogram·§ McGoldrick
↘ preview
100%
Genogram: The Potter Family Genogram diagram with 10 individuals across 3 generations The Potter Family Fleamont (1909-1979) 70 Euphemia (1920-1979) 59 Mr_evans (1925) Mrs_evans (1928) James (1960-1981) 21 Lily (1960-1981) 21 Vernon (1951) Petunia (1958) Harry (1980) Dudley (1980) Fleamont (1909–1979) Euphemia (1920–1979) Mr_evans (b. 1925) Mrs_evans (b. 1928) James (1960–1981) Lily (1960–1981) Vernon (b. 1951) Petunia (b. 1958) Harry (b. 1980) Dudley (b. 1980) m. 1978 SYMBOLS Deceased RELATIONSHIPS Close Hostile Cutoff MARKERS Index person (focal subject)
UTF-8 · LF · 17 lines · 486 chars✓ parsed·10.8 ms·15.4 KB SVG

1. Your first genogram

The smallest clinically useful genogram: two parents, one child.

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 3 individuals across 2 generations Bob (1978) Alice (1980) Carol (2008) Bob (b. 1978) Alice (b. 1980) Carol (b. 2008) m. 2005
UTF-8 · LF · 5 lines · 92 chars✓ parsed·1.0 ms·5.3 KB SVG

Four rules cover 80% of usage:

  1. Start with the keyword genogram, optionally followed by a quoted title.
  2. Declare each person on their own line: id [attributes]. Attributes go in square brackets, comma-separated.
  3. Connect two people with a couple operator-- (marriage) here; see §4.1 for all six. A trailing quoted string is the relationship label.
  4. Indent under the couple line to add their children.

Comments must be on their own line, starting with #, //, or Mermaid-style %%. Trailing inline comments (bob [male, 1978] # ...) are not supported and will break the parser — see §8.


2. Individuals

An individual line is id [attr1, attr2, …]. Attributes are comma-separated, order-independent, all optional.

ID rules. Must match [a-zA-Z][a-zA-Z0-9_-]*. IDs are case-insensitive internally but preserve their original casing as the display label (override with label:"…").

Attributes accepted by the parser today:

AttributeValuesEffect
Sexmale, female, unknown, otherShape: square, circle, diamond, diamond
Statusdeceased, stillborn, miscarriage, abortionVisual modifier (X-out, scaled shape, etc.)
Birth year4-digit number, e.g. 1980First 4-digit token = birth year
Death year4-digit number after birth, e.g. 1980, 2055Second 4-digit token = death year
indexflagConcentric shape = identified patient
unknown-siblingsflagDiamond with ? — placeholder for ≥1 siblings of unknown count
age:Ne.g. age:42Age shown inside shape
death:YYYYe.g. death:2020Explicit death year
label:"…"e.g. label:"Dr. Smith"Display label override
sibling-of:<id>e.g. sibling-of:monicaPins same generation as the referenced sibling, draws a dashed bracket — for known relatives with unknown ancestry.
conditions:…see §5Medical/psychological conditions
key:valueany customStored as metadata
genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 4 individuals across 1 generations Grandma (1920-2002) 82 Dad (1950) 74 Me (1985) Em (2012) Grandma (1920–2002) Dad (b. 1950) Me (b. 1985) Em (b. 2012) SYMBOLS Deceased MARKERS Index person (focal subject)
UTF-8 · LF · 5 lines · 131 chars✓ parsed·1.1 ms·6.9 KB SVG

3. Shapes

VisualSex valueMeaning
☐ SquaremaleMale
○ CirclefemaleFemale
◇ Diamondunknown, other, or attribute omittedUnknown / unspecified

Status modifiers layer on top of the base shape:

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 4 individuals across 1 generations Passed (1930-2010) 80 Alive (1960) Stillborn_child Lost Passed (1930–2010) Alive (b. 1960) Stillborn_child Lost SYMBOLS Unknown Deceased Stillborn Miscarriage
UTF-8 · LF · 5 lines · 128 chars✓ parsed·0.8 ms·7.1 KB SVG

4. Connections

4.1 Couple operators

The parser tries these in order. The first one that matches wins — so -x- beats --.

OperatorTypeExampleMeaning
-x-divorceda -x- bDivorce
-/-separateda -/- bSeparation (married)
-//separateda -// bSeparation (alias for -/-)
-o-engageda -o- bEngagement
==consanguineousa == bBlood-related couple
--marrieda -- bMarriage
~cohabitinga ~ bCohabiting / LTR (current)
~/~cohabiting-endeda ~/~ bCohabitation has ended (never-married). Common in LATAM child-protection caseloads where biological parents lived together unmarried and the relationship has since broken — distinct from -x- divorce (no marriage) and -/- separation (still married).

A trailing quoted string becomes the relationship label (a -- b "m. 2005").

4.2 Inline individual on the right side

If the right-hand person hasn't been declared yet, you can declare them in-place:

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 3 individuals across 2 generations Ben (1968) Ann (1970) Kim (1997) Ben (b. 1968) Ann (b. 1970) Kim (b. 1997) m. 1995
UTF-8 · LF · 4 lines · 82 chars✓ parsed·2.2 ms·5.3 KB SVG

4.3 Children (indented under a couple)

Indentation under a couple line = "these are the children of this couple." Any indent greater than the couple's indent works; by convention use 2 more spaces. Children are rendered in order of declaration (render also sorts by birth year when present).

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 6 individuals across 2 generations Dad (1950) Mom (1952) Eldest (1975) Middle (1978) Twin_a (1985) Twin_b (1985) Dad (b. 1950) Mom (b. 1952) Eldest (b. 1975) Middle (b. 1978) Twin_a (b. 1985) Twin_b (b. 1985) STRUCTURAL Adopted Twin Identical
UTF-8 · LF · 8 lines · 186 chars✓ parsed·1.0 ms·7.9 KB SVG

Special child attributes:

AttributeEffect
adoptedAdoption line style
fosterFoster relationship
guardianGuardianship by a non-parent relative (e.g. grandparent custody). Same primitive as foster — drawn as a secondary "current caregiver" link when biological parents are also declared.
twin-identicalGrouped with other twin-identical children of the same couple
twin-fraternalGrouped with other twin-fraternal children
unknown-siblingsSingle diamond with ? glyph — "≥1 siblings, count and identities unknown" (pedigree convention).

4.3.1 Dual-parent families (foster, adoption, guardianship)

Children placed with a non-biological caregiver while biological parents are still part of the case can be declared under both couples. Declare the child with full attributes the first time (under the biological couple), then redeclare with just [foster] / [adopted] / [guardian] under the current caregiver. The first declaration wins layout; the second is drawn as a secondary dotted "current caregiver" link that does not pull the child away from their biological position.

genogram·§ McGoldrick
↘ preview
100%
Genogram: Foster placement Genogram diagram with 6 individuals across 2 generations Foster placement Bio dad Bio mom Foster dad Foster mom Own (2010) Child (2018) Bio dad Bio mom Foster dad Foster mom Own (b. 2010) Child (b. 2018) STRUCTURAL Cohabiting (ended) Foster MARKERS Index person (focal subject)
UTF-8 · LF · 10 lines · 240 chars✓ parsed·1.3 ms·8.9 KB SVG

The same primitive serves adoption (closed/open), foster placement, and guardianship by a relative — only the keyword differs. Re-declaration merges non-conflicting attributes (sex, birth year, label, index marker) into the original; declaring a conflicting male vs female raises a parse error rather than silently overwriting.

4.3.2 Unknown-count siblings

When a case file mentions "the child has siblings" without naming them, use either the ? shorthand on its own line, or [unknown-siblings] on a regular id. Both render as a single diamond with a "?" glyph — the standard pedigree marker for "one or more siblings, identities unknown."

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 4 individuals across 2 generations Dad Mom Known_kid (2018) ? ? Dad Mom Known_kid (b. 2018) ? SYMBOLS Unknown MARKERS Sibling(s) — unknown count
UTF-8 · LF · 6 lines · 72 chars✓ parsed·0.6 ms·7.1 KB SVG

4.3.3 Sibling-of (known relative, unknown ancestry)

To express "X is a sibling of Y" without inventing parents, use the sibling-of: <id> property. The renderer pins X to Y's generation and draws a dashed bracket above the two — the standard pedigree convention for a known relative whose ancestry is not part of the case.

genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 2 individuals across 1 generations Monica (1990) Tío materno Monica (b. 1990) Tío materno
UTF-8 · LF · 3 lines · 85 chars✓ parsed·0.5 ms·4.4 KB SVG

4.4 Emotional relationships

Separate line, parser pattern A -TYPE- B (non-directional) or A -TYPE-> B (directional). An optional quoted label goes at the end. Both individuals must already be declared before the emotional line.

harry -cutoff- petunia           # non-directional
harry -hostile- dudley "since 1991"
uncle -abuse-> nephew             # directional (arrow)

All 32 types the parser accepts today:

CategoryTypes
Positive / closeharmony, close, bestfriends, love, inlove, friendship
Negative / hostilehostile, conflict, enmity, distant-hostile, cutoff
Ambivalentclose-hostile, fused, fused-hostile
Distancedistant, normal, nevermet
Abuse (directional)abuse, physical-abuse, emotional-abuse, sexual-abuse, neglect
Control (directional)manipulative, controlling, jealous
Specialfocused, focused-neg, distrust, admirer, limerence
genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 3 individuals across 1 generations since 2010 Dad (1950) Son (1985) Daughter (1988) Dad (b. 1950) Son (b. 1985) Daughter (b. 1988) RELATIONSHIPS Close Conflict Cutoff
UTF-8 · LF · 7 lines · 136 chars✓ parsed·0.6 ms·6.8 KB SVG

5. Medical conditions

Syntax: conditions: name(fill) [+ name(fill, #color)]…

father [male, 1945, conditions: heart(full, #E53935)]
mother [female, 1948, conditions: diabetes(half-left) + anxiety(half-right, #26A69A)]
  • name — any identifier you choose (displayed in legend/tooltip).
  • fill — required, controls which region of the shape is colored. See table below.
  • color — optional hex. Default depends on the renderer theme.
  • Multiple conditions are joined with +. Each needs its own (fill).

Fill positions:

fill valueRegion
fullEntire shape
half-left / half-rightLeft / right half
half-top / half-bottomTop / bottom half
quad-tl / quad-tr / quad-bl / quad-brOne quadrant
stripedDiagonal stripe pattern (asymptomatic carrier)
dottedDot pattern
genogram·§ McGoldrick
↘ preview
100%
Genogram Genogram diagram with 3 individuals across 2 generations Dad (1950) Mom (1952) Son (1980) Dad (b. 1950) Mom (b. 1952) Son (b. 1980) CONDITIONS Heart Diabetes Depression Carrier
UTF-8 · LF · 5 lines · 205 chars✓ parsed·1.4 ms·8.5 KB SVG

6. Labels & comments

  • Title: genogram "Smith Family" — first line only.
  • Person label override: alice [female, label:"Dr. Alice Smith"].
  • Relationship label: trailing quoted string on a couple or emotional line — alice -- bob "m. 2005".
  • Comments: #, //, or %% at the start of a line (after leading whitespace). Inline comments are not supported.
genogram "Smith Family"
  # this line is a comment — fine
  %% Mermaid-style comment — also fine
  alice [female, 1980]   # ← THIS trailing comment breaks the parser

7. Reserved words & escaping

Reserved at line start: genogram (header keyword).

Reserved operator tokens inside a line — avoid using these sequences in IDs: --, ~, ~/~, ==, -x-, -/-, -//, -o-, and any -<type>- / -<type>-> matching an emotional-relationship type.

Reserved id ? — bare ? on a child line auto-generates a synthetic placeholder with the unknown-siblings marker. Do not use ? as a real id.

Strings with spaces must be double-quoted: titles, labels, label:"…". Single quotes and backticks are not recognized.


8. Common mistakes

Real parser errors, what triggers them, and how to fix.

You wroteParser saysFix
alex [nonbinary, 1995]Unknown property 'nonbinary'Use unknown or other (nonbinary is §13 Roadmap)
alice [female, transgender]Unknown property 'transgender'Not yet parseable (§13 Roadmap)
dad -- mom ← followed by child [male, 2010] at the same indentChild parsed as a new top-level individual, not as their childIndent the child line deeper than the couple line (2 spaces is enough)
A -- B where A was never declaredUnknown individual 'A'Declare A [sex, year] on a line above
father -- mother "married" on line 1 (no genogram header)Expected "genogram" headerStart the file with genogram or genogram "Title"
conditions: diabetes + cancer (no parens)Invalid condition format 'diabetes'Add fill: conditions: diabetes(half-left) + cancer(half-right)
[triplet-identical]Unknown property 'triplet-identical'Triplets not yet parseable (§13 Roadmap)
dad -- mom # first marriageTrailing inline # comment is treated as part of the label / errorsMove the comment to its own line
Same id declared twice with different sex (x [male] then x [female])Conflicting sex for 'x': previously 'male', now 'female'Pick one or rename one of the ids
child [foster] redeclared but biological parents never declaredchild becomes the foster couple's regular child (no secondary link drawn)This is intentional — secondary links require an existing primary parent-child rel from a prior declaration

9. Grammar (EBNF)

document       = header (blank | comment | individual | couple-block | emotional)*

header         = "genogram" ( WS quoted-string )? NEWLINE
quoted-string  = '"' any-char-but-quote* '"'

individual     = INDENT id ( "[" attrs "]" )? NEWLINE
couple-block   = INDENT id WS coupleOp WS right-side ( WS quoted-string )? NEWLINE
                   ( deeper-indent child )*
child          = INDENT id ( "[" attrs "]" )? NEWLINE
               | INDENT "?" NEWLINE                              // unknown-count sibling shorthand
right-side     = id ( "[" attrs "]" )?

emotional      = INDENT id WS "-" type "-"  id ( WS quoted-string )? NEWLINE
               | INDENT id WS "-" type "->" id ( WS quoted-string )? NEWLINE

coupleOp       = "~/~" | "-//" | "-x-" | "-/-" | "-o-" | "==" | "--" | "~"
type           = "harmony" | "close" | "bestfriends" | "love" | "inlove"
               | "friendship" | "hostile" | "conflict" | "enmity"
               | "distant-hostile" | "cutoff" | "close-hostile" | "fused"
               | "fused-hostile" | "distant" | "normal" | "nevermet"
               | "abuse" | "physical-abuse" | "emotional-abuse"
               | "sexual-abuse" | "neglect" | "manipulative" | "controlling"
               | "jealous" | "focused" | "focused-neg" | "distrust"
               | "admirer" | "limerence"

id             = [a-zA-Z] [a-zA-Z0-9_-]*
attrs          = attr ("," attr)*
attr           = "male" | "female" | "unknown" | "other"
               | "deceased" | "stillborn" | "miscarriage" | "abortion"
               | "adopted" | "foster" | "guardian"
               | "twin-identical" | "twin-fraternal"
               | "index" | "unknown-siblings"
               | digit digit digit digit                         // year
               | "age" ":" digits
               | "death" ":" digit digit digit digit
               | "label" ":" quoted-string
               | "sibling-of" ":" id
               | "conditions" ":" condition ("+" condition)*
               | key ":" value                                    // custom
condition      = name "(" fill ("," "#" hex)? ")"
fill           = "full" | "half-left" | "half-right" | "half-top" | "half-bottom"
               | "quad-tl" | "quad-tr" | "quad-bl" | "quad-br"
               | "striped" | "dotted"

comment        = INDENT ( "#" | "//" | "%%" ) any NEWLINE

Authoritative source: src/diagrams/genogram/parser.ts. If this diverges from the parser, the parser wins — please open an issue.


10. Standard compliance

Schematex genograms follow McGoldrick, Gerson & Petry (2020), Genograms: Assessment and Treatment, 4th ed. for structural symbols, couple operators, and generation alignment. Emotional-relationship taxonomy follows GenoPro's 32-type classification (we do not implement GenoPro's 34-type set in full; focused-admirer and one duplicate are folded into focused and admirer).

What is implemented today vs. the standard:

  • ✅ Core structural symbols (male/female/unknown, deceased, stillborn, miscarriage, abortion)
  • ✅ McGoldrick 6-operator couple system
  • ✅ GenoPro 32 emotional types, directional where clinically specified
  • ✅ Medical condition quadrant fill system (4-position + stripe/dot patterns)
  • ✅ Index person (concentric shape)
  • ✅ Twin groupings (identical / fraternal)
  • ⏳ Bennett 2022 gender inclusivity additions — see §13
  • ⏳ Donor / surrogate / step-child connection types — see §13

References:

  • McGoldrick, M., Gerson, R., & Petry, S. (2020). Genograms: Assessment and Treatment (4th ed.).
  • Hardy, K.V. & Laszloffy, T.A. (1995). The cultural genogram. J Marital Fam Ther, 21(3), 227–237.
  • GenoPro symbol reference — https://genopro.com/genogram/

Ready-to-use scenarios from the examples gallery:

genogram·§ McGoldrick 2020
Genogram: Smith Family Genogram diagram with 3 individuals across 2 generations Smith Family John (1975) Mary (1977) Alice (2005) John (b. 1975) Mary (b. 1977) Alice (b. 2005) m. 2002 MARKERS Index person (focal subject)
Nuclear family (minimal template)
Minimal nuclear family genogram — married couple, one child, marriage date — the clinical intake starting template per McGoldrick 2020 notation.
healthcare & social
genogram·§ McGoldrick 2020
Genogram: Medical History Genogram diagram with 7 individuals across 3 generations Medical History Grandfather (1930-1990) 60 Grandmother (1935) Father (1960) Mother (1962) Uncle (1963) Patient (1988) Sister (1991) Grandfather (1930–1990) Grandmother (b. 1935) Father (b. 1960) Mother (b. 1962) Uncle (b. 1963) Patient (b. 1988) Sister (b. 1991) SYMBOLS Deceased CONDITIONS Heart Disease Diabetes Cancer Hypertension MARKERS Index person (focal subject)
Multi-generation medical history
Three-generation family medical history genogram with multi-condition color annotations using fill zones — heart disease, diabetes, cancer, hypertension.
healthcare & social
genogram·§ McGoldrick 2020
Genogram: BRCA1 Family Genogram diagram with 8 individuals across 3 generations BRCA1 Family I_1 (1930-1995) 65 I_2 (1932-1990) 58 II_4 (1954) II_1 (1955) II_2 (1958) II_3 (1960) III_1 (1985) III_2 (1988) I_1 (1930–1995) I_2 (1932–1990) II_4 (b. 1954) II_1 (b. 1955) II_2 (b. 1958) II_3 (b. 1960) III_1 (b. 1985) III_2 (b. 1988) SYMBOLS Deceased CONDITIONS Ovarian Cancer Breast Cancer MARKERS Index person (focal subject)
Hereditary cancer (BRCA1) family
Three-generation BRCA1 family genogram with hereditary breast/ovarian cancer conditions — captured at intake before formal clinical pedigree analysis.
healthcare & social
genogram·§ McGoldrick 2020
Genogram: The Potter Family Genogram diagram with 10 individuals across 3 generations The Potter Family Fleamont (1909-1979) 70 Euphemia (1920-1979) 59 Mr_evans (1925) Mrs_evans (1928) James (1960-1981) 21 Lily (1960-1981) 21 Vernon (1951) Petunia (1958) Harry (1980) Dudley (1980) Fleamont (1909–1979) Euphemia (1920–1979) Mr_evans (b. 1925) Mrs_evans (b. 1928) James (1960–1981) Lily (1960–1981) Vernon (b. 1951) Petunia (b. 1958) Harry (b. 1980) Dudley (b. 1980) m. 1978 SYMBOLS Deceased RELATIONSHIPS Close Hostile Cutoff MARKERS Index person (focal subject)
The Potter family
Three-generation Potter family genogram with emotional relationship lines — cutoff, hostile, and close — illustrating McGoldrick relational notation.
education
genogram·§ McGoldrick 2020 + Bennett 2022 (adopted-out / dual-parent convention)
Genogram: Familia Isaías Genogram diagram with 9 individuals across 2 generations Familia Isaías Víctor Seguel Mónica Barrientos Tío materno Don Pablo Doña Priscila Isaías (2020) 6 ? ? Pablo (jr) Alanis Víctor Seguel Mónica Barrientos Tío materno Don Pablo Doña Priscila Isaías (b. 2020) ? Pablo (jr) Alanis SYMBOLS Unknown STRUCTURAL Cohabiting (ended) Foster RELATIONSHIPS Nevermet Physical Abuse MARKERS Index person (focal subject) Sibling(s) — unknown count
Foster care / child protection
Foster-care genogram for a real LATAM child-protection case — biological parents (cohabitation ended), abuse, current foster placement (dotted secondary link), unknown-count siblings, and a maternal uncle as known-relative-with-unknown-ancestry.
social-work

13. Roadmap

Planned — not yet parseable. Do not use these in generated DSL today; the parser will reject them.

  • Bennett 2022 gender inclusivitynonbinary, intersex as sex values; transgender as a marker. Currently typed in src/core/types.ts but the parser's VALID_SEX set does not yet include them.
  • Triplets and higher-order birthstriplet-identical, triplet-fraternal.
  • Modern family structuressurrogate, donor, step as child-type attributes.
  • Category shorthand for conditionsconditions: cardiovascular + depression without (fill), auto-assigning quadrants and default colors.
  • Domestic partnership operator~dp~ / explicit DP label.
  • Heritage annotations — cultural-genogram heritage identifiers on individuals.
  • Household boundary boxes — group nodes that share a roof (foster placement, multi-generational household).

Track in the GitHub issues if you need any of these sooner.