European-XFEL / DAMNIT

Data And Metadata iNspection Interactive Thing
https://damnit.rtfd.io
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Plotly widget not showing figure #308

Closed vojtavozda closed 6 days ago

vojtavozda commented 1 month ago

I am trying to employ plotly but the widget which should show the figure gets stuck on a waiting animation.

My context file:

from damnit_ctx import Variable
import plotly.graph_objects as go

@Variable(title="Plotly")
def get_plotly(run):
    # Sample data
    x = [1, 2, 3, 4, 5]
    y = [10, 14, 12, 16, 15]

    # Create a scatter plot
    fig = go.Figure(data=go.Scatter(x=x, y=y, mode='markers'))

    # Add titles and labels
    fig.update_layout(
        title='Simple Scatter Plot',
        xaxis_title='X-Axis',
        yaxis_title='Y-Axis'
    )

    return fig

Created column and mouse-hover preview is quite promising: image

But when I double-click on the cell, a new widget is opened but stucks on waiting animation. The app itself is working, I can close the widget, the waiting circle is spinning but the figure is never generated. image

I am using Ubuntu, I tried several ways to open the gui: FastX in browser (Chrome, Firefox), ssh -X from terminal, as well as FastX app from https://confluence.desy.de/display/IS/FastX3_258905161.html. I tried also different figure settings all with the same result.

Thank you for your help

tmichela commented 1 month ago

Hi,

Could you try setting the following environment variable before starting the gui:

export QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox
amore-proto gui
vojtavozda commented 1 month ago

Great, thank you. Figures are now well generated.

It works great in a browser but for use in the desktop app this setings somehow ruins scale factor of the entire app (before -> now): image

However, setting export QT_AUTO_SCREEN_SCALE_FACTOR=1 and restarting the app solved the issue.

tmichela commented 1 month ago

Thanks for your feedback. I'll just reopen the issue until we have it fixed.

tmichela commented 1 month ago

the desktop app this setings somehow ruins scale factor of the entire app

I could not reproduce this issue, @vojtavozda what OS are you using, and where are you running the damnit gui (locally or on Maxwell)?

vojtavozda commented 1 month ago

Ubuntu 24.04. When I ran the gui from the browser FastX or Maxwell via ssh -X username@max-exfl-display.desy.de there was no scaling issue. But when I ran the app localy it was present. I got the app from here (StarNet_FastX3/client/3.3/FastX3-3.3.60.rhel7.x86_64.tar.gz)