you might be interested in <a href="http:&#x2F;&#x2F;demo.bokehplots.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;demo.bokehplots.com&#x2F;</a> which are all examples of bokeh apps that use websockets to allow you to run python functions based on user interactions with plots. the code for all the examples is linked from that page also.