iplotx 0.6.7__py3-none-any.whl → 0.6.8__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.
iplotx/tree.py
CHANGED
|
@@ -311,13 +311,21 @@ class TreeArtist(mpl.artist.Artist):
|
|
|
311
311
|
if not leaf_style.get("deep", True):
|
|
312
312
|
return
|
|
313
313
|
|
|
314
|
+
# Given the conditions above, we should have leaf labels. If not,
|
|
315
|
+
# make a None series with a valid index
|
|
316
|
+
leaf_label_series = self._get_label_series("leaf")
|
|
317
|
+
if leaf_label_series is None:
|
|
318
|
+
leaf_label_series = self._ipx_internal_data["leaf_df"].copy()
|
|
319
|
+
leaf_label_series["label"] = None
|
|
320
|
+
leaf_label_series = leaf_label_series["label"]
|
|
321
|
+
|
|
314
322
|
edge_style = get_style(
|
|
315
323
|
".leafedge",
|
|
316
324
|
)
|
|
317
325
|
default_style = {
|
|
318
326
|
"linestyle": "--",
|
|
319
327
|
"linewidth": 1,
|
|
320
|
-
"
|
|
328
|
+
"color": "#111",
|
|
321
329
|
}
|
|
322
330
|
for key, value in default_style.items():
|
|
323
331
|
if key not in edge_style:
|
|
@@ -335,14 +343,24 @@ class TreeArtist(mpl.artist.Artist):
|
|
|
335
343
|
else:
|
|
336
344
|
cmap_fun = None
|
|
337
345
|
|
|
338
|
-
leaf_shallow_layout = self.get_layout("leaf")
|
|
339
|
-
|
|
340
346
|
if "cmap" in edge_style:
|
|
341
347
|
colorarray = []
|
|
342
348
|
edgepatches = []
|
|
343
349
|
adjacent_vertex_ids = []
|
|
344
|
-
for i, vid in enumerate(
|
|
345
|
-
|
|
350
|
+
for i, (vid, label) in enumerate(leaf_label_series.items()):
|
|
351
|
+
# Use leaf label to compute backup key for style rotation
|
|
352
|
+
# NOTE: This is quite a common use case. Users typically
|
|
353
|
+
# refer to leaves via their labels because that's what you see
|
|
354
|
+
# on screen. While an object exact match should take priority
|
|
355
|
+
# for power users, a backup based on label is useful. Beginners
|
|
356
|
+
# won't stumble upon this anyway since it's only used if
|
|
357
|
+
# a dict-like property for leaf edges is provided, which is a
|
|
358
|
+
# decently advanced thing to do.
|
|
359
|
+
# NOTE: Multiple leaves might have the same label, in which case
|
|
360
|
+
# all leaves will be style matched to this *unless* the dict-like
|
|
361
|
+
# style object *also* matches on leaf objects directly, which
|
|
362
|
+
# takes precedence since key2 is only a fallback.
|
|
363
|
+
edge_stylei = rotate_style(edge_style, index=i, key=vid, key2=label)
|
|
346
364
|
|
|
347
365
|
if cmap_fun is not None:
|
|
348
366
|
colorarray.append(edge_stylei["color"])
|
iplotx/version.py
CHANGED
|
@@ -6,9 +6,9 @@ iplotx/label.py,sha256=6am3a0ejcW_bWEXSOODE1Ke3AyCU1lJ45RfnXNbHAQw,8923
|
|
|
6
6
|
iplotx/layout.py,sha256=KxmRLqjo8AYCBAmXez8rIiLU2sM34qhb6ox9AHYwRyE,4839
|
|
7
7
|
iplotx/network.py,sha256=LaW9zQZ4sKiDVb25_icnquGNnN7HrKC7NO07o6PSmGI,11527
|
|
8
8
|
iplotx/plotting.py,sha256=IEUxW1xzTljLjBfsVP2BNsOPCDpj5bEPZ99bzvD5-mo,10066
|
|
9
|
-
iplotx/tree.py,sha256
|
|
9
|
+
iplotx/tree.py,sha256=-69lpPjisRfigY4fDQcmVxzOAf1tGwMXviUcW6mZU6U,28508
|
|
10
10
|
iplotx/typing.py,sha256=QLdzV358IiD1CFe88MVp0D77FSx5sSAVUmM_2WPPE8I,1463
|
|
11
|
-
iplotx/version.py,sha256=
|
|
11
|
+
iplotx/version.py,sha256=Ssoh-uTVPI9dHESTgtP5SAY8kO-o2pYIi_gVIxFJKiw,66
|
|
12
12
|
iplotx/vertex.py,sha256=-JZaQPjIAWWP8Wap1HyR4g4HXLNGLwjf4v6jyo994Tk,14671
|
|
13
13
|
iplotx/edge/__init__.py,sha256=HlxeIs88RbRrTetJNLcoq9gjV7cBhOdqQoiVZFFylFc,27081
|
|
14
14
|
iplotx/edge/arrow.py,sha256=C4XoHGCYou1z2alz5Q2VhdaWYEzgebtEF70zVYY_frk,15533
|
|
@@ -33,6 +33,6 @@ iplotx/utils/geometry.py,sha256=6RrC6qaB0-1vIk1LhGA4CfsiMd-9JNniSPyL_l9mshE,9245
|
|
|
33
33
|
iplotx/utils/internal.py,sha256=WWfcZDGK8Ut1y_tOHRGg9wSqY1bwSeLQO7dHM_8Tvwo,107
|
|
34
34
|
iplotx/utils/matplotlib.py,sha256=wELE73quQv10-1w9uA5eDTgkZkylJvjg7pd3K5tZPOo,6294
|
|
35
35
|
iplotx/utils/style.py,sha256=wMWxJykxBD-JmcN8-rSKlWcV6pMfwKgR4EzSpk_NX8k,547
|
|
36
|
-
iplotx-0.6.
|
|
37
|
-
iplotx-0.6.
|
|
38
|
-
iplotx-0.6.
|
|
36
|
+
iplotx-0.6.8.dist-info/METADATA,sha256=HorC8mcRXtF_RaDZQQbrPWtdXyBwGPTLYa5oNVViVM0,4908
|
|
37
|
+
iplotx-0.6.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
38
|
+
iplotx-0.6.8.dist-info/RECORD,,
|
|
File without changes
|