Testing web browser backend
See original GitHub issueGinga has a new backend, targeting canvases in HTML5 compliant browsers. I am looking for early feedback on this capability. You will need at least commit 97ec3d5e25a4c77498138d3db46cf74b3a20772e or later.
The easiest test right now is example2_pg.py
Run it like this:
$ python .../path/to/ginga/examples/pg/example2_pg.py --loglevel=20 --stderr path/to/some/fitsfile.fits
The very last line of the log output should tell you a URL to visit with an HTML5/websockets compliant browser. Visit this page and click on the link for the Ginga window. You should get something that looks like this:
But of course with your FITS file.
Helpful additional packages
For full functionality with graphical overlays you will need one of {aggdraw
|PIL/pillow
||opencv (cv2)
} modules installed on the server side. PIL
is a pretty common library included in many distributions. aggdraw
provides the most complete experience similar to the native widgets (qt/gtk/tk)–you can get it here; currently it only supports python 2. opencv
provides a huge boost to rotation performance, no matter what what widget set you are using. If you have it installed, add the --opencv
flag to the command invocation.
Non-local access
The example program also supports the --host
and --port
options for listening on alternate interfaces. Start the example with:
--host=
i.e. empty host to have the example listen on all interfaces. You can then connect from any other system that can connect to this host.
Sharing
Windows are shareable. This has interesting applications for collaboration. To test it, simply open another browser window to the same address, possibly from a different host.
Trackpad
In the example, there is a checkbox for “I’m using a trackpad”. Check it if you are, you will have a more pleasant experience zooming the window.
Issue Analytics
- State:
- Created 8 years ago
- Comments:25 (23 by maintainers)
Top GitHub Comments
Hi @ejeschke,
I’ve been working with Ginga’s web backend as in example2_pg.py and noticed there might be a slight hiccup when creating the viewer widget as on line 75 of example2_pg.py:
w = Viewers.GingaViewerWidget(viewer=fi)
There’s no issue there, but trying to create a different sized window using a command such as
w = Viewers.GingaViewerWidget(viewer=fi, width=1000, hiehgt=1000)
didn’t work and I noticed that lines 15/16 of Viewers.py could be altered in the slightest way.
could be changed to
so that the default values could be changed. It’s the smallest change and I doubt anyone will ever make use of it (I’m not even sure if we need any different sizes other than 600x600), but I could make a quick pull request with the change if you wanted!
@austinbeauch, I’d be happy to receive your PR!