-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Allow for a supplementary notebook editor pane associated with a main notebook document for holding outputs #143244
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
Comments
|
I love this idea and technically it's doable.
It's similar to opening the same notebook file in two editor groups side by side, they should be connected to the same underlining kernel. The two editors will load output renderers into their webview, but the renderers, e.g., ipywidgets, should be communicating to the same kernel objects in the extension host. Current Jupyter infrastructure would allow multiple frontends connected to the same backend/server. Making it generic might need more thinking about how to hook up renderers in the Output editor pane but we can build something already in Jupyter:
On the other hand, it reminds me of interactive window somehow. If we allow open an interactive window side by side and connect to the same kernel, would it already work as expected? |
|
This is an interesting idea. Questions that crossed my mind while reading through it. No need to answer those right now.
|
|
+1 on doing this. Super cool idea. I think we could just use the interactive window with some tweaks to do this. We already want to support opening the interactive window as a 'scratchpad'. Doesn't seem very hard to make just mirror output instead/in addition to that. |
|
From the questions Kai posted above, it seems there are two potential UX in our discussions here, one is dragging an output to another editor, or in other words, mirroring outputs, while another one is allowing to render input and output side by side (might include scrolling sync). We can try using the intearctive window for the former idea. The later reminds me of how Xcode playground works |
|
@kieferrm @rebornix Sorry for the late reply. Didn't have a free cycle until now. I did have a few thoughts while designing this around some of these questions already. Considerations here are all based around how I think I would use this. With the usual caveat that I'm not a data scientist and just a dogfood noodler :).
I considered this as a 1:1 mapping between each notebook editor and a single possible output editor. My thought was that one output editor per document would simplify the UI some. Like if I have a button to move the output I don't need to worry about which output editor to send that output to. I can see an argument for wanting to put a plot from Cell 1 in one editor and a plot from Cell 2 in another. But 1:1 felt like a clean solution that would probably solve 95% of customer usages. And if the basic machinery is in place I think it wouldn't be hard to scale that up to more possible editors later.
I can see that as well. I like the independent scrolling as a concept as I think that I often have a single output that I'm manipulating and I want to place it further up my file next to another output or next to an earlier cell. But I can see frustration in having to sync up cells to match. In my design I was seeing those [input] and [output] small indicators as buttons that would sync the other pane, but the idea of locking them or always focusing the output when the input is focused is good as it wouldn't require extra user actions.
Yup, the controls and controller are all in the main file. Feels confusing to keep just the output around.
Honestly this one I didn't consider, and it's interesting. For simplicities sake I want to say "just open it in a normal editor and re-pop the output" but I think that I probably would want my popped output state restored.
Yup, that's how I was seeing it |
|
this is exactly what Jupyter Notebook does in vscode - all the code on the left hand side and all the output on the right hand side. this layout works much better than how the C# notebook works for the following reasons -
we are trying to switch from Jupyter Notebook (python code) to C# Notebook because the library we use is in C#. we have to have an interop layer between python code and the C# library which is problematic. but how the layout works with C# notebooks is making it difficult to switch. if it works with Jupyter Notebook in vscode it means it's definitely possible. it would be a great feature to implement. |
@Maoni0, can you show me what you mean? I didn't think the side-by-side functionality is available in vscode even for jupyter notebooks yet. |
|
fwiw, I suppose another possible approach at implementation would be to add the ability to independently allow users to collapse (and uncollapse) any combination of the code and output of a notebook cell and then to have commands to collapse-all-code, expand-all-code, collapse-all-output, and collapse-all-output. The idea is that this collapsing functionality might be useful in its own right, and with that in place, the already-existing ability to split the window would go pretty far to getting what is being proposed. A user could just split the window, collapse all output on the left and collapse all code on the right. (And actually, the ability to simply split the window and scroll the left-side to the code and the right-side to the output of the cell, actually solves one of my current personal use-cases.) |
|
Hi @teichert, What we want is to have similar behavior for .NET Interactive notebooks like python notebooks running in vscode that has been done for many years where the result of the cell execution is available side by side such as: As opposed to the more traditional notebook style of displaying the result below the cell such as: In other words, we'd like the chart to show up in the interactive window running the .NET Interactive kernel: Currently we can create a Jupyter Interactive window that can make use of the .NET Interactive kernel: However, this feature currently entails that we have to manually enter all our expressions in the single cell to execute: Do let me know if you have any further questions. |
|
Thanks, @mrsharm! I was trying to figure out how to even do that for python, and you helped me get the answer. btw, for anyone else finding this while trying to figure out how to even get the side by side working with python notebooks, note that the "Jupyter: Convert to Python Script" command makes it easy to convert to the .py format if that is applicable. Of course, the .ipynb format may have some separate use-cases since results are stored in the file. |











Partially inspired by the SxS output comment in this issue here #142455 I sketched up a quick proposal for a notebook editor feature that I would really like.
What I would like is that if I have a notebook document open I could move outputs from it into a fully separate editor pane. In this editor pane the outputs could be reordered and scrolled separate from the main notebook document. Instead of a new editor instance this output document would be connected to the same controller as the main document so widgets and whatnot would all work as expected if different output cells are in different panes. The UI controls would all still be in the main document and when a cell is re-executed in the main document the output is updated in the supplemental output document.
This UI feels similar in execution to the interactive window to me, except that instead of a running history log it's just the notebook outputs.
Since this output document is a full editor pane it would allow the following scenarios:
There is a big question here of if / how we can have two different editor panes sharing a notebook controller and communications, but just leaving that slightly to the side for now to just look at the UI bits.
The text was updated successfully, but these errors were encountered: