howso-visuals 2.3.0__py3-none-any.whl → 2.4.1__py3-none-any.whl

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.
howso/visuals/graph.py CHANGED
@@ -1,4 +1,4 @@
1
- from collections.abc import Callable, Collection, Mapping
1
+ from collections.abc import Callable, Collection, Mapping, Sequence
2
2
  from typing import Any, SupportsInt, TypeAlias
3
3
 
4
4
  import networkx as nx
@@ -111,6 +111,7 @@ def _create_edge_annotations(
111
111
  def plot_graph(
112
112
  G: nx.Graph, # noqa: N803
113
113
  *,
114
+ colorscale: str | Sequence[tuple[float, str]] = "Bluered",
114
115
  cscale_tuple: tuple[float, float, float] = None,
115
116
  edge_attr_sigfigs: SupportsInt | None = 4,
116
117
  edge_attr: str | None = None,
@@ -129,8 +130,11 @@ def plot_graph(
129
130
  ----------
130
131
  G : nx.Graph
131
132
  The graph to plot.
133
+ colorscale : str | Sequence[tuple[float, str]], default "Bluered"
134
+ The colorscale to use when plotting nodes using ``node_color``. Defaults to `Plotly`'s reversed "Bluered"
135
+ colorscale.
132
136
  cscale_tuple : tuple[float, float, float], optional
133
- The tuple of values to use for the colorscale. If None, (3, 15, 30) will be used.
137
+ The tuple of values (``cmin``, ``cmid``, ``cmax``) to use for the colorscale. If None, ``(3, 15, 30)`` will be used.
134
138
  edge_attr : str, optional
135
139
  The name of the edge attribute to use when scaling the size of the edges. This should
136
140
  be an attribute that is contained within ``G``.
@@ -230,7 +234,7 @@ def plot_graph(
230
234
 
231
235
  fig.update_layout(
232
236
  coloraxis=dict(
233
- colorscale="Bluered_r",
237
+ colorscale=colorscale,
234
238
  cmin=cbot,
235
239
  cmid=cmid,
236
240
  cmax=cmax,
@@ -239,7 +243,6 @@ def plot_graph(
239
243
  tickvals=[cbot, cmin, cmid, cmax],
240
244
  ticktext=[f"{cbot}", f"{cmin}", f"{cmid}", f"≥{cmax}"],
241
245
  ),
242
- reversescale=True,
243
246
  ),
244
247
  )
245
248
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howso-visuals
3
- Version: 2.3.0
3
+ Version: 2.4.1
4
4
  Summary: Visualization utilities for use with Howso Engine.
5
5
  License: GNU AFFERO GENERAL PUBLIC LICENSE
6
6
  Version 3, 19 November 2007
@@ -8,15 +8,15 @@ config/powershell/Download-Tzdata.ps1,sha256=uGNszw3t3quz1ClN3PWlPr4cKMar9KxxFf4
8
8
  config/powershell/Helper-Functions.ps1,sha256=oLEunSYLr-zxtG9kqYuOGG8v3kSxTQEpqeERWQ4jC8I,990
9
9
  howso/visuals/__init__.py,sha256=OL9LT4186YIXkEmM4qc21maRnfrtxBmFUHnalcKzGWA,507
10
10
  howso/visuals/colors.py,sha256=2ChjT4MUjA4ZqITR_K1j3fUKNRBd8M9iyJ4ZT10cNlw,1709
11
- howso/visuals/graph.py,sha256=_9DMGBQCzSuPA2UxIb4elgXpWlUG97YVTTASVdF4zOw,8054
11
+ howso/visuals/graph.py,sha256=OWbeOTn-OC4WQOZ65XjkpeQlEUzRI_7AwU8ldamYZi4,8334
12
12
  howso/visuals/visuals.py,sha256=ZW6hDabf-nQJZ5ZZ4yMC2vStJxk8cBwAkVxl5Dz1Hvc,30419
13
13
  howso/visuals/data/iris.csv,sha256=73iTb6rB42LgZwf89er-tEbuyjlvEAx6WywMPwt0GjU,2757
14
14
  howso/visuals/tests/conftest.py,sha256=BcvCVDWbwaQKSstzJzN9G48KoDnCgTtVdgYo2CJZTWM,1293
15
15
  howso/visuals/tests/test_graph.py,sha256=gfuJNpsNBLx2tDXDIR-ClbCZUSOQCmk8Dx2X-NhN2yM,1014
16
16
  howso/visuals/tests/test_plot.py,sha256=lOYYUty84LFFdaQCDcw-fMAicTqlHIwvNtuVch0RIEE,8121
17
- howso_visuals-2.3.0.dist-info/licenses/LICENSE-3RD-PARTY.txt,sha256=gQCRczb39so1uukj3mR5BYytgO87owXzfLkgjfDau-U,370555
18
- howso_visuals-2.3.0.dist-info/licenses/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
19
- howso_visuals-2.3.0.dist-info/METADATA,sha256=AuOfqSN_7GYpZH5JhIrHcRjtQA6gm28Fxddl3pa8WT8,41051
20
- howso_visuals-2.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- howso_visuals-2.3.0.dist-info/top_level.txt,sha256=4ltSHx7mNsXczuoCPkz1irjq1x1JZir2QrX-ZwRNWXU,22
22
- howso_visuals-2.3.0.dist-info/RECORD,,
17
+ howso_visuals-2.4.1.dist-info/licenses/LICENSE-3RD-PARTY.txt,sha256=gQCRczb39so1uukj3mR5BYytgO87owXzfLkgjfDau-U,370555
18
+ howso_visuals-2.4.1.dist-info/licenses/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
19
+ howso_visuals-2.4.1.dist-info/METADATA,sha256=WxxC8YhIcHzuZVDyIEio5tfkwNGPpImfgxH5dN_wkJA,41051
20
+ howso_visuals-2.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ howso_visuals-2.4.1.dist-info/top_level.txt,sha256=4ltSHx7mNsXczuoCPkz1irjq1x1JZir2QrX-ZwRNWXU,22
22
+ howso_visuals-2.4.1.dist-info/RECORD,,