Schematex

Ecomap

About ecomaps

An ecomap is a single page that shows a person or family at the center and the web of outside systems — extended family, school, church, clinic, employer, support groups — arrayed around them. Each connecting line records the quality (strong, tenuous, stressful) and direction (who gives, who takes) of the relationship. Social workers, school counselors, case managers, and community-health nurses use ecomaps to see at a glance where a client has anchors and where the safety net is thin.

Schematex follows the Hartman (1978) ecomap model — the original Social Casework paper that introduced the notation — extended with conventions from contemporary clinical social work practice. For background see Wikipedia: Ecomap. This page documents what the parser accepts today.

ecomap·§ Hartman 1978
↘ preview
100%
Ecomap Ecomap diagram with 7 external systems Nguyen Family IRC Office Lincoln Elementary Community Clinic Ms. Patel Vietnamese Temple Sponsor Family Warehouse Job active case vaccinations weekly anchor housing host new, part-time SYSTEMS Community Cultural Education Government Health Mental Health Work TIES Strong
UTF-8 · LF · 16 lines · 737 chars✓ parsed·5.6 ms·12.9 KB SVG

1. Your first ecomap

The smallest useful ecomap: one center and three outside systems.

ecomap·§ Hartman 1978
↘ preview
100%
Ecomap Ecomap diagram with 3 external systems Maria Mother Tech Corp Dr. Patel weekly SYSTEMS Family Mental Health Work TIES Strong
UTF-8 · LF · 8 lines · 246 chars✓ parsed·0.9 ms·8.0 KB SVG

Four rules cover 80% of usage:

  1. Start with the keyword ecomap, optionally followed by a quoted title.
  2. Declare the center on its own line: center: id [label: "…"]. Exactly one center per diagram.
  3. Declare each outside system on its own line: id [label: "…", category: …].
  4. Connect any two declared IDs with a connection operator=== (strong), --- (normal), <-> (reciprocal), etc. See §3 for the full table. A trailing [label: "…"] adds an edge label.

Comments must be on their own line, starting with #, //, or Mermaid-style %%. Inline trailing comments will break the parser.


2. Center and outside systems

Every ecomap has one center and any number of outside systems. Both use the same id [attrs] syntax; the only difference is the center: prefix.

ID rules. Must match [a-zA-Z][a-zA-Z0-9_-]*. IDs are case-insensitive; the original token is kept as the default label.

Attributes accepted by the parser today:

AttributeValuesEffect
label:"…"any quoted stringDisplay label override
category:…see §2.1Color / grouping of a system node
size:…small, medium, largeNode size
importance:…major, moderate, minorVisual weight
sector:…top, right, bottom, leftHint for which side of the center the system sits on
age:Ne.g. age:34Age shown inside a person-typed center
male / female / unknownflagSex for a person-typed center

2.1 System categories

Categories color-code outside systems by the life domain they belong to. The parser accepts any string — these are the values the renderer has themed palettes for:

CategoryTypical examples
familyExtended family, in-laws, cousins
friendsFriends, neighbors
workEmployer, coworkers
educationSchool, college, training program
healthPrimary care, specialist, hospital
mental-healthTherapist, psychiatrist, support group
religionChurch, temple, spiritual community
recreationSports, hobbies, clubs
legalLawyer, probation, court
governmentSocial services, housing, immigration
financialBank, benefits, financial aid
communityNeighborhood groups, sponsors
culturalCultural/ethnic organizations
substanceRecovery programs or, if negative, active-use sources
technologyOnline community, support forum
petPets, service animals
ecomap·§ Hartman 1978
↘ preview
100%
Ecomap Ecomap diagram with 5 external systems Marcus, age 15 Mother Father (divorced) East High School Soccer Coach Ms. Chen EOW weekends mentor weekly SYSTEMS Community Education Family Mental Health TIES Strong
UTF-8 · LF · 12 lines · 446 chars✓ parsed·1.1 ms·10.6 KB SVG

3. Connections

A connection is one line: fromId OP toId optionally followed by [label: "…"]. Both IDs must already be declared (center counts).

3.1 Relationship-quality operators

OperatorTypeMeaning
===strongClose, supportive, high-frequency
==moderatePositive, moderate involvement
---normalNeutral / average
- -weakTenuous, fragile, early-stage
~~~stressfulStressful relationship
~=~stressful-strongClose and stressful
~x~conflictualActive conflict
-/-brokenSevered, estranged, cutoff

3.2 Energy-flow operators

Layer arrow direction onto strong or normal lines:

OperatorMeaning
-->One-way: energy flows from center to system
<--One-way: energy flows from system to center
<->Reciprocal / bidirectional
===>Strong one-way outflow (draining)
<===Strong one-way inflow (nourishing)
<=>Strong reciprocal
==>Moderate one-way outflow
<==Moderate one-way inflow

The parser normalizes direction so arrows read relative to the center. Writing family === resettlement and resettlement === family produces the same diagram; writing clinic --> family vs family <-- clinic likewise produces the same arrow pointing from the clinic to the family.

ecomap·§ Hartman 1978
↘ preview
100%
Ecomap Ecomap diagram with 4 external systems Rosa Mom Ex AA Group Warehouse daily calls custody disputes sponsor support unstable hours SYSTEMS Family Substance Work TIES Strong Moderate Weak Conflictual
UTF-8 · LF · 10 lines · 329 chars✓ parsed·1.2 ms·10.3 KB SVG

3.3 Edge labels

A trailing [label: "…"] is the only attribute a connection line accepts. Put schedule, nature, or a short note here:

family === temple [label: "weekly service"]
clinic --> family [label: "vaccinations"]
caseworker <-> family [label: "every Tuesday"]

4. Labels & comments

  • Title: ecomap "Nguyen Family" — first line only.
  • Node label override: family [label: "The Nguyens"].
  • Edge label: trailing [label: "…"] on a connection line.
  • Mode suffix: ecomap:strengths "Smith family" is accepted. The suffix is stored as metadata.mode; current renderers ignore it.
  • Comments: #, //, or %% at the start of a line (after leading whitespace). Inline trailing comments are not supported.
ecomap "Marcus Intake"
  # caseworker's notes — fine
  // also fine
  %% Mermaid-style comments are fine
  mom [category: family]   # ← THIS trailing comment breaks the parser

5. Reserved words & escaping

Reserved at line start: ecomap, center:.

Reserved operator tokens inside a line — avoid using these sequences in IDs: ===, ==, ---, - -, ~~~, ~=~, ~x~, -/-, and the directional variants listed in §3.2.

Strings with spaces must be double-quoted: titles and any label. Single quotes and backticks are not recognized.


6. Common mistakes

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

You wroteParser saysFix
family -- schoolUnexpected: family -- schoolEcomap uses ===/---/<-> etc. -- is a genogram/pedigree operator
family === school where school was never declaredSilently creates an empty school node with no label/categoryDeclare systems above their connection lines
No center: anywhereRenders but with no visual center anchorEvery ecomap needs exactly one center: line
Two center: linesOnly the first is treated as center; the second becomes a regular systemPick one
family==school (no spaces)Unexpected: family==schoolOperators require a space on each side
family === school [weekly]Bare token weekly is parsed as a property flag, no label shownUse [label: "weekly"]
family === school # dailyTrailing # is consumed as part of the lineMove the comment above

7. Grammar (EBNF)

document       = header (blank | comment | center | system | connection)*

header         = "ecomap" ( ":" mode )? ( WS quoted-string )? NEWLINE
mode           = [A-Za-z] [A-Za-z0-9_-]*
quoted-string  = '"' any-char-but-quote* '"'

center         = "center:" WS id ( "[" attrs "]" )? NEWLINE
system         = id ( "[" attrs "]" )? NEWLINE
connection     = id WS op WS id ( WS "[" "label:" quoted-string "]" )? NEWLINE

op             = "===" | "==" | "---" | "- -" | "~~~" | "~=~" | "~x~" | "-/-"
               | "===>" | "<===" | "<=>" | "==>" | "<=="
               | "-->" | "<--" | "<->"

