JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/brython-dev/brython/master/www/src/brython_dist.js"></script>
<script src="https://cdn.pydata.org/bokeh/release/bokeh-0.12.0.min.js"></script>
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-0.12.0.css">
<h1>Example of a Bokeh plot</h1>
<div id="myplot"></div>
<p>Pretty cool!!</p>
<script type="text/python">
from browser import document, window
import random
# 'importing' the library
Bokeh = window.Bokeh
plt = Bokeh.Plotting
# set up some data
M = 100
xx = []
yy = []
colors = []
radii = []
for y in range(0, M, 4):
for x in range(0, M, 4):
xx.append(x)
yy.append(y)
colors.append(plt.color(50+2*x, 30+2*y, 150))
radii.append(random.random() * 0.4 + 1.7)
# create a data source
source = Bokeh.ColumnDataSource.new({
'data': {'x': xx, 'y': yy, 'radius': radii, 'colors': colors}
})
# make the plot and add some tools
tools = "pan,crosshair,wheel_zoom,box_zoom,reset,save"
p = plt.figure({'title': "Colorful Scatter", 'tools': tools})
# call the circle glyph method to add some circle glyphs
circles = p.circle({'field': "x" }, {'field': "y" }, {
'source': source,
'radius': radii,
'fill_color': colors,
'fill_alpha': 0.6,
'line_color': None
})
# show the plot
mydiv = document['myplot']
plt.show(p, mydiv.elt)
</script>