Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated while building documentation.
doc/auto_examples

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
5 changes: 1 addition & 4 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ html[data-theme="light"] table.data tbody tr:nth-child(even) {
background-color: #ffffff; /* Lighter gray */
}

/* Fixed width for the navbar items */
.bd-header ul.navbar-nav {
width: 475px;
}

/* Remove whitespace to the right of the xgi logo */
.bd-header .navbar-header-items__start {
width: 100px;
Expand Down
Binary file removed docs/source/assets/images/Filtering_2024_Fig1.png
Binary file not shown.
Binary file not shown.
Binary file removed docs/source/assets/images/XGI_2023_Fig2.png
Binary file not shown.
26 changes: 25 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import sys
from datetime import date, datetime
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey

import requests

Expand Down Expand Up @@ -87,6 +88,7 @@
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_design",
"sphinx_gallery.gen_gallery",
"nbsphinx",
"nbsphinx_link",
]
Expand Down Expand Up @@ -231,7 +233,7 @@
"icon": "fab fa-twitter-square", # Font Awesome icon
},
],
"header_links_before_dropdown": 4,
"header_links_before_dropdown": 5,
"switcher": {
"json_url": (
"https://xgi.readthedocs.io/en/latest/_static/version_switcher.json"
Expand All @@ -247,6 +249,7 @@
"installing": [],
"tutorial": [],
"xgi-data": [],
"auto_examples/index": [],
"gallery": [],
"contribute": [],
"user_guides": [],
Expand All @@ -261,6 +264,27 @@

htmlhelp_basename = "XGIDoc"

# -- Options for Sphinx Gallery ----------------------


sphinx_gallery_conf = {
# path to your examples scripts
"examples_dirs": "../../examples",
"subsection_order": ExplicitOrder(
[
"../../examples/basic",
"../../examples/layouts",
"../../examples/stats",
"../../examples/advanced",
]
),
"within_subsection_order": "FileNameSortKey",
# path where to save gallery generated examples
"gallery_dirs": "auto_examples",
"plot_gallery": "True",
"image_scrapers": ("matplotlib",),
}

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand Down
27 changes: 0 additions & 27 deletions docs/source/gallery.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
user_guides
api_reference
xgi-data
auto_examples/index
contribute
using-xgi
gallery

|release_announcement|

Expand Down
67 changes: 67 additions & 0 deletions docs/source/sg_execution_times.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

:orphan:

.. _sphx_glr_sg_execution_times:


Computation times
=================
**00:00.327** total execution time for 11 files **from all galleries**:

.. container::

.. raw:: html

<style scoped>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
</style>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" class="init">
$(document).ready( function () {
$('table.sg-datatable').DataTable({order: [[1, 'desc']]});
} );
</script>

.. list-table::
:header-rows: 1
:class: table table-striped sg-datatable

* - Example
- Time
- Mem (MB)
* - :ref:`sphx_glr_auto_examples_advanced_plot_colormaps_colorbars.py` (``../../examples/advanced/plot_colormaps_colorbars.py``)
- 00:00.047
- 0.0
* - :ref:`sphx_glr_auto_examples_stats_plot_color_stat.py` (``../../examples/stats/plot_color_stat.py``)
- 00:00.042
- 0.0
* - :ref:`sphx_glr_auto_examples_basic_plot_simple_hypergraph_multilayer.py` (``../../examples/basic/plot_simple_hypergraph_multilayer.py``)
- 00:00.035
- 0.0
* - :ref:`sphx_glr_auto_examples_basic_plot_simple_hypergraph.py` (``../../examples/basic/plot_simple_hypergraph.py``)
- 00:00.033
- 0.0
* - :ref:`sphx_glr_auto_examples_advanced_plot_labels.py` (``../../examples/advanced/plot_labels.py``)
- 00:00.030
- 0.0
* - :ref:`sphx_glr_auto_examples_basic_plot_simple_hypergraph_hull.py` (``../../examples/basic/plot_simple_hypergraph_hull.py``)
- 00:00.026
- 0.0
* - :ref:`sphx_glr_auto_examples_basic_plot_simple_simplicial_complex.py` (``../../examples/basic/plot_simple_simplicial_complex.py``)
- 00:00.025
- 0.0
* - :ref:`sphx_glr_auto_examples_basic_plot_simple_hypergraph_outline.py` (``../../examples/basic/plot_simple_hypergraph_outline.py``)
- 00:00.024
- 0.0
* - :ref:`sphx_glr_auto_examples_layouts_plot_barycenter_spring_layout.py` (``../../examples/layouts/plot_barycenter_spring_layout.py``)
- 00:00.023
- 0.0
* - :ref:`sphx_glr_auto_examples_layouts_plot_simple_graph.py` (``../../examples/layouts/plot_simple_graph.py``)
- 00:00.022
- 0.0
* - :ref:`sphx_glr_auto_examples_layouts_plot_spiral_layout.py` (``../../examples/layouts/plot_spiral_layout.py``)
- 00:00.021
- 0.0
4 changes: 4 additions & 0 deletions examples/GALLERY_HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Gallery
==================

Introductory examples to XGI.
2 changes: 2 additions & 0 deletions examples/advanced/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Advanced
--------
35 changes: 35 additions & 0 deletions examples/advanced/plot_colormaps_colorbars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
========================
Colormaps and colorbars
========================

Set colormaps and show colorbars.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)

fig, ax = plt.subplots(figsize=(6, 2.5))

ax, collections = xgi.draw(
H,
pos=pos,
node_fc=H.nodes.degree,
edge_fc=H.edges.size,
edge_fc_cmap="viridis",
node_fc_cmap="mako_r",
)

node_col, _, edge_col = collections

plt.colorbar(node_col, label="Node degree")
plt.colorbar(edge_col, label="Edge size")

plt.show()
20 changes: 20 additions & 0 deletions examples/advanced/plot_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
=================
Show labels
=================

Draw hypergraph with labels.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, node_labels=True, node_size=15, hyperedge_labels=True)

plt.show()
2 changes: 2 additions & 0 deletions examples/basic/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Basic
-----
20 changes: 20 additions & 0 deletions examples/basic/plot_simple_hypergraph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
=================
Simple hypergraph
=================

Draw simple hypergraph with manual layout.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

plt.show()
20 changes: 20 additions & 0 deletions examples/basic/plot_simple_hypergraph_hull.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
===================================
Simple hypergraph with convex hulls
===================================

Draw simple hypergraph with convex hulls and manual layout.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, hull=True)

plt.show()
20 changes: 20 additions & 0 deletions examples/basic/plot_simple_hypergraph_multilayer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
===================================
Simple hypergraph as multilayer
===================================

Draw simple hypergraph as multilayer
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


ax3 = plt.axes(projection="3d") # requires a 3d axis
xgi.draw_multilayer(H, ax=ax3)

plt.show()
20 changes: 20 additions & 0 deletions examples/basic/plot_simple_hypergraph_outline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
===================================
Simple hypergraph with outline
===================================

Draw simple hypergraph with outline and manual layout.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, hull=True, edge_fc="white")

plt.show()
20 changes: 20 additions & 0 deletions examples/basic/plot_simple_simplicial_complex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
=========================
Simple simplicial complex
=========================

Draw simple simplicial complex with manual layout.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.SimplicialComplex(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

plt.show()
2 changes: 2 additions & 0 deletions examples/layouts/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Layouts
-------
20 changes: 20 additions & 0 deletions examples/layouts/plot_barycenter_spring_layout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
=================
Barycenter spring
=================

Draw simple hypergraph with barycenter_spring layout.
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

plt.show()
Loading
Loading