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

Feature Request: JupyterBook Layout Control #1036

Open
2 of 5 tasks
edasmalchi opened this issue Feb 22, 2024 · 2 comments
Open
2 of 5 tasks

Feature Request: JupyterBook Layout Control #1036

edasmalchi opened this issue Feb 22, 2024 · 2 comments
Assignees
Labels
admin Administrative work enhancement New feature or request feature request Issues to request new features jupyterhub Work related to our notebooks tooling portfolio work Work related to the analytics portfolio tooling Work related to the management of our tooling and shared modules

Comments

@edasmalchi
Copy link
Member

edasmalchi commented Feb 22, 2024

Where does your feature apply?
Select from the below, and be sure to affix the appropriate label to this issue (e.g. dataset, jupyterhub, metabase, analytics.calitp.org)

  • Data (the warehouse)
  • JupyterHub
  • Metabase
  • analytics.calitp.org
  • Other (add detail)

Is your feature request related to a problem? Please describe.
We've updated to the latest JupyterBook version, which makes things a little narrower by default. However, it also includes a way to designate cell outputs for additional width via tags.

Describe the solution you'd like
Analysts able to specify cells for additional width (and possibly other page layout controls such as sidebar) when running parameterized notebooks via the portfolio script.

Describe alternatives you've considered

  1. Doing nothing and having analyses with large maps and figures being kinda squished.
  2. Following existing pattern in portfolio script, use a new cell magic such as %%full_width to signal the portfolio script to append the "full-width" tag to that cell. Requires corresponding change to calitp_data_analysis.magics
  3. Same as 2, but add corresponding magic/tag pair for sidebar as well.
  4. Use existing %%capture_parameters cell magic and portfolio logic. Revise portfolio script to append all tags provided in an iterable passed via capture_parameters, i.e.
~%%capture_parameters~
organization_name = rt_day.organization_name
jupyterbook_append_tags = ['full-width']
organization_name, jupyterbook_append_tags

#  output
{"organization_name": "Santa Barbara Metropolitan Transit District", "jupyterbook_append_tags": ["full-width"]}

No change required to calitp_data_analysis.magics, additionally provides flexibility to append any set of tags to any cell. Would require supporting documentation, since appended tags would necessarily be per-cell while all other user-set parameters would persist.
edit, won't work with %%capture_parameters but overall concept would still work for a new magic allowing flexibility
5. Something else?

@tiffanychu90 thoughts? I'm leaning towards 4.

Additional context
Current state with narrowed content:
Screenshot 2024-02-21 175011

@edasmalchi edasmalchi added enhancement New feature or request portfolio work Work related to the analytics portfolio jupyterhub Work related to our notebooks tooling feature request Issues to request new features admin Administrative work tooling Work related to the management of our tooling and shared modules labels Feb 22, 2024
@edasmalchi edasmalchi self-assigned this Feb 22, 2024
@github-actions github-actions bot added this to To Be Refined in Analytics Work Feb 22, 2024
@edasmalchi
Copy link
Member Author

Tried it out last week, was able to inject the "full-width" tag using the portfolio script but speedmaps didn't render properly. Reverted back for now and will revisit when time allows

@tiffanychu90
Copy link
Member

tiffanychu90 commented Feb 29, 2024

  • Use right hand widget panel and add tags (radio button should be checked)
  • It's ok if the cell metadata box says tags = {["tags"]}...it resets and doesn't hold the full-width setting, but portfolio.py will set that metadata again.
  • Every cell that needs full-width needs the cell tag. The docs show us how we can set these and portfolio.py does do remove-input as a similar tag.
  • TODO: get the cell magic to work with the Jupyterbook build. Ideally, we want a solution that can be set once at the top and all the cells are rendered as full-width. Currently, it doesn't error when parameterizing the notebook, but when the book is built, it throws an error while parsing tags
cell_tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Administrative work enhancement New feature or request feature request Issues to request new features jupyterhub Work related to our notebooks tooling portfolio work Work related to the analytics portfolio tooling Work related to the management of our tooling and shared modules
Projects
Analytics Work
To Be Refined
Development

No branches or pull requests

2 participants