I try to use Holoviews with Bokeh backend in Hydrogen and I do not get any output plot. When I switch to Matplotlib backend for Holoviews it seems to work.
Steps to Reproduce
Sample Python code to reproduce the problem:
# %%
import sys
import holoviews
import holoviews.operation.datashader as hd
print('Python version: ' + sys.version)
print('Holoviews version: ' + holoviews.__version__)
# %%
holoviews.extension('bokeh')
holoviews.output(backend='bokeh')
# %%
import pandas as pd
import numpy as np
import datashader as ds
import datashader.transfer_functions as tf
from collections import OrderedDict as odict
num = 100000
np.random.seed(1)
dists = {cat: pd.DataFrame(odict([('x', np.random.normal(x, s, num)),
('y', np.random.normal(y, s, num)),
('val', val),
('cat', cat)]))
for x, y, s, val, cat in
[(2, -2, 0.10, 20, "d2"),
(-2, -2, 0.50, 30, "d3"),
(-2, 2, 1.00, 40, "d4"),
(0, 0, 3.00, 50, "d5")]}
df = pd.concat(dists, ignore_index=True)
df["cat"] = df["cat"].astype("category")
# %%
points = holoviews.Points(df.sample(10000))
points
# %%
agg = ds.Canvas().points(df, 'x', 'y')
hd.datashade(points) + hd.shade(holoviews.Image(agg)) + holoviews.RGB(np.array(tf.shade(agg).to_pil()))
If you replace bokeh backend by matplotlib (at top of file), it should work:
OS version:
I run Atom on macOS 10.15.
My Jupyter kernel run from a docker container based on this image: rapidsai/rapidsai-dev-nightly:0.15-cuda10.1-devel-ubuntu18.04-py3.7
Have you installed and activated any of the Hydrogen plugins below ?
[N] hydrogen-python
[N] Hydrogen Launcher
[N] Data Explorer
Logs
I got this Javascript related error in the output of the following python instruction:
holoviews.extension('bokeh')
SyntaxError: Unexpected token ?
at runCodeHere (/Users/bu2/.atom/packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/javascript.js:16:21)
at JavaScript.componentDidMount (/Users/bu2/.atom/packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/javascript.js:34:9)
at Ji (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:212:132)
at Sj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:255:229)
at exports.unstable_runWithPriority (/Users/bu2/.atom/packages/Hydrogen/node_modules/scheduler/cjs/scheduler.production.min.js:19:467)
at cg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:325)
at Jj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:248:370)
at yj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:239:376)
at /Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:123:115
at exports.unstable_runWithPriority (/Users/bu2/.atom/packages/Hydrogen/node_modules/scheduler/cjs/scheduler.production.min.js:19:467)
at cg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:325)
at fg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:123:61)
at gg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:496)
at Ig (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:230:156)
at Object.enqueueForceUpdate (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:133:76)
at ResultViewComponent.F.forceUpdate (/Users/bu2/.atom/packages/Hydrogen/node_modules/react/cjs/react.production.min.js:12:456)
at e.onInvalidate (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx-react/dist/mobxreact.cjs.production.min.js:1:3180)
at e.runReaction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:26685)
at runReactionsHelper (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28732)
at reactionScheduler (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28230)
at runReactions (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28314)
at endBatch (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:23125)
at _endAction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:14750)
at executeAction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:14121)
at OutputStore.n (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:13939)
at /Users/bu2/.atom/packages/Hydrogen/lib/result.js:66:23
at /Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:379:9
at /Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:312:9
at wrappedOnResults (/Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:78:5)
at future.onIOPub (/Users/bu2/.atom/packages/Hydrogen/lib/ws-kernel.js:49:7)
Expected behavior
I want to plot in Hydrogen with Holoviews (so then I can use interactive Datashader)
Prerequisites
Description
I try to use Holoviews with Bokeh backend in Hydrogen and I do not get any output plot. When I switch to Matplotlib backend for Holoviews it seems to work.
Steps to Reproduce
Versions
OS version: I run Atom on macOS 10.15. My Jupyter kernel run from a docker container based on this image: rapidsai/rapidsai-dev-nightly:0.15-cuda10.1-devel-ubuntu18.04-py3.7
Hydrogen version: Hydrogen 2.14.3
Plugins
Have you installed and activated any of the Hydrogen plugins below ?
Logs
I got this Javascript related error in the output of the following python instruction:
SyntaxError: Unexpected token ? at runCodeHere (/Users/bu2/.atom/packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/javascript.js:16:21) at JavaScript.componentDidMount (/Users/bu2/.atom/packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/javascript.js:34:9) at Ji (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:212:132) at Sj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:255:229) at exports.unstable_runWithPriority (/Users/bu2/.atom/packages/Hydrogen/node_modules/scheduler/cjs/scheduler.production.min.js:19:467) at cg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:325) at Jj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:248:370) at yj (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:239:376) at /Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:123:115 at exports.unstable_runWithPriority (/Users/bu2/.atom/packages/Hydrogen/node_modules/scheduler/cjs/scheduler.production.min.js:19:467) at cg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:325) at fg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:123:61) at gg (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:122:496) at Ig (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:230:156) at Object.enqueueForceUpdate (/Users/bu2/.atom/packages/Hydrogen/node_modules/react-dom/cjs/react-dom.production.min.js:133:76) at ResultViewComponent.F.forceUpdate (/Users/bu2/.atom/packages/Hydrogen/node_modules/react/cjs/react.production.min.js:12:456) at e.onInvalidate (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx-react/dist/mobxreact.cjs.production.min.js:1:3180) at e.runReaction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:26685) at runReactionsHelper (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28732) at reactionScheduler (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28230) at runReactions (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:28314) at endBatch (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:23125) at _endAction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:14750) at executeAction (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:14121) at OutputStore.n (/Users/bu2/.atom/packages/Hydrogen/node_modules/mobx/lib/mobx.min.js:1:13939) at /Users/bu2/.atom/packages/Hydrogen/lib/result.js:66:23 at /Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:379:9 at /Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:312:9 at wrappedOnResults (/Users/bu2/.atom/packages/Hydrogen/lib/kernel.js:78:5) at future.onIOPub (/Users/bu2/.atom/packages/Hydrogen/lib/ws-kernel.js:49:7)
Expected behavior
I want to plot in Hydrogen with Holoviews (so then I can use interactive Datashader)
Thanks for your help.