kececilayout 0.4.2__tar.gz → 0.4.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kececilayout
3
- Version: 0.4.2
3
+ Version: 0.4.3
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
@@ -10,7 +10,7 @@ import inspect
10
10
  import warnings
11
11
 
12
12
  # Paket sürüm numarası
13
- __version__ = "0.4.1"
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
+
@@ -1,6 +1,6 @@
1
1
  # _version.py
2
2
 
3
- __version__ = "0.4.1"
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
+
@@ -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.2
3
+ Version: 0.4.3
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
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "kececilayout"
9
- version = "0.4.2"
9
+ version = "0.4.3"
10
10
 
11
11
  # Diğer proje bilgileri (isteğe bağlı ama tavsiye edilir)
12
12
  authors = [
@@ -54,3 +54,4 @@ test = [
54
54
 
55
55
 
56
56
 
57
+
File without changes
File without changes
File without changes
File without changes
File without changes