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 (python - Bokeh: Implementing AJAX DataSource in Pyramid framework - Stack Overflow)

Also, found this post helpful as well : Flask + Bokeh AjaxDataSource - Stack Overflow

···

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