OpenBBTerminal icon indicating copy to clipboard operation
OpenBBTerminal copied to clipboard

Web UI TODO Tracking

Open CoconutMacaroon opened this issue 2 years ago • 9 comments

Note that I test the web UI on a server running Debian 11 Bullseye with the 5.15 Linux kernel.

Here's what works and what doesn't:

  • [x] Basic terminal output works
  • [x] Font selected that supports lines for the tables and required Unicode characters - I chose Consolas. It looks nice, supports the required characters, and is reasonably well-liked.
  • [x] API keys - they work, set them in the gamestonk_terminal_web/setenv file, as documented here. You can manually create that file, or it is automatically created when you run the launch script if it doesn't already exist.
  • [ ] Graphs - Don't currently work, I'm currently pretty busy, but I hope to get to them sometime around January 27th, though it might be later.
  • [x] Prompt emoji renders shifted a bit - I'm not sure why this happens, but I have bigger priorities. ~~I plan to just use a custom flair instead of fixing that one. I was waiting on #1249, but now that it has been merged, I'll configure it to use a custom flair that works when I get a chance. It's pretty simple, so expect that within the next week.~~ Update: I'm just going to remove the flair because that is easier. Support for no flair was added in #1264 .

CoconutMacaroon avatar Jan 24 '22 03:01 CoconutMacaroon

Any progress?
In the same boat here. Basic terminal functions and API connects just fine, when installing the Docker Image, or deploying via Anaconda on local machine. However I cannot get graphs to generate with either.

Trying to come up with some next steps to troubleshoot further..

CaptainTollBooth avatar Feb 18 '22 21:02 CaptainTollBooth

@CaptainTollBooth For Docker, see this. It explains how.

As for the web UI, you're correct, graphs don't work. Sorry, I should have given an update, but I forgot. The web UI uses a program that allows one to run a terminal in a browser (gotty). To do that, gotty has two options for rendering the terminal in the browser. The first is a library called xterm.js. But, xterm.js only does web-based terminals, not GUI apps. gotty also supports one called hterm. Sadly, neither of them support GUI windows, only the terminal. There's two (main) ways to get the graphs working. Either use Sixel to render images directly, or have some way for the graphs to be a popup. The latter of those options would let you interact with it, like pan it. But it's more complex.

For Sixel, neither hterm nor xterm.js currently support it. There is an add-in for xterm.js that supports it, but until said add-in gets added to the main xterm.js repo, I can't (easily) use it. See this issue. For hterm, I asked there, but I have yet to receive a response.

In theory, having some sort of way to run an X server on the host and have a web-based X client to popup any GUI windows would be the optimal solution. But, I've been busy and haven't had time to work on it. Sorry.

CoconutMacaroon avatar Feb 19 '22 01:02 CoconutMacaroon

Thanks for pointing that out.

So far I got the setenv file loading ok, xquartz installed, but the DISPLAY parameter pointing to the IP address doesn't seem to be working. I will have to test further and figure out what I am missing.

CaptainTollBooth avatar Feb 19 '22 05:02 CaptainTollBooth

I GOT IT WORKING!

This is exciting.. Must have had something wrong with the path or something the first time..

Time to explore some of these features, and then I suppose figuring out how to add in machine learning, tensorflow, etc..

CaptainTollBooth avatar Feb 19 '22 14:02 CaptainTollBooth

Update: images in the browser work (this was just a Proof of Concept): image That is inside my browser (Microsoft Edge, Windows). It connects via noVNC to a local Docker container, and uses the Kitty terminal + SIXEL to display images. I'm going to make the Kitty terminal take up the entire browser window, do a bit of hacking to get matplotlib to use SIXEL, and then graphs should work in the web UI. I'm not going to have them be a separate window.

CoconutMacaroon avatar Apr 06 '22 18:04 CoconutMacaroon

Is there any update on this @CoconutMacaroon ?

DidierRLopes avatar Jul 03 '22 13:07 DidierRLopes

@DidierRLopes Kind of, yes. I was busy with school and then I forgot about this, so very sorry about that! Now for your question:

The addon for xterm.js that adds Sixel support was published as an NPM package, so I can use it. So I need to compile gotty from source using that addon + xterm.js instead of base xterm.js. After that, SIXEL should work in the browser, which is good. From there, I have to configure matplotlib to use Sixel (as opposed to spaning a window). In theory, this library can do it pretty easily. But I haven't tested it yet. If it doesn't work, I can have matplotlib just save the chart as an image somewhere and then render that image in the terminal as Sixel (there are a few packages to do that that I've used in the past).

So I pretty much just need to re-compile gotty with that addon and then configure matplotlib to use SIXEL.

If this would still be a useful feature, I can start looking into getting gotty up and running with SIXEL.

Now that SIXEL support is out, I no longer believe noVNC is the best option given that it has significantly more overhead and is rather overkill.

CoconutMacaroon avatar Jul 03 '22 14:07 CoconutMacaroon

This makes sense! Yes, I believe this is very much worth pursuing.

We are getting several users with issues running the terminal on Linux, I think that this solution could solve that 😄

DidierRLopes avatar Jul 03 '22 14:07 DidierRLopes

@DidierRLopes Hello! Unfortunately, I've been pretty busy lately and I haven't worked on this. I might be able to at some point, but I don't know if I'll be able to get to it any time soon. I know this isn't what you hoped, but I wanted to let you know

CoconutMacaroon avatar Aug 04 '22 04:08 CoconutMacaroon