generated from readthedocs/tutorial-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from EmnaTay/newint
updates to support dashboard
- Loading branch information
Showing
13 changed files
with
288 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import plotly.graph_objects as go | ||
import plotly.io as pio | ||
|
||
# Data for the table example | ||
status = ["Active", "Inactive", "Active", "Inactive"] | ||
system_name = ["System A", "System B", "System C", "System D"] | ||
|
||
# Create the table | ||
fig = go.Figure( | ||
data=[ | ||
go.Table( | ||
header=dict( | ||
values=["Status", "System Name"], | ||
fill_color="paleturquoise", | ||
align="left", | ||
), | ||
cells=dict( | ||
values=[status, system_name], fill_color="lavender", align="left" | ||
), | ||
) | ||
] | ||
) | ||
|
||
# Update layout | ||
fig.update_layout(title="System Status Dashboard", width=500, height=300) | ||
|
||
|
||
# Save the figure as an HTML file | ||
pio.write_html( | ||
fig, | ||
file="C:/Users/Admin/meg-pipeline-main/docs/source/_static/plotly_dashboard02.html", | ||
auto_open=False, | ||
) |
9 changes: 9 additions & 0 deletions
9
docs/source/9-dashboard/Helium_recovery_system_status_dashboard.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _helium_recovery_dashboard: | ||
|
||
Helium Recovery Dashboard | ||
========================== | ||
|
||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard02.html" width="100%" height="600px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _kit_meg_system_dashboard: | ||
|
||
KIT MEG system Dashboard Test | ||
============================= | ||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _kit_data_quality_dashboard: | ||
|
||
KIT Data Quality Dashboard | ||
========================== | ||
|
||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _opm_meg_system_status_dashboard: | ||
|
||
OPM MEG system status dashboard | ||
=============================== | ||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _opm_data_quality_dashboard: | ||
|
||
OPM Data Quality dashboard | ||
========================== | ||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
8 changes: 8 additions & 0 deletions
8
docs/source/9-dashboard/Vpixx_devices_system_status_dashboard.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _vpixx_devices_system_status_dashboard: | ||
|
||
VPIXX devices system status dashboard | ||
===================================== | ||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _systems_dashboard: | ||
|
||
Plotly Dashboard Test | ||
===================== | ||
|
||
.. raw:: html | ||
|
||
<iframe src="../_static/plotly_dashboard.html" width="100%" height="600px"></iframe> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,80 +7,93 @@ | |
from sphinx.application import Sphinx | ||
|
||
|
||
project = 'MEG Pipeline' | ||
copyright = '2024, Hadi Zaatiti' | ||
author = 'Hadi Zaatiti [email protected]' | ||
# Dashboard Generation | ||
import os | ||
import subprocess | ||
import logging | ||
from sphinx.application import Sphinx | ||
|
||
release = '0.1' | ||
version = '0.1.0' | ||
|
||
project = "MEG Pipeline" | ||
copyright = "2024, Hadi Zaatiti" | ||
author = "Hadi Zaatiti [email protected]" | ||
|
||
release = "0.1" | ||
version = "0.1.0" | ||
|
||
# -- General configuration | ||
|
||
extensions = [ | ||
'sphinx.ext.duration', | ||
'sphinx.ext.doctest', | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.autosummary', | ||
'sphinx.ext.intersphinx', | ||
'nbsphinx', | ||
'sphinx_gallery.load_style', | ||
"sphinx.ext.duration", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.intersphinx", | ||
"nbsphinx", | ||
"sphinx_gallery.load_style", | ||
] | ||
|
||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3/', None), | ||
'sphinx': ('https://www.sphinx-doc.org/en/master/', None), | ||
"python": ("https://docs.python.org/3/", None), | ||
"sphinx": ("https://www.sphinx-doc.org/en/master/", None), | ||
} | ||
intersphinx_disabled_domains = ['std'] | ||
intersphinx_disabled_domains = ["std"] | ||
|
||
templates_path = ['_templates'] | ||
templates_path = ["_templates"] | ||
|
||
# -- Options for HTML output | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
html_logo = 'graphic/NYU_Logo.png' | ||
html_theme = "sphinx_rtd_theme" | ||
html_logo = "graphic/NYU_Logo.png" | ||
html_theme_options = { | ||
|
||
'logo_only': False, | ||
'display_version': True, | ||
'prev_next_buttons_location': 'bottom', | ||
'style_external_links': False, | ||
'vcs_pageview_mode': '', | ||
'style_nav_header_background': '#561A70', | ||
"logo_only": False, | ||
"display_version": True, | ||
"prev_next_buttons_location": "bottom", | ||
"style_external_links": False, | ||
"vcs_pageview_mode": "", | ||
"style_nav_header_background": "#561A70", | ||
# Toc options | ||
'collapse_navigation': True, | ||
'sticky_navigation': True, | ||
'navigation_depth': 4, | ||
'includehidden': True, | ||
'titles_only': False | ||
"collapse_navigation": True, | ||
"sticky_navigation": True, | ||
"navigation_depth": 4, | ||
"includehidden": True, | ||
"titles_only": False, | ||
} | ||
|
||
suppress_warnings = ['epub.unknown_project_files'] #This allows us to avoid the warning caused by html files in _static directory (regarding mime types) | ||
suppress_warnings = [ | ||
"epub.unknown_project_files" | ||
] # This allows us to avoid the warning caused by html files in _static directory (regarding mime types) | ||
|
||
html_css_files = [ | ||
'custom.css', | ||
"custom.css", | ||
] | ||
|
||
html_static_path = ['_static'] | ||
html_static_path = ["_static"] | ||
# -- Options for EPUB output | ||
epub_show_urls = 'footnote' | ||
epub_show_urls = "footnote" | ||
|
||
|
||
def run_dashboard_generation(app: Sphinx): | ||
"""Run the dashboard generation script.""" | ||
logger = logging.getLogger(__name__) | ||
script_path = os.path.join(app.confdir, 'dashboards', 'generate_snr_dashboard.py') | ||
script_path = os.path.join(app.confdir, "dashboards", "generate_snr_dashboard.py") | ||
if os.path.exists(script_path): | ||
logger.info(f"Found generate_snr_dashboard.py at {script_path}, running it now.") | ||
result = subprocess.run(['python', script_path], capture_output=True, text=True) | ||
logger.info( | ||
f"Found generate_snr_dashboard.py at {script_path}, running it now." | ||
) | ||
result = subprocess.run(["python", script_path], capture_output=True, text=True) | ||
if result.returncode == 0: | ||
logger.info("generate_snr_dashboard.py ran successfully.") | ||
else: | ||
logger.error(f"generate_snr_dashboard.py failed with return code {result.returncode}") | ||
logger.error( | ||
f"generate_snr_dashboard.py failed with return code {result.returncode}" | ||
) | ||
logger.error(result.stdout) | ||
logger.error(result.stderr) | ||
else: | ||
logger.error(f"The script {script_path} does not exist.") | ||
|
||
|
||
def setup(app: Sphinx): | ||
logging.basicConfig(level=logging.INFO) | ||
app.connect('builder-inited', run_dashboard_generation) | ||
app.connect("builder-inited", run_dashboard_generation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This file will be updated to contain the script to generate the dashboard | ||
# the script to automate its update is conf.py | ||
|
||
import plotly.graph_objs as go | ||
import plotly.io as pio | ||
|
||
# Sample data | ||
x = [1, 2, 3, 4, 5, 6, 7, 8] | ||
y = [10, 14, 12, 20, 18, 20, 22, 23] | ||
|
||
# Create a scatter plot | ||
fig = go.Figure(data=go.Scatter(x=x, y=y, mode="lines+markers")) | ||
|
||
# Save the figure as an HTML file | ||
pio.write_html(fig, file="_static/plotly_dashboard.html", auto_open=False) | ||
|
||
|
||
################################################################################################ | ||
import os | ||
|
||
# Data for the table | ||
status = ["Active", "Inactive", "Active", "Inactive"] | ||
system_name = ["System A", "System B", "System C", "System D"] | ||
|
||
# Create the table | ||
fig = go.Figure( | ||
data=[ | ||
go.Table( | ||
header=dict( | ||
values=["Status", "System Name"], | ||
fill_color="paleturquoise", | ||
align="left", | ||
), | ||
cells=dict( | ||
values=[status, system_name], fill_color="lavender", align="left" | ||
), | ||
) | ||
] | ||
) | ||
|
||
# Update layout | ||
fig.update_layout(title="System Status Dashboard", width=500, height=300) | ||
|
||
# Ensure the directory exists | ||
output_dir = os.path.abspath(os.path.join("..", "docs", "source", "_static")) | ||
os.makedirs(output_dir, exist_ok=True) | ||
|
||
# Define the output file path | ||
output_file = os.path.join(output_dir, "plotly_dashboard02.html") | ||
|
||
# Save the figure as an HTML file | ||
pio.write_html(fig, output_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters