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

DataFrame column hover out of bounds #370

Open
cyrfar opened this issue Nov 7, 2023 · 0 comments
Open

DataFrame column hover out of bounds #370

cyrfar opened this issue Nov 7, 2023 · 0 comments
Assignees

Comments

@cyrfar
Copy link

cyrfar commented Nov 7, 2023

Hi, I am using Solara 1.22.0 to render a DataFrame in my app with column hover capabilities. However, the DataFrame is rather wide and when I hover over the right-most columns, the rendered hover box is out of bounds so that it cannot be seen fully. Is there a way to force the right-most columns to render the box inside the bounds? Here is a reproducible example code and screenshot. Thanks!

import plotly.express as px
import random
import solara


# Create a dataframe with 15 columns of random floats
df = pd.DataFrame({f'Column_{i}': [random.random() for _ in range(100)] for i in range(15)})

@solara.component
def DataFrameWithHover():

    column_hover, set_column_hover = solara.use_state(None)

    with solara.Sidebar():
        solara.Markdown('my app')

    with solara.Column(style='max-width: 400px;') as column_header_info:
        if column_hover:
            fig = px.histogram(df, x=column_hover, title='Histogram')
            solara.FigurePlotly(fig)
    
    with solara.Column():
        solara.DataFrame(
            df,
            column_header_info=column_header_info,
            on_column_header_hover=set_column_hover
        )

DataFrameWithHover()
image
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

2 participants