Permanently linking sections of two jupyter notebooks - jupyter-notebook

I have two jupyter notebooks. The middle sections of both are identical, being code to create charts. But for various reasons, the first sections (data inputs) and end sections (the charts themselves) are different.
I want to link the middle sections, so when I change the code for the charts, I can do it in just one file, and the changes will automatically show in the second.
%%writefile in one file and %load to recreate the middle sections works, but isn't a good solution, as I am often revising the charts. Is there a better solution?

Related

Displaying Plotly figures in full screen in Jupyter notebooks

The bounty expires in 7 days. Answers to this question are eligible for a +500 reputation bounty.
Mikko Ohtamaa wants to draw more attention to this question.
I have large Plotly figures and tables in my Jupyter Notebook and Sphinx-based documentation. Because the documentation page is already crowded, I would like to give the user an option to
Display these figures in a full-screen pop-up
or
Make tables scrollable instead of compressed columns, as the table layout with many columns do not work when embedded on a page
An example of a broken layout:
Does Plotly.py offer ways to achieve this easily? If it doesn't, can I somehow include external JavaScript on the generated Sphinx documentation page for the same effect?

how to show multiple plots into a jupyter notebook page, without "subpages"

I've done a code in a jupyter notebook cell which draws many different plots and everything works fine, except the way jupyter show them, which I do not like very much, as you can see in the following picture
As you can see, plots are reported into a kind of subpage with a scroll bar by side, while what I'd like is just a sequence of such plots into the some page where I've written the code, without any annoying subpage or the like.
Can you suggest me anything, please?

Is there a way to keep editing cell and rendered cell open at the same time in a Jupyter Notebook?

I.e. for one cell in the notebook, the editing version and rendered version are presented side-by-side so you don't lose your place between editing and checking the rendered version. Particularly for Markdown cells.
Are there any plugins or add-ons which achieve this? Perhaps there is a hacky way to have two browser windows where one updates rendered cells in real time and the other is used for editing. I guess even something as simple as the "render cell" command being piped to a different window would do the trick.

Embedding a scrollable collection of plots in a widget

I am trying to write a graphical file dialog for navigating the filesystem and previewing and opening files in the format that is relevant to to my visualisation and analysis program. The idea is to provide a much more efficient way of selecting a file to analyse, than is possible with the standard file dialog. The dialog I want to create should
show directories
show a graphical preview of the data contained in the files which match the format of interest
show (perhaps as a watermark) some textual identification of the file (this might be the filename, or some other information extracted from the file)
not make the elements representing the directories and files too small when there are many of them to be shown (by leaving some of them effectively invisible beyond the limits of the widget)
be navigable (and scrollable when there are too many to be shown at once) with keyboard and mouse
allow selection of directories and files with keyboard and mouse
With the above information describing my broader goal, my specific question is: How can I embed a (potentially large) number of plots inside some widget, with a lower limit on the size of the component plots, and provide the possibility to scroll (using keyboard and mouse) through the whole set of plots (with the widget acting as a window through which only a subset of all the plots can be seen)?

Altering The Sorting Arrows In an R Shiny tabPanel

I didn't see anything here or in http://shiny.rstudio.com/reference/shiny that seems to hit on this problem.
In an R Shiny tabPanel output, the sorting arrows align with the right side of the search fields at the bottom of the page.
Here's a pretty good example:
http://shiny.rstudio.com/gallery/datatables-options.html
Is there a way to make them align just to the right of the column name text up top?
Alternatively (or possibly both), is there a way to change the color of the arrows?
The default greyish doesn't really stand out. Bonus points to make the up and down arrows different colors.
Doing it directly in RShiny is best, but I could muddle my way through .js or .css if needed.
I'm trying to head off imminent support requests of "the column is sorting wrong" and "I can't see the arrows" before I push into production.
At the bottom of that shiny example you showed they show that you can pass in through the options parameter options to the rendering for the DataTable table, via the shiny::renderDataTable() function.
Hopefully the http://datatables.net/ site has documentation on what you want if it's indeed possible
If you look at Developer Tools on the http://shiny.rstudio.com/gallery/datatables-options.html page maybe you can see what element would need to be changed.

Resources