()
| 6 | ], function(Jupyter, utils){ |
| 7 | |
| 8 | function load_ipython_extension(){ |
| 9 | var notebookUrl = window.location.href |
| 10 | var baseUrl = utils.get_body_data('baseUrl'); |
| 11 | var baseNotebooks = baseUrl + "notebooks" |
| 12 | var n = notebookUrl.search(baseNotebooks) |
| 13 | var jupyterServerUrl = notebookUrl.slice(0, n) |
| 14 | |
| 15 | var register_comm = function() { |
| 16 | Jupyter.notebook.kernel.comm_manager.register_target('dash', |
| 17 | function (comm, msg) { |
| 18 | // Register handlers for later messages: |
| 19 | comm.on_msg(function (msg) { |
| 20 | console.log("Dash message", msg); |
| 21 | var msgData = msg.content.data; |
| 22 | if (msgData.type === 'base_url_request') { |
| 23 | comm.send({ |
| 24 | type: 'base_url_response', |
| 25 | server_url: jupyterServerUrl, |
| 26 | base_subpath: baseUrl, |
| 27 | frontend: "notebook" |
| 28 | }); |
| 29 | } else if (msgData.type === 'show') { |
| 30 | |
| 31 | } |
| 32 | }); |
| 33 | }); |
| 34 | }; |
| 35 | |
| 36 | Jupyter.notebook.events.on('kernel_ready.Kernel', register_comm) |
| 37 | } |
| 38 | |
| 39 | return { |
| 40 | load_ipython_extension: load_ipython_extension |
nothing calls this directly
no test coverage detected
searching dependent graphs…