Skip to content

Improve Gitpod setup to plot charts graphically#15

Merged
JesterOrNot merged 1 commit intoJesterOrNot:masterfrom
jankeromnes:master
Oct 1, 2019
Merged

Improve Gitpod setup to plot charts graphically#15
JesterOrNot merged 1 commit intoJesterOrNot:masterfrom
jankeromnes:master

Conversation

@jankeromnes
Copy link
Copy Markdown
Contributor

@jankeromnes jankeromnes commented Oct 1, 2019

Hi @JesterOrNot!

In this Pull Request, I've made the following changes:

  • Replace Dockerfile with a core image where Python3 works with Tk (the image was built from [full] Install tk-dev to help Python work with graphical environments gitpod-io/workspace-images#119, which I hope to merge soon, so eventually you'll be able to use the default gitpod/workspace-full-vnc image instead)
  • Pre-expose port 6080, which is Gitpod's Virtual Desktop, and automatically open it in a side panel
  • Configure Matplotlib in graphQuadMod.py to use TkAgg instead of agg, thus displaying plots in graphical windows

It should look like this:

Screenshot 2019-10-01 at 16 37 02

This isn't perfect however:

  • The Virtual Desktop (noVNC) side panel now always opens, even when you only want to do command-line calculations. Ideally it should only open when you do some graphical stuff, but we have no way to detect that yet (you can control the preview manually though, by using onOpen: ignore and running a command like gp preview $(gp url 6080) when the preview is appropriate)
  • The noVNC connection is a little bit unstable. Sometimes you need to refresh the preview, and other times (if the port 6080 server crashes) you'll need to open a new Terminal, because the noVNC auto-restarting script lives in ~/.bashrc
  • By default, you only see a small part of the Virtual Desktop, the being hidden. And since Matplotlib will open a graphical window in the center of the screen, you need to scroll a bit in the Virtual Desktop to find the window. Maybe there is a way to change or auto-adjust noVNC's screen dimensions, or to make Matplotlib open windows in the screen's top left

Please let me know what you think, or if I should change anything here. 🙂 I'm happy to make as many iterations as necessary.

- Automatically open Virtual Desktop
- Configure Matplotlib to render graphically using Tk
- Replace Dockerfile with an image where Python3 works with Tk:
gitpod-io/workspace-images#119
@JesterOrNot JesterOrNot merged commit ebe8003 into JesterOrNot:master Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants