embedded bokeh plots in php

Hi folks,

My project is Flask+Bokeh to provide RESTful API to the frontend PHP web pages.

Currently, I see my plots on http://localhost:5000/bokeh

But I have no idea how to embed those plots into the PHP web pages.

any idea?

thanks,

Dave

First question one would asks is why having another PHP server when Flask is already there?

The architecture you are aiming deploys 3 servers: Bokeh server, Flask server and PHP server.

Do you have any requirements on how those servers will be physically allocated?

Setting up Bokeh server and Flask server on separate machines can be complex enough…

See here e.g. about Flask/Bokeh session handling: https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/fu6ASwWeeDY/SkCTVR2bCwAJ

Another question is what type of application are you actually building?

Do you want live plotting with data streaming? webpages with BokehJS interaction? or both?

Going back to your PHP+Flask+Bokeh scenario: serving webpages with or without data-streaming should not be a problem (having PHP server acting as a proxy to load a SPA from Flask/Bokeh).

As far as I know once the page is served and loaded in the browser the communication is done directly between the Bokeh server and the webpage (so PHP server should not be involved).

The HTML controls (not Bokeh controls) on the page should however refer to the PHP server which in turn will communicate with the Flask REST API (e.g. to serve new type of plot from Bokeh server)

Having this said, it is difficult to understand the actual role of the PHP server there and I can only speculate on that without knowing the actual reasons…

Is it that Flask uses by default port 5000 and you want to use port 80? is it about https which is not default supported on Flask?

Maybe you could explain a little more about the application context and why are you targeting for this setup?

···

On Tuesday, February 5, 2019 at 2:16:26 AM UTC+1, Dave Wen wrote:

Hi folks,

My project is Flask+Bokeh to provide RESTful API to the frontend PHP web pages.

Currently, I see my plots on http://localhost:5000/bokeh

But I have no idea how to embed those plots into the PHP web pages.

any idea?

thanks,

Dave

In fact, I have a short time to integrate those service altogether.

PHP project is there for a long while. And another one developed the flask app to provide a RESTful service to extend the php server functions. Meanwhile, they deploy the flask app through uwsgi.

Our mission is to plotting with data streaming. That’s why I was not approaching to BokehJS.

All of the setup (php+flask+bokeh) is under https. And I can make the flask+Bokeh work together under debugging mode. https works well for flask, too.

The only thing bothering me is that the proxy_pass setting in Nginx seems didn’t pass the request to the standalone Bokeh server.

I post another question: https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/i72gsbiFEcQ

···

On Sun, Feb 17, 2019 at 6:26 AM [email protected] wrote:

First question one would asks is why having another PHP server when Flask is already there?

The architecture you are aiming deploys 3 servers: Bokeh server, Flask server and PHP server.

Do you have any requirements on how those servers will be physically allocated?

Setting up Bokeh server and Flask server on separate machines can be complex enough…

See here e.g. about Flask/Bokeh session handling: https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/fu6ASwWeeDY/SkCTVR2bCwAJ

Another question is what type of application are you actually building?

Do you want live plotting with data streaming? webpages with BokehJS interaction? or both?

Going back to your PHP+Flask+Bokeh scenario: serving webpages with or without data-streaming should not be a problem (having PHP server acting as a proxy to load a SPA from Flask/Bokeh).

As far as I know once the page is served and loaded in the browser the communication is done directly between the Bokeh server and the webpage (so PHP server should not be involved).

The HTML controls (not Bokeh controls) on the page should however refer to the PHP server which in turn will communicate with the Flask REST API (e.g. to serve new type of plot from Bokeh server)

Having this said, it is difficult to understand the actual role of the PHP server there and I can only speculate on that without knowing the actual reasons…

Is it that Flask uses by default port 5000 and you want to use port 80? is it about https which is not default supported on Flask?

Maybe you could explain a little more about the application context and why are you targeting for this setup?

On Tuesday, February 5, 2019 at 2:16:26 AM UTC+1, Dave Wen wrote:

Hi folks,

My project is Flask+Bokeh to provide RESTful API to the frontend PHP web pages.

Currently, I see my plots on http://localhost:5000/bokeh

But I have no idea how to embed those plots into the PHP web pages.

any idea?

thanks,

Dave


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8a8d8794-b54a-4bf5-af6b-d51cc2eb9e94%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.