datavis-tech / graph-data-structure

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

Add deserialize function #7

Closed curran closed 8 years ago

curran commented 8 years ago

There is now a serialize() function, so probably we should add its inverse, maybe call it graph.parse(serialized)?

curran commented 8 years ago

Maybe better to call it deserialize?

curran commented 8 years ago

This should probably mirror D3 in that it should support an optional id function that defaults to the index in the nodes array.

curran commented 8 years ago

Not sure the id function idea makes sense actually, because as it stands, the data structure only is capable of representing nodes as strings, without storing any metadata. So parsing a graph that uses an id function would mean just using the ids of links as the nodes, and not even looking at the nodes array at all. Not implementing for now.