Skip to content

Commit

Permalink
Add tabs in doc demo page.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinEnjalbert committed Jul 29, 2024
1 parent adc2c26 commit f7e918a
Show file tree
Hide file tree
Showing 4 changed files with 2,299 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser numpy k3d vedo colour
pip install sphinx sphinx_rtd_theme sphinx-tabs myst_parser numpy k3d vedo colour
- name: Sphinx build
run: |
sphinx-build docs/src docs/build
Expand Down
2,210 changes: 2,210 additions & 0 deletions docs/src/_static/html/points.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.extlinks',
]
'sphinx_tabs.tabs']

intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
Expand Down
125 changes: 87 additions & 38 deletions docs/src/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,90 @@
Demo
====

.. raw:: html

<iframe src="_static/html/meshes.html" height="600px" width="100%"></iframe>

.. code-block:: python
from SimExporter.core import Exporter
# Load data
...
# Create the exporter
exporter = Exporter(animation=True,
fps=50)
# Add meshes to the scene
exporter.objects.add_mesh(positions=...,
cells=...,
color=[192, 28, 40],
alpha=0.6,
flat_shading=False,
time_positions=...)
exporter.objects.add_mesh(positions=...,
cells=...,
alpha=1.,
flat_shading=False,
wireframe=True,
colormap_name='Reds',
colormap_range=[0, 1],
time_colormap_values=...,
time_positions=...)
# Export to HTML
exporter.process(filename='scene.html',
background_color='black',
menu_visible=True,
grid_visible=False,
frame_visible=True)

.. tabs::

.. group-tab:: Meshes

.. raw:: html

<iframe src="_static/html/meshes.html" height="600px" width="100%"></iframe>

.. group-tab:: Points

.. raw:: html

<iframe src="_static/html/points.html" height="600px" width="100%"></iframe>

.. tabs::

.. group-tab:: Meshes

.. code-block:: python
from SimExporter.core import Exporter
# Load data
...
# Create the exporter
exporter = Exporter(animation=True,
fps=50)
# Add meshes to the scene
exporter.objects.add_mesh(positions=...,
cells=...,
color=[192, 28, 40],
alpha=0.6,
flat_shading=False,
time_positions=...)
exporter.objects.add_mesh(positions=...,
cells=...,
alpha=1.,
flat_shading=False,
wireframe=True,
colormap_name='Reds',
colormap_range=[0, 1],
time_colormap_values=...,
time_positions=...)
# Export to HTML
exporter.process(filename='scene.html',
background_color='black',
menu_visible=True,
grid_visible=False,
frame_visible=True)
.. group-tab:: Points

.. code-block:: python
from SimExporter.core import Exporter
# Load data
...
# Create the exporter
exporter = Exporter(animation=True,
fps=50)
# Add meshes to the scene
exporter.objects.add_points(positions=...,
point_size=2.,
colormap_name='YlOrBr',
time_colormap_values=...,
time_positions=...)
exporter.objects.add_mesh(positions=...,
cells=...,
color='grey',
alpha=0.6,
wireframe=True,
time_positions=...)
# Export to HTML
exporter.process(filename='scene.html',
background_color='black',
menu_visible=True,
grid_visible=False,
frame_visible=True)

0 comments on commit f7e918a

Please sign in to comment.