Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min/max_val not working in _scalar_arg_to_dict() #442

Closed
maximelucas opened this issue Aug 1, 2023 · 3 comments
Closed

min/max_val not working in _scalar_arg_to_dict() #442

maximelucas opened this issue Aug 1, 2023 · 3 comments
Labels
bug Something isn't working viz

Comments

@maximelucas
Copy link
Collaborator

Running

import xgi
from xgi.drawing.draw_utils import _scalar_arg_to_dict

H = xgi.random_hypergraph(5, ps=[0.5, 0.05])

_scalar_arg_to_dict(50, H.nodes, min_val=10, max_val=20)
# --> {0: 50, 1: 50, 2: 50, 3: 50, 4: 50}   # all values are 50 > 20, wrong!

As a consequence, the default settings in draw_nodes()

      "min_node_size": 10.0,
      "max_node_size": 30.0,
      "min_node_lw": 1.0,
      "max_node_lw": 5.0,

and all other default min/max settings going through _scalar_arg_to_dict are ignored.

@maximelucas
Copy link
Collaborator Author

#441 solved this for drawing nodes. Still needs fixing for drawing hyperedges.

@maximelucas
Copy link
Collaborator Author

#456 fixed this for hyperdges. The functions _color_arg_to_dict() and _scalar_arg_to_dict() are not used in the new versions, but are still used in draw_dihypergraph(), draw_multilayer().

@maximelucas
Copy link
Collaborator Author

Fixed by #476 for draw_dihypergraph by removing dependency. draw_multilayer remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working viz
Projects
None yet
Development

No branches or pull requests

1 participant