iplotx 0.5.0__tar.gz → 0.5.2.dev0__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.
Files changed (205) hide show
  1. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/PKG-INFO +32 -15
  2. iplotx-0.5.2.dev0/README.md +69 -0
  3. iplotx-0.5.2.dev0/docs/source/_static/banner.png +0 -0
  4. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api/complete_style_specification.md +23 -0
  5. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/sg_execution_times.rst +27 -3
  6. iplotx-0.5.2.dev0/gallery/plot_arrowlawn.py +81 -0
  7. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_arrows.py +5 -2
  8. iplotx-0.5.2.dev0/gallery/plot_edgepadding.py +37 -0
  9. iplotx-0.5.2.dev0/gallery/plot_elements.py +43 -0
  10. iplotx-0.5.2.dev0/gallery/plot_feedbacks.py +54 -0
  11. iplotx-0.5.2.dev0/gallery/plot_redblack.py +71 -0
  12. iplotx-0.5.2.dev0/gallery/plot_waypoints.py +40 -0
  13. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_cladeedges.py +2 -2
  14. iplotx-0.5.2.dev0/gallery/tree/plot_elements_tree.py +55 -0
  15. iplotx-0.5.2.dev0/gallery/tree/plot_style_tree.py +42 -0
  16. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_tree_style_clades.py +2 -2
  17. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/edge/__init__.py +20 -6
  18. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/edge/arrow.py +79 -1
  19. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/edge/geometry.py +91 -44
  20. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/network/simple.py +4 -0
  21. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/tree/simple.py +2 -0
  22. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/typing.py +10 -8
  23. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/label.py +6 -0
  24. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/plotting.py +1 -2
  25. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/style/__init__.py +1 -1
  26. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/style/leaf_info.py +2 -0
  27. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/style/library.py +22 -0
  28. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/tree.py +6 -9
  29. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/utils/matplotlib.py +3 -0
  30. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/version.py +1 -1
  31. iplotx-0.5.2.dev0/scripts/make_banner.py +82 -0
  32. iplotx-0.5.2.dev0/tests/baseline_images/test_biopython/directed_child.png +0 -0
  33. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_biopython.py +26 -7
  34. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_edge.py +24 -0
  35. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_edge_geometry.py +1 -1
  36. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_geometry.py +56 -0
  37. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_heuristics.py +17 -42
  38. iplotx-0.5.2.dev0/tests/test_ingest_protocols.py +52 -0
  39. iplotx-0.5.2.dev0/tests/test_matplotlib_utils.py +57 -0
  40. iplotx-0.5.2.dev0/tests/test_simple_tree_provider.py +222 -0
  41. iplotx-0.5.2.dev0/tests/test_style.py +109 -0
  42. iplotx-0.5.0/README.md +0 -52
  43. iplotx-0.5.0/tests/test_matplotlib_utils.py +0 -18
  44. iplotx-0.5.0/tests/test_simple_tree_provider.py +0 -92
  45. iplotx-0.5.0/tests/test_style.py +0 -68
  46. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/.github/workflows/publish.yml +0 -0
  47. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/.github/workflows/test.yml +0 -0
  48. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/.gitignore +0 -0
  49. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/.pre-commit-config.yaml +0 -0
  50. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/.readthedocs.yaml +0 -0
  51. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/LICENSE +0 -0
  52. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/MANIFEST.in +0 -0
  53. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/assets/pylint.svg +0 -0
  54. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/Makefile +0 -0
  55. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/make.bat +0 -0
  56. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/_static/graph_basic.png +0 -0
  57. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/_templates/layout.html +0 -0
  58. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api/artists.md +0 -0
  59. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api/plotting.md +0 -0
  60. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api/providers.md +0 -0
  61. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api/style.md +0 -0
  62. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/api.md +0 -0
  63. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/conf.py +0 -0
  64. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/images/sphx_glr_plot_basic_001.png +0 -0
  65. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/images/thumb/sphx_glr_plot_basic_thumb.png +0 -0
  66. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/index.md +0 -0
  67. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/providers.md +0 -0
  68. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/docs/source/style.md +0 -0
  69. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/GALLERY_HEADER.rst +0 -0
  70. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/data/chess_masters_WCC.pgn.bz2 +0 -0
  71. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/data/knuth_miles.txt.gz +0 -0
  72. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_animation.py +0 -0
  73. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_basic.py +0 -0
  74. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_big_curves.py +0 -0
  75. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_chess_masters.py +0 -0
  76. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_cliques.py +0 -0
  77. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_cluster_layout.py +0 -0
  78. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_company_structure.py +0 -0
  79. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_complex.py +0 -0
  80. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_dag.py +0 -0
  81. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_directed.py +0 -0
  82. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_edit_artists.py +0 -0
  83. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_four_grids.py +0 -0
  84. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_grouping.py +0 -0
  85. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_halfarrows.py +0 -0
  86. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_house.py +0 -0
  87. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_knuth_miles.py +0 -0
  88. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_labels_and_colors.py +0 -0
  89. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_loops.py +0 -0
  90. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_max_bipartite_matching.py +0 -0
  91. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_minimum_spanning_trees.py +0 -0
  92. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_mouse_hover.py +0 -0
  93. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_multipartite_layout.py +0 -0
  94. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_multistyle.py +0 -0
  95. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_parallel_igraph_networkx.py +0 -0
  96. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_ports.py +0 -0
  97. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_shortest_path.py +0 -0
  98. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_simple_networkx.py +0 -0
  99. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_simple_path.py +0 -0
  100. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_simplenetworkdataprovider.py +0 -0
  101. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_style.py +0 -0
  102. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_tension.py +0 -0
  103. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_traveling_salesman.py +0 -0
  104. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_vertexmarkers.py +0 -0
  105. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_voronoi.py +0 -0
  106. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/plot_with_colorbar.py +0 -0
  107. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/GALLERY_HEADER.rst +0 -0
  108. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/data/tree-with-support.json +0 -0
  109. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_angular_waypoints.py +0 -0
  110. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_biopython_tree.py +0 -0
  111. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_cogent3_layouts.py +0 -0
  112. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_cogent3_tree.py +0 -0
  113. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_ete4.py +0 -0
  114. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_leafedges.py +0 -0
  115. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_leafedges_and_cascades.py +0 -0
  116. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_simpletreedataprovider.py +0 -0
  117. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_skbio_tree.py +0 -0
  118. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_split_edges.py +0 -0
  119. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_support.py +0 -0
  120. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_tree_node_background.py +0 -0
  121. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/gallery/tree/plot_trees_of_trees.py +0 -0
  122. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/__init__.py +0 -0
  123. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/artists.py +0 -0
  124. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/cascades.py +0 -0
  125. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/edge/leaf.py +0 -0
  126. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/edge/ports.py +0 -0
  127. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/groups.py +0 -0
  128. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/__init__.py +0 -0
  129. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/heuristics.py +0 -0
  130. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/network/igraph.py +0 -0
  131. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/network/networkx.py +0 -0
  132. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/tree/biopython.py +0 -0
  133. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/tree/cogent3.py +0 -0
  134. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/tree/ete4.py +0 -0
  135. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/ingest/providers/tree/skbio.py +0 -0
  136. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/layout.py +0 -0
  137. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/network.py +0 -0
  138. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/typing.py +0 -0
  139. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/utils/geometry.py +0 -0
  140. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/utils/internal.py +0 -0
  141. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/utils/style.py +0 -0
  142. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/iplotx/vertex.py +0 -0
  143. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/pyproject.toml +0 -0
  144. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/scripts/copy_github_release_into_version.sh +0 -0
  145. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/scripts/update_pylint_badge.sh +0 -0
  146. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/cascades.png +0 -0
  147. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/leaf_labels.png +0 -0
  148. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/leaf_labels_hmargin.png +0 -0
  149. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/leafedges.png +0 -0
  150. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/show_support.png +0 -0
  151. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/tree_basic.png +0 -0
  152. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_biopython/tree_radial.png +0 -0
  153. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_cogent3/leaf_labels.png +0 -0
  154. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_cogent3/leaf_labels_hmargin.png +0 -0
  155. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_cogent3/tree_basic.png +0 -0
  156. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_cogent3/tree_radial.png +0 -0
  157. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_ete4/leaf_labels.png +0 -0
  158. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_ete4/leaf_labels_hmargin.png +0 -0
  159. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_ete4/split_edges.png +0 -0
  160. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_ete4/tree_basic.png +0 -0
  161. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_ete4/tree_radial.png +0 -0
  162. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/clustering_directed.png +0 -0
  163. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/clustering_directed_large.png +0 -0
  164. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_basic.png +0 -0
  165. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_directed.png +0 -0
  166. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_directed_curved_loops.png +0 -0
  167. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_edit_children.png +0 -0
  168. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_labels.png +0 -0
  169. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_layout_attribute.png +0 -0
  170. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_null.png +0 -0
  171. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_squares_directed.png +0 -0
  172. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/graph_with_curved_edges.png +0 -0
  173. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/igraph_layout_object.png +0 -0
  174. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_igraph/multigraph_with_curved_edges_undirected.png +0 -0
  175. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/cluster-layout.png +0 -0
  176. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/complex.png +0 -0
  177. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/complex_rotatelabels.png +0 -0
  178. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/directed_graph.png +0 -0
  179. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/directed_graph_with_colorbar.png +0 -0
  180. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/empty_graph.png +0 -0
  181. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/flat_style.png +0 -0
  182. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/house_with_colors.png +0 -0
  183. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/labels_and_colors.png +0 -0
  184. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/shortest_path.png +0 -0
  185. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_networkx/simple_graph.png +0 -0
  186. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_simple_network_provider/graph_basic.png +0 -0
  187. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_simple_network_provider/graph_directed.png +0 -0
  188. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_simple_network_provider/graph_labels.png +0 -0
  189. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_skbio/leaf_labels.png +0 -0
  190. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_skbio/leaf_labels_hmargin.png +0 -0
  191. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_skbio/tree_basic.png +0 -0
  192. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/baseline_images/test_skbio/tree_radial.png +0 -0
  193. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_arrows.py +0 -0
  194. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_cascades.py +0 -0
  195. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_cogent3.py +0 -0
  196. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_ete4.py +0 -0
  197. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_igraph.py +0 -0
  198. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_network_hotload.py +0 -0
  199. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_networkx.py +0 -0
  200. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_ports.py +0 -0
  201. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_simple_network_provider.py +0 -0
  202. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_skbio.py +0 -0
  203. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/test_vertex.py +0 -0
  204. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/tests/utils.py +0 -0
  205. {iplotx-0.5.0 → iplotx-0.5.2.dev0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iplotx
3
- Version: 0.5.0
3
+ Version: 0.5.2.dev0
4
4
  Summary: Plot networkx from igraph and networkx.
5
5
  Project-URL: Homepage, https://github.com/fabilab/iplotx
6
6
  Project-URL: Documentation, https://readthedocs.org/iplotx
@@ -43,9 +43,25 @@ Description-Content-Type: text/markdown
43
43
  ![pylint](assets/pylint.svg)
44
44
 
45
45
  # iplotx
46
- Plotting networks from igraph and networkx.
46
+ [![Banner](docs/source/_static/banner.png)](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
47
47
 
48
- **NOTE**: This is currently beta quality software. The API and functionality are settling in and might break occasionally.
48
+ Visualise networks and trees in Python, with style.
49
+
50
+ Supports:
51
+ - **networks**:
52
+ - [networkx](https://networkx.org/)
53
+ - [igraph](igraph.readthedocs.io/)
54
+ - [minimal network data structure](https://iplotx.readthedocs.io/en/latest/gallery/plot_simplenetworkdataprovider.html#sphx-glr-gallery-plot-simplenetworkdataprovider-py) (for educational purposes)
55
+ - **trees**:
56
+ - [ETE4](https://etetoolkit.github.io/ete/)
57
+ - [cogent3](https://cogent3.org/)
58
+ - [Biopython](https://biopython.org/)
59
+ - [scikit-bio](https://scikit.bio)
60
+ - [minimal tree data structure](https://iplotx.readthedocs.io/en/latest/gallery/tree/plot_simpletreedataprovider.html#sphx-glr-gallery-tree-plot-simpletreedataprovider-py) (for educational purposes)
61
+
62
+ In addition to the above, *any* network or tree analysis library can register an [entry point](https://iplotx.readthedocs.io/en/latest/providers.html#creating-a-custom-data-provider) to gain compatibility with `iplotx` with no intervention from our side.
63
+
64
+ **NOTE**: This is currently late beta quality software. The API and functionality might break rarely.
49
65
 
50
66
  ## Installation
51
67
  ```bash
@@ -72,19 +88,20 @@ See [readthedocs](https://iplotx.readthedocs.io/en/latest/) for the full documen
72
88
  ## Gallery
73
89
  See [gallery](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
74
90
 
75
- ## Roadmap
76
- - Plot networks from igraph and networkx interchangeably, using matplotlib as a backend. ✅
77
- - Support interactive plotting, e.g. zooming and panning after the plot is created. ✅
78
- - Support storing the plot to disk thanks to the many matplotlib backends (SVG, PNG, PDF, etc.).
79
- - Support flexible yet easy styling. ✅
91
+ ## Features
92
+ - Plot networks from multiple libraries including networkx and igraph, using matplotlib as a backend. ✅
93
+ - Plot trees from multiple libraries such as cogent3, ETE4, skbio, and biopython. ✅
94
+ - Flexible yet easy styling, including an internal library of styles
95
+ - Interactive plotting, e.g. zooming and panning after the plot is created. ✅
96
+ - Store the plot to disk thanks to the many matplotlib backends (SVG, PNG, PDF, etc.). ✅
80
97
  - Efficient plotting of large graphs using matplotlib's collection functionality. ✅
81
- - Support editing plotting elements after the plot is created, e.g. changing node colors, labels, etc. ✅
82
- - Support animations, e.g. showing the evolution of a network over time. ✅
83
- - Support mouse interaction, e.g. hovering over or clicking on nodes and edges to get information about them. ✅
84
- - Support trees from special libraries such as ete3, biopython, etc. This will need a dedicated function and layouting. ✅
85
- - Support uni- and bi-directional communication between graph object and plot object.🏗️
86
-
87
- **NOTE:** The last item can probably be achieved already by using `matplotlib`'s existing callback functionality. It is currently untested, but if you manage to get it to work on your graph let me know and I'll add it to the examples (with credit).
98
+ - Edit plotting elements after the plot is created, e.g. changing node colors, labels, etc. ✅
99
+ - Animations, e.g. showing the evolution of a network over time. ✅
100
+ - Mouse and keyboard interaction, e.g. hovering over nodes/edges to get information about them. ✅
101
+ - Node clustering and covers, e.g. showing communities in a network. ✅
102
+ - Choice of tree layouts and orientations.
103
+ - Tree-specific options: cascades, subtree styling, split edges, etc. ✅
104
+ - (WIP) Support uni- and bi-directional communication between graph object and plot object.🏗️
88
105
 
89
106
  ## Authors
90
107
  Fabio Zanini (https://fabilab.org)
@@ -0,0 +1,69 @@
1
+ ![Github Actions](https://github.com/fabilab/iplotx/actions/workflows/test.yml/badge.svg)
2
+ ![PyPI - Version](https://img.shields.io/pypi/v/iplotx)
3
+ ![RTD](https://readthedocs.org/projects/iplotx/badge/?version=latest)
4
+ [![Coverage Status](https://coveralls.io/repos/github/fabilab/iplotx/badge.svg?branch=main)](https://coveralls.io/github/fabilab/iplotx?branch=main)
5
+ ![pylint](assets/pylint.svg)
6
+
7
+ # iplotx
8
+ [![Banner](docs/source/_static/banner.png)](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
9
+
10
+ Visualise networks and trees in Python, with style.
11
+
12
+ Supports:
13
+ - **networks**:
14
+ - [networkx](https://networkx.org/)
15
+ - [igraph](igraph.readthedocs.io/)
16
+ - [minimal network data structure](https://iplotx.readthedocs.io/en/latest/gallery/plot_simplenetworkdataprovider.html#sphx-glr-gallery-plot-simplenetworkdataprovider-py) (for educational purposes)
17
+ - **trees**:
18
+ - [ETE4](https://etetoolkit.github.io/ete/)
19
+ - [cogent3](https://cogent3.org/)
20
+ - [Biopython](https://biopython.org/)
21
+ - [scikit-bio](https://scikit.bio)
22
+ - [minimal tree data structure](https://iplotx.readthedocs.io/en/latest/gallery/tree/plot_simpletreedataprovider.html#sphx-glr-gallery-tree-plot-simpletreedataprovider-py) (for educational purposes)
23
+
24
+ In addition to the above, *any* network or tree analysis library can register an [entry point](https://iplotx.readthedocs.io/en/latest/providers.html#creating-a-custom-data-provider) to gain compatibility with `iplotx` with no intervention from our side.
25
+
26
+ **NOTE**: This is currently late beta quality software. The API and functionality might break rarely.
27
+
28
+ ## Installation
29
+ ```bash
30
+ pip install iplotx
31
+ ```
32
+
33
+ ## Quick Start
34
+ ```python
35
+ import networkx as nx
36
+ import matplotlib.pyplot as plt
37
+ import iplotx as ipx
38
+
39
+ g = nx.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)])
40
+ layout = nx.layout.circular_layout(g)
41
+ fig, ax = plt.subplots(figsize=(3, 3))
42
+ ipx.plot(g, ax=ax, layout=layout)
43
+ ```
44
+
45
+ ![Quick start image](docs/source/_static/graph_basic.png)
46
+
47
+ ## Documentation
48
+ See [readthedocs](https://iplotx.readthedocs.io/en/latest/) for the full documentation.
49
+
50
+ ## Gallery
51
+ See [gallery](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
52
+
53
+ ## Features
54
+ - Plot networks from multiple libraries including networkx and igraph, using matplotlib as a backend. ✅
55
+ - Plot trees from multiple libraries such as cogent3, ETE4, skbio, and biopython. ✅
56
+ - Flexible yet easy styling, including an internal library of styles ✅
57
+ - Interactive plotting, e.g. zooming and panning after the plot is created. ✅
58
+ - Store the plot to disk thanks to the many matplotlib backends (SVG, PNG, PDF, etc.). ✅
59
+ - Efficient plotting of large graphs using matplotlib's collection functionality. ✅
60
+ - Edit plotting elements after the plot is created, e.g. changing node colors, labels, etc. ✅
61
+ - Animations, e.g. showing the evolution of a network over time. ✅
62
+ - Mouse and keyboard interaction, e.g. hovering over nodes/edges to get information about them. ✅
63
+ - Node clustering and covers, e.g. showing communities in a network. ✅
64
+ - Choice of tree layouts and orientations. ✅
65
+ - Tree-specific options: cascades, subtree styling, split edges, etc. ✅
66
+ - (WIP) Support uni- and bi-directional communication between graph object and plot object.🏗️
67
+
68
+ ## Authors
69
+ Fabio Zanini (https://fabilab.org)
@@ -69,6 +69,13 @@
69
69
  # unless the "norm" option is used.
70
70
  "color": str | float | Any,
71
71
 
72
+ # How to cap the edge line. Should be "butt" (default), "round", or "projecting".
73
+ "capstyle": str,
74
+
75
+ # Whether to leave any space between edge cap and vertex border. This is
76
+ # in figure points and autoscales correctly with dpi.
77
+ "padding": float,
78
+
72
79
  # Matplotlib color map used to map floating numbers into RGBA colors. Only
73
80
  # used when the previous option "color" is set to floats.
74
81
  "cmap": str | matplotlib.colors.Colormap,
@@ -138,10 +145,15 @@
138
145
  # |/
139
146
  # |\\ (double slash needed to avoid character escaping)
140
147
  # >
148
+ # <
141
149
  # >>
142
150
  # )>
143
151
  # )
152
+ # (
153
+ # ]
154
+ # [
144
155
  # |
156
+ # x (or X)
145
157
  # s
146
158
  # d
147
159
  # p
@@ -180,6 +192,17 @@
180
192
  "bbox": dict, # Bounding box properties for the label (see vertex labels)
181
193
 
182
194
  },
195
+
196
+ ############################################################################
197
+ # The following edge properties are only valid for trees via `iplotx.tree`
198
+ "split": {
199
+ # NOTE: This takes any properties of "edge" except for itself (i.e. no
200
+ # "nested" split) and applies it to the last segment of split edges.
201
+ "color": str | Any, # Color of the split edge
202
+
203
+ # ...
204
+ },
205
+
183
206
  },
184
207
 
185
208
  # The following entry is used by networks ONLY (not trees as plotted by `iplotx.tree`)
@@ -6,7 +6,7 @@
6
6
 
7
7
  Computation times
8
8
  =================
9
- **00:01.263** total execution time for 51 files **from all galleries**:
9
+ **00:00.045** total execution time for 59 files **from all galleries**:
10
10
 
11
11
  .. container::
12
12
 
@@ -32,12 +32,15 @@ Computation times
32
32
  * - Example
33
33
  - Time
34
34
  - Mem (MB)
35
- * - :ref:`sphx_glr_gallery_tree_plot_split_edges.py` (``../../gallery/tree/plot_split_edges.py``)
36
- - 00:01.263
35
+ * - :ref:`sphx_glr_gallery_plot_feedbacks.py` (``../../gallery/plot_feedbacks.py``)
36
+ - 00:00.045
37
37
  - 0.0
38
38
  * - :ref:`sphx_glr_gallery_plot_animation.py` (``../../gallery/plot_animation.py``)
39
39
  - 00:00.000
40
40
  - 0.0
41
+ * - :ref:`sphx_glr_gallery_plot_arrowlawn.py` (``../../gallery/plot_arrowlawn.py``)
42
+ - 00:00.000
43
+ - 0.0
41
44
  * - :ref:`sphx_glr_gallery_plot_arrows.py` (``../../gallery/plot_arrows.py``)
42
45
  - 00:00.000
43
46
  - 0.0
@@ -68,9 +71,15 @@ Computation times
68
71
  * - :ref:`sphx_glr_gallery_plot_directed.py` (``../../gallery/plot_directed.py``)
69
72
  - 00:00.000
70
73
  - 0.0
74
+ * - :ref:`sphx_glr_gallery_plot_edgepadding.py` (``../../gallery/plot_edgepadding.py``)
75
+ - 00:00.000
76
+ - 0.0
71
77
  * - :ref:`sphx_glr_gallery_plot_edit_artists.py` (``../../gallery/plot_edit_artists.py``)
72
78
  - 00:00.000
73
79
  - 0.0
80
+ * - :ref:`sphx_glr_gallery_plot_elements.py` (``../../gallery/plot_elements.py``)
81
+ - 00:00.000
82
+ - 0.0
74
83
  * - :ref:`sphx_glr_gallery_plot_four_grids.py` (``../../gallery/plot_four_grids.py``)
75
84
  - 00:00.000
76
85
  - 0.0
@@ -113,6 +122,9 @@ Computation times
113
122
  * - :ref:`sphx_glr_gallery_plot_ports.py` (``../../gallery/plot_ports.py``)
114
123
  - 00:00.000
115
124
  - 0.0
125
+ * - :ref:`sphx_glr_gallery_plot_redblack.py` (``../../gallery/plot_redblack.py``)
126
+ - 00:00.000
127
+ - 0.0
116
128
  * - :ref:`sphx_glr_gallery_plot_shortest_path.py` (``../../gallery/plot_shortest_path.py``)
117
129
  - 00:00.000
118
130
  - 0.0
@@ -140,6 +152,9 @@ Computation times
140
152
  * - :ref:`sphx_glr_gallery_plot_voronoi.py` (``../../gallery/plot_voronoi.py``)
141
153
  - 00:00.000
142
154
  - 0.0
155
+ * - :ref:`sphx_glr_gallery_plot_waypoints.py` (``../../gallery/plot_waypoints.py``)
156
+ - 00:00.000
157
+ - 0.0
143
158
  * - :ref:`sphx_glr_gallery_plot_with_colorbar.py` (``../../gallery/plot_with_colorbar.py``)
144
159
  - 00:00.000
145
160
  - 0.0
@@ -158,6 +173,9 @@ Computation times
158
173
  * - :ref:`sphx_glr_gallery_tree_plot_cogent3_tree.py` (``../../gallery/tree/plot_cogent3_tree.py``)
159
174
  - 00:00.000
160
175
  - 0.0
176
+ * - :ref:`sphx_glr_gallery_tree_plot_elements_tree.py` (``../../gallery/tree/plot_elements_tree.py``)
177
+ - 00:00.000
178
+ - 0.0
161
179
  * - :ref:`sphx_glr_gallery_tree_plot_ete4.py` (``../../gallery/tree/plot_ete4.py``)
162
180
  - 00:00.000
163
181
  - 0.0
@@ -173,6 +191,12 @@ Computation times
173
191
  * - :ref:`sphx_glr_gallery_tree_plot_skbio_tree.py` (``../../gallery/tree/plot_skbio_tree.py``)
174
192
  - 00:00.000
175
193
  - 0.0
194
+ * - :ref:`sphx_glr_gallery_tree_plot_split_edges.py` (``../../gallery/tree/plot_split_edges.py``)
195
+ - 00:00.000
196
+ - 0.0
197
+ * - :ref:`sphx_glr_gallery_tree_plot_style_tree.py` (``../../gallery/tree/plot_style_tree.py``)
198
+ - 00:00.000
199
+ - 0.0
176
200
  * - :ref:`sphx_glr_gallery_tree_plot_support.py` (``../../gallery/tree/plot_support.py``)
177
201
  - 00:00.000
178
202
  - 0.0
@@ -0,0 +1,81 @@
1
+ """
2
+ Arrow lawn
3
+ ==========
4
+
5
+ This example demonstrates the visualisation of a network with 1,000 nodes and a few thousand
6
+ edges, using a custom layout that resembles a lawn of arrows.
7
+ """
8
+
9
+ import numpy as np
10
+ import iplotx as ipx
11
+ import matplotlib.pyplot as plt
12
+
13
+ n = 1000 # Number of nodes
14
+ k = 3
15
+ layout = np.random.rand(n, 2)
16
+ nodes = np.arange(n)
17
+ edges = []
18
+ for i, v1 in enumerate(layout):
19
+ found = 0
20
+ dv = layout - v1
21
+ for j in (dv**2).sum(axis=1).argsort()[1:]:
22
+ angle = 180 / np.pi * np.arctan2(dv[j, 1], dv[j, 0])
23
+ # Only make an edge for neighbors towards the north-east
24
+ if 10 < angle < 80:
25
+ edges.append((i, j))
26
+ found += 1
27
+ if found == k:
28
+ break
29
+
30
+ # Plot the network using iplotx
31
+ fig, ax = plt.subplots(figsize=(7, 7))
32
+ ipx.network(
33
+ {'nodes': nodes, 'edges': edges, 'directed': True},
34
+ layout=layout,
35
+ ax=ax,
36
+ vertex_size=5,
37
+ vertex_alpha=0.8,
38
+ vertex_facecolor="seagreen",
39
+ vertex_edgecolor="none",
40
+ edge_arrow_width=3,
41
+ edge_alpha=0.5,
42
+ )
43
+ fig.tight_layout()
44
+
45
+
46
+ # %%
47
+ # If you want to start pushing the scalability of iplotx, you can try with 10,000 nodes and
48
+ # ~30,000 edges. This takes ~14 seconds on a modern laptop, of which 5 are spent on building
49
+ # the network and 9 are spent inside of ``iplotx`` visualising it:
50
+
51
+ n = 10000 # Number of nodes
52
+ k = 3
53
+ layout = np.random.rand(n, 2)
54
+ nodes = np.arange(n)
55
+ edges = []
56
+ for i, v1 in enumerate(layout):
57
+ found = 0
58
+ dv = layout - v1
59
+ for j in (dv**2).sum(axis=1).argsort()[1:]:
60
+ angle = 180 / np.pi * np.arctan2(dv[j, 1], dv[j, 0])
61
+ # Only make an edge for neighbors towards the north-east
62
+ if 10 < angle < 80:
63
+ edges.append((i, j))
64
+ found += 1
65
+ if found == k:
66
+ break
67
+
68
+ # Plot the network using iplotx
69
+ fig, ax = plt.subplots(figsize=(9, 9))
70
+ ipx.network(
71
+ {'nodes': nodes, 'edges': edges, 'directed': True},
72
+ layout=layout,
73
+ ax=ax,
74
+ vertex_size=5,
75
+ vertex_alpha=0.8,
76
+ vertex_facecolor="seagreen",
77
+ vertex_edgecolor="none",
78
+ edge_arrow_width=3,
79
+ edge_alpha=0.5,
80
+ )
81
+ fig.tight_layout()
@@ -9,14 +9,15 @@ import networkx as nx
9
9
  import matplotlib.pyplot as plt
10
10
  import iplotx as ipx
11
11
 
12
- arrow_markers = ["|>", "|/", "|\\", ">", ">>", ")>", ")", "|", "s", "d", "p", "q"]
12
+ arrow_markers = ["|>", "|/", "|\\", ">", "<", ">>", ")>", ")", "(", "]", "[", "|",
13
+ "x", "s", "d", "p", "q"]
13
14
  n = len(arrow_markers)
14
15
  G = nx.DiGraph()
15
16
  G.add_edges_from([(f"l{i}", f"r{i}") for i in range(n)])
16
17
  layout = {f"l{i}": (0, -i) for i in range(n)}
17
18
  layout.update({f"r{i}": (1, -i) for i in range(n)})
18
19
 
19
- fig, ax = plt.subplots(figsize=(3, 7.5))
20
+ fig, ax = plt.subplots(figsize=(3, 8.5))
20
21
  ipx.network(
21
22
  G,
22
23
  layout=layout,
@@ -24,8 +25,10 @@ ipx.network(
24
25
  vertex_size=12,
25
26
  edge_arrow_marker=arrow_markers,
26
27
  edge_arrow_height="width",
28
+ edge_padding=8,
27
29
  edge_color="steelblue",
28
30
  title="Arrow markers",
29
31
  )
30
32
  ax.set_yticks(list(range(-n + 1, 1))[::-1])
31
33
  ax.set_yticklabels(arrow_markers)
34
+ ax.yaxis.set_tick_params(length=0)
@@ -0,0 +1,37 @@
1
+ """
2
+ Edge padding
3
+ ============
4
+
5
+ This example illustrates how to pad edges, i.e. leave a bit of empty space between
6
+ edge cap (end) and the border of its source/target vertices.
7
+ """
8
+
9
+ import iplotx as ipx
10
+
11
+ graph = {
12
+ "edges": [
13
+ ("A", "B"),
14
+ ("B", "C"),
15
+ ("C", "D"),
16
+ ("C", "E"),
17
+ ("E", "Bingo"),
18
+ ],
19
+ "directed": True,
20
+ }
21
+ layout = {
22
+ "A": (0, 0),
23
+ "B": (1, 0),
24
+ "C": (1, 1),
25
+ "D": (-1, 1),
26
+ "E": (-0.5, 2),
27
+ "Bingo": (0, 3),
28
+ }
29
+
30
+ ipx.network(
31
+ graph,
32
+ layout,
33
+ style="rededge",
34
+ edge_padding=5,
35
+ vertex_labels=True,
36
+ vertex_size={"A": 20, "B": 20, "C": 20, "D": 20, "E": 20, "Bingo": 50},
37
+ )
@@ -0,0 +1,43 @@
1
+ """
2
+ Network element showroom
3
+ ========================
4
+
5
+ This example showcases various plot elements that can be styled in ``iplotx``.
6
+ """
7
+
8
+ import matplotlib.pyplot as plt
9
+ import iplotx as ipx
10
+
11
+ network = {
12
+ "edges": [(0, 1), (1, 2), (2, 3), (3, 0), (2, 2)],
13
+ "directed": True,
14
+ }
15
+ layout = [(0, 0), (1, 0), (1, 1), (0, 1)]
16
+
17
+ fig, ax = plt.subplots(figsize=(4.3, 4.3))
18
+ ipx.network(
19
+ network,
20
+ layout,
21
+ ax=ax,
22
+ vertex_labels=["Vertex\nlabel"] + [""] * 3,
23
+ edge_labels=["", "", "Edge\nlabel", "", ""],
24
+ vertex_label_bbox_edgecolor="k",
25
+ vertex_label_bbox_linewidth=1.5,
26
+ vertex_label_bbox_facecolor="steelblue",
27
+ vertex_label_bbox_alpha=0.5,
28
+ edge_label_bbox_edgecolor="k",
29
+ edge_label_bbox_linewidth=1.5,
30
+ edge_label_bbox_facecolor="tomato",
31
+ edge_color=["k", "tomato", "k", "k", "k"],
32
+ edge_arrow_color=["k", "darkred", "k", "k", "k"],
33
+ edge_linewidth=[2, 4, 2, 2, 2],
34
+ vertex_facecolor=["w"] * 3 + ["steelblue"],
35
+ vertex_edgecolor="k",
36
+ vertex_linewidth=2,
37
+ vertex_size=[50, 25, 25, 50],
38
+ vertex_marker="o",
39
+ vertex_label_color="k",
40
+ edge_curved=True,
41
+ edge_tension=[0, 1.25, 0, 3.5],
42
+ margins=(0, 0.08),
43
+ )
@@ -0,0 +1,54 @@
1
+ """
2
+ Feedback loops
3
+ ==============
4
+
5
+ Graphs with arrows and bars are commonly used to represent feedback loops in systems.
6
+ This example shows how to obtain that effect in ``iplotx``.
7
+ """
8
+
9
+ import numpy as np
10
+ import matplotlib.pyplot as plt
11
+ import iplotx as ipx
12
+
13
+ graph = {
14
+ "edges": [
15
+ ("A", "B"),
16
+ ("B", "C"),
17
+ ("C", "A"),
18
+ ],
19
+ "directed": True,
20
+ }
21
+ layout = {
22
+ "A": (0, 0),
23
+ "B": (1, 0),
24
+ "C": (0.5, 0.5 * 1.73),
25
+ }
26
+
27
+ fig, ax = plt.subplots()
28
+ ipx.network(
29
+ graph,
30
+ layout,
31
+ ax=ax,
32
+ vertex_size=50,
33
+ edge_linewidth=5,
34
+ edge_arrow_width=30,
35
+ edge_arrow_height=40,
36
+ edge_arrow_marker=[")>", "|", "|"],
37
+ edge_padding=15,
38
+ edge_curved=True,
39
+ edge_tension=[2, 2, 2],
40
+ vertex_facecolor=["#26677FFF", "#635C72FF", "#89374FFF"],
41
+ vertex_edgecolor="black",
42
+ vertex_linewidth=5,
43
+ aspect=1.0,
44
+ margins=0.1,
45
+ )
46
+
47
+ # Add a parametric spiral
48
+ t = np.linspace(0, 4 * np.pi, 400)
49
+ ax.plot(
50
+ 0.5 + np.cos(t + np.pi) * t / 40,
51
+ 0.31 + np.sin(t + np.pi) * t / 40,
52
+ color="grey",
53
+ lw=4,
54
+ )
@@ -0,0 +1,71 @@
1
+ """
2
+ The red and the black
3
+ =====================
4
+
5
+ This example demonstrates how to overlay an ``iplotx`` artist with plain matplotlib patches.
6
+ """
7
+
8
+
9
+ import numpy as np
10
+ import iplotx as ipx
11
+ import matplotlib.pyplot as plt
12
+
13
+ # We will use a network laid out onto a square grid
14
+ gsize = 5 # Grid size
15
+ layout = [(i % gsize, i // gsize) for i in range(gsize**2)]
16
+
17
+ # Two possible colors
18
+ colorlist = np.array(["tomato", "#111"])
19
+
20
+ # Assign node colors at random
21
+ node_colors = colorlist[np.random.randint(2, size=gsize**2)]
22
+
23
+ # Connect two neighboring nodes if they have the same color
24
+ edges = []
25
+ for inode in range(gsize**2):
26
+ i = inode // gsize
27
+ j = inode % gsize
28
+ # Four possible edges
29
+ cands = []
30
+ if i != 0:
31
+ cands.append(inode - gsize)
32
+ if j != 0:
33
+ cands.append(inode - 1)
34
+ if i != gsize - 1:
35
+ cands.append(inode + gsize)
36
+ if j != gsize - 1:
37
+ cands.append(inode + 1)
38
+ for inode2 in cands:
39
+ if node_colors[inode] == node_colors[inode2]:
40
+ if (inode2, inode) not in edges:
41
+ edges.append((inode, inode2))
42
+
43
+ # Build the network using our zero-dependency data structure
44
+ network = {
45
+ "edges": edges,
46
+ "nodes": list(range(gsize**2)),
47
+ }
48
+
49
+ # Visualise the network
50
+ fig, ax = plt.subplots(figsize=(5, 5))
51
+ ipx.network(
52
+ network,
53
+ layout=layout,
54
+ ax=ax,
55
+ vertex_size=8,
56
+ vertex_marker='d',
57
+ )
58
+
59
+ # Add square patches centered on each node
60
+ for i in range(gsize):
61
+ for j in range(gsize):
62
+ inode = i * gsize + j
63
+ ax.add_patch(plt.Rectangle(
64
+ (j-0.5, i-0.5),
65
+ 1,
66
+ 1,
67
+ facecolor=node_colors[inode],
68
+ edgecolor="none",
69
+ alpha=0.4,
70
+ zorder=0,
71
+ ))
@@ -0,0 +1,40 @@
1
+ """
2
+ Edge waypoints
3
+ ==============
4
+
5
+ This example demonstrates the use of edge waypoints.
6
+ """
7
+
8
+ import matplotlib.pyplot as plt
9
+ import numpy as np
10
+ import iplotx as ipx
11
+
12
+ g = {
13
+ "edges": [
14
+ ("A", "B"),
15
+ ("B", "C"),
16
+ ("B", "D"),
17
+ ("A", "E"),
18
+ ],
19
+ }
20
+ layout = {
21
+ "A": (0, 0),
22
+ "B": (0, 1),
23
+ "C": (1, 2),
24
+ "D": (0, 2),
25
+ "E": (-1, 1),
26
+ }
27
+
28
+ fig, ax = plt.subplots()
29
+ ipx.network(
30
+ g,
31
+ layout=layout,
32
+ ax=ax,
33
+ vertex_labels=True,
34
+ edge_waypoints=["none", [(1, 1), (0.5, 1.5), (1, 1.5)], "none", "none"],
35
+ )
36
+ plt.ion(); plt.show()
37
+
38
+ # %%
39
+ # .. note::
40
+ # Edge waypoints are not currently compatible with curved edges.
@@ -1,6 +1,6 @@
1
1
  """
2
- Styling clades
3
- ==============
2
+ Subtrees and cascades
3
+ =====================
4
4
 
5
5
  This Biopython-inspired example shows how to style clade edges for a
6
6
  node and its descendants.