initial commit
This commit is contained in:
97
mne/html_templates/repr/_acquisition.html.jinja
Normal file
97
mne/html_templates/repr/_acquisition.html.jinja
Normal file
@@ -0,0 +1,97 @@
|
||||
{% set section = "Acquisition" %}
|
||||
{% set section_class_name = section | lower | append_uuid %}
|
||||
|
||||
{# Collapse content during documentation build. #}
|
||||
{% if collapsed %}
|
||||
{% set collapsed_row_class = "mne-repr-collapsed" %}
|
||||
{% else %}
|
||||
{% set collapsed_row_class = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%include 'static/_section_header_row.html.jinja' %}
|
||||
|
||||
{% if duration %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Duration</td>
|
||||
<td>{{ duration }} (HH:MM:SS)</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("kind") and inst | has_attr("nave") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Aggregation</td>
|
||||
{% if inst.kind == "average" %}
|
||||
<td>average of {{ inst.nave }} epochs</td>
|
||||
{% elif inst.kind == "standard_error" %}
|
||||
<td>standard error of {{ inst.nave }} epochs</td>
|
||||
{% else %}
|
||||
<td>{{ inst.kind }} ({{ inst.nave }} epochs)</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("comment") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Condition</td>
|
||||
<td>{{inst.comment}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("events") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Total number of events</td>
|
||||
<td>{{ inst.events | length }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if event_counts is defined %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Events counts</td>
|
||||
{% if events is not none %}
|
||||
<td>
|
||||
{% for e in event_counts %}
|
||||
{{ e }}
|
||||
{% if not loop.last %}<br />{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% else %}
|
||||
<td>Not available</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("tmin") and inst | has_attr("tmax") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Time range</td>
|
||||
<td>{{ inst | format_time_range }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("baseline") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Baseline</td>
|
||||
<td>{{ inst | format_baseline }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if info["sfreq"] is defined and info["sfreq"] is not none %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Sampling frequency</td>
|
||||
<td>{{ "%0.2f" | format(info["sfreq"]) }} Hz</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst.times is defined %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Time points</td>
|
||||
<td>{{ inst.times | length | format_number }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if inst is defined and inst | has_attr("metadata") %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Metadata</td>
|
||||
<td>{{ inst | format_metadata }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
25
mne/html_templates/repr/_channels.html.jinja
Normal file
25
mne/html_templates/repr/_channels.html.jinja
Normal file
@@ -0,0 +1,25 @@
|
||||
{% set section = "Channels" %}
|
||||
{% set section_class_name = section | lower | append_uuid %}
|
||||
|
||||
{# Collapse content during documentation build. #}
|
||||
{% if collapsed %}
|
||||
{% set collapsed_row_class = "mne-repr-collapsed" %}
|
||||
{% else %}
|
||||
{% set collapsed_row_class = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%include 'static/_section_header_row.html.jinja' %}
|
||||
|
||||
{% for channel_type, channels in (info | format_channels).items() %}
|
||||
{% include 'static/_channels.html.jinja' %}
|
||||
{% endfor %}
|
||||
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Head & sensor digitization</td>
|
||||
{% if info["dig"] is not none %}
|
||||
<td>{{ info["dig"] | length }} points</td>
|
||||
{% else %}
|
||||
<td>Not available</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
38
mne/html_templates/repr/_filters.html.jinja
Normal file
38
mne/html_templates/repr/_filters.html.jinja
Normal file
@@ -0,0 +1,38 @@
|
||||
{% set section = "Filters" %}
|
||||
{% set section_class_name = section | lower | append_uuid %}
|
||||
|
||||
{# Collapse content during documentation build. #}
|
||||
{% if collapsed %}
|
||||
{% set collapsed_row_class = "mne-repr-collapsed" %}
|
||||
{% else %}
|
||||
{% set collapsed_row_class = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%include 'static/_section_header_row.html.jinja' %}
|
||||
|
||||
{% if info["highpass"] is defined and info["highpass"] is not none %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Highpass</td>
|
||||
<td>{{ "%0.2f" | format(info["highpass"]) }} Hz</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if info["lowpass"] is defined and info["lowpass"] is not none %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Lowpass</td>
|
||||
<td>{{ "%0.2f" | format(info["lowpass"]) }} Hz</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if info.projs is defined and info.projs %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Projections</td>
|
||||
<td>
|
||||
{% for p in (info | format_projs) %}
|
||||
{{ p }}
|
||||
{% if not loop.last %}<br />{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
58
mne/html_templates/repr/_general.html.jinja
Normal file
58
mne/html_templates/repr/_general.html.jinja
Normal file
@@ -0,0 +1,58 @@
|
||||
{% set section = "General" %}
|
||||
{% set section_class_name = section | lower | append_uuid %}
|
||||
|
||||
{# Collapse content during documentation build. #}
|
||||
{% if collapsed %}
|
||||
{% set collapsed_row_class = "mne-repr-collapsed" %}
|
||||
{% else %}
|
||||
{% set collapsed_row_class = "" %}
|
||||
{% endif %}
|
||||
|
||||
{%include 'static/_section_header_row.html.jinja' %}
|
||||
|
||||
{% if filenames %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Filename(s)</td>
|
||||
<td>
|
||||
{% for f in filenames %}
|
||||
{{ f }}
|
||||
{% if not loop.last %}<br />{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>MNE object type</td>
|
||||
<td>{{ inst | data_type }}</td>
|
||||
</tr>
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Measurement date</td>
|
||||
{% if info["meas_date"] is defined and info["meas_date"] is not none %}
|
||||
<td>{{ info["meas_date"] | dt_to_str }}</td>
|
||||
{% else %}
|
||||
<td>Unknown</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Participant</td>
|
||||
{% if info["subject_info"] is defined and info["subject_info"] is not none %}
|
||||
{% if info["subject_info"]["his_id"] is defined %}
|
||||
<td>{{ info["subject_info"]["his_id"] }}</td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<td>Unknown</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Experimenter</td>
|
||||
{% if info["experimenter"] is defined and info["experimenter"] is not none %}
|
||||
<td>{{ info["experimenter"] }}</td>
|
||||
{% else %}
|
||||
<td>Unknown</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
7
mne/html_templates/repr/_js_and_css.html.jinja
Normal file
7
mne/html_templates/repr/_js_and_css.html.jinja
Normal file
@@ -0,0 +1,7 @@
|
||||
<script type="text/javascript">
|
||||
{% include 'static/repr.js' %}
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
{% include 'static/repr.css' %}
|
||||
</style>
|
||||
10
mne/html_templates/repr/epochs.html.jinja
Normal file
10
mne/html_templates/repr/epochs.html.jinja
Normal file
@@ -0,0 +1,10 @@
|
||||
{%include '_js_and_css.html.jinja' %}
|
||||
|
||||
{% set info = inst.info %}
|
||||
|
||||
<table class="table mne-repr-table">
|
||||
{%include '_general.html.jinja' %}
|
||||
{%include '_acquisition.html.jinja' %}
|
||||
{%include '_channels.html.jinja' %}
|
||||
{%include '_filters.html.jinja' %}
|
||||
</table>
|
||||
10
mne/html_templates/repr/evoked.html.jinja
Normal file
10
mne/html_templates/repr/evoked.html.jinja
Normal file
@@ -0,0 +1,10 @@
|
||||
{%include '_js_and_css.html.jinja' %}
|
||||
|
||||
{% set info = inst.info %}
|
||||
|
||||
<table class="table mne-repr-table">
|
||||
{%include '_general.html.jinja' %}
|
||||
{%include '_acquisition.html.jinja' %}
|
||||
{%include '_channels.html.jinja' %}
|
||||
{%include '_filters.html.jinja' %}
|
||||
</table>
|
||||
29
mne/html_templates/repr/forward.html.jinja
Normal file
29
mne/html_templates/repr/forward.html.jinja
Normal file
@@ -0,0 +1,29 @@
|
||||
{%include '_js_and_css.html.jinja' %}
|
||||
|
||||
{% set section = "Forward" %}
|
||||
{% set section_class_name = section | lower | append_uuid %}
|
||||
|
||||
{# Collapse content during documentation build. #}
|
||||
{% if collapsed %}
|
||||
{% set collapsed_row_class = "mne-repr-collapsed" %}
|
||||
{% else %}
|
||||
{% set collapsed_row_class = "" %}
|
||||
{% endif %}
|
||||
|
||||
<table class="table mne-repr-table">
|
||||
{%include 'static/_section_header_row.html.jinja' %}
|
||||
{% for channel_type, channels in (info | format_channels).items() %}
|
||||
{% include 'static/_channels.html.jinja' %}
|
||||
{% endfor %}
|
||||
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Source space</td>
|
||||
<td>{{ source_space_descr }}</td>
|
||||
</tr>
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>Source orientation</td>
|
||||
<td>{{ source_orientation }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
32
mne/html_templates/repr/ica.html.jinja
Normal file
32
mne/html_templates/repr/ica.html.jinja
Normal file
@@ -0,0 +1,32 @@
|
||||
<table class="table mne-repr-table">
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<td>{{ method }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fit parameters</th>
|
||||
<td>{% if fit_params %}{% for key, value in fit_params.items() %}{{ key }}={{ value }}<br />{% endfor %}{% else %}—{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fit</th>
|
||||
<td>{% if fit_on %}{{ n_iter }} iterations on {{ fit_on }} ({{ n_samples }} samples){% else %}no{% endif %}</td>
|
||||
</tr>
|
||||
{% if fit_on %}
|
||||
<tr>
|
||||
<th>ICA components</th>
|
||||
<td>{{ n_components }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Available PCA components</th>
|
||||
<td>{{ n_pca_components }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Channel types</th>
|
||||
<td>{{ ch_types|join(', ') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ICA components marked for exclusion</th>
|
||||
<td>{% if excludes %}{{ excludes|join('<br />' | safe) }}{% else %}—{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
10
mne/html_templates/repr/info.html.jinja
Normal file
10
mne/html_templates/repr/info.html.jinja
Normal file
@@ -0,0 +1,10 @@
|
||||
{%include '_js_and_css.html.jinja' %}
|
||||
|
||||
{%set inst = info %}
|
||||
|
||||
<table class="table mne-repr-table">
|
||||
{%include '_general.html.jinja' %}
|
||||
{%include '_acquisition.html.jinja' %}
|
||||
{%include '_channels.html.jinja' %}
|
||||
{%include '_filters.html.jinja' %}
|
||||
</table>
|
||||
14
mne/html_templates/repr/inverse_operator.html.jinja
Normal file
14
mne/html_templates/repr/inverse_operator.html.jinja
Normal file
@@ -0,0 +1,14 @@
|
||||
<table class="table mne-repr-table">
|
||||
<tr>
|
||||
<th>Channels</th>
|
||||
<td>{{ channels }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Source space</th>
|
||||
<td>{{ source_space_descr }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Source orientation</th>
|
||||
<td>{{ source_orientation }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
10
mne/html_templates/repr/raw.html.jinja
Normal file
10
mne/html_templates/repr/raw.html.jinja
Normal file
@@ -0,0 +1,10 @@
|
||||
{%include '_js_and_css.html.jinja' %}
|
||||
|
||||
{% set info = inst.info %}
|
||||
|
||||
<table class="table mne-repr-table">
|
||||
{%include '_general.html.jinja' %}
|
||||
{%include '_acquisition.html.jinja' %}
|
||||
{%include '_channels.html.jinja' %}
|
||||
{%include '_filters.html.jinja' %}
|
||||
</table>
|
||||
50
mne/html_templates/repr/spectrum.html.jinja
Normal file
50
mne/html_templates/repr/spectrum.html.jinja
Normal file
@@ -0,0 +1,50 @@
|
||||
<table class="table mne-repr-table">
|
||||
<tr>
|
||||
<th>Data type</th>
|
||||
<td>{{ spectrum._data_type }}</td>
|
||||
</tr>
|
||||
{%- for unit in units %}
|
||||
<tr>
|
||||
{%- if loop.index == 1 %}
|
||||
<th rowspan={{ units | length }}>Units</th>
|
||||
{%- endif %}
|
||||
<td class="justify">{{ unit }}</td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
<tr>
|
||||
<th>Data source</th>
|
||||
<td>{{ inst_type }}</td>
|
||||
</tr>
|
||||
{%- if inst_type == "Epochs" %}
|
||||
<tr>
|
||||
<th>Number of epochs</th>
|
||||
<td>{{ spectrum.shape[0] }}</td>
|
||||
</tr>
|
||||
{% endif -%}
|
||||
<tr>
|
||||
<th>Dims</th>
|
||||
<td>{{ spectrum._dims | join(", ") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Estimation method</th>
|
||||
<td>{{ spectrum.method }}</td>
|
||||
</tr>
|
||||
{% if "taper" in spectrum._dims %}
|
||||
<tr>
|
||||
<th>Number of tapers</th>
|
||||
<td>{{ spectrum._mt_weights.size }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th>Number of channels</th>
|
||||
<td>{{ spectrum.ch_names|length }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Number of frequency bins</th>
|
||||
<td>{{ spectrum.freqs|length }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Frequency range</th>
|
||||
<td>{{ '%.2f'|format(spectrum.freqs[0]) }} – {{ '%.2f'|format(spectrum.freqs[-1]) }} Hz</td>
|
||||
</tr>
|
||||
</table>
|
||||
17
mne/html_templates/repr/static/_channels.html.jinja
Normal file
17
mne/html_templates/repr/static/_channels.html.jinja
Normal file
@@ -0,0 +1,17 @@
|
||||
{% set channel_names_good = channels["good"] | map(attribute='name_html') | join(', ') %}
|
||||
<tr class="repr-element {{ section_class_name }} {{ collapsed_row_class }}">
|
||||
<td class="mne-repr-section-toggle"></td>
|
||||
<td>{{ channel_type }}</td>
|
||||
<td>
|
||||
<button class="mne-ch-names-btn sd-sphinx-override sd-btn sd-btn-info sd-text-wrap sd-shadow-sm" onclick="alert('Good {{ channel_type}}:\n\n{{ channel_names_good | safe }}')" title="(Click to open in popup) {{ channel_names_good | safe }}">
|
||||
{{ channels["good"] | length}}
|
||||
</button>
|
||||
|
||||
{% if channels["bad"] %}
|
||||
{% set channel_names_bad = channels["bad"] | map(attribute='name_html') | join(', ') %}
|
||||
and <button class="mne-ch-names-btn sd-sphinx-override sd-btn sd-btn-info sd-text-wrap sd-shadow-sm" onclick="alert('Bad {{ channel_type}}:\n\n{{ channel_names_bad | safe }}')" title="(Click to open in popup) {{ channel_names_bad | safe }}">
|
||||
{{ channels["bad"] | length}} bad
|
||||
</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,12 @@
|
||||
<tr class="mne-repr-section-header {{ section_class_name }}"
|
||||
{% if collapsed %} title="Show section" {% else %} title="Hide section" {% endif %}
|
||||
onclick="toggleVisibility('{{ section_class_name }}')">
|
||||
<th class="mne-repr-section-toggle">
|
||||
<button {% if collapsed %}class="collapsed"{% endif %}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/></svg>
|
||||
</button>
|
||||
</th>
|
||||
<th colspan="2">
|
||||
<strong>{{ section }}</strong>
|
||||
</th>
|
||||
</tr>
|
||||
107
mne/html_templates/repr/static/repr.css
Normal file
107
mne/html_templates/repr/static/repr.css
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
Styles in this section apply both to the sphinx-built website docs and to notebooks
|
||||
rendered in an IDE or in Jupyter. In our web docs, styles here are complemented by
|
||||
doc/_static/styles.css and other CSS files (e.g. from the sphinx theme, sphinx-gallery,
|
||||
or bootstrap). In IDEs/Jupyter, those style files are unavailable, so only the rules in
|
||||
this file apply (plus whatever default styling the IDE applies).
|
||||
*/
|
||||
.mne-repr-table {
|
||||
display: inline; /* prevent using full container width */
|
||||
}
|
||||
.mne-repr-table tr.mne-repr-section-header > th {
|
||||
padding-top: 1rem;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.mne-repr-section-toggle > button {
|
||||
all: unset;
|
||||
display: block;
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
}
|
||||
.mne-repr-section-toggle > button > svg {
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
/* transition (rotation) effects on the collapser button */
|
||||
.mne-repr-section-toggle > button.collapsed > svg {
|
||||
transition: 0.1s ease-out;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
.mne-repr-section-toggle > button:not(.collapsed) > svg {
|
||||
transition: 0.1s ease-out;
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
/* hide collapsed table rows */
|
||||
.mne-repr-collapsed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@layer {
|
||||
/*
|
||||
Selectors in a `@layer` will always be lower-precedence than selectors outside the
|
||||
layer. So even though e.g. `div.output_html` is present in the sphinx-rendered
|
||||
website docs, the styles here won't take effect there as long as some other rule
|
||||
somewhere in the page's CSS targets the same element.
|
||||
|
||||
In IDEs or Jupyter notebooks, though, the CSS files from the sphinx theme,
|
||||
sphinx-gallery, and bootstrap are unavailable, so these styles will apply.
|
||||
|
||||
Notes:
|
||||
|
||||
- the selector `.accordion-body` is for MNE Reports
|
||||
- the selector `.output_html` is for VSCode's notebook interface
|
||||
- the selector `.jp-RenderedHTML` is for Jupyter notebook
|
||||
- variables starting with `--theme-` are VSCode-specific.
|
||||
- variables starting with `--jp-` are Jupyter styles, *some of which* are also
|
||||
available in VSCode. Here we try the `--theme-` variable first, then fall back to
|
||||
the `--jp-` ones.
|
||||
*/
|
||||
.mne-repr-table {
|
||||
--mne-toggle-color: var(--theme-foreground, var(--jp-ui-font-color1));
|
||||
--mne-button-bg-color: var(--theme-button-background, var(--jp-info-color0, var(--jp-content-link-color)));
|
||||
--mne-button-fg-color: var(--theme-button-foreground, var(--jp-ui-inverse-font-color0, var(--jp-editor-background)));
|
||||
--mne-button-hover-bg-color: var(--theme-button-hover-background, var(--jp-info-color1));
|
||||
--mne-button-radius: var(--jp-border-radius, 0.25rem);
|
||||
}
|
||||
/* chevron position/alignment; in VSCode it looks ok without adjusting */
|
||||
.accordion-body .mne-repr-section-toggle > button,
|
||||
.jp-RenderedHTML .mne-repr-section-toggle > button {
|
||||
padding: 0 0 45% 25% !important;
|
||||
}
|
||||
/* chevron color; MNE Report doesn't have light/dark mode */
|
||||
div.output_html .mne-repr-section-toggle > button > svg > path,
|
||||
.jp-RenderedHTML .mne-repr-section-toggle > button > svg > path {
|
||||
fill: var(--mne-toggle-color);
|
||||
}
|
||||
.accordion-body .mne-ch-names-btn,
|
||||
div.output_html .mne-ch-names-btn,
|
||||
.jp-RenderedHTML .mne-ch-names-btn {
|
||||
-webkit-border-radius: var(--mne-button-radius);
|
||||
-moz-border-radius: var(--mne-button-radius);
|
||||
border-radius: var(--mne-button-radius);
|
||||
border: none;
|
||||
background-image: none;
|
||||
background-color: var(--mne-button-bg-color);
|
||||
color: var(--mne-button-fg-color);
|
||||
font-size: inherit;
|
||||
min-width: 1.5rem;
|
||||
padding: 0.25rem;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
.accordion-body .mne-ch-names-btn:hover,
|
||||
div.output_html .mne.ch-names-btn:hover,
|
||||
.jp-RenderedHTML .mne-ch-names-btn:hover {
|
||||
background-color: var(--mne-button-hover-bg-color);
|
||||
text-decoration: underline;
|
||||
}
|
||||
.accordion-body .mne-ch-names-btn:focus-visible,
|
||||
div.output_html .mne-ch-names-btn:focus-visible,
|
||||
.jp-RenderedHTML .mne-ch-names-btn:focus-visible {
|
||||
outline: 0.1875rem solid var(--mne-button-bg-color) !important;
|
||||
outline-offset: 0.1875rem !important;
|
||||
}
|
||||
}
|
||||
23
mne/html_templates/repr/static/repr.js
Normal file
23
mne/html_templates/repr/static/repr.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// must be `var` (not `const`) because this can get embedded multiple times on a page
|
||||
var toggleVisibility = (className) => {
|
||||
|
||||
const elements = document.querySelectorAll(`.${className}`);
|
||||
|
||||
elements.forEach(element => {
|
||||
if (element.classList.contains("mne-repr-section-header")) {
|
||||
return // Don't collapse the section header row
|
||||
}
|
||||
element.classList.toggle("mne-repr-collapsed");
|
||||
});
|
||||
|
||||
// trigger caret to rotate
|
||||
var sel = `.mne-repr-section-header.${className} > th.mne-repr-section-toggle > button`;
|
||||
const button = document.querySelector(sel);
|
||||
button.classList.toggle("collapsed");
|
||||
|
||||
// adjust tooltip
|
||||
sel = `tr.mne-repr-section-header.${className}`;
|
||||
const secHeadRow = document.querySelector(sel);
|
||||
secHeadRow.classList.toggle("collapsed");
|
||||
secHeadRow.title = secHeadRow.title === "Hide section" ? "Show section" : "Hide section";
|
||||
}
|
||||
60
mne/html_templates/repr/tfr.html.jinja
Normal file
60
mne/html_templates/repr/tfr.html.jinja
Normal file
@@ -0,0 +1,60 @@
|
||||
<table class="table mne-repr-table">
|
||||
<tr>
|
||||
<th>Data type</th>
|
||||
<td>{{ tfr._data_type }}</td>
|
||||
</tr>
|
||||
{%- for unit in units %}
|
||||
<tr>
|
||||
{%- if loop.index == 1 %}
|
||||
<th rowspan={{ units | length }}>Units</th>
|
||||
{%- endif %}
|
||||
<td class="justify">{{ unit }}</td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
<tr>
|
||||
<th>Data source</th>
|
||||
<td>{{ inst_type }}</td>
|
||||
</tr>
|
||||
{%- if inst_type == "Epochs" %}
|
||||
<tr>
|
||||
<th>Number of epochs</th>
|
||||
<td>{{ tfr.shape[0] }}</td>
|
||||
</tr>
|
||||
{% endif -%}
|
||||
{%- if inst_type == "Evoked" %}
|
||||
<tr>
|
||||
<th>Number of averaged trials</th>
|
||||
<td>{{ nave }}</td>
|
||||
</tr>
|
||||
{% endif -%}
|
||||
<tr>
|
||||
<th>Dims</th>
|
||||
<td>{{ tfr._dims | join(", ") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Estimation method</th>
|
||||
<td>{{ tfr.method }}</td>
|
||||
</tr>
|
||||
{% if "taper" in tfr._dims %}
|
||||
<tr>
|
||||
<th>Number of tapers</th>
|
||||
<td>{{ tfr._mt_weights.size }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th>Number of channels</th>
|
||||
<td>{{ tfr.ch_names|length }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Number of timepoints</th>
|
||||
<td>{{ tfr.times|length }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Number of frequency bins</th>
|
||||
<td>{{ tfr.freqs|length }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Frequency range</th>
|
||||
<td>{{ '%.2f'|format(tfr.freqs[0]) }} – {{ '%.2f'|format(tfr.freqs[-1]) }} Hz</td>
|
||||
</tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user