GUI tools for Jupyter Notebook - jupyter-notebook

Is it possible to build Interactive application using Jupyter Notebook?? for example I want to a window frame with two icons for Image and Camera and I want to be call my Ipython program in it.

Yes. The primary way to implement rich interactions in Jupyter is to use
widgets.
https://ipywidgets.readthedocs.io/en/stable/
Please see https://github.com/AaronWatters/jp_proxy_widget for an easy
way to use general interactive Javascript in Jupyter notebook widgets. Also see
https://github.com/AaronWatters/jp_doodle for some components built using proxy widgets that support complex visualizations with mouse interactions and animation.

Related

Display glTF scenes in a Jupyter Notebook

I use Jupyter notebooks to teach fluid mechanics. It allows me to present students with various forms of media from basic python examples to videos and 3D models.
https://github.com/nolankucd/MEEN20010
Currently I use pyGEL3D to display simple OBJ files and it works reasonably well. The models can be rotated and zoomed etc but there is no support for materials or animation. I can export the notebooks to embedded html and everything works. This is convenient because I can support students with different technical abilities.
I’d like to transition to glTF files created in Blender to avail of animation and material support. I want to keep the solution simple or self contained to keep the simplicity of the material.
I’ve tried a few different approaches. I’ve found pyVista can load the scene but does not support animation and performance can be poor.
Using an iframe I’ve tried a few viewers.
Don McCurdy’s viewer (https://gltf-viewer.donmccurdy.com) works well but I need to manually load local files via drag and drop. I can load a file hosted via CORS but I’d like to load a local file automatically.
from IPython.display import IFrame
model_url = "https://www.khronos.org/assets/gltf/BusterDrone.glb"
IFrame("https://gltf-viewer.donmccurdy.com#kiosk=1&model="+model_url, width=800, height=600)
There is a loader example on threejs.org which works nicely and loads the example files but I’m unsure how to modify it to load a local file.
https://threejs.org/examples/#webgl_loader_gltf
Can anyone help me understand how display a glTF file in Jupyter?

How to use OpenGL in QT Creator

I am working on OpenGL to create a GUI .I want to create some tabs which will help me to display different things in different windows. How is this possible using OpenGL? I read in some articles that we can use QT for that. Since I have already developed some of the GUI part in OpenGL using GLUT library ,is it possible to use the same code in QT? If so brief me how to make settings for OpenGL libraries in QT creator.
In my GUI I am trying to create a Car which is following a track.
I think you might be mixing some things up: OpenGL is a API with which you can instruct drivers to draw visual primitives, like lines, boxes, 3D triangles, pictures from buffer onto a render plane.
GLUT is a library that gives you a minimal environment around that, ie. it handles creating a window etc.
Neither of them are high-level UI description tools. Qt is really most likely what you want, as it will not only give you things like tab widgets etc, but also a feature-rich framework to do things like defining what should happen when you click a button, close a window etc.
There's a lot of examples of OpenGL usage within Qt widgets. In fact, a lot of visualization frontends use Qt and OpenGL. Qt has extensive documentation on how to generate OpenGL contextes and draw inside Qt applications.

Simultaneously edit the same ipython notebook in two tabs

As my ipython notebooks get larger, I find myself more and more frequently wanting to quickly move between two sections. Since there is no split-window view, is there any way to edit the same notebook in two browser tabs simultaneously? Naively it seems that you have to reload the notebook in the second window after making changes in the first.
I'd also be interested in any general workflow suggestions for this, thanks!
It's not a perfect solution, but I use section headers and a floating table of contents to jump around to different sections. It's nice that it encourages me to make headings, although it's not super efficient. I use MinRK's extension to make the TOC (here).
If you want to go the TOC route, you should look at the How can I add a table of contents to an ipython notebook? question. The answers there (currently) suggest either MinRK's extension to the notebook as I use, or a simple browser extension that can generate a TOC for any webpage.

Automated functional testing qt apps in windows

I'm trying to create scripts that test if some GUI components exist inside a window (combo boxes, check boxes, the state of check boxes, etc.) The app I want to tests is written in QT and running on Windows 7. Its content is created dynamically.
I've tried with swapy/pywinauto, AutoHotkey and AutoIt. But as they rely on standard Windows API calls they are useless for this (need a solution that involves QT).
Any recommendation will be appreciated.
You can try QtTestLib for integrated solution, or, if you want (and can afford) commercial solutions, I am aware of squish and kdexecutor.
Are you aware that AutoHotKey Windows Spy allows you to see if certain GUI objects exist inside a window. In the example image you see that I held the mouse over a combo box named ComboBox5. Are you trying to test at this level?
The rest can be found here already:Check if a certain button is existing or not using autohotkey

How to embed plplot or matplotlib into Qt?

I can't find anything about how to embed plotting into Qt by using C++. Which component in Qt should be used for plotting?
I want to grasp the thing generated by these lib and display it using Qt.
I have a working example at this blogpost combining embedded R with Qt. I used both SVG and PNG graphs, though the current version only uses SVG.
The repository is here, if you rewind a commit or two you get the version that flips between SVG and PNG (depending on whether a particular can be loaded).
You should be able to use the logic to show plots from either plplot or matplotlib.

Resources