Implementing AJAX DataSource in Pyramid framework

(apologies - deleted first post to make a new more detailed post)

I’m having a little trouble implementing a webpage that uses AJAX to update the bokeh plot embedded within an html page.

See below specific file where I’m trying to implement it:

https://github.com/hhprogram/PyramidSite/blob/master/webgraphing/views/ajaxView.py

You should be able to just clone the whole webgraphing repo to your machine to run the pyramid webpage locally. You can then run the pyramid serve using pserve deveopment.ini and then navigate to ‘localhost:6543/bokehAJAX’ in your browser. Looking at the javascript console it seems to be embedding the bokeh div in my html except the div has width of zero. The ultimate goal is there should be a bokeh line graph figure on the page that periodically updates and adds data to the line graph. I’m not really too sure what I’m doing wrong here - any push in the right direction would be much appreciated. Thanks

Found the issue of why the bokeh graph wasn’t being displayed. I did get the INLINE.render_js() object and thus my html didn’t have that required object so I was getting a javascript error Reference error: bokeh not defined and thus no bokeh plot being displayed.

Hope this helps someone else. Link my stack over flow post (https://stackoverflow.com/questions/48454388/bokeh-implementing-ajax-datasource-in-pyramid-framework?noredirect=1#comment83906394_48454388)

Also, found this post helpful as well : https://stackoverflow.com/questions/37083998/flask-bokeh-ajaxdatasource

···

On Monday, January 22, 2018 at 11:31:13 AM UTC-8, Harrison wrote:

(apologies - deleted first post to make a new more detailed post)

I’m having a little trouble implementing a webpage that uses AJAX to update the bokeh plot embedded within an html page.

See below specific file where I’m trying to implement it:

https://github.com/hhprogram/PyramidSite/blob/master/webgraphing/views/ajaxView.py

You should be able to just clone the whole webgraphing repo to your machine to run the pyramid webpage locally. You can then run the pyramid serve using pserve deveopment.ini and then navigate to ‘localhost:6543/bokehAJAX’ in your browser. Looking at the javascript console it seems to be embedding the bokeh div in my html except the div has width of zero. The ultimate goal is there should be a bokeh line graph figure on the page that periodically updates and adds data to the line graph. I’m not really too sure what I’m doing wrong here - any push in the right direction would be much appreciated. Thanks