Prevent wrapping group names in InferenceData HTML repr #1407
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The HTML repr for
InferenceData
reuses some of the classes of xarray's HTML repr forxarray.Dataset
.The
xr-sections
class determines the grid layout of the list of sections in theDataset
repr. However, the same class is applied to the list of groups in theInferenceData
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):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!)This PR adds a
group-sections
subclass toxr-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:Checklist