iplotx 1.1.0__tar.gz → 1.2.1__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 (262) hide show
  1. {iplotx-1.1.0 → iplotx-1.2.1}/.github/workflows/test.yml +1 -1
  2. {iplotx-1.1.0 → iplotx-1.2.1}/.gitignore +4 -0
  3. {iplotx-1.1.0 → iplotx-1.2.1}/PKG-INFO +4 -5
  4. {iplotx-1.1.0 → iplotx-1.2.1}/README.md +1 -2
  5. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api/complete_style_specification.md +9 -2
  6. iplotx-1.2.1/docs/source/code_of_conduct.rst +145 -0
  7. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/index.md +1 -0
  8. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/sg_execution_times.rst +2 -2
  9. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_double_tree.py +36 -1
  10. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/__init__.py +2 -0
  11. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/edge/__init__.py +6 -0
  12. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/edge/arrow.py +6 -1
  13. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/__init__.py +19 -8
  14. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/simple.py +2 -3
  15. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/typing.py +13 -3
  16. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/network/__init__.py +3 -4
  17. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/plotting.py +89 -3
  18. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/tree/__init__.py +25 -0
  19. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/tree/cascades.py +6 -0
  20. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/version.py +1 -1
  21. {iplotx-1.1.0 → iplotx-1.2.1}/pyproject.toml +2 -2
  22. iplotx-1.2.1/tests/baseline_images/test_doubletree/tree_gap.png +0 -0
  23. iplotx-1.2.1/tests/baseline_images/test_doubletree/tree_nogap.png +0 -0
  24. iplotx-1.2.1/tests/test_doubletree.py +66 -0
  25. {iplotx-1.1.0 → iplotx-1.2.1}/uv.lock +509 -48
  26. {iplotx-1.1.0 → iplotx-1.2.1}/.github/workflows/publish.yml +0 -0
  27. {iplotx-1.1.0 → iplotx-1.2.1}/.pre-commit-config.yaml +0 -0
  28. {iplotx-1.1.0 → iplotx-1.2.1}/.readthedocs.yaml +0 -0
  29. {iplotx-1.1.0 → iplotx-1.2.1}/LICENSE +0 -0
  30. {iplotx-1.1.0 → iplotx-1.2.1}/MANIFEST.in +0 -0
  31. {iplotx-1.1.0 → iplotx-1.2.1}/assets/pylint.svg +0 -0
  32. {iplotx-1.1.0 → iplotx-1.2.1}/docs/Makefile +0 -0
  33. {iplotx-1.1.0 → iplotx-1.2.1}/docs/make.bat +0 -0
  34. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/_static/banner.png +0 -0
  35. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/_static/custom-icons.js +0 -0
  36. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/_static/custom.css +0 -0
  37. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/_static/graph_basic.png +0 -0
  38. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/_templates/layout.html +0 -0
  39. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api/artists.md +0 -0
  40. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api/plotting.md +0 -0
  41. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api/providers.md +0 -0
  42. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api/style.md +0 -0
  43. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/api.md +0 -0
  44. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/conf.py +0 -0
  45. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/images/sphx_glr_plot_basic_001.png +0 -0
  46. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/images/thumb/sphx_glr_plot_basic_thumb.png +0 -0
  47. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/installing.md +0 -0
  48. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/providers.md +0 -0
  49. {iplotx-1.1.0 → iplotx-1.2.1}/docs/source/style.md +0 -0
  50. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/GALLERY_HEADER.rst +0 -0
  51. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/GALLERY_HEADER.rst +0 -0
  52. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_3d.py +0 -0
  53. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_basic.py +0 -0
  54. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_big_curves.py +0 -0
  55. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_dag.py +0 -0
  56. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_directed.py +0 -0
  57. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_grouping.py +0 -0
  58. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_house.py +0 -0
  59. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_loops.py +0 -0
  60. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/basic/plot_simple_path.py +0 -0
  61. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/GALLERY_HEADER.rst +0 -0
  62. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/80201010000000001.mst +0 -0
  63. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/GN-tree.json +0 -0
  64. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/breast_cancer_string_interactions_short.tsv +0 -0
  65. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/breast_cancer_string_network_coordinates.tsv +0 -0
  66. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/cell_cycle_arrest_string_interactions_short.tsv +0 -0
  67. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/cell_cycle_arrest_string_network_coordinates.tsv +0 -0
  68. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/data/fevo-08-588430_DataSheet1_S1.csv +0 -0
  69. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_animal_phylogeny.py +0 -0
  70. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_antibody_clone.py +0 -0
  71. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_breast_cancer_ppi.py +0 -0
  72. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_cell_cycle_arrest.py +0 -0
  73. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_food_network.py +0 -0
  74. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_foraging_table.py +0 -0
  75. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_pollinators.py +0 -0
  76. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_ppi.py +0 -0
  77. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/biology/plot_tca_cycle.py +0 -0
  78. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/GALLERY_HEADER.rst +0 -0
  79. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/data/chess_masters_WCC.pgn.bz2 +0 -0
  80. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/data/knuth_miles.txt.gz +0 -0
  81. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_arrowlawn.py +0 -0
  82. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_chess_masters.py +0 -0
  83. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_cliques.py +0 -0
  84. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_cluster_layout.py +0 -0
  85. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_company_structure.py +0 -0
  86. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_complex.py +0 -0
  87. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_financial_network.py +0 -0
  88. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_knuth_miles.py +0 -0
  89. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_labels_and_colors.py +0 -0
  90. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_max_bipartite_matching.py +0 -0
  91. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_minimum_spanning_trees.py +0 -0
  92. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_multipartite_layout.py +0 -0
  93. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_parallel_igraph_networkx.py +0 -0
  94. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_redblack.py +0 -0
  95. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_shortest_path.py +0 -0
  96. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_simple_networkx.py +0 -0
  97. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_social_network_circles.py +0 -0
  98. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_traveling_salesman.py +0 -0
  99. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/network_science/plot_with_colorbar.py +0 -0
  100. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/GALLERY_HEADER.rst +0 -0
  101. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_animation.py +0 -0
  102. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_edit_artists.py +0 -0
  103. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_feedbacks.py +0 -0
  104. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_graph.py +0 -0
  105. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_mouse_hover.py +0 -0
  106. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/other/plot_train.py +0 -0
  107. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/GALLERY_HEADER.rst +0 -0
  108. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_arrows.py +0 -0
  109. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_depthshade.py +0 -0
  110. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_edgepadding.py +0 -0
  111. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_elements.py +0 -0
  112. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_four_grids.py +0 -0
  113. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_halfarrows.py +0 -0
  114. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_multistyle.py +0 -0
  115. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_ports.py +0 -0
  116. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_style.py +0 -0
  117. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_tension.py +0 -0
  118. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_vertexmarkers.py +0 -0
  119. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_voronoi.py +0 -0
  120. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/style/plot_waypoints.py +0 -0
  121. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/GALLERY_HEADER.rst +0 -0
  122. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/data/tree-with-support.json +0 -0
  123. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_angular_waypoints.py +0 -0
  124. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_biopython_tree.py +0 -0
  125. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_cladeedges.py +0 -0
  126. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_cogent3_layouts.py +0 -0
  127. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_cogent3_tree.py +0 -0
  128. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_dendropy.py +0 -0
  129. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_elements_tree.py +0 -0
  130. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_ete4.py +0 -0
  131. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_leafedges.py +0 -0
  132. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_leafedges_and_cascades.py +0 -0
  133. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_scalebar.py +0 -0
  134. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_skbio_tree.py +0 -0
  135. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_split_edges.py +0 -0
  136. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_style_tree.py +0 -0
  137. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_support.py +0 -0
  138. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_tree_node_background.py +0 -0
  139. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_tree_style_clades.py +0 -0
  140. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/tree/plot_trees_of_trees.py +0 -0
  141. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/zero_dependency/GALLERY_HEADER.rst +0 -0
  142. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/zero_dependency/plot_simplenetworkdataprovider.py +0 -0
  143. {iplotx-1.1.0 → iplotx-1.2.1}/gallery/zero_dependency/plot_simpletreedataprovider.py +0 -0
  144. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/art3d/edge/__init__.py +0 -0
  145. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/art3d/edge/arrow.py +0 -0
  146. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/art3d/edge/geometry.py +0 -0
  147. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/art3d/vertex.py +0 -0
  148. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/artists.py +0 -0
  149. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/edge/geometry.py +0 -0
  150. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/edge/leaf.py +0 -0
  151. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/edge/ports.py +0 -0
  152. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/heuristics.py +0 -0
  153. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/network/graph_tool.py +0 -0
  154. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/network/igraph.py +0 -0
  155. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/network/networkx.py +0 -0
  156. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/network/simple.py +0 -0
  157. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/biopython.py +0 -0
  158. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/cogent3.py +0 -0
  159. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/dendropy.py +0 -0
  160. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/ete4.py +0 -0
  161. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/ingest/providers/tree/skbio.py +0 -0
  162. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/label.py +0 -0
  163. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/layout.py +0 -0
  164. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/network/groups.py +0 -0
  165. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/style/__init__.py +0 -0
  166. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/style/leaf_info.py +0 -0
  167. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/style/library.py +0 -0
  168. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/tree/scalebar.py +0 -0
  169. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/typing.py +0 -0
  170. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/utils/geometry.py +0 -0
  171. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/utils/internal.py +0 -0
  172. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/utils/matplotlib.py +0 -0
  173. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/utils/style.py +0 -0
  174. {iplotx-1.1.0 → iplotx-1.2.1}/iplotx/vertex.py +0 -0
  175. {iplotx-1.1.0 → iplotx-1.2.1}/scripts/copy_github_release_into_version.sh +0 -0
  176. {iplotx-1.1.0 → iplotx-1.2.1}/scripts/make_banner.py +0 -0
  177. {iplotx-1.1.0 → iplotx-1.2.1}/scripts/update_pylint_badge.sh +0 -0
  178. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/cascades.png +0 -0
  179. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/directed_child.png +0 -0
  180. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/leaf_labels.png +0 -0
  181. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/leaf_labels_hmargin.png +0 -0
  182. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/leafedges.png +0 -0
  183. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/show_support.png +0 -0
  184. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/tree_basic.png +0 -0
  185. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_biopython/tree_radial.png +0 -0
  186. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_cogent3/leaf_labels.png +0 -0
  187. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_cogent3/leaf_labels_hmargin.png +0 -0
  188. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_cogent3/tree_basic.png +0 -0
  189. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_cogent3/tree_radial.png +0 -0
  190. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/cascades.png +0 -0
  191. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/directed_child.png +0 -0
  192. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/leaf_labels.png +0 -0
  193. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/leaf_labels_hmargin.png +0 -0
  194. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/leafedges.png +0 -0
  195. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/tree_basic.png +0 -0
  196. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_dendropy/tree_radial.png +0 -0
  197. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_ete4/leaf_labels.png +0 -0
  198. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_ete4/leaf_labels_hmargin.png +0 -0
  199. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_ete4/split_edges.png +0 -0
  200. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_ete4/tree_basic.png +0 -0
  201. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_ete4/tree_radial.png +0 -0
  202. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_graph_tool/graph_basic.png +0 -0
  203. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_graph_tool/graph_directed.png +0 -0
  204. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/clustering_directed.png +0 -0
  205. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/clustering_directed_large.png +0 -0
  206. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_basic.png +0 -0
  207. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_directed.png +0 -0
  208. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_directed_curved_loops.png +0 -0
  209. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_edit_children.png +0 -0
  210. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_labels.png +0 -0
  211. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_layout_attribute.png +0 -0
  212. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_null.png +0 -0
  213. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_squares_directed.png +0 -0
  214. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_vertexsize.png +0 -0
  215. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/graph_with_curved_edges.png +0 -0
  216. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/igraph_layout_object.png +0 -0
  217. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph/multigraph_with_curved_edges_undirected.png +0 -0
  218. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph_3d/directed.png +0 -0
  219. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph_3d/undirected.png +0 -0
  220. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_igraph_3d/vertex_labels.png +0 -0
  221. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/cluster-layout.png +0 -0
  222. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/complex.png +0 -0
  223. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/complex_rotatelabels.png +0 -0
  224. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/directed_graph.png +0 -0
  225. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/directed_graph_with_colorbar.png +0 -0
  226. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/empty_graph.png +0 -0
  227. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/flat_style.png +0 -0
  228. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/house_with_colors.png +0 -0
  229. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/labels_and_colors.png +0 -0
  230. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/shortest_path.png +0 -0
  231. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_networkx/simple_graph.png +0 -0
  232. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_simple_network_provider/graph_basic.png +0 -0
  233. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_simple_network_provider/graph_directed.png +0 -0
  234. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_simple_network_provider/graph_labels.png +0 -0
  235. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_skbio/leaf_labels.png +0 -0
  236. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_skbio/leaf_labels_hmargin.png +0 -0
  237. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_skbio/tree_basic.png +0 -0
  238. {iplotx-1.1.0 → iplotx-1.2.1}/tests/baseline_images/test_skbio/tree_radial.png +0 -0
  239. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_arrows.py +0 -0
  240. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_biopython.py +0 -0
  241. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_cascades.py +0 -0
  242. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_cogent3.py +0 -0
  243. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_dendropy.py +0 -0
  244. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_edge.py +0 -0
  245. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_edge_geometry.py +0 -0
  246. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_ete4.py +0 -0
  247. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_geometry.py +0 -0
  248. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_graph_tool.py +0 -0
  249. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_heuristics.py +0 -0
  250. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_igraph.py +0 -0
  251. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_igraph_3d.py +0 -0
  252. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_ingest_protocols.py +0 -0
  253. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_matplotlib_utils.py +0 -0
  254. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_network_hotload.py +0 -0
  255. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_networkx.py +0 -0
  256. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_ports.py +0 -0
  257. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_simple_network_provider.py +0 -0
  258. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_simple_tree_provider.py +0 -0
  259. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_skbio.py +0 -0
  260. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_style.py +0 -0
  261. {iplotx-1.1.0 → iplotx-1.2.1}/tests/test_vertex.py +0 -0
  262. {iplotx-1.1.0 → iplotx-1.2.1}/tests/utils.py +0 -0
@@ -12,7 +12,7 @@ jobs:
12
12
  strategy:
13
13
  fail-fast: false
14
14
  matrix:
15
- python-version: ["3.11", "3.12", "3.13"]
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v5
@@ -179,3 +179,7 @@ cython_debug/
179
179
 
180
180
  # PyPI configuration file
181
181
  .pypirc
182
+
183
+ # vim backup files
184
+ *.swp
185
+ *.swo
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iplotx
3
- Version: 1.1.0
3
+ Version: 1.2.1
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
@@ -26,8 +26,8 @@ Classifier: Programming Language :: Python :: 3.13
26
26
  Classifier: Topic :: Scientific/Engineering :: Visualization
27
27
  Classifier: Topic :: System :: Networking
28
28
  Classifier: Typing :: Typed
29
- Requires-Python: >=3.11
30
- Requires-Dist: matplotlib>=2.0.0
29
+ Requires-Python: >=3.10
30
+ Requires-Dist: matplotlib>=3.10.0
31
31
  Requires-Dist: numpy>=2.0.0
32
32
  Requires-Dist: pandas>=2.0.0
33
33
  Provides-Extra: igraph
@@ -78,8 +78,7 @@ import iplotx as ipx
78
78
 
79
79
  g = nx.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)])
80
80
  layout = nx.layout.circular_layout(g)
81
- fig, ax = plt.subplots(figsize=(3, 3))
82
- ipx.plot(g, ax=ax, layout=layout)
81
+ ipx.plot(g, layout)
83
82
  ```
84
83
 
85
84
  ![Quick start image](/docs/source/_static/graph_basic.png)
@@ -40,8 +40,7 @@ import iplotx as ipx
40
40
 
41
41
  g = nx.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)])
42
42
  layout = nx.layout.circular_layout(g)
43
- fig, ax = plt.subplots(figsize=(3, 3))
44
- ipx.plot(g, ax=ax, layout=layout)
43
+ ipx.plot(g, layout)
45
44
  ```
46
45
 
47
46
  ![Quick start image](/docs/source/_static/graph_basic.png)
@@ -274,8 +274,15 @@
274
274
  # - "radial" layout: "clockwise" or "counterclockwise"
275
275
  "orientation": str,
276
276
  "angular": bool, # Whether to use an angular or waypoint-based layout
277
- "start": float, # Starting angle for radial layouts (in degrees)
278
- "span": float, # Angle span for radial layouts (in degrees)
277
+ # The following two parameters are used differently depending on the layout.
278
+ # For radial layouts:
279
+ # start: Starting angle (in degrees, one float)
280
+ # span: Angle span (in degrees)
281
+ # For horizontal and vertical layouts:
282
+ # start: Starting position in data units (tuple of two floats)
283
+ # span: Breadth in data units (float)
284
+ "start": float | tuple[float, float],
285
+ "span": float,
279
286
  },
