mapequation / infomap

Multi-level network clustering based on the Map Equation
https://mapequation.org/infomap
GNU General Public License v3.0
425 stars 88 forks source link

feat: Write node metadata to json #301

Closed antoneri closed 2 years ago

antoneri commented 2 years ago

The metadata key is an object to enable multiple metadata dimensions, and add named metadata categories in post-processing.

The metadata value is a string to highlight that this is a categorical variable. In Alluvial, we also support numerical metadata (from e.g. color map equation) and we distinguish between categorical and numerical by the value types.

Metadata is only being written for memoryless networks as we don't support using both memory and meta map equation at the same time.

Output:

"nodes": [{
      "path": [1, 1],
      "modules": [1],
      "name": "2",
      "flow": 0.214286,
      "mec": 0.230673,
      "metadata": {"0": "1"},
      "id": 2
    },
]