There is a full-featured javascript runtime &quot;BokehJS&quot; which is designed from the ground up to be driven by remote (aka server-side) models, which are sent over the wire as JSON.  The server-side models are generated programmatically via Python, R, Scala, etc.  The cool thing is that a lot of the interactivity is completely native in BokehJS, so you can build interactive Javascript visualizations <i>from Python</i>, and have an entirely static HTML document that embeds a lot of rich interactivity.<p>See, for instance, Sarah Bird&#x27;s excellent GapMinder example:
<a href="http:&#x2F;&#x2F;nbviewer.jupyter.org&#x2F;github&#x2F;bokeh&#x2F;bokeh-notebooks&#x2F;blob&#x2F;master&#x2F;tutorial&#x2F;00%20-%20intro.ipynb#Interaction" rel="nofollow">http:&#x2F;&#x2F;nbviewer.jupyter.org&#x2F;github&#x2F;bokeh&#x2F;bokeh-notebooks&#x2F;blo...</a><p>When you move the slider, it generates JS events which drive model updates completely in the browser, which then update the objects that comprise the plot.  All of that is built straight from Python, but there is no Python kernel running in the background.<p>Bokeh also lets you write your event handlers in Python, and reside on the server, and get called back automatically when the user interacts with the plot in some way.  Check out this app for example: <a href="http:&#x2F;&#x2F;demo.bokehplots.com&#x2F;apps&#x2F;selection_histogram" rel="nofollow">http:&#x2F;&#x2F;demo.bokehplots.com&#x2F;apps&#x2F;selection_histogram</a>
You can use the lasso tool to select some points, and that computes a new sub-histogram.  Here is the entirety of the code for it: <a href="https:&#x2F;&#x2F;github.com&#x2F;bokeh&#x2F;bokeh&#x2F;blob&#x2F;master&#x2F;examples&#x2F;app&#x2F;selection_histogram.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bokeh&#x2F;bokeh&#x2F;blob&#x2F;master&#x2F;examples&#x2F;app&#x2F;sele...</a><p>For more deep-dive on the architecture, you can start at this slide and walk through:
<a href="http:&#x2F;&#x2F;www.slideshare.net&#x2F;misterwang&#x2F;bokeh-tutorial-pydata-strata-san-jose-2015&#x2F;18" rel="nofollow">http:&#x2F;&#x2F;www.slideshare.net&#x2F;misterwang&#x2F;bokeh-tutorial-pydata-s...</a><p>Or you can watch this webinar recording (start at the 19 minute mark): <a href="https:&#x2F;&#x2F;continuum-analytics.wistia.com&#x2F;medias&#x2F;f6wp9dam91" rel="nofollow">https:&#x2F;&#x2F;continuum-analytics.wistia.com&#x2F;medias&#x2F;f6wp9dam91</a>