risk-network 0.0.6b2__tar.gz → 0.0.6b3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/PKG-INFO +1 -1
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/__init__.py +1 -1
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/network/plot.py +6 -5
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk_network.egg-info/PKG-INFO +1 -1
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/LICENSE +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/MANIFEST.in +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/README.md +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/pyproject.toml +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/annotations/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/annotations/annotations.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/annotations/io.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/constants.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/log/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/log/console.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/log/params.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/neighborhoods/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/neighborhoods/community.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/neighborhoods/domains.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/neighborhoods/neighborhoods.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/network/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/network/geometry.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/network/graph.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/network/io.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/risk.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/fisher_exact.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/hypergeom.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/permutation/__init__.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/permutation/permutation.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/permutation/test_functions.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk/stats/stats.py +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk_network.egg-info/SOURCES.txt +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk_network.egg-info/dependency_links.txt +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk_network.egg-info/requires.txt +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/risk_network.egg-info/top_level.txt +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/setup.cfg +0 -0
- {risk_network-0.0.6b2 → risk_network-0.0.6b3}/setup.py +0 -0
@@ -207,6 +207,7 @@ class NetworkPlotter:
|
|
207
207
|
self,
|
208
208
|
node_size: Union[int, np.ndarray] = 50,
|
209
209
|
node_shape: str = "o",
|
210
|
+
node_edgewidth: float = 1.0,
|
210
211
|
edge_width: float = 1.0,
|
211
212
|
node_color: Union[str, List, Tuple, np.ndarray] = "white",
|
212
213
|
node_edgecolor: Union[str, List, Tuple, np.ndarray] = "black",
|
@@ -214,11 +215,12 @@ class NetworkPlotter:
|
|
214
215
|
node_alpha: float = 1.0,
|
215
216
|
edge_alpha: float = 1.0,
|
216
217
|
) -> None:
|
217
|
-
"""Plot the network graph with customizable node colors, sizes, and edge widths.
|
218
|
+
"""Plot the network graph with customizable node colors, sizes, edge widths, and node edge widths.
|
218
219
|
|
219
220
|
Args:
|
220
221
|
node_size (int or np.ndarray, optional): Size of the nodes. Can be a single integer or an array of sizes. Defaults to 50.
|
221
222
|
node_shape (str, optional): Shape of the nodes. Defaults to "o".
|
223
|
+
node_edgewidth (float, optional): Width of the node edges. Defaults to 1.0.
|
222
224
|
edge_width (float, optional): Width of the edges. Defaults to 1.0.
|
223
225
|
node_color (str, list, tuple, or np.ndarray, optional): Color of the nodes. Can be a single color or an array of colors. Defaults to "white".
|
224
226
|
node_edgecolor (str, list, tuple, or np.ndarray, optional): Color of the node edges. Defaults to "black".
|
@@ -232,6 +234,7 @@ class NetworkPlotter:
|
|
232
234
|
"custom" if isinstance(node_size, np.ndarray) else node_size
|
233
235
|
), # np.ndarray usually indicates custom sizes
|
234
236
|
network_node_shape=node_shape,
|
237
|
+
network_node_edgewidth=node_edgewidth,
|
235
238
|
network_edge_width=edge_width,
|
236
239
|
network_node_color=(
|
237
240
|
"custom" if isinstance(node_color, np.ndarray) else node_color
|
@@ -245,10 +248,7 @@ class NetworkPlotter:
|
|
245
248
|
# Convert colors to RGBA using the _to_rgba helper function
|
246
249
|
# If node_colors was generated using get_annotated_node_colors, its alpha values will override node_alpha
|
247
250
|
node_color = _to_rgba(node_color, node_alpha, num_repeats=len(self.graph.network.nodes))
|
248
|
-
|
249
|
-
node_edgecolor = _to_rgba(
|
250
|
-
node_edgecolor, 1.0, num_repeats=len(self.graph.network.nodes)
|
251
|
-
) # Node edges are usually fully opaque
|
251
|
+
node_edgecolor = _to_rgba(node_edgecolor, 1.0, num_repeats=len(self.graph.network.nodes))
|
252
252
|
edge_color = _to_rgba(edge_color, edge_alpha, num_repeats=len(self.graph.network.edges))
|
253
253
|
|
254
254
|
# Extract node coordinates from the network graph
|
@@ -262,6 +262,7 @@ class NetworkPlotter:
|
|
262
262
|
node_shape=node_shape,
|
263
263
|
node_color=node_color,
|
264
264
|
edgecolors=node_edgecolor,
|
265
|
+
linewidths=node_edgewidth,
|
265
266
|
ax=self.ax,
|
266
267
|
)
|
267
268
|
# Draw the edges of the graph
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|