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

altair chart height is incorrect on safari #144

Open
cpsievert opened this issue Mar 19, 2024 · 1 comment
Open

altair chart height is incorrect on safari #144

cpsievert opened this issue Mar 19, 2024 · 1 comment

Comments

@cpsievert
Copy link
Collaborator

import altair
import pandas as pd
import plotly.express
import shiny

import shinywidgets

_SOURCE_DATA = pd.DataFrame(
    {
        "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"],
        "b": [28, 55, 43, 91, 81, 53, 19, 87, 52],
    }
)

UI = shiny.ui.page_fixed(
    shinywidgets.output_widget("plot")
)

def server(input):

    @shinywidgets.render_widget
    def plot():
        return altair.Chart(_SOURCE_DATA).mark_bar().encode(x="a", y="b")


app = shiny.App(UI, server)
Screenshot 2024-03-19 at 2 02 41 PM
@cpsievert
Copy link
Collaborator Author

I can actually reproduce this behavior in a Jupyter notebook with .properies(height="container"), so I don't think it's on shinywidgets to fix it:

Screenshot 2024-03-19 at 4 41 15 PM

A workaround in the meantime is to set an explicit height on the chart (e.g., chart.properties(height=400))

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

No branches or pull requests

1 participant