Skip to content

Conversation

@cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Dec 6, 2023

Closes #846.

With this PR, page_fillable() becomes the new page default for express. This should lead to the same experience as before for non-fill items (e.g., inputs, text, etc), but fill items like plots, cards, layouts, etc. will now fill the page (when wide enough).

Moreover, this default is more consistent with the with layout.sidebar() experience, which treats the main content area as a fillable container (by default).

For a concrete example, notice that the plot here will now fill the page:

from shiny import App, render, ui
from shiny.express import input

ui.input_slider("slider", label="Slider", min=0, max=100, value=50)

@render.plot()
def plt():
    import matplotlib.pyplot as plt
    import numpy as np
    x = np.linspace(0, 2 * np.pi, 100)
    y = np.sin(x * input.slider())
    fig, ax = plt.subplots()
    ax.plot(x, y)
    return fig

@cpsievert
Copy link
Collaborator Author

I decided that it'd be better to do separate PRs for the issues we ran into earlier today (see #859 and #861) since they're orthogonal to this change. I also sent a PR for the doc change you requested wch/shiny_express_doc#1

So, feel free to merge this as-is when you're ready.

@cpsievert cpsievert marked this pull request as ready for review December 6, 2023 23:21
@wch wch merged commit ec4054b into main Dec 7, 2023
@wch wch deleted the express-page-fillable branch December 7, 2023 01:30
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.

Consider making page_fillable() the default for shiny.express

3 participants