280
287
  ############################################################################
281
288
  }
@@ -0,0 +1,145 @@
1
+ .. _scipy-coc:
2
+
3
+ ilpotx Code of Conduct
4
+ ======================
5
+
6
+
7
+ Introduction
8
+ ------------
9
+
10
+ This code of conduct applies to all spaces managed by the iplotx project,
11
+ including all public and private mailing lists, issue trackers, wikis, blogs,
12
+ and any other communication channel used by our community. The iplotx
13
+ project does not organize in-person events, however, events related to our
14
+ community should have a code of conduct similar in spirit to this one.
15
+
16
+ This code of conduct should be honored by everyone who participates in
17
+ the iplotx community formally or informally, or claims any affiliation with the
18
+ project, in any project-related activities, and, especially, when representing the
19
+ project, in any role.
20
+
21
+ This code is neither exhaustive nor complete. It serves to distill our common
22
+ understanding of a collaborative, shared environment and goals. Please try to
23
+ follow this code in spirit as much as in letter, to create a friendly and
24
+ productive environment that enriches the surrounding community.
25
+
26
+
27
+ Specific guidelines
28
+ -------------------
29
+
30
+ We strive to:
31
+
32
+ 1. Be open. We invite anyone to participate in our community. We prefer to use
33
+ public methods of communication for project-related messages, unless
34
+ discussing something sensitive. This applies to messages for help or
35
+ project-related support, too; not only is a public-support request much more
36
+ likely to result in an answer to a question, it also ensures that any
37
+ inadvertent mistakes in answering are more easily detected and corrected.
38
+
39
+ 2. Be empathetic, welcoming, friendly, and patient. We work together to resolve
40
+ conflict, and assume good intentions. We may all experience some frustration
41
+ from time to time, but we do not allow frustration to turn into a personal
42
+ attack. A community where people feel uncomfortable or threatened is not a
43
+ productive one.
44
+
45
+ 3. Be collaborative. Our work will be used by other people, and in turn we will
46
+ depend on the work of others. When we make something for the benefit of the
47
+ project, we are willing to explain to others how it works, so that they can
48
+ build on the work to make it even better. Any decision we make will affect
49
+ users and colleagues, and we take those consequences seriously when making
50
+ decisions.
51
+
52
+ 4. Be inquisitive. Nobody knows everything! Asking questions early avoids many
53
+ problems later, so we encourage questions, although we may direct them to
54
+ the appropriate forum. We will try hard to be responsive and helpful.
55
+
56
+ 5. Be careful in the words that we choose. We are careful and respectful in
57
+ our communication and we take responsibility for our own speech. Be kind to
58
+ others. Do not insult or put down other participants. We will not accept
59
+ harassment or other exclusionary behavior, such as:
60
+
61
+ - Violent threats or language directed against another person.
62
+ - Sexist, racist, or otherwise discriminatory jokes and language.
63
+ - Posting sexually explicit or violent material.
64
+ - Posting (or threatening to post) other people's personally identifying information ("doxing").
65
+ - Sharing private content, such as emails sent privately or non-publicly,
66
+ or unlogged forums, such as IRC channel history, without the sender's consent.
67
+ - Personal insults, especially those using racist or sexist terms.
68
+ - Unwelcome sexual attention.
69
+ - Excessive profanity. Please avoid swearwords; people differ greatly in their sensitivity to swearing.
70
+ - Repeated harassment of others. In general, if someone asks you to stop, then stop.
71
+ - Advocating for, or encouraging, any of the above behavior.
72
+
73
+
74
+ Diversity statement
75
+ -------------------
76
+
77
+ The iplotx project welcomes and encourages participation by everyone. We are
78
+ committed to being a community that everyone enjoys being part of. Although
79
+ we may not always be able to accommodate each individual's preferences, we try
80
+ our best to treat everyone kindly.
81
+
82
+ No matter how you identify yourself or how others perceive you: we welcome you.
83
+ Though no list can hope to be comprehensive, we explicitly honor diversity in:
84
+ age, culture, ethnicity, genotype, gender identity or expression, language,
85
+ national origin, neurotype, phenotype, political beliefs, profession, race,
86
+ religion, sexual orientation, socioeconomic status, subculture and technical
87
+ ability, to the extent that these do not conflict with this code of conduct.
88
+
89
+
90
+ Though we welcome people fluent in all languages, iplotx development is
91
+ conducted in English.
92
+
93
+ Standards for behavior in the iplotx community are detailed in the Code of
94
+ Conduct above. Participants in our community should uphold these standards
95
+ in all their interactions and help others to do so as well (see next section).
96
+
97
+
98
+ Reporting guidelines
99
+ --------------------
100
+
101
+ We know that it is painfully common for internet communication to start at or
102
+ devolve into obvious and flagrant abuse. We also recognize that sometimes
103
+ people may have a bad day, or be unaware of some of the guidelines in this Code
104
+ of Conduct. Please keep this in mind when deciding on how to respond to a
105
+ breach of this Code.
106
+
107
+ For clearly intentional breaches, report those to the Code of Conduct committee
108
+ (see below). For possibly unintentional breaches, you may reply to the person
109
+ and point out this Code of Conduct (either in public or in private, whatever is
110
+ most appropriate). If you would prefer not to do that, please feel free to
111
+ report to the Code of Conduct committee directly, or ask the committee for
112
+ advice, in confidence.
113
+
114
+ You can report issues to the iplotx core developer Fabio Zanini, at
115
+ fabio.zanini@unsw.edu.au.
116
+
117
+
118
+ Incident reporting resolution & Code of Conduct enforcement
119
+ -----------------------------------------------------------
120
+
121
+ We will investigate and respond to all complaints. This Code of Conduct
122
+ Committee will protect the identity of the reporter, and treat the content
123
+ of complaints as confidential (unless the reporter requests otherwise).
124
+
125
+ In case of severe and obvious breaches, e.g., personal threat or violent, sexist
126
+ or racist language, we will immediately do our utmost to disconnect the
127
+ originator from iplotx communication channels; please see the manual for details.
128
+
129
+ In cases not involving clear severe and obvious breaches of this code of
130
+ conduct, the process for acting on any received code of conduct violation
131
+ report will be:
132
+
133
+ 1. Acknowledgement that the report has been received
134
+ 2. Reasonable discussion/feedback
135
+ 3. Mediation (if feedback didn't help, and only if both reporter and reportee agree to this)
136
+ 4. Enforcement via transparent decision by the Code of Conduct Committee
137
+
138
+ The committee will respond to any report as soon as possible, and at most
139
+ within 72 hours.
140
+
141
+
142
+ Endnotes
143
+ --------
144
+
145
+ This document was adapted from the `SciPy Code of Conduct <https://scipy.github.io/devdocs/dev/conduct/code_of_conduct.html>`_.
@@ -36,4 +36,5 @@ Plotting API <api/plotting>
36
36
  Style API <api/style>
37
37
  Artist hierarchy <api/artists>
38
38
  Data provider protocols <api/providers>
39
+ Code of conduct <code_of_conduct>
39
40
  ```
@@ -6,7 +6,7 @@
6
6
 
7
7
  Computation times
8
8
  =================
9
- **00:00.542** total execution time for 77 files **from all galleries**:
9
+ **00:00.565** total execution time for 77 files **from all galleries**:
10
10
 
11
11
  .. container::
12
12
 
@@ -33,7 +33,7 @@ Computation times
33
33
  - Time
34
34
  - Mem (MB)
35
35
  * - :ref:`sphx_glr_gallery_tree_plot_double_tree.py` (``../../gallery/tree/plot_double_tree.py``)
36
- - 00:00.542
36
+ - 00:00.565
37
37
  - 0.0
38
38
  * - :ref:`sphx_glr_gallery_basic_plot_3d.py` (``../../gallery/basic/plot_3d.py``)
39
39
  - 00:00.000
@@ -18,7 +18,7 @@ tree2 = Tree(
18
18
  "((),((),(),((),())),());",
19
19
  )
20
20
 
21
- fig, ax = plt = plt.subplots(figsize=(9, 4))
21
+ fig, ax = plt.subplots(figsize=(9, 4))
22
22
 
23
23
  # Plot first tree on the left
24
24
  ipx.plotting.tree(
@@ -54,3 +54,38 @@ for y1, y2 in matches:
54
54
  ax.plot(
55
55
  [5.2, 6.8], [y1, y2], color="gray", linewidth=2,
56
56
  )
57
+
58
+ # %%
59
+ # ``iplotx`` has a dedicated function for double trees, which virtually the same result with less code:
60
+
61
+ fig, ax = plt.subplots(figsize=(9, 4))
62
+ ipx.doubletree(
63
+ tree1,
64
+ tree2,
65
+ ax=ax,
66
+ kwargs_left=dict(
67
+ leaf_deep=True,
68
+ edge_color="tomato",
69
+ ),
70
+ kwargs_right=dict(
71
+ leaf_deep=True,
72
+ edge_color="steelblue",
73
+ ),
74
+ gap=2,
75
+ aspect=1,
76
+ )
77
+
78
+ # Add lines connecting corresponding leaves
79
+ # NOTE: The layout is horizontally centered now
80
+ matches = [
81
+ (0, 0),
82
+ (1, 4),
83
+ (2, 5),
84
+ (3, 2),
85
+ (4, 1),
86
+ (5, 5),
87
+ ]
88
+ for y1, y2 in matches:
89
+ ax.plot(
90
+ [-0.3, 1.3], [y1, y2], color="gray", linewidth=2,
91
+ )
@@ -11,6 +11,7 @@ from .plotting import (
11
11
  network,
12
12
  graph,
13
13
  tree,
14
+ doubletree,
14
15
  plot,
15
16
  )
16
17
  import iplotx.artists as artists
@@ -20,6 +21,7 @@ import iplotx.style as style
20
21
  __all__ = [
21
22
  "network",
22
23
  "tree",
24
+ "doubletree",
23
25
  "plot",
24
26
  "graph",
25
27
  "artists",
@@ -274,6 +274,12 @@ class EdgeCollection(mpl.collections.PatchCollection):
274
274
  """Return mappable for colorbar."""
275
275
  return self
276
276
 
277
+ def shift(self, x: float, y: float) -> None:
278
+ """Shift the cascade by a certain amount."""
279
+ for path in self._paths:
280
+ path.vertices[:, 0] += x
281
+ path.vertices[:, 1] += y
282
+
277
283
  def _get_adjacent_vertices_info(self):
278
284
  index = self._vertex_collection.get_index()
279
285
  index = pd.Series(
@@ -2,7 +2,12 @@
2
2
  Module for edge arrows in iplotx.
3
3
  """
4
4
 
5
- from typing import Never, Optional
5
+ import sys
6
+ if sys.version_info < (3, 11):
7
+ from typing_extensions import Never
8
+ else:
9
+ from typing import Never
10
+ from typing import Optional
6
11
 
7
12
  from math import atan2, cos, sin
8
13
  import numpy as np
@@ -2,16 +2,24 @@
2
2
  This module focuses on how to ingest network/tree data into standard data structures no matter what library they come from.
3
3
  """
4
4
 
5
- import pathlib
6
- import pkgutil
7
- import importlib
8
- import warnings
5
+ import sys
9
6
  from typing import (
10
7
  Optional,
11
8
  Sequence,
12
- Protocol,
13
9
  )
10
+
11
+ # NOTE: __init__ in Protocols has had a difficult gestation
12
+ # https://github.com/python/cpython/issues/88970
13
+ if sys.version_info < (3, 11):
14
+ Protocol = object
15
+ else:
16
+ from typing import Protocol
17
+
14
18
  from collections.abc import Hashable
19
+ import pathlib
20
+ import pkgutil
21
+ import importlib
22
+ import warnings
15
23
  import pandas as pd
16
24
 
17
25
  from ..typing import (
@@ -35,6 +43,9 @@ provider_protocols = {
35
43
  data_providers: dict[str, dict[str, Protocol]] = {kind: {} for kind in provider_protocols}
36
44
  for kind in data_providers:
37
45
  providers_path = pathlib.Path(__file__).parent.joinpath("providers").joinpath(kind)
46
+ if sys.version_info < (3, 11):
47
+ providers_path = str(providers_path)
48
+
38
49
  for importer, module_name, _ in pkgutil.iter_modules([providers_path]):
39
50
  module = importlib.import_module(f"iplotx.ingest.providers.{kind}.{module_name}")
40
51
  for key, val in module.__dict__.items():
@@ -138,11 +149,11 @@ def ingest_tree_data(
138
149
 
139
150
 
140
151
  # INTERNAL FUNCTIONS
141
- def _update_data_providers(kind):
142
- """Update data provieders dynamically from external packages."""
152
+ def _update_data_providers(kind: str):
153
+ """Update data providers dynamically from external packages."""
143
154
  discovered_providers = importlib.metadata.entry_points(group=f"iplotx.{kind}_data_providers")
144
155
  for entry_point in discovered_providers:
145
- if entry_point.name not in data_providers["network"]:
156
+ if entry_point.name not in data_providers[kind]:
146
157
  try:
147
158
  data_providers[kind][entry_point.name] = entry_point.load()
148
159
  except Exception as e:
@@ -3,7 +3,6 @@ from typing import (
3
3
  Optional,
4
4
  Sequence,
5
5
  Iterable,
6
- Self,
7
6
  )
8
7
 
9
8
  from ...typing import (
@@ -19,12 +18,12 @@ class SimpleTree:
19
18
  branch_length: Length of the branch leading to this node/tree.
20
19
  """
21
20
 
22
- children: Sequence[Self] = []
21
+ children: Sequence = []
23
22
  branch_length: float = 1
24
23
  name: str = ""
25
24
 
26
25
  @classmethod
27
- def from_dict(cls, data: dict) -> Self:
26
+ def from_dict(cls, data: dict):
28
27
  """Create a SimpleTree from a dictionary.
29
28
 
30
29
  Parameters:
@@ -5,15 +5,20 @@ Networkx and trees are treated separately for practical reasons: many tree analy
5
5
  work as well on general networks.
6
6
  """
7
7
 
8
+ import sys
8
9
  from typing import (
9
- NotRequired,
10
- TypedDict,
11
- Protocol,
12
10
  Optional,
13
11
  Sequence,
14
12
  Any,
15
13
  Iterable,
16
14
  )
15
+ # NOTE: __init__ in Protocols has had a difficult gestation
16
+ # https://github.com/python/cpython/issues/88970
17
+ if sys.version_info < (3, 11):
18
+ Protocol = object
19
+ else:
20
+ from typing import Protocol
21
+
17
22
  from collections.abc import Hashable
18
23
  import numpy as np
19
24
  import pandas as pd
@@ -26,6 +31,11 @@ from .heuristics import (
26
31
  normalise_tree_layout,
27
32
  )
28
33
 
34
+ if sys.version_info < (3, 11):
35
+ from typing_extensions import TypedDict, NotRequired
36
+ else:
37
+ from typing import TypedDict, NotRequired
38
+
29
39
 
30
40
  class NetworkData(TypedDict):
31
41
  """Network data structure for iplotx."""
@@ -1,7 +1,6 @@
1
1
  from typing import (
2
2
  Optional,
3
3
  Sequence,
4
- Self,
5
4
  )
6
5
  import numpy as np
7
6
  import pandas as pd
@@ -103,8 +102,8 @@ class NetworkArtist(mpl.artist.Artist):
103
102
  @classmethod
104
103
  def from_other(
105
104
  cls: "NetworkArtist", # NOTE: This is fixed in Python 3.14
106
- other: Self,
107
- ) -> Self:
105
+ other,
106
+ ):
108
107
  """Create a NetworkArtist as a copy of another one.
109
108
 
110
109
  Parameters:
@@ -123,7 +122,7 @@ class NetworkArtist(mpl.artist.Artist):
123
122
  def from_edgecollection(
124
123
  cls: "NetworkArtist", # NOTE: This is fixed in Python 3.14
125
124
  edge_collection: EdgeCollection | Edge3DCollection,
126
- ) -> Self:
125
+ ):
127
126
  """Create a NetworkArtist from iplotx artists.
128
127
 
129
128
  Parameters:
@@ -1,4 +1,8 @@
1
- from typing import Optional, Sequence
1
+ from typing import (
2
+ Optional,
3
+ Sequence,
4
+ Any,
5
+ )
2
6
  from contextlib import nullcontext
3
7
  import numpy as np
4
8
  import pandas as pd
@@ -269,8 +273,86 @@ def tree(
269
273
  return artist
270
274
 
271
275
 
276
+ def doubletree(
277
+ tree_left: Optional[TreeType] = None,
278
+ tree_right: Optional[TreeType] = None,
279
+ kwargs_left: Optional[dict[Any]] = None,
280
+ kwargs_right: Optional[dict[Any]] = None,
281
+ gap: float = 0,
282
+ ax: Optional[mpl.axes.Axes] = None,
283
+ title: Optional[str] = None,
284
+ aspect: Optional[str | float] = None,
285
+ margins: float | tuple[float, float] = 0,
286
+ strip_axes: bool = True,
287
+ figsize: Optional[tuple[float, float]] = None,
288
+ ) -> tuple[TreeArtist, TreeArtist]:
289
+ """Visualize two trees facing each other.
290
+
291
+ Parameters:
292
+ tree_left: The tree to plot on the left side.
293
+ tree_right: The tree to plot on the right side.
294
+ kwargs_left: Additional keyword arguments passed to the left tree plotting function.
295
+ kwargs_right: Additional keyword arguments passed to the right tree plotting function.
296
+ ax: The axis to plot on. If None, a new figure and axis will be created. Defaults to
297
+ None.
298
+ title: If not None, set the axes title to this value.
299
+ aspect: If not None, set the aspect ratio of the axis to this value. The most common
300
+ value is 1.0, which proportionates x- and y-axes.
301
+ margins: How much margin to leave around the plot. A higher value (e.g. 0.1) can be
302
+ used as a quick fix when some vertex shapes reach beyond the plot edge. This is
303
+ a fraction of the data limits, so 0.1 means 10% of the data limits will be left
304
+ as margin.
305
+ strip_axes: If True, remove axis spines and ticks.
306
+ figsize: If ax is None, a new matplotlib Figure is created. This argument specifies
307
+ the (width, height) dimension of the figure in inches. If ax is not None, this
308
+ argument is ignored. If None, the default matplotlib figure size is used.
309
+ Returns:
310
+ A tuple with the left and right TreeArtist objects.
311
+ """
312
+ artist1 = tree(
313
+ tree_left,
314
+ layout="horizontal",
315
+ layout_orientation="right",
316
+ ax=ax,
317
+ strip_axes=False,
318
+ figsize=figsize,
319
+ **kwargs_left or {},
320
+ )
321
+
322
+ ax = artist1.axes
323
+
324
+ if kwargs_right is None:
325
+ kwargs_right = {}
326
+
327
+ had_layout_start = "layout_start" in kwargs_right
328
+
329
+ artist2 = tree(
330
+ tree_right,
331
+ layout="horizontal",
332
+ layout_orientation="left",
333
+ ax=ax,
334
+ title=title,
335
+ aspect=aspect,
336
+ strip_axes=False,
337
+ margins=margins,
338
+ **kwargs_right,
339
+ )
340
+
341
+ if not had_layout_start:
342
+ x2min = artist2.get_layout().values[:, 0].min()
343
+ x1max = artist1.get_layout().values[:, 0].max()
344
+ xshift = x1max - x2min + gap
345
+
346
+ artist2.shift(0.5 * xshift, 0)
347
+ artist1.shift(-0.5 * xshift, 0)
348
+
349
+ _postprocess_axes(ax, [artist1, artist2], strip=strip_axes, ignore_previous=True)
350
+
351
+ return (artist1, artist2)
352
+
353
+
272
354
  # INTERNAL ROUTINES
273
- def _postprocess_axes(ax, artists, strip=True, had_data=None):
355
+ def _postprocess_axes(ax, artists, strip=True, had_data=None, ignore_previous=False):
274
356
  """Postprocess axis after plotting."""
275
357
 
276
358
  if strip:
@@ -309,7 +391,11 @@ def _postprocess_axes(ax, artists, strip=True, had_data=None):
309
391
  for art in artists:
310
392
  bboxes.append(art.get_datalim(ax.transData))
311
393
  bbox = mpl.transforms.Bbox.union(bboxes)
312
- ax.update_datalim(bbox)
394
+
395
+ if not ignore_previous:
396
+ ax.update_datalim(bbox)
397
+ else:
398
+ ax.dataLim.update_from_data_xy(bbox.corners(), ignore=True)
313
399
 
314
400
  # Autoscale for x/y axis limits
315
401
  ax.autoscale_view()
@@ -219,6 +219,31 @@ class TreeArtist(mpl.artist.Artist):
219
219
  else:
220
220
  raise ValueError(f"Unknown layout kind: {kind}. Use 'vertex' or 'edge'.")
221
221
 
222
+ def shift(self, x: float, y: float) -> None:
223
+ """Shift layout coordinates for all tree elements.
224
+
225
+ Paramerers:
226
+ x: The shift in x direction.
227
+ y: The shift in y direction.
228
+ """
229
+ layout_columns = [f"_ipx_layout_{i}" for i in range(self._ipx_internal_data["ndim"])]
230
+ self._ipx_internal_data["vertex_df"][layout_columns[0]] += x
231
+ self._ipx_internal_data["vertex_df"][layout_columns[1]] += y
232
+
233
+ self.get_vertices()._layout.values[:, 0] += x
234
+ self.get_vertices()._layout.values[:, 1] += y
235
+ self.get_vertices()._update_offsets_from_layout()
236
+
237
+ self.get_edges().shift(x, y)
238
+
239
+ if hasattr(self, "_leaf_vertices"):
240
+ self.get_leaf_vertices()._layout.values[:, 0] += x
241
+ self.get_leaf_vertices()._layout.values[:, 1] += y
242
+ self.get_leaf_vertices()._update_offsets_from_layout()
243
+
244
+ if hasattr(self, "_cascades"):
245
+ self._cascades.shift(x, y)
246
+
222
247
  def get_datalim(self, transData, pad=0.15):
223
248
  """Get limits on x/y axes based on the graph layout data.
224
249
 
@@ -158,6 +158,12 @@ class CascadeCollection(mpl.collections.PatchCollection):
158
158
  zorder=zorder,
159
159
  )
160
160
 
161
+ def shift(self, x: float, y: float) -> None:
162
+ """Shift the cascade by a certain amount."""
163
+ for path in self._paths:
164
+ path.vertices[:, 0] += x
165
+ path.vertices[:, 1] += y
166
+
161
167
  def get_maxdepth(self) -> float:
162
168
  """Get the maxdepth of the cascades.
163
169
 
@@ -2,4 +2,4 @@
2
2
  iplotx version information module.
3
3
  """
4
4
 
5
- __version__ = "1.1.0"
5
+ __version__ = "1.2.1"
@@ -11,11 +11,11 @@ authors = [
11
11
  maintainers = [
12
12
  {name = "Fabio Zanini", email = "fabio.zanini@unsw.edu.au"}
13
13
  ]
14
- requires-python = ">=3.11"
14
+ requires-python = ">=3.10"
15
15
  readme = "README.md"
16
16
  dynamic = ["version"]
17
17
  dependencies = [
18
- "matplotlib>=2.0.0",
18
+ "matplotlib>=3.10.0",
19
19
  "numpy>=2.0.0",
20
20
  "pandas>=2.0.0",
21
21
  ]