Vpython rendering inside of a PyQt5 widget - python

On a recent project, I've been using PyQt5 designer to make a GUI for a visualization using vpython. As of right now, the vpython visualization is separate from gui and I was wondering if there was a way to get the visualization inside of a QWidget?
Please note that my vpython visualization is currently rendering inside of a local server in my browser

Related

Visualization library embedded inside of PyQt5

I've made a simple PyQt5 GUI and would like to embed a visualization inside of it. The visualization would be that of CSV data, so nothing too hard. I was wondering if anyone had any suggestions for python visualization libraries that could be embedded inside of a PyQt5 GUI easily?

Prefered 3-d plot library for WxPython

I am building a GUI application using Wxpython which requires 3-d scatter plots. I have tried using the following libraries but with shortcomings:
Matplotlib: Very slow rendering, panning and zooming needs workarounds.
plot.ly: I tried creating a wxpython webview and loading the plotly html from there, but wxpython webview does not seem to support WebGL which is required for 3d rendering. Have a look at this question for details.
mayavi: I am unable to figure how I can embed mayavi into wxpython GUI. This example at mayavi docs
just open a blank wx frame. Comments at this SO answer suggests that mayavi doesn't support Wxpython 4+.
Are there any 'decent' 3d-plotting libraries which support wxpython or is matplotlib my only option here?
[edit after comment]: The plot should be interactive(at least pan and zoom). The plot should preferably be inside a panel in wxpython. The data will be static.

Integrating Plotly inside WxPython

Plotly says it is a web library. Matplotlib does support Wxpython but comparatively, it is too low level. Is there any way to integrate Plotly inside a Wxpython GUI or are there any alternative for it?
You might be able to use Plotly's ability to export plots to images to get the plots into wxPython:
https://plot.ly/python/offline/#static-image-export
If you need the live plotting though, then you will need to use Webview:
https://wxpython.org/Phoenix/docs/html/wx.html2.WebView.html
I also see that Plotly can now be used offline, so if you used that plus Webview, it should work.
Wxpython webview doesn't support 3-d graphs from plotly.
For 3-d graphs, I used cefpython. It embeds a full chromium browser inside python application. wxpython example can be found here: https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py.
I used plotly offline, and read the file inside cefpython.

Displaying a pdf document within a PySide python application

I have a python application using PySide, Qt and python. In my application I would like to open and display a pdf document, but have the viewer within the application and not using the default viewer on the operating system.
I have not as of yet been able to find a widget which is capable of doing this or some example code. I have never used these tools before and this is my first Qt & PySide application so I am sure there is a widget which is capable of this but that I am just not aware of it.
I found this post and when I take the sample code I am unable to get any pdf to show and cannot replicate the behaviour of the poster, but I am using python 2.7.3, PySide 1.1.1 so perhaps this is why. The error that I get when trying to run the sample code in the other post is:
QWebInspector: QSettings couldn't read configuration setting [resourceTrackingEnabled].
and the pdfs I would like to render are saved locally, in the same directory as the the python script and not accessible via the web.
Could somebody point me in the direction of some sample code or a Qt widget which I would be able to use to render a pdf?
As an aside, I am not sure that it matters but the pdf will be generated using LaTeX.
Edit --More information--
The program has to run on both Windows and Mac OSX environments but it is just for a personal project which wont be distributed. Using PyQt is not an option as it is not compatible with the python editor that I use and PySide is the requirement. I have read the following link but from what I understood under the Rendering section it said that the 3rd party libraries available worked with C, C++ and Qt not python or PySide but maybe I have misunderstood this?

PyGTK and visual-python

I'm developing an application with PyGTK that will make use of visual-python's 3d drawings and animations, but I can't get both libraries to work together: they either hung up when I close the Gtk window or they get stuck when I run the application.
I've tried with threads and they run side-by-side, but when I close visual-python's window this kills python's interpreter, raising a Segmentation Fault.
Has anyone been able to use visual-python from a PyGtk app?
This is a non-trivial problem given the way that VPython wants to work, but there is an example in the contributed programs section of the VPython web site that shows how to embed VPython into a wxPython application, so perhaps you can look over that code and determine what you would need to do to perform the same magic in PyGTK.

Categories