jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.59k stars 4.86k forks source link

add Cell to DOMWidget / autocompletion if using text div #1660

Open hainm opened 8 years ago

hainm commented 8 years ago

Hi,

I should ask this question on maillist but it's hard to express without an image. So I post here.

Basically I have a DOMWidget (from ipywidgets) that display biomolecule.

cell

I would like to use the DOMWidget in full screen mode and want to add a command text box in the full screen.

            var cell = Jupyter.notebook.get_selected_cell();
            var cell_el = cell.element;
            cell_el.css("position", "absolute")
                   .css("bottom", "20%")
                   .appendTo(this.$container);

this does not work when running the Cell (the DOMWidget and the Cell were rerun)

            $inputNotebookCommand.keypress(function(e){
                var command = $("#input_notebook_command").val();
                if (e.which == 13){
                    $("#input_notebook_command").val("")
                    Jupyter.notebook.kernel.execute(command);
                }
            });

I would like to implement autocompletion for the text box but don't know how.

Can you point me to where I should read? The final aim is to bring a Jupyter cell-like to DOMWidget in full screen mode. thanks.

Hai

gnestor commented 8 years ago

@SylvainCorlay Any ideas?