howso-visuals 2.1.1__py3-none-any.whl → 2.2.0__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
@@ -103,6 +103,7 @@ def _create_edge_annotations(
103
103
  def plot_graph(
104
104
  G: nx.Graph, # noqa: N803
105
105
  *,
106
+ cscale_tuple: tuple[float, float, float] = None,
106
107
  edge_attr_sigfigs: SupportsInt | None = 4,
107
108
  edge_attr: str | None = None,
108
109
  label_edges: bool = True,
@@ -118,6 +119,8 @@ def plot_graph(
118
119
  ----------
119
120
  G : nx.Graph
120
121
  The graph to plot.
122
+ cscale_tuple : tuple[float, float, float], optional
123
+ The tuple of values to use for the colorscale. If None, (3, 15, 30) will be used.
121
124
  edge_attr : str, optional
122
125
  The name of the edge attribute to use when scaling the size of the edges. This should
123
126
  be an attribute that is contained within ``G``.
@@ -196,14 +199,28 @@ def plot_graph(
196
199
  annotations=annotations,
197
200
  )
198
201
  )
202
+
203
+ if cscale_tuple is None:
204
+ cbot = 1
205
+ cmin = 3
206
+ cmid = 15
207
+ cmax = 30
208
+ else:
209
+ cbot = 1
210
+ cmin = cscale_tuple[0]
211
+ cmid = cscale_tuple[1]
212
+ cmax = cscale_tuple[2]
213
+
199
214
  fig.update_layout(
200
215
  coloraxis=dict(
201
216
  colorscale="Bluered_r",
202
- cmin=1,
203
- cmax=30,
204
- cmid=15,
217
+ cmin=cbot,
218
+ cmid=cmid,
219
+ cmax=cmax,
205
220
  colorbar=dict(
206
- title="Missing Information Ratio", tickvals=[1, 3, 15, 30], ticktext=["1", "3", "15", "≥30"]
221
+ title="Missing Information Ratio",
222
+ tickvals=[cbot, cmin, cmid, cmax],
223
+ ticktext=[f"{cbot}", f"{cmin}", f"{cmid}", f"≥{cmax}"],
207
224
  ),
208
225
  reversescale=True,
209
226
  ),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howso-visuals
3
- Version: 2.1.1
3
+ Version: 2.2.0
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=DvBx28IER95HRTEuowuBo1aWWPS7wx3KWrvPZejRnlo,6661
11
+ howso/visuals/graph.py,sha256=Q3LvQLLyM1wtr5JfzCZo1OD-caWMIA2RXuSw8uB21Wg,7157
12
12
  howso/visuals/visuals.py,sha256=fElgT6lc4KWG9qCY-mUqNL3gsZwcb56YUZJL_QUuMto,30409
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=M0YYqDzY4GYmDXcak2QUWn9Zehr5u8pR0SqhxiCUDbY,8111
17
- howso_visuals-2.1.1.dist-info/licenses/LICENSE-3RD-PARTY.txt,sha256=IZ0jE6Q4mRGPplwo7uW_bQcxm-jBhe8Ol5s-sNphxnw,364089
18
- howso_visuals-2.1.1.dist-info/licenses/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
19
- howso_visuals-2.1.1.dist-info/METADATA,sha256=OyjRrxKbeK4Iel2raDM2_1j9hcgMzfXY8d2Vw6_joT8,41051
20
- howso_visuals-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- howso_visuals-2.1.1.dist-info/top_level.txt,sha256=4ltSHx7mNsXczuoCPkz1irjq1x1JZir2QrX-ZwRNWXU,22
22
- howso_visuals-2.1.1.dist-info/RECORD,,
17
+ howso_visuals-2.2.0.dist-info/licenses/LICENSE-3RD-PARTY.txt,sha256=IZ0jE6Q4mRGPplwo7uW_bQcxm-jBhe8Ol5s-sNphxnw,364089
18
+ howso_visuals-2.2.0.dist-info/licenses/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
19
+ howso_visuals-2.2.0.dist-info/METADATA,sha256=obCEnk6-S2n-qoXkEd_RLuscsATxo2MIfNHzGWDR1cI,41051
20
+ howso_visuals-2.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ howso_visuals-2.2.0.dist-info/top_level.txt,sha256=4ltSHx7mNsXczuoCPkz1irjq1x1JZir2QrX-ZwRNWXU,22
22
+ howso_visuals-2.2.0.dist-info/RECORD,,