I’m experimenting with BokehJS only (and no Python code). As an example, the code below works, with JS only.
Similarly, how to create a slider with BokehJS and no Python code?
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.1.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-api-2.4.1.min.js"></script>
<div id="chart1">
</div>
<script>
var plt = Bokeh.Plotting, M = 100, xx = [], yy = [], colors = [], radii = [];
for (var y = 0; y <= M; y += 4) {
for (var x = 0; x <= M; x += 4) {
xx.push(x);
yy.push(y);
colors.push(plt.color(50+2*x, 30+2*y, 150));
radii.push(Math.random() * 0.4 + 1.7)
}
}
var source = new Bokeh.ColumnDataSource({data: {x: xx, y: yy, radius: radii, colors: colors}});
var p = plt.figure({title: "Colorful Scatter", tools: "pan,crosshair,wheel_zoom,box_zoom,reset,save"});
var circles = p.circle({ field: "x" }, { field: "y" }, {source: source, radius: radii, fill_color: colors, fill_alpha: 0.6, line_color: null});
plt.show(p, "#chart1");
</script>