Open nwlandry opened 6 months ago
Do you mean that you would like the -1 to be rescaled to a positive value? I feel like any negative value for a node size is wrong and should raise an error rather than be rescaled, but happy to be convinced.
Maybe a work-around solution would be to publish a recipe detailing how to take a list of nodal values (In my case, continuous values between -1 and 1) and mapping them to node sizes. I probably would do something like
import xgi
import numpy as np
min_node_size = 1
max_node_size = 30
H = xgi.Hypergraph([[1, 2, 3]])
props = np.random.uniform(-1, 1, H.num_nodes)
node_size = np.interp(props, [props.min(), props.max()], [min_node_size, max_node_size])
xgi.draw(H, node_size=node_size)
Yea we can probably do that. My feeling is that I would probably rather visualize that by having colored nodes with a diverging colormap to visualize positive and negative values. What's your exact use case? An interpolation recipe is useful in any case I would say.
Minimal working example:
gives the error
ValueError: node_size cannot contain negative values.
We should make this consistent with how xgi handles nodestats, i.e., interpolating them between max and min values.