id             = [a-zA-Z] [a-zA-Z0-9_-]*
attrs          = attr ("," attr)*
attr           = "label" ":" quoted-string
               | "category" ":" category
               | "size" ":" ("small" | "medium" | "large")
               | "importance" ":" ("major" | "moderate" | "minor")
               | "sector" ":" ("top" | "right" | "bottom" | "left")
               | "age" ":" digits
               | "male" | "female" | "unknown"
               | key ":" value                  // custom, stored as metadata

category       = "family" | "friends" | "work" | "education" | "health"
               | "mental-health" | "religion" | "recreation" | "legal"
               | "government" | "financial" | "community" | "cultural"
               | "substance" | "technology" | "pet" | "other"

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

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


8. Standard compliance

Schematex ecomaps follow Hartman (1978), Diagrammatic Assessment of Family Relationships for the core notation: a bounded center surrounded by outside systems, connecting lines that encode both quality and directionality. The category palette and the expanded operator set (stressful-strong, reciprocal arrows) follow conventions from contemporary clinical social work and nursing research.

What is implemented today:

  • ✅ Center + outside-system radial structure
  • ✅ 8 quality operators (strong / moderate / normal / weak / stressful / stressful-strong / conflictual / broken)
  • ✅ 8 directional operators (one-way and reciprocal, at three intensities)
  • ✅ Category color-coding (17 categories)
  • ✅ Edge labels
  • ⏳ Embedded mini-genogram as the center (see §10)
  • ⏳ Sector-based layout hints beyond the current four cardinals

References:

  • Hartman, A. (1978). Diagrammatic assessment of family relationships. Social Casework, 59(8), 465–476.
  • Ray, R.A. & Street, A.F. (2005). Ecomapping: An innovative research tool for nurses. Journal of Advanced Nursing, 50(5), 545–552.
  • Rempel, G.R., Neufeld, A., & Kushner, K.E. (2007). Interactive use of genograms and ecomaps in family caregiving research. Journal of Family Nursing, 13(4), 403–419.

Ready-to-use scenarios from the examples gallery:

ecomap·§ Hartman 1978
Ecomap Ecomap diagram with 9 external systems Nguyen Family IRC Office Lincoln Elementary Adult ESL Class Community Clinic Ms. Patel Vietnamese Temple Sponsor Family Warehouse Job Cousins (CA) active case twice weekly vaccinations weekly anchor housing host new, part-time phone support SYSTEMS Community Cultural Education Family Government Health Mental Health Work TIES Strong Moderate
Refugee family resettlement
Ecomap of a refugee family's support network — IRC office, school, clinic, and sponsor family — categorized by resource type per Hartman 1978.
healthcare & social
ecomap·§ Hartman 1978
Ecomap Ecomap diagram with 6 external systems Marcus Mother Father (divorced) East High School Soccer Coach Soccer team Ms. Chen primary caregiver EOW weekends mentor weekly SYSTEMS Community Education Family Mental Health TIES Strong
Teen client intake
Quick intake ecomap for a 15-year-old showing family, school, soccer peers, and therapist — drawn in under five minutes during a counseling session.
healthcare & social
ecomap·§ Hartman 1978
Ecomap Ecomap diagram with 9 external systems James Age 28 AA Group Bill (Sponsor) Warehouse Job Mom Ex-wife Children (2) Old Friends P.O. Johnson CBT Therapist new, probationary supportive custody conflict supervised visits trying to cut off weekly SYSTEMS Family Legal Mental Health Substance Work TIES Strong Moderate Weak Stressful Broken
Substance abuse recovery
Ecomap charting a client's recovery support network — AA group, family, probation, and therapist — with relationship strength and directional connections.
healthcare & social

10. Roadmap

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

  • Embedded mini-genogram as the center — declaring a full family block inside the center: node (indented couples and children) so the center is a small genogram rather than a single shape. The parser currently reads indented content under center: as skipped lines.
  • Per-category default arrow semantics — e.g. auto-directional arrows for health systems (in) vs work systems (out).
  • Multiple centers — ecomaps for two clients sharing some systems.
  • Custom color overrides[color: "#…"] on a system or connection.

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