Giter Site home page Giter Site logo

WebGL error about pandasgui HOT 20 CLOSED

adamerose avatar adamerose commented on July 17, 2024
WebGL error

from pandasgui.

Comments (20)

miglto avatar miglto commented on July 17, 2024 1

BTW... I was COMPLETELY shocked by the change in the Grapher layout. I was like "I must have broken something". Once I figured how it works, it's clearly an improvement.

from pandasgui.

miglto avatar miglto commented on July 17, 2024

Pls ignore "render_mode", I was trying that out to see if it did anything.

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

Hi @miglto

It works for me:
image

Let's check if your problem is related to pandasgui or just plotly. Can you run the code below and let me know what happens?

import pandas as pd
import plotly.express as px

df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
fig.show(renderer="browser")

It should open a Plotly figure in your browser that looks like mine above

from pandasgui.

miglto avatar miglto commented on July 17, 2024

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

Yeah pandasgui uses the QWebEngineView from PyQt.

Can you try this code now?

from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView

import tempfile
import pandas as pd

import plotly.express as px
from plotly.io import to_html

df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')

app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])

file = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False)
file.write(to_html(fig, config={"responsive": True}))

viewer = QWebEngineView()
viewer.load(QtCore.QUrl.fromLocalFile(file.name))
viewer.show()

app.exec_()

from pandasgui.

miglto avatar miglto commented on July 17, 2024

from pandasgui.

miglto avatar miglto commented on July 17, 2024

Simple example that fails below - this is a QtWebEngine issue... Who to ask?

from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets

app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])

viewer = QtWebEngineWidgets.QWebEngineView()
viewer.load(QtCore.QUrl("http://webglreport.com/?v=2"))
viewer.show()

app.exec_()

from pandasgui.

miglto avatar miglto commented on July 17, 2024

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

Yep looks like a QWebEngineView issue. I found a few potential fixes... try the snippet below. And if it doesn't work, also try upgrading PyQt5 and PyQtWebEngine to latest versions or at least 5.13.0

from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets

app = QtWidgets.QApplication(["--ignore-gpu-blacklist", "--enable-gpu-rasterization"])

viewer = QtWebEngineWidgets.QWebEngineView()
viewer.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True)
viewer.load(QtCore.QUrl("http://webglreport.com/?v=2"))
viewer.show()

app.exec_()

Who to ask?

If none of the above works, try also posting on https://stackoverflow.com/ with the pyqt and pyqt5 tags.

Also include what OS version you're using and your version of PyQt5 and PyQtWebEngine

from pandasgui.

miglto avatar miglto commented on July 17, 2024

from pandasgui.

miglto avatar miglto commented on July 17, 2024

PyQt5 and PyQtWebEngine are versions 5.15.0 (latest)
OS is macOSX 10.15.6
Laptop is MacBookPro11,1 (GPU is Inter Iris)

from pandasgui.

miglto avatar miglto commented on July 17, 2024

I installed Ubuntu 20.04 on my mac, and the webgl error is gone. I am guessing this is macos blocking a call to webgl. It is odd that it would do that but it works in Safari, Chrome, and Firefox.

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

Yeah unfortunately I can't be much help debugging since I can't reproduce the issue myself (don't have a Mac), but if you do end up finding a solution I'll add the fix to pandasgui

from pandasgui.

miglto avatar miglto commented on July 17, 2024

Yes, I will let you know if I find a solution. However, frankly now that I got my mac to triple-boot (macos, ubuntu, windows) I will probably not bother with macos for this any longer... :)

BTW... Quick question: Would it be possible/useful to add a filter to pandasgui? Meaning for example selecting rows based on some value of the row. Obviously this can be done in code, but that's a tad slower. Thx!

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

BTW... Quick question: Would it be possible/useful to add a filter to pandasgui? Meaning for example selecting rows based on some value of the row. Obviously this can be done in code, but that's a tad slower. Thx!

Yup I'll probably focus on that now since I'm mostly done the Grapher. If you have any ideas about how it should look & work feel free to post.

I'll probably start off by just providing a text input on each DataFrame that lets you enter strings as a Pandas query expression, and allow you to toggle them on/off.

Also considered a button on each header that pops up a UI like this, but its more work and not that much better so I'll put it off for someone else to do or until I have more time
image

from pandasgui.

miglto avatar miglto commented on July 17, 2024

That's cool.

A few comments:

  • You really want to indicate what columns have filters applied, maybe making the header red or something (otherwise it is easy to overlook)
  • For values, I often care that they are in a range, so maybe that's something consider (an and would do)
  • In other tabs (eg stats and grapher) I would also add an indication that some filtering had been applied - like a red dot or a message.

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

Closing this since you moved on and I was unable to replicate it.

btw I just pushed what I've done so far on the filters feature to the dev branch if you want to try it out.
image

You really want to indicate what columns have filters applied, maybe making the header red or something (otherwise it is easy to overlook)

Decided against this because filters can reference multiple or modified columns. It's still easy to see what filters are applied by looking at the Filters tab.

For values, I often care that they are in a range, so maybe that's something consider (an and would do)

Example of this is in my pic for both ranges and value lists.

In other tabs (eg stats and grapher) I would also add an indication that some filtering had been applied - like a red dot or a message.

I like this idea but haven't done anything on it yet. Right now Statistics remain unfiltered and Grapher works on the currently filtered DataFrame

If you have any more feedback or suggestions on filtering or other topics please open a new issue so it doesn't get lost

from pandasgui.

beetleskin avatar beetleskin commented on July 17, 2024

ftr, I have the same issue in Ubuntu 18.04

from pandasgui.

adamerose avatar adamerose commented on July 17, 2024

@beetleskin

ftr, I have the same issue in Ubuntu 18.04

I recommend trying the same snippet as miglto:

from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets

app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])

viewer = QtWebEngineWidgets.QWebEngineView()
viewer.load(QtCore.QUrl("http://webglreport.com/?v=2"))
viewer.show()

app.exec_()

And that will narrow it down to a PyQt5 issue, and then I recommend opening a thread here https://forum.qt.io/category/10/general-and-desktop

If someone has a solution that can be solved with code let me know and I'll put it in PandasGUI.

from pandasgui.

beetleskin avatar beetleskin commented on July 17, 2024

For me it turned out to be an issue with PyCharm. It works nicely from the ipython commandline.

from pandasgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.