Skip to content

Commit

Permalink
Raise a warning if the node edge color dominates (issue #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbrodersen committed Nov 22, 2023
1 parent a6228db commit 04fbce7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions netgraph/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ def __init__(self, edges,
edge_alpha = self._normalize_numeric_argument(edge_alpha, self.edges, 'edge_alpha')
edge_zorder = self._normalize_numeric_argument(edge_zorder, self.edges, 'edge_zorder')

for node in self.nodes:
if (node_size[node] < node_edge_width[node]) & (node_color[node] != node_edge_color[node]):
msg = f"The border around the node {node} is broader than its radius."
msg += f" The node will mostly have the color of the border ({node_edge_color[node]}), even though a different face color was specified ({node_color[node]})."
msg += f" To address this issue, reduce the value given for `node_edge_width`."
warnings.warn(msg)

# Rescale.
node_size = self._rescale(node_size, BASE_SCALE)
node_edge_width = self._rescale(node_edge_width, BASE_SCALE)
Expand Down

0 comments on commit 04fbce7

Please sign in to comment.