kececilayout 0.4.2__py3-none-any.whl → 0.4.4__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.
- kececilayout/__init__.py +3 -1
- kececilayout/_version.py +3 -1
- kececilayout/kececi_layout.py +52 -1
- {kececilayout-0.4.2.dist-info → kececilayout-0.4.4.dist-info}/METADATA +2 -2
- kececilayout-0.4.4.dist-info/RECORD +8 -0
- kececilayout-0.4.2.dist-info/RECORD +0 -8
- {kececilayout-0.4.2.dist-info → kececilayout-0.4.4.dist-info}/WHEEL +0 -0
- {kececilayout-0.4.2.dist-info → kececilayout-0.4.4.dist-info}/licenses/LICENSE +0 -0
- {kececilayout-0.4.2.dist-info → kececilayout-0.4.4.dist-info}/top_level.txt +0 -0
kececilayout/__init__.py
CHANGED
|
@@ -10,7 +10,7 @@ import inspect
|
|
|
10
10
|
import warnings
|
|
11
11
|
|
|
12
12
|
# Paket sürüm numarası
|
|
13
|
-
__version__ = "0.4.
|
|
13
|
+
__version__ = "0.4.3"
|
|
14
14
|
|
|
15
15
|
# =============================================================================
|
|
16
16
|
# OTOMATİK İÇE AKTARMA VE __all__ OLUŞTURMA
|
|
@@ -139,3 +139,5 @@ def old_function_placeholder():
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
|
|
142
|
+
|
|
143
|
+
|
kececilayout/_version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# _version.py
|
|
2
2
|
|
|
3
|
-
__version__ = "0.4.
|
|
3
|
+
__version__ = "0.4.3"
|
|
4
4
|
__license__ = "MIT"
|
|
5
5
|
__description__ = "A deterministic node placement algorithm used in graph visualization. In this layout, nodes are arranged sequentially along a defined primary axis. Each subsequent node is then alternately offset along a secondary, perpendicular axis, typically moving to one side of the primary axis and then the other. Often, the magnitude of this secondary offset increases as nodes progress along the primary axis, creating a characteristic zig-zag or serpentine pattern."
|
|
6
6
|
__author__ = "Mehmet Keçeci"
|
|
@@ -10,3 +10,5 @@ __dependencies__ = ["python>=3.10"] # Diğer bağımlılıkları da ekleyebilir
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
|
kececilayout/kececi_layout.py
CHANGED
|
@@ -1279,6 +1279,56 @@ def _draw_internal(nx_graph, ax, style, **kwargs):
|
|
|
1279
1279
|
}
|
|
1280
1280
|
draw_params = {k: v for k, v in kwargs.items() if k not in layout_params}
|
|
1281
1281
|
|
|
1282
|
+
if style == 'curved':
|
|
1283
|
+
pos = kececi_layout(nx_graph, **layout_params)
|
|
1284
|
+
final_params = {'ax': ax, 'with_labels': True, 'node_color': '#1f78b4',
|
|
1285
|
+
'node_size': 700, 'font_color': 'white',
|
|
1286
|
+
'connectionstyle': 'arc3,rad=0.2', 'arrows': True}
|
|
1287
|
+
final_params.update(draw_params)
|
|
1288
|
+
with warnings.catch_warnings():
|
|
1289
|
+
warnings.simplefilter("ignore", UserWarning)
|
|
1290
|
+
nx.draw(nx_graph, pos, **final_params)
|
|
1291
|
+
ax.set_title("Keçeci Layout: Curved Edges")
|
|
1292
|
+
|
|
1293
|
+
elif style == 'transparent':
|
|
1294
|
+
pos = kececi_layout(nx_graph, **layout_params)
|
|
1295
|
+
# node_color'u draw_params'dan al, yoksa default değeri kullan
|
|
1296
|
+
node_color = draw_params.pop('node_color', '#2ca02c') # DÜZELTME BURADA
|
|
1297
|
+
nx.draw_networkx_nodes(nx_graph, pos, ax=ax, node_color=node_color,
|
|
1298
|
+
node_size=700, **draw_params) # DÜZELTME BURADA
|
|
1299
|
+
nx.draw_networkx_labels(nx_graph, pos, ax=ax, font_color='white')
|
|
1300
|
+
edge_lengths = {e: np.linalg.norm(np.array(pos[e[0]]) - np.array(pos[e[1]])) for e in nx_graph.edges()}
|
|
1301
|
+
max_len = max(edge_lengths.values()) if edge_lengths else 1.0
|
|
1302
|
+
for edge, length in edge_lengths.items():
|
|
1303
|
+
alpha = 0.15 + 0.85 * (1 - length / max_len)
|
|
1304
|
+
nx.draw_networkx_edges(nx_graph, pos, edgelist=[edge], ax=ax,
|
|
1305
|
+
width=1.5, edge_color='black', alpha=alpha)
|
|
1306
|
+
ax.set_title("Keçeci Layout: Transparent Edges")
|
|
1307
|
+
|
|
1308
|
+
elif style == '3d':
|
|
1309
|
+
pos_3d = _kececi_layout_3d_helix(nx_graph)
|
|
1310
|
+
node_color = draw_params.get('node_color', '#d62728') # DÜZELTME BURADA
|
|
1311
|
+
edge_color = draw_params.get('edge_color', 'gray') # DÜZELTME BURADA
|
|
1312
|
+
for node, (x, y, z) in pos_3d.items():
|
|
1313
|
+
ax.scatter([x], [y], [z], s=200, c=[node_color], depthshade=True)
|
|
1314
|
+
ax.text(x, y, z, f' {node}', size=10, zorder=1, color='k')
|
|
1315
|
+
for u, v in nx_graph.edges():
|
|
1316
|
+
coords = np.array([pos_3d[u], pos_3d[v]])
|
|
1317
|
+
ax.plot(coords[:, 0], coords[:, 1], coords[:, 2],
|
|
1318
|
+
color=edge_color, alpha=0.8) # DÜZELTME BURADA
|
|
1319
|
+
ax.set_title("Keçeci Layout: 3D Helix")
|
|
1320
|
+
ax.set_axis_off()
|
|
1321
|
+
ax.view_init(elev=20, azim=-60)
|
|
1322
|
+
"""
|
|
1323
|
+
def _draw_internal(nx_graph, ax, style, **kwargs):
|
|
1324
|
+
#Internal router that handles the different drawing styles.
|
|
1325
|
+
layout_params = {
|
|
1326
|
+
k: v for k, v in kwargs.items()
|
|
1327
|
+
if k in ['primary_spacing', 'secondary_spacing', 'primary_direction',
|
|
1328
|
+
'secondary_start', 'expanding']
|
|
1329
|
+
}
|
|
1330
|
+
draw_params = {k: v for k, v in kwargs.items() if k not in layout_params}
|
|
1331
|
+
|
|
1282
1332
|
if style == 'curved':
|
|
1283
1333
|
pos = kececi_layout(nx_graph, **layout_params)
|
|
1284
1334
|
final_params = {'ax': ax, 'with_labels': True, 'node_color': '#1f78b4',
|
|
@@ -1314,7 +1364,7 @@ def _draw_internal(nx_graph, ax, style, **kwargs):
|
|
|
1314
1364
|
ax.set_title("Keçeci Layout: 3D Helix")
|
|
1315
1365
|
ax.set_axis_off()
|
|
1316
1366
|
ax.view_init(elev=20, azim=-60)
|
|
1317
|
-
|
|
1367
|
+
"""
|
|
1318
1368
|
|
|
1319
1369
|
# =============================================================================
|
|
1320
1370
|
# 4. MAIN USER-FACING DRAWING FUNCTION
|
|
@@ -1396,3 +1446,4 @@ if __name__ == '__main__':
|
|
|
1396
1446
|
|
|
1397
1447
|
|
|
1398
1448
|
|
|
1449
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kececilayout
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Çeşitli graf kütüphaneleri için sıralı-zigzag yerleşimleri sağlayan bir Python paketi.
|
|
5
5
|
Home-page: https://github.com/WhiteSymmetry/kececilayout
|
|
6
6
|
Author: Mehmet Keçeci
|
|
@@ -48,7 +48,7 @@ Requires-Dist: pytest; extra == "test"
|
|
|
48
48
|
Requires-Dist: pytest-cov; extra == "test"
|
|
49
49
|
Requires-Dist: pytest-mock; extra == "test"
|
|
50
50
|
Requires-Dist: ruff; extra == "test"
|
|
51
|
-
Requires-Dist: igraph; extra == "test"
|
|
51
|
+
Requires-Dist: python-igraph; extra == "test"
|
|
52
52
|
Requires-Dist: python-louvain; extra == "test"
|
|
53
53
|
Requires-Dist: rustworkx; extra == "test"
|
|
54
54
|
Requires-Dist: networkit; extra == "test"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
kececilayout/__init__.py,sha256=ya1f1Hx9MbS04zu8jpjW_Lq82H-zIYu7R-NzLL2mx40,4226
|
|
2
|
+
kececilayout/_version.py,sha256=fN2LSPj9YZtOf8U7dE1dA-uf9QAQ_GmUWm8UlLIsI7I,823
|
|
3
|
+
kececilayout/kececi_layout.py,sha256=KWPOvtPjzUbxzfDAAstBgvjoidtgGkixkfmoQNa7tgw,65990
|
|
4
|
+
kececilayout-0.4.4.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
|
5
|
+
kececilayout-0.4.4.dist-info/METADATA,sha256=plPTSvFXl-BmPVJYJQcfGjywhEamCMexXI3-05s1DAs,48629
|
|
6
|
+
kececilayout-0.4.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
kececilayout-0.4.4.dist-info/top_level.txt,sha256=OBzN_wm4q-iwSkeACF4E8ET_LFLJKBTldSH3D1jG2hA,13
|
|
8
|
+
kececilayout-0.4.4.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
kececilayout/__init__.py,sha256=dWK5Z-hiOAAR0qhhVAaTqlxIEjEOCKiFM5j3WE5Gmc0,4222
|
|
2
|
-
kececilayout/_version.py,sha256=DOXOZJRr3bBhULuct-NNLbpjQs3zN5rGVQfGj22l6T8,819
|
|
3
|
-
kececilayout/kececi_layout.py,sha256=xbgStoYbmKnPSB6jfF7l7acbkmBCksqLOKKvG13eIRc,63242
|
|
4
|
-
kececilayout-0.4.2.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
|
5
|
-
kececilayout-0.4.2.dist-info/METADATA,sha256=v85Kw4K7OjDRSGg7TJ2yBJj7dpziV7vC0mRO8OYTZ28,48622
|
|
6
|
-
kececilayout-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
kececilayout-0.4.2.dist-info/top_level.txt,sha256=OBzN_wm4q-iwSkeACF4E8ET_LFLJKBTldSH3D1jG2hA,13
|
|
8
|
-
kececilayout-0.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|