datavis-tech / graph-data-structure

A graph data structure with topological sort and shortest path algorithms.
MIT License
249 stars 46 forks source link

Change serialization to use objects for nodes #9

Closed curran closed 8 years ago

curran commented 8 years ago

Make the structure be like this:

{
  "nodes": [
    { "id": "a" },
    { "id": "b" },
    { "id": "c" }
  ],
  "links": [
    { "source": "a", "target": "b" },
    { "source": "b", "target": "c" }
  ]
}
curran commented 8 years ago

Related to https://github.com/d3/d3-force/issues/32

curran commented 8 years ago

Required for https://github.com/datavis-tech/reactive-model/issues/28

curran commented 8 years ago

Part of reactive-model 1.0 https://github.com/datavis-tech/reactive-model/issues/31

Natallia112202 commented 6 years ago

The structure of my file with links and nodes perfectly matches the one recommended in this blog: { "nodes": [ { "id": "a" }, { "id": "b" }, { "id": "c" } ], "links": [ { "source": "a", "target": "b" }, { "source": "b", "target": "c" } ] } Yet, when I run my index.html file (attached) using graph_russian.json file (attached) I got the "Cannot create property 'vx' on string" error. Can anyone help?

graph_russian.txt index.txt

curran commented 6 years ago

This seems like a question about D3, not about this library.

Please post your request for D3 help in the d3-js Google Group or the d3-js Slack. Thanks!