From 99b98f9b2fee802db4b4c3557604330044338740 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 27 Feb 2018 09:15:38 -0500 Subject: [PATCH] BUG: only start comm if IJulia is inited closes #181 --- src/displays/ijulia.jl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/displays/ijulia.jl b/src/displays/ijulia.jl index 5176dfa7..8a289e11 100644 --- a/src/displays/ijulia.jl +++ b/src/displays/ijulia.jl @@ -222,12 +222,13 @@ prependtraces!(jd::JupyterDisplay, update::Associative=Dict(), # --------------------------------------------- # @require IJulia begin - init_notebook() + import IJulia using IJulia.send_comm # needed for _call_js above to work - - # set up the comms we will use to send js messages to be executed - global const _ijulia_eval_comm = Ref(IJulia.CommManager.Comm(:plotlyjs_eval)) - global const _ijulia_return_comms = ObjectIdDict() + global const _ijulia_eval_comm = Ref{IJulia.CommManager.Comm{:plotlyjs_eval}}() + if IJulia.inited + _ijulia_eval_comm[] = IJulia.CommManager.Comm(:plotlyjs_eval) + end + init_notebook() function IJulia.display_dict(p::JupyterPlot) if p.view.displayed