I have done some network generation and analysis in Python NetworkX. I do most of my visualizations with D3, but for publications I would like to generate some graph plots with Mathematica as well as perform some additional analyses. My question is: How do I import the JSON exported from NetworkX and read it in as a Mathematica graph?
Importing the JSON itself is easy. Manipulating the resulting rule sets from the JSON dictionaries into what is needed by Mathematica is also certainly possible, and certainly complicated. My expectation is that somebody has already done this and has (at least partial) code to share. There is already a question about importing specific elements from the JSON which will likely be useful to collect data and assign it to the appropriate Mathematica command.
Here is an example of going in the opposite direction: from Mathematica to the NetworkX-style JSON, so people are working in the neighborhood of this functionality.
For a specific example you can download a test JSON of the Les Miserables characters here. The question is how to import that and render it into a Mathematica graph with the properties assigned to the proper nodes and the edges connecting the proper nodes. In miserables.json there is a node property called "group" and I would like to color the nodes by that property and label them by the "name" property. Any layout is fine.
Secondly I would like to be able generate data lists from the node (or edge) properties (to generate plots like histograms). This can be done from the resulting Mathematica graph or directly from the imported JSON...whichever is easier...but it's actually better for me to do it directly from the imported JSON. This second part is really just a question about rule manipulation: how to go through a JSON structured the way NetworkX makes them and collect all and only a particular node property into a Mathematica list of values.