pyvista / pyvista

3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

Home Page:https://docs.pyvista.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrollbars in interactive viewer in jupyter

ChristosT opened this issue · comments

Describe the bug, what's wrong, and what you expected.

As mentioned in a previous PR #4847

Or maybe there should never be scroll bars, or maybe we can detect when they should be there...?

Do we really need these scrollbars in the generated iframes ? In all the examples that I have seen they introduce only a small amount of scrolling which is never really useful.

Is there any issue with adding scrolling='no' in the html widget of trame in pyvista ? https://github.com/pyvista/pyvista/blob/main/pyvista/trame/jupyter.py#L70

Or there is a better way to fix this issue ?

cc: @pyvista/kitware @banesullivan

Steps to reproduce the bug.

Run any example in jupyter or through nbconvert e.g
Screenshot from 2024-04-25 12-16-40

System Information

--------------------------------------------------------------------------------
  Date: Thu Apr 25 12:20:12 2024 EDT

                OS : Linux
            CPU(s) : 16
           Machine : x86_64
      Architecture : 64bit
               RAM : 62.5 GiB
       Environment : Python
       File system : ext4
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : NVIDIA RTX A2000 Laptop GPU/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 535.171.04
  MathText Support : True

  Python 3.10.14 (main, Apr  6 2024, 18:45:05) [GCC 9.4.0]

           pyvista : 0.44.dev0
               vtk : 9.3.0
             numpy : 1.26.4
        matplotlib : 3.8.4
            scooby : 0.9.2
             pooch : 1.8.1
            pillow : 10.3.0
           imageio : 2.34.0
           IPython : 8.23.0
          colorcet : 3.1.0
           cmocean : 4.0.3
        ipywidgets : 8.1.2
             scipy : 1.13.0
              tqdm : 4.66.2
            meshio : 5.3.5
        jupyterlab : 4.1.6
    pytest_pyvista : 0.1.8
             trame : 3.6.0
      trame_client : 3.0.2
      trame_server : 3.0.0
         trame_vtk : 2.8.6
     trame_vuetify : 2.4.3
      nest_asyncio : 1.6.0
--------------------------------------------------------------------------------

Screenshots

No response

PyVista viewer needs to add a client.Style("html{overflow: hidden;}") under its layout.

PyVista viewer needs to add a client.Style("html{overflow: hidden;}") under its layout.

This helps on Firefox but not on Chrome on Linux .
Edge and Chrome exhibit the same issue on Windows.

See below
Screenshot from 2024-04-28 21-34-18
Screenshot from 2024-04-28 21-35-12

The issue is fixed upstream in vtk-js (Kitware/vtk-js#3065) that provides the embedded viewer.
The latest version of trame-vtk 2.8.8 brings the updated viewer.