File tree Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ def find_tag(file, tag):
180180
181181neo_vis_js_cell = '''\
182182 %%javascript
183+ var output_area = this;
183184requirejs(['neovis.js'], function(NeoVis){
184185 var config = {
185186 container_id: "viz",
@@ -200,8 +201,9 @@ def find_tag(file, tag):
200201 let command = "image_src = '" + imageSrc + "'";
201202 kernel.execute(command);
202203
203- var nb = Jupyter.notebook;
204- var cell = nb.select_next().get_selected_cell();
204+ var cell_element = output_area.element.parents('.cell');
205+ var cell_idx = Jupyter.notebook.get_cell_elements().index(cell_element);
206+ var cell = Jupyter.notebook.get_cell(cell_idx+1);
205207 cell.set_text("HTML('<img id=\\ "viz-image\\ " width=\\ "300px\\ " src=\\ "%s\\ " />' % image_src)")
206208 cell.execute();
207209 });
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments