Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to request a Kernel *without* creating editable code cells #102

Open
choldgraf opened this issue Jan 14, 2019 · 1 comment

Comments

@choldgraf
Copy link
Collaborator

I've been thinking for a while about how Thebelab could mimic the functionality of nbinteract (https://www.nbinteract.com). I think that one easy step could be something like the following:

  1. Expose a configuration option that would request the kernel but wouldn't create
    CodeMirror cells (e.g. codeMirror: false). This would add the Thebelab output area, but wouldn't change the input area.

  2. Document (or create a function for) running the code for a subset of cells (e.g. runSelector: "[data-executable data-execute-on-bootstrap]"). This would basically do (after the kernel is created):

    thebelab.events.on("request-kernel")((kernel) => {
     document.querySelectorAll(`${runSelector}`).forEach((item) => {
       return kernel.requestExecute({code: <item contents>})
    }});

Thus, you could create notebooks with the expectation that they'd render interactive plots backed by a kernel, but where the users would only need to click a button to create those plots.

What do folks think about that?

@minrk
Copy link
Collaborator

minrk commented Jan 15, 2019

Since execution without user input necessarily requires custom javascript to trigger the execution, I think this one should probably be handled by requesting the kernel explicitly, rather than relying on thebelab bootstrap to do it.

thebelab.requestKernel(kernel => {
    ...

I'll have to see what hooking up output areas looks like for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants