Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent wrapping group names in InferenceData HTML repr #1407

Merged
merged 2 commits into from
Oct 5, 2020
Merged

Conversation

sethaxen
Copy link
Member

@sethaxen sethaxen commented Oct 5, 2020

Description

The HTML repr for InferenceData reuses some of the classes of xarray's HTML repr for xarray.Dataset.
The xr-sections class determines the grid layout of the list of sections in the Dataset repr. However, the same class is applied to the list of groups in the InferenceData repr. The result is that the same grid layout is applied to both (note that the left-most and two right-most columns are the same width):
Screen Shot 2020-10-04 at 8 50 36 PM
This isn't a problem in the arviz docs or Jupyter notebooks with the default theme, but a different Jupyter theme is used or the InferenceData HTML repr is used in a different page, then if the font size is too large, the group names can exceed the fixed width of the grid. This happens in the ArviZ.jl docs, because they use a different font size than the arviz docs (thanks to @ColCarroll for pointing that out!)
Screen Shot 2020-10-04 at 9 05 25 PM

This PR adds a group-sections subclass to xr-sections that is used for the groups list, and in the CSS resets the grid for just that list while keeping all other CSS attributes. The result is that only the grid is changed:
Screen Shot 2020-10-04 at 8 53 33 PM

Checklist

  • Follows official PR format
  • Includes new or updated tests to cover the new feature
  • Changes are listed in changelog

@sethaxen
Copy link
Member Author

sethaxen commented Oct 5, 2020

I'd appreciate any suggestions on a good test for this.

@sethaxen
Copy link
Member Author

sethaxen commented Oct 5, 2020

The failures don't seem to be unique to this PR (they also show up in e.g. #1406).

@ColCarroll ColCarroll merged commit 8f3dc70 into master Oct 5, 2020
@ColCarroll
Copy link
Member

Thanks, Seth! I'm not super worried that we do a great job testing CSS :D

ahartikainen pushed a commit that referenced this pull request Oct 5, 2020
* Reset grid for group names

* Update changelog
ahartikainen added a commit that referenced this pull request Oct 5, 2020
* update draws call and fix prior

* check if draws exists

* update changelog

* fix new and old parsing

* Prevent wrapping group names in InferenceData HTML repr (#1407)

* Reset grid for group names

* Update changelog

* make some sets

Co-authored-by: ahartikainen <ahartikainen@github.com>
Co-authored-by: Seth Axen <seth.axen@gmail.com>
@OriolAbril OriolAbril deleted the idatacss branch October 5, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants