iplotx 0.4.0__tar.gz → 0.5.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.
- {iplotx-0.4.0 → iplotx-0.5.1}/.github/workflows/test.yml +5 -2
- iplotx-0.5.1/.pre-commit-config.yaml +54 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/MANIFEST.in +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/PKG-INFO +33 -15
- iplotx-0.5.1/README.md +69 -0
- iplotx-0.5.1/docs/source/_static/banner.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api/artists.md +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api/complete_style_specification.md +2 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api/providers.md +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/conf.py +1 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/sg_execution_times.rst +16 -4
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_animation.py +5 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_chess_masters.py +10 -5
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_dag.py +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_edit_artists.py +4 -4
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_grouping.py +14 -9
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_house.py +1 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_knuth_miles.py +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_loops.py +7 -8
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_max_bipartite_matching.py +4 -4
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_minimum_spanning_trees.py +5 -5
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_mouse_hover.py +1 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_ports.py +15 -9
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_shortest_path.py +1 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_simple_networkx.py +3 -2
- iplotx-0.4.0/gallery/plot_simpledataprovider.py → iplotx-0.5.1/gallery/plot_simplenetworkdataprovider.py +3 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_style.py +8 -6
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_traveling_salesman.py +1 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_vertexmarkers.py +1 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_voronoi.py +5 -1
- iplotx-0.5.1/gallery/tree/plot_angular_waypoints.py +87 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_biopython_tree.py +1 -1
- iplotx-0.5.1/gallery/tree/plot_cladeedges.py +38 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_cogent3_tree.py +1 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_leafedges_and_cascades.py +1 -2
- iplotx-0.5.1/gallery/tree/plot_simpletreedataprovider.py +48 -0
- iplotx-0.5.1/gallery/tree/plot_split_edges.py +46 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_tree_node_background.py +1 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_tree_style_clades.py +25 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_trees_of_trees.py +0 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/cascades.py +19 -28
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/edge/__init__.py +74 -6
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/edge/arrow.py +10 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/edge/geometry.py +5 -17
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/edge/ports.py +3 -2
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/groups.py +1 -3
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/__init__.py +5 -14
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/heuristics.py +1 -4
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/network/igraph.py +4 -12
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/network/networkx.py +6 -20
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/network/simple.py +2 -9
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/tree/biopython.py +2 -5
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/tree/cogent3.py +2 -5
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/tree/ete4.py +2 -5
- iplotx-0.5.1/iplotx/ingest/providers/tree/simple.py +97 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/providers/tree/skbio.py +2 -5
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/ingest/typing.py +5 -14
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/network.py +4 -7
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/plotting.py +1 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/style/__init__.py +131 -106
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/style/leaf_info.py +3 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/style/library.py +94 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/tree.py +55 -42
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/typing.py +2 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/utils/geometry.py +32 -40
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/utils/matplotlib.py +13 -10
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/utils/style.py +6 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/version.py +1 -1
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/vertex.py +16 -23
- {iplotx-0.4.0 → iplotx-0.5.1}/pyproject.toml +5 -0
- iplotx-0.5.1/scripts/make_banner.py +82 -0
- iplotx-0.5.1/tests/baseline_images/test_biopython/cascades.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_biopython/leafedges.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_biopython/show_support.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_ete4/split_edges.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_igraph/graph_with_curved_edges.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_igraph/igraph_layout_object.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_networkx/complex_rotatelabels.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_simple_network_provider/graph_basic.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_simple_network_provider/graph_directed.png +0 -0
- iplotx-0.5.1/tests/baseline_images/test_simple_network_provider/graph_labels.png +0 -0
- iplotx-0.5.1/tests/test_arrows.py +109 -0
- iplotx-0.5.1/tests/test_biopython.py +236 -0
- iplotx-0.5.1/tests/test_cascades.py +127 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/test_cogent3.py +4 -12
- iplotx-0.5.1/tests/test_edge.py +77 -0
- iplotx-0.5.1/tests/test_edge_geometry.py +136 -0
- iplotx-0.5.1/tests/test_ete4.py +84 -0
- iplotx-0.5.1/tests/test_geometry.py +146 -0
- iplotx-0.5.1/tests/test_heuristics.py +117 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/test_igraph.py +6 -16
- iplotx-0.5.1/tests/test_matplotlib_utils.py +18 -0
- iplotx-0.5.1/tests/test_network_hotload.py +41 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/test_networkx.py +51 -16
- iplotx-0.5.1/tests/test_ports.py +34 -0
- iplotx-0.5.1/tests/test_simple_network_provider.py +136 -0
- iplotx-0.5.1/tests/test_simple_tree_provider.py +92 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/test_skbio.py +4 -10
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/test_style.py +16 -8
- iplotx-0.5.1/tests/test_vertex.py +216 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/utils.py +5 -7
- {iplotx-0.4.0 → iplotx-0.5.1}/uv.lock +116 -0
- iplotx-0.4.0/README.md +0 -51
- iplotx-0.4.0/tests/baseline_images/test_igraph/igraph_layout_object.png +0 -0
- iplotx-0.4.0/tests/test_biopython.py +0 -85
- iplotx-0.4.0/tests/test_ete4.py +0 -81
- {iplotx-0.4.0 → iplotx-0.5.1}/.github/workflows/publish.yml +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/.gitignore +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/.readthedocs.yaml +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/LICENSE +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/assets/pylint.svg +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/Makefile +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/make.bat +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/_static/graph_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/_templates/layout.html +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api/plotting.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api/style.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/api.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/images/sphx_glr_plot_basic_001.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/images/thumb/sphx_glr_plot_basic_thumb.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/index.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/providers.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/docs/source/style.md +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/GALLERY_HEADER.rst +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/data/chess_masters_WCC.pgn.bz2 +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/data/knuth_miles.txt.gz +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_arrows.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_basic.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_big_curves.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_cliques.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_cluster_layout.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_company_structure.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_complex.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_directed.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_four_grids.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_halfarrows.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_labels_and_colors.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_multipartite_layout.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_multistyle.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_parallel_igraph_networkx.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_simple_path.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_tension.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/plot_with_colorbar.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/GALLERY_HEADER.rst +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/data/tree-with-support.json +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_cogent3_layouts.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_ete4.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_leafedges.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_skbio_tree.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/gallery/tree/plot_support.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/__init__.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/artists.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/edge/leaf.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/label.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/layout.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/iplotx/utils/internal.py +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/scripts/copy_github_release_into_version.sh +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/scripts/update_pylint_badge.sh +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_biopython/leaf_labels.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_biopython/leaf_labels_hmargin.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_biopython/tree_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_biopython/tree_radial.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_cogent3/leaf_labels.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_cogent3/leaf_labels_hmargin.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_cogent3/tree_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_cogent3/tree_radial.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_ete4/leaf_labels.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_ete4/leaf_labels_hmargin.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_ete4/tree_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_ete4/tree_radial.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/clustering_directed.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/clustering_directed_large.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_directed.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_directed_curved_loops.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_edit_children.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_labels.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_layout_attribute.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_null.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/graph_squares_directed.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_igraph/multigraph_with_curved_edges_undirected.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/cluster-layout.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/complex.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/directed_graph.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/directed_graph_with_colorbar.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/empty_graph.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/flat_style.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/house_with_colors.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/labels_and_colors.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/shortest_path.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_networkx/simple_graph.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_skbio/leaf_labels.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_skbio/leaf_labels_hmargin.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_skbio/tree_basic.png +0 -0
- {iplotx-0.4.0 → iplotx-0.5.1}/tests/baseline_images/test_skbio/tree_radial.png +0 -0
|
@@ -35,7 +35,10 @@ jobs:
|
|
|
35
35
|
run: uv sync --all-extras --group test
|
|
36
36
|
|
|
37
37
|
- name: Run pytest
|
|
38
|
-
run: uv run pytest tests
|
|
38
|
+
run: uv run pytest --cov-report term-missing --cov=iplotx tests
|
|
39
|
+
|
|
40
|
+
- name: Coveralls
|
|
41
|
+
uses: coverallsapp/github-action@v2
|
|
39
42
|
|
|
40
43
|
- name: Run flake8
|
|
41
|
-
run: uv run flake8 iplotx --count --exit-zero --max-complexity=
|
|
44
|
+
run: uv run flake8 iplotx --count --exit-zero --max-complexity=20 --max-line-length=127 --statistics
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v5.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: check-added-large-files
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
13
|
+
# Ruff version.
|
|
14
|
+
rev: v0.12.3
|
|
15
|
+
hooks:
|
|
16
|
+
# Run the linter.
|
|
17
|
+
- id: ruff-check
|
|
18
|
+
types_or: [ python, pyi ]
|
|
19
|
+
args: [ --fix ]
|
|
20
|
+
# Run the formatter.
|
|
21
|
+
- id: ruff-format
|
|
22
|
+
types_or: [ python, pyi ]
|
|
23
|
+
|
|
24
|
+
#- repo: https://github.com/psf/black
|
|
25
|
+
# rev: 25.1.0
|
|
26
|
+
# hooks:
|
|
27
|
+
# - id: black
|
|
28
|
+
# args: [--check,--target-version,py311]
|
|
29
|
+
- repo: https://github.com/PyCQA/flake8
|
|
30
|
+
rev: 7.3.0
|
|
31
|
+
hooks:
|
|
32
|
+
- id: flake8
|
|
33
|
+
args: [
|
|
34
|
+
--count,
|
|
35
|
+
--max-complexity=20,
|
|
36
|
+
--max-line-length=127,
|
|
37
|
+
--statistics,
|
|
38
|
+
--extend-ignore=RST399,
|
|
39
|
+
--exit-zero,
|
|
40
|
+
]
|
|
41
|
+
additional_dependencies: [
|
|
42
|
+
'flake8-rst-docstrings>=0.2.3',
|
|
43
|
+
]
|
|
44
|
+
#- repo: https://github.com/pre-commit/mirrors-mypy
|
|
45
|
+
# rev: v1.16.1
|
|
46
|
+
# hooks:
|
|
47
|
+
# - id: mypy
|
|
48
|
+
# files: '^(iplotx)/'
|
|
49
|
+
|
|
50
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
51
|
+
# uv version.
|
|
52
|
+
rev: 0.7.20
|
|
53
|
+
hooks:
|
|
54
|
+
- id: uv-lock
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iplotx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.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
|
|
@@ -39,12 +39,29 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|

