A GEDCOM parser, which translates GEDCOM (.ged) files into D3 capable JSON. This package is specifically designed to prepare data for use in https://github.com/oh-kay-blanket/blood-lines
npm install gedcom-d3A parser and converter for GEDCOM (.ged) files, producing D3-capable JSON for genealogy visualization, especially with 3d-force-graph.
- Based on: tmcw/parse-gedcom
- See it in action: oh-kay-blanket/blood-lines
---
``sh`
npm install --save gedcom-d3
---
- Input: A string containing GEDCOM data.
- Output: An array of parsed GEDCOM objects (tree structure).
- Input: The output of parse() (GEDCOM tree array).nodes
- Output: An object with the following structure:
- : Array of person nodes, each with properties like id, name, surname, gender, dob, yob, color, bio, etc.links
- : Array of relationship links (parent/child, spouse, etc.), with source, target, and relationship type.families
- : Array of family groupings from the GEDCOM data.surnameList
- : Array of unique surnames with color assignments.
---
`javascript
import { parse, d3ize } from 'gedcom-d3'
import gedcomFile from './gedcoms/sample_ancestors.ged'
const tree = parse(gedcomFile)
const d3Data = d3ize(tree)
// d3Data.nodes and d3Data.links can be fed into 3d-force-graph or similar D3 visualizations
`
---
- id: Unique identifier (GEDCOM pointer)name
- : Full namefirstName
- , surname: Parsed name partsgender
- : 'M' or 'F'dob
- , yob: Date/year of birthdod
- , yod: Date/year of deathpob
- , pod: Place of birth/deathfamilies
- : Array of family objectscolor
- : Assigned color for surnamebio
- : Biographical notes (if present)
- ...and more, depending on GEDCOM tags
- source: Source person idtarget
- : Target person idsourceType
- , targetType: Relationship roles (e.g., 'HUSB', 'WIFE', 'CHIL')type
- : Relationship type (e.g., 'MARR', 'DIV', or parentage)
---
- Edit code, update version in package.json (see semver).
- In another project, run:
`sh`
npm install /path/to/gedcom-d3
npm link
- Or use for local development.
`sh`
git add .
git commit -m "Describe your changes"
git push
- For a patch, minor, or major update:
`sh`
npm version patch # or 'minor' or 'major'
git push && git push --tags
- Log in if you haven't:
`sh`
npm login
`
- Publish:
sh`
npm publish
`
- For scoped packages (not needed here):
sh``
npm publish --access public
- Check your package at npmjs.com/package/gedcom-d3
---
ISC
---
Pull requests and issues welcome! See oh-kay-blanket/gedcom-d3.
---
- tmcw/parse-gedcom for the original parser
- vasturiano/3d-force-graph for visualization inspiration
- oh-kay-blanket/blood-lines for implementation example