Voronoï Mushrooms - medialab/graph-recipes GitHub Wiki

This recipe computes a (tweaked) Voronoï space around nodes and displays it. It is not intended for visualization but rather as a computing brick to reuse in various contexts. Cells are colored according to their nodes' color.

Recipe code

Key settings

voronoi_range

Limits the size of Voronoï cells around each nodes. Infinity is a valid value and produces traditional Voronoï images.

voronoi_paint_distance

Draws the distance to the node in each cell as a gradient. Should not be used with voronoi_range = Infinity.

Demo network with settings.voronoi_range = 10 and settings.voronoi_paint_distance = true:

Demo network with settings.voronoi_range = Infinity and settings.voronoi_paint_distance = false:

voronoi_use_node_size

Set to true to augment cells size according to their nodes' size. Set to false to make as if each node has a size of 1.

Demo network with settings.voronoi_use_node_size = true:

Demo network with settings.voronoi_use_node_size = false: