Skip to content

Info representation in doc build is not fully collapsed #12130

Closed

Description

@hoechenberger

Description of the problem

In the Report, the sections of all Info objects are collapsed, but the vertical space is still occupied

Steps to reproduce

# %%
import mne

sample_dir = mne.datasets.sample.data_path()
sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif'

raw = mne.io.read_raw_fif(sample_fname)
raw.crop(tmax=60)

report = mne.Report()
report.add_raw(raw, title="Test")
report.save("/tmp/report.html", overwrite=True)

Link to data

No response

Expected results

  • All sections should be uncollapsed by default
  • Collapsing a section should free the corresponding vertical space

Actual results

Screenshot 2023-10-24 at 17 07 22

Additional information

Report has its own collapsible sections

For the purpose of quick data / report assessment, all Info sections should be uncollapsed by default

Activity

  1. larsoner commented on Oct 24, 2023

    @larsoner
    Member

    For the purpose of quick data / report assessment, all Info sections should be uncollapsed by default

    Agreed this should be the case for mne.Report. I think for general object __repr_html__ outside of mne.Report we decided to collapse by default in some issue/PR.

  2. cbrnr commented on Oct 24, 2023

    @cbrnr
    Contributor

    Collapsing in notebooks doesn't make a lot of sense, because e.g. raw.info will only show section headers without any information at all. I see that @hoechenberger just created #12131 for this.

  3. hoechenberger commented on Oct 26, 2023

    @hoechenberger
    MemberAuthor

    JS inspector in Safari on macOS says:

    [Error] ReferenceError: Can't find variable: $
    	Global Code (30_info.html:1323)
    

    The respective line is:

    <script type="text/javascript">$(function () { $("time.localized").each(function () { var el = $(this); el.text(new Date(el.attr("datetime")).toLocaleString([], {dateStyle: "medium", timeStyle: "long"})); }); } )</script></p></div>

    not sure if related, though!

    but it seems as if jQuery is expected but not embedded

  4. larsoner commented on Oct 26, 2023

    @larsoner
    Member

    Not related, making new issue

  5. changed the title [-]Info representation in Report is broken[/-] [+]Info representation in doc build is not fully collapsed[/+] on Oct 26, 2023
  6. larsoner commented on Oct 26, 2023

    @larsoner
    Member

    Even after #12145 there is still a bug on Safari on macOS with the collapsing in rendered tutorial HTML, see:

    #12145 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions