That's my attempt on D62553 that i (just) promised.
Here's roughly how it looks:
Full dump of some random test file:
The rough idea behind this script is that it deserializes JSON dumps into familiar python objects. Serializing them back into a pretty graph dump is only one of the possible use-cases; we can manipulate the deserialized graph by, say, hiding nodes that we aren't interested in.
This initial commit only supports Environment and Store and silently drops unsupported information; i'll hopefully follow up with more this week, most importantly ranges. As of today it's only a dot-to-dot converter, so @Charusso's SVG cleanup is not supported yet. Diffs are not supported yet; tomorrow i'll think a bit more how exactly do i want to implement them.
I wrote some tests but i'm not really sure they're worth it. I guess some corner-cases would be nice to document this way.
@Charusso, could you see if you can:
- Bring back stable IDs for nodes into JSON (not only pointers). They're very useful for debugging.
- See if your trick for reducing SVG size with text joining is even applicable to the dumps that i produce.
- Understand my code here :)
I think it is not that cool variable name. I would use the appropiate name of the object instead of the generic json name.