tmcw / gedcom

A simple GEDCOM parser that focuses on translating GEDCOM structure into JSON.
https://tmcw.github.io/parse-gedcom/live/
ISC License
159 stars 31 forks source link

Invalid graph links generated by .d3ize() #18

Closed mn113 closed 3 years ago

mn113 commented 6 years ago

I am trying out this library and imported the sample gedcom file found on: http://heiner-eichmann.de/gedcom/allged.htm The essential contents of this file are 8 individuals and 4 families, giving 12 nodes and 11 expected edges in the graph.

The parser gets through it all and makes seemingly valid JSON, but when I pass that into .d3ize(), there is one bad link among the 12 links returned:

links: [ { source: 8, target: 0 },
  { source: 8, target: 1 },
  { source: 8, target: 2 },
  { source: 8, target: 3 },
  { source: 8, target: undefined }, <-- invalid
  { source: 9, target: 4 },
  { source: 9, target: 0 },
  { source: 10, target: 5 },
  { source: 10, target: 0 },
  { source: 11, target: 0 },
  { source: 11, target: 7 },
  { source: 11, target: 6 } ]

I haven't found out what caused it yet, and for now I'm going to work around the error by testing for undefined values before I plug the JSON into dagre-d3 for graphing.

mdugue commented 4 years ago

hey @mn113 I just stumbled upon the same problem. Do you have any news on this? @tmcw is this project still maintained btw?

mn113 commented 4 years ago

Nope!

tmcw commented 4 years ago

I'll happily review and accept a PR from anyone who wants to help. d3ize is a very concise and debuggable bit of code, so I'd recommend taking a look to see if the solution is discoverable.

mdugue commented 4 years ago

Thanks, for your reply. Would you recommend developing against master or v2? The latter one seems newer but also somewhat stale.

Am 08.01.2020 um 23:22 schrieb Tom MacWright notifications@github.com:

 I'll happily review and accept a PR from anyone who wants to help. d3ize is a very concise and debuggable bit of code, so I'd recommend taking a look to see if the solution is discoverable.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

tmcw commented 3 years ago

The main branch is rewritten and fixes this bug.