|
|
40
40
|

|
|
41
41
|

|
|
42
|
+
[](https://coveralls.io/github/fabilab/iplotx?branch=main)
|
|
42
43
|

|
|
43
44
|
|
|
44
45
|
# iplotx
|
|
45
|
-
|
|
46
|
+
[](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
|
|
46
47
|
|
|
47
|
-
|
|
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.
|
|
48
65
|
|
|
49
66
|
## Installation
|
|
50
67
|
```bash
|
|
@@ -71,19 +88,20 @@ See [readthedocs](https://iplotx.readthedocs.io/en/latest/) for the full documen
|
|
|
71
88
|
## Gallery
|
|
72
89
|
See [gallery](https://iplotx.readthedocs.io/en/latest/gallery/index.html).
|
|
73
90
|
|
|
74
|
-
##
|
|
75
|
-
- Plot networks from
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
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.). ✅
|
|
79
97
|
- Efficient plotting of large graphs using matplotlib's collection functionality. ✅
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
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.🏗️
|
|
87
105
|
|
|
88
106
|
## Authors
|
|
89
107
|
Fabio Zanini (https://fabilab.org)
|
iplotx-0.5.1/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+

|
|
2
|
+

|
|
3
|
+

|
|
4
|
+
[](https://coveralls.io/github/fabilab/iplotx?branch=main)
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
# iplotx
|
|
8
|
+
[](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
|
+

|
|
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)
|
|
Binary file
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
# Marker style. Currently supported markers:
|
|
18
18
|
# o, c, circle: circle
|
|
19
|
-
|
|
19
|
+
# s, square, r, rectangle: rectangle (square if only one size specified)
|
|
20
20
|
# ^, triangle: upward triangle
|
|
21
21
|
# v, triangle_down: downward triangle
|
|
22
22
|
# <, triangle_left: leftward triangle
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
# 8, octagon: octagon
|
|
29
29
|
# *, star: 5-point star, upright
|
|
30
30
|
"marker": str,
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
"facecolor": str | Any, # Color of the vertex face (e.g. 'red', '#FF0000')
|
|
33
33
|
"edgecolor": str | Any, # Color of the vertex edge (e.g. 'black', '#000000')
|
|
34
34
|
"alpha": float, # Opacity of the vertex (0.0 for fully transparent, 1.0 for fully opaque)
|
|
@@ -49,7 +49,6 @@ myst_enable_extensions = ["colon_fence"]
|
|
|
49
49
|
sphinx_gallery_conf = {
|
|
50
50
|
"examples_dirs": "../../gallery", # path to your example scripts
|
|
51
51
|
"gallery_dirs": "./gallery", # path to where to save gallery generated output
|
|
52
|
-
#'matplotlib_animations': (True, 'mp4'),
|
|
53
52
|
"matplotlib_animations": True,
|
|
54
53
|
}
|
|
55
54
|
|
|
@@ -135,7 +134,7 @@ if link_github:
|
|
|
135
134
|
|
|
136
135
|
version = parse_version(iplotx.__version__)
|
|
137
136
|
tag = "main" if version.is_devrelease else f"v{version.public}"
|
|
138
|
-
return "https://github.com/fabilab/iplotx/blob
|
|
137
|
+
return f"https://github.com/fabilab/iplotx/blob/{tag}/{fn}{linespec}"
|
|
139
138
|
|
|
140
139
|
else:
|
|
141
140
|
extensions.append("sphinx.ext.viewcode")
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Computation times
|
|
8
8
|
=================
|
|
9
|
-
**00:01.
|
|
9
|
+
**00:01.263** total execution time for 51 files **from all galleries**:
|
|
10
10
|
|
|
11
11
|
.. container::
|
|
12
12
|
|
|
@@ -32,8 +32,8 @@ Computation times
|
|
|
32
32
|
* - Example
|
|
33
33
|
- Time
|
|
34
34
|
- Mem (MB)
|
|
35
|
-
* - :ref:`
|
|
36
|
-
- 00:01.
|
|
35
|
+
* - :ref:`sphx_glr_gallery_tree_plot_split_edges.py` (``../../gallery/tree/plot_split_edges.py``)
|
|
36
|
+
- 00:01.263
|
|
37
37
|
- 0.0
|
|
38
38
|
* - :ref:`sphx_glr_gallery_plot_animation.py` (``../../gallery/plot_animation.py``)
|
|
39
39
|
- 00:00.000
|
|
@@ -122,7 +122,7 @@ Computation times
|
|
|
122
122
|
* - :ref:`sphx_glr_gallery_plot_simple_path.py` (``../../gallery/plot_simple_path.py``)
|
|
123
123
|
- 00:00.000
|
|
124
124
|
- 0.0
|
|
125
|
-
* - :ref:`
|
|
125
|
+
* - :ref:`sphx_glr_gallery_plot_simplenetworkdataprovider.py` (``../../gallery/plot_simplenetworkdataprovider.py``)
|
|
126
126
|
- 00:00.000
|
|
127
127
|
- 0.0
|
|
128
128
|
* - :ref:`sphx_glr_gallery_plot_style.py` (``../../gallery/plot_style.py``)
|
|
@@ -143,9 +143,15 @@ Computation times
|
|
|
143
143
|
* - :ref:`sphx_glr_gallery_plot_with_colorbar.py` (``../../gallery/plot_with_colorbar.py``)
|
|
144
144
|
- 00:00.000
|
|
145
145
|
- 0.0
|
|
146
|
+
* - :ref:`sphx_glr_gallery_tree_plot_angular_waypoints.py` (``../../gallery/tree/plot_angular_waypoints.py``)
|
|
147
|
+
- 00:00.000
|
|
148
|
+
- 0.0
|
|
146
149
|
* - :ref:`sphx_glr_gallery_tree_plot_biopython_tree.py` (``../../gallery/tree/plot_biopython_tree.py``)
|
|
147
150
|
- 00:00.000
|
|
148
151
|
- 0.0
|
|
152
|
+
* - :ref:`sphx_glr_gallery_tree_plot_cladeedges.py` (``../../gallery/tree/plot_cladeedges.py``)
|
|
153
|
+
- 00:00.000
|
|
154
|
+
- 0.0
|
|
149
155
|
* - :ref:`sphx_glr_gallery_tree_plot_cogent3_layouts.py` (``../../gallery/tree/plot_cogent3_layouts.py``)
|
|
150
156
|
- 00:00.000
|
|
151
157
|
- 0.0
|
|
@@ -161,9 +167,15 @@ Computation times
|
|
|
161
167
|
* - :ref:`sphx_glr_gallery_tree_plot_leafedges_and_cascades.py` (``../../gallery/tree/plot_leafedges_and_cascades.py``)
|
|
162
168
|
- 00:00.000
|
|
163
169
|
- 0.0
|
|
170
|
+
* - :ref:`sphx_glr_gallery_tree_plot_simpletreedataprovider.py` (``../../gallery/tree/plot_simpletreedataprovider.py``)
|
|
171
|
+
- 00:00.000
|
|
172
|
+
- 0.0
|
|
164
173
|
* - :ref:`sphx_glr_gallery_tree_plot_skbio_tree.py` (``../../gallery/tree/plot_skbio_tree.py``)
|
|
165
174
|
- 00:00.000
|
|
166
175
|
- 0.0
|
|
176
|
+
* - :ref:`sphx_glr_gallery_tree_plot_support.py` (``../../gallery/tree/plot_support.py``)
|
|
177
|
+
- 00:00.000
|
|
178
|
+
- 0.0
|
|
167
179
|
* - :ref:`sphx_glr_gallery_tree_plot_tree_node_background.py` (``../../gallery/tree/plot_tree_node_background.py``)
|
|
168
180
|
- 00:00.000
|
|
169
181
|
- 0.0
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
Animations
|
|
3
3
|
==========
|
|
4
4
|
|
|
5
|
-
This tutorial shows how to animate `iplotx` visualizations using
|
|
5
|
+
This tutorial shows how to animate `iplotx` visualizations using
|
|
6
|
+
`matplotlib.animation.FuncAnimation`.
|
|
6
7
|
|
|
7
|
-
For illustration purposes, we will animate a simple directed graph,
|
|
8
|
+
For illustration purposes, we will animate a simple directed graph,
|
|
9
|
+
rotating it around its center. We also modify the opacity of the
|
|
10
|
+
vertices and edges, just for fun.
|
|
8
11
|
"""
|
|
9
12
|
|
|
10
13
|
import matplotlib.pyplot as plt
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
Chess masters
|
|
3
3
|
=============
|
|
4
4
|
|
|
5
|
-
This example from networkx shows the relatinoships between chess masters.
|
|
5
|
+
This example from networkx shows the relatinoships between chess masters.
|
|
6
|
+
The example has a lot of network analysis code that is somewhat irrelevant
|
|
7
|
+
for `iplotx` and is kept to demonstrate functional parity.
|
|
6
8
|
|
|
7
9
|
.. note::
|
|
8
|
-
The layout of this graph is computed with the Kamada-Kawai algorithm. In
|
|
10
|
+
The layout of this graph is computed with the Kamada-Kawai algorithm. In
|
|
11
|
+
networkx, that requires the `scipy` package to be installed. Here, we
|
|
12
|
+
also demonstrate the alternative, which is to convert the network to
|
|
13
|
+
`igraph`, which has an internal implementation of the algorithm. While
|
|
14
|
+
the exact layout is not identical, it is equally accurate and visually
|
|
15
|
+
similar.
|
|
9
16
|
"""
|
|
10
17
|
|
|
11
18
|
import numpy as np
|
|
@@ -52,9 +59,7 @@ def chess_pgn_graph(pgn_file="data/chess_masters_WCC.pgn.bz2"):
|
|
|
52
59
|
|
|
53
60
|
G = chess_pgn_graph()
|
|
54
61
|
|
|
55
|
-
print(
|
|
56
|
-
f"Loaded {G.number_of_edges()} chess games between {G.number_of_nodes()} players\n"
|
|
57
|
-
)
|
|
62
|
+
print(f"Loaded {G.number_of_edges()} chess games between {G.number_of_nodes()} players\n")
|
|
58
63
|
|
|
59
64
|
# identify connected components of the undirected version
|
|
60
65
|
H = G.to_undirected()
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Editing artists after plotting
|
|
3
3
|
==============================
|
|
4
4
|
|
|
5
|
-
One of the strengths of `iplotx` is the support for editing artists after
|
|
5
|
+
One of the strengths of `iplotx` is the support for editing artists after
|
|
6
|
+
they have been plotted the first time without making a whole new figure.
|
|
6
7
|
|
|
7
|
-
In this example, we will change vertices, edges, arrows, etc. and check
|
|
8
|
+
In this example, we will change vertices, edges, arrows, etc. and check
|
|
9
|
+
out how they look like.
|
|
8
10
|
"""
|
|
9
11
|
|
|
10
12
|
# %%
|
|
11
13
|
# This is the vanilla version, taken from the "Ports" gallery example:
|
|
12
14
|
|
|
13
15
|
import igraph as ig
|
|
14
|
-
import numpy as np
|
|
15
|
-
import matplotlib.pyplot as plt
|
|
16
16
|
import iplotx as ipx
|
|
17
17
|
|
|
18
18
|
g = ig.Graph.Ring(3, directed=True)
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Grouping
|
|
3
3
|
========
|
|
4
4
|
|
|
5
|
-
This example shows how to use the `grouping` argument to visualise vertex
|
|
5
|
+
This example shows how to use the `grouping` argument to visualise vertex
|
|
6
|
+
covers or clustering, including singletons (i.e. groups of one vertex).
|
|
6
7
|
|
|
7
|
-
The function takes a few different formats for the groups, but the easiest
|
|
8
|
+
The function takes a few different formats for the groups, but the easiest
|
|
9
|
+
is a dictionary of sets, in which each key is the name of the group and
|
|
8
10
|
each value is the set of vertices in that group.
|
|
9
11
|
|
|
10
12
|
"""
|
|
@@ -15,7 +17,7 @@ import iplotx as ipx
|
|
|
15
17
|
|
|
16
18
|
g = ig.Graph.Ring(8)
|
|
17
19
|
|
|
18
|
-
ipx.
|
|
20
|
+
ipx.network(
|
|
19
21
|
network=g,
|
|
20
22
|
layout="circle",
|
|
21
23
|
grouping={
|
|
@@ -28,11 +30,13 @@ plt.gca().set_aspect(1.0)
|
|
|
28
30
|
|
|
29
31
|
# %%
|
|
30
32
|
# .. note::
|
|
31
|
-
# Group layouts are computed as rounded convex hulls around each group of vertices.
|
|
33
|
+
# Group layouts are computed as rounded convex hulls around each group of vertices.
|
|
34
|
+
# If you are interested in contributing an algorithm that computes concave group
|
|
35
|
+
# layouts, please reach out on GitHub!
|
|
32
36
|
#
|
|
33
37
|
# Groups can be styles in a similar way as all other elements in `iplotx`:
|
|
34
38
|
|
|
35
|
-
ipx.
|
|
39
|
+
ipx.network(
|
|
36
40
|
network=g,
|
|
37
41
|
layout="circle",
|
|
38
42
|
grouping={
|
|
@@ -61,7 +65,7 @@ plt.gca().set_aspect(1.0)
|
|
|
61
65
|
|
|
62
66
|
layout = g.layout("circle")
|
|
63
67
|
fig, ax = plt.subplots(figsize=(5, 5))
|
|
64
|
-
ipx.
|
|
68
|
+
ipx.network(
|
|
65
69
|
network=g,
|
|
66
70
|
layout=layout,
|
|
67
71
|
ax=ax,
|
|
@@ -70,7 +74,7 @@ ipx.plot(
|
|
|
70
74
|
vertex_label_color="white",
|
|
71
75
|
zorder=2,
|
|
72
76
|
)
|
|
73
|
-
ipx.
|
|
77
|
+
ipx.network(
|
|
74
78
|
grouping={
|
|
75
79
|
"singleton": {0},
|
|
76
80
|
"doublet": {1, 2},
|
|
@@ -87,6 +91,7 @@ ipx.plot(
|
|
|
87
91
|
|
|
88
92
|
# %%
|
|
89
93
|
# .. note::
|
|
90
|
-
# The argument `zorder` is applied to both network and grouping style, however
|
|
91
|
-
#
|
|
94
|
+
# The argument `zorder` is applied to both network and grouping style, however
|
|
95
|
+
# since only one of them is plotted each time this is equivalent to setting
|
|
96
|
+
# `network_zorder` and `grouping_zorder`. If both are specified, `zorder` takes
|
|
92
97
|
# priority over its more specific cousins.
|
|
@@ -11,9 +11,7 @@ import iplotx as ipx
|
|
|
11
11
|
|
|
12
12
|
G = nx.house_graph()
|
|
13
13
|
fig, ax = plt.subplots()
|
|
14
|
-
nx.set_node_attributes(
|
|
15
|
-
G, {0: (0, 0), 1: (1, 0), 2: (0, 1), 3: (1, 1), 4: (0.5, 2.0)}, "pos"
|
|
16
|
-
)
|
|
14
|
+
nx.set_node_attributes(G, {0: (0, 0), 1: (1, 0), 2: (0, 1), 3: (1, 1), 4: (0.5, 2.0)}, "pos")
|
|
17
15
|
nx.set_node_attributes(
|
|
18
16
|
G,
|
|
19
17
|
{
|
|
@@ -6,7 +6,6 @@ This minimal example shows how to style a plot in a few different ways.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import networkx as nx
|
|
9
|
-
import matplotlib.pyplot as plt
|
|
10
9
|
import iplotx as ipx
|
|
11
10
|
|
|
12
11
|
# Create a graph and add a self-loop to node 0
|
|
@@ -22,7 +21,7 @@ G.add_edges_from(edgelist)
|
|
|
22
21
|
# Style the edge lines
|
|
23
22
|
linestyle = {e: "-" if e not in edgelist else "--" for e in G.edges()}
|
|
24
23
|
|
|
25
|
-
ipx.
|
|
24
|
+
ipx.network(
|
|
26
25
|
G,
|
|
27
26
|
layout=pos,
|
|
28
27
|
vertex_labels=True,
|
|
@@ -47,11 +46,11 @@ ipx.plot(
|
|
|
47
46
|
)
|
|
48
47
|
|
|
49
48
|
# %%
|
|
50
|
-
# In addition to fully structured styles in the form of nested dictionaries,
|
|
51
|
-
# also accepts flat or semi-flat styles, with levels separated by
|
|
52
|
-
# The above is equivalent to:
|
|
49
|
+
# In addition to fully structured styles in the form of nested dictionaries,
|
|
50
|
+
# `iplotx` also accepts flat or semi-flat styles, with levels separated by
|
|
51
|
+
# underscores ("_"). The above is equivalent to:
|
|
53
52
|
|
|
54
|
-
ipx.
|
|
53
|
+
ipx.network(
|
|
55
54
|
G,
|
|
56
55
|
layout=pos,
|
|
57
56
|
vertex_labels=True,
|
|
@@ -71,7 +70,7 @@ ipx.plot(
|
|
|
71
70
|
# The `**kwargs` flexible argument of `ipx.plotting` can be used for this purpose as well,
|
|
72
71
|
# for increased readability:
|
|
73
72
|
|
|
74
|
-
ipx.
|
|
73
|
+
ipx.network(
|
|
75
74
|
G,
|
|
76
75
|
layout=pos,
|
|
77
76
|
vertex_labels=True,
|
|
@@ -98,7 +97,7 @@ with ipx.style.context(
|
|
|
98
97
|
edge_looptension=3.5,
|
|
99
98
|
edge_arrow_marker="|>",
|
|
100
99
|
):
|
|
101
|
-
ipx.
|
|
100
|
+
ipx.network(
|
|
102
101
|
G,
|
|
103
102
|
layout=pos,
|
|
104
103
|
vertex_labels=True,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Maximum Bipartite Matching by Maximum Flow
|
|
3
3
|
==========================================
|
|
4
4
|
|
|
5
|
-
This example from `igraph` presents how to visualise bipartite matching
|
|
5
|
+
This example from `igraph` presents how to visualise bipartite matching
|
|
6
|
+
using maximum flow, with edge linewidth and vertex facecolor styling.
|
|
6
7
|
|
|
7
8
|
"""
|
|
8
9
|
|
|
9
10
|
import igraph as ig
|
|
10
|
-
import matplotlib.pyplot as plt
|
|
11
11
|
import iplotx as ipx
|
|
12
12
|
|
|
13
13
|
# We start by creating the bipartite directed graph.
|
|
@@ -37,7 +37,7 @@ layout = g.layout_bipartite()
|
|
|
37
37
|
layout[9] = (2, -1)
|
|
38
38
|
layout[10] = (2, 2)
|
|
39
39
|
|
|
40
|
-
ipx.
|
|
40
|
+
ipx.network(
|
|
41
41
|
g,
|
|
42
42
|
layout=layout,
|
|
43
43
|
vertex_labels=True,
|
|
@@ -57,7 +57,7 @@ ipx.plot(
|
|
|
57
57
|
# vertex style accordingly, perhaps with pronounced vertex borders to
|
|
58
58
|
# increase constrast:
|
|
59
59
|
#
|
|
60
|
-
ipx.
|
|
60
|
+
ipx.network(
|
|
61
61
|
g,
|
|
62
62
|
layout=layout,
|
|
63
63
|
vertex_labels=True,
|
|
@@ -7,7 +7,6 @@ This example from igraph shows how to work with edge labels and linewidths.
|
|
|
7
7
|
|
|
8
8
|
import random
|
|
9
9
|
import igraph as ig
|
|
10
|
-
import matplotlib.pyplot as plt
|
|
11
10
|
import iplotx as ipx
|
|
12
11
|
|
|
13
12
|
|
|
@@ -24,7 +23,7 @@ g.es[mst_edges]["width"] = 3.0
|
|
|
24
23
|
|
|
25
24
|
layout = g.layout("grid")
|
|
26
25
|
|
|
27
|
-
ipx.
|
|
26
|
+
ipx.network(
|
|
28
27
|
g,
|
|
29
28
|
layout=layout,
|
|
30
29
|
edge_labels=g.es["weight"],
|
|
@@ -48,10 +47,11 @@ ipx.plot(
|
|
|
48
47
|
)
|
|
49
48
|
|
|
50
49
|
# %%
|
|
51
|
-
# If you want to avoid rotating the labels vertically and let them follow the
|
|
52
|
-
# just set the "rotate" parameter to False (or skip
|
|
50
|
+
# If you want to avoid rotating the labels vertically and let them follow the
|
|
51
|
+
# edge directions instead, just set the "rotate" parameter to False (or skip
|
|
52
|
+
# it in the default style):
|
|
53
53
|
|
|
54
|
-
ipx.
|
|
54
|
+
ipx.network(
|
|
55
55
|
g,
|
|
56
56
|
layout=layout,
|
|
57
57
|
edge_labels=g.es["weight"],
|
|
@@ -12,7 +12,6 @@ This example shows how to interact with mouse events (e.g. hovering) in `iplotx`
|
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
import matplotlib.pyplot as plt
|
|
15
|
-
import numpy as np
|
|
16
15
|
import igraph as ig
|
|
17
16
|
import iplotx as ipx
|
|
18
17
|
|
|
@@ -48,7 +47,7 @@ def hover_callback(event):
|
|
|
48
47
|
if cont:
|
|
49
48
|
i = ind["ind"][0]
|
|
50
49
|
annot.xy = vc.get_offsets()[i]
|
|
51
|
-
annot.set_text(f"{i+1}")
|
|
50
|
+
annot.set_text(f"{i + 1}")
|
|
52
51
|
annot.set_visible(True)
|
|
53
52
|
# Otherwise, hide the bubble
|
|
54
53
|
elif annot.get_visible():
|