I am trying to find a way to make a FlexDashboard (using Shiny runtime) accessible to a colleague without access to the internet.
To provide my colleague with the full interactive experience (drop-down menus etc), I was thinking of simply installing R on my colleagues laptop and share the markdown script with them but does anyone know a way to lock the script for edits?
I just want to make sure that there is no accidental edits which might mess up the running of the markdown.
Look forward to hearing any inputs!
I would create a shiny application tweak it perfectly and then write a docker script to run they shiny application as an independent entity,
Your friend can use that docker container to run the dashboard and interact with it, but has no need of opening the script or anything else, just bake all the functionality into the shiny application and call the docker container and the flexdashboard will publish to a console.
Related
I've some shiny app and I want to execute and to make it standalone application (it will be awesome if it will open via chrome).
I can't upload the app to the Net and I want that also co-workers without R studio or R
will use this app.
because of the security company - I can't download any software except R packages.
I saw here a few solution, but all of them included any software download.
I have done some research on this issue. The commenters are basically correct: you need the R binaries in some way, either a portable R or an R server. But there are solutions that allow it to bundle those with your code and hide the details from your users.
On option is to wrap your app along with
a portable R into a container application like Electron. The electron-quick-start project tries this.
The RInno package provides functions to bundle your app and R portable into an installer app. Every user runs the installer on their system once which will install your app, the packages and the code. But in the end users may not see the difference to other apps. They get a link in the start menu and that's it. I did that successfully. But it did not work out of the box. I had to adjust the output manually in several places.
A second container solution works with docker. That is what ShinyProxy does. See also this blog.
The package shinyShortcut (I quote) "will produce an executable file that runs the shiny app directly in the user's default browser".
Important to note: I haven't tested most of them. From reviewing the solutions I often get the feeling that these solutions might make releases somewhat complicated because there are always manual steps involved.
Is there an optimal way to share/serve a readonly-ish Jupyter notebooks with the input code cells hidden, but connected to a live kernel so users can interact with widgets?
I understand there are ways to embed data for widgets, but often the widgets require rerunning a query against a larger data sets.
I've recently started learning to use widgets and they'd be really useful to share interactive data with our non-technical staff, but I haven't figured out a good way to do so yet.
Having this capability would also reduce the desire for expensive tools like Tableau.
If you use kyso.io (disclaimer: I founded kyso) you can share notebooks online easily:
It will you can show/hide code so non-technical people can read it
Interactive visualisations work perfectly, like bokeh and plotly.
Heres some examples:
https://kyso.io/laura/bokeh-example
https://kyso.io/laura/gauss-fitting
you can share a notebook using these commands
kyso create "some study title"
kyso push "a version message"
Currently the notebooks are static renderings, but soon we are going to host
runnable Jupyter dashboards.
Take a look Apache Zeppelin https://zeppelin.apache.org. Which is closest opensource software that you can share a notebook with code hidden and let other users run it. Apache Zeppelin has Dynamic form, which is not exactly widgets but used for the same purpose. Zeppelin supports notebook level access control so you can achieve what you want.(disclaimer: I'm creator of Apache Zeppelin)
You can also take a look notebook sharing service https://www.zepl.com. Which enables
Access control on the notebook
Notebook updates auto synced from Github / S3
Report looknfeel (Hide code for non-technical people)
Comments on the cells
Team and Workspace to organize sharing
Both Jupyter notebook and Zeppelin notebook format support
This can be an possible alternative on sharing your notebook with non-technical users. (disclaimer: I'm co-founder of ZEPL)
I have a Jupyter Notebook that plots some data and lets the user interact with it via a slider.
What would be the easiest way to make a web app with a similar functionality? (reusing as much of the code...)
I believe the easiest way is to use voilà.
After installing you just have to run:
voila <path-to-notebook> <options>
And you will have a server running your notebook as a web app, with all the input code omitted.
AppMode is "A Jupyter extension that turns notebooks into web applications".
From the README:
Appmode consist of a server-side and a notebook extension for Jupyter.
Together these two extensions provide the following features:
One can view any notebook in appmode by clicking on the Appmode button in the toolbar. Alternatively one can change the url from
baseurl/notebooks/foo.ipynb to baseurl/apps/foo.ipynb. This also
allows for direct links into appmode.
When a notebook is opened in appmode, all code cells are automatically executed. In order to present a clean UI, all code cells
are hidden and the markdown cells are read-only.
A notebook can be opened multiple times in appmode without interference. This is achieved by creating temporary copies of the
notebook for each active appmode view. Each appmode view has its
dedicated ipython kernel. When an appmode page is closed the kernel is
shutdown and the temporary copy gets removed.
To allow for passing information between notebooks via url parameters, the current url is injected into the variable
jupyter_notebook_url.
To be complete - there exists also https://www.streamlit.io/ .
I still dont understand the exact difference between voila and streamlit.
At the moment I just struggle with the possibility to re-run everything with new parameters... I have bad luck with voila still.
Edit: I see that streamlit requires a raw python, not .ipynb, this fact would mean that this answer is completely wrong, I will search a bit more on streamlit before further action/comment.
Edit2: Voila looks great. However, I found few things that uncover the underlying complexity and thus a troubles that may arise.
callbacks. Widgets work great in jupyter, but since it is not possible to re-run one cell, sometimes the logic must be modified to work in Voila.
interactive java objects need a special treatment, e.g. matplotlib has a cheap solution, but there was nothing for e.g. jsroot
links. It is easy to create (a file and) a download link in jupyter, Voila can also serve a file, but it needs another extra treatment.
After all, I pose myself a question - is it better to learn many tricks and modifications to jupyter or to use some other system? I am going to see if streamlit can give em some answer.
The Jupyter Dashboards Bundlers extension from the Jupyter Incubator is one way to do it while retaining interactivity.
EDIT: While pip installing this package will also install the cms package dependency, like dashboard_bundlers, cms needs to be explicitly enabled/quick-setup as a notebook extension for the dashboard tools to work.
#raphaelts has the right idea and should be the accepted answer. As of Dec 2019, Voila is the most appropriate method to deploy Jupyter notebooks to production as a stand alone webapp. Think internal datascience teams sharing their analytics workload with internal C-Suite teams using SPA stlye Notebooks with all the code hidden and custom GUI/interactions thrown in. Recently discussed on HN
https://news.ycombinator.com/item?id=20160634 and the official announcement from the Jupyter maintainer https://blog.jupyter.org/and-voil%C3%A0-f6a2c08a4a93enter link description here
As mentioned above, voilà is a very powerful tool which hides the input cells from your notebooks and therefore provides a clean interface. In order to deploy your notebook with voilà you need to follow the specific steps of your organization. But if you want to quickly run it on your machine, simply install it with pip install voila. Then you can enter start from the command-line: voila my_notebook.ipynb or use the "Voila" button which should have appeared in your Jupyter notebook.
Note, however, that using voilà is only one part of the story. You also need to build the required interactivity, ie. to set up how to respond to input changes. There are quite a few frameworks for this.
The simplest one is to use the interact function or the observe method from the Ipywidgets library. This is very direct, but things can easily get out of control as you start having more and more widgets and complexity.
There are complete frameworks, some of them mentioned above. E.g. streamlit, dash and holoviz. These are very powerful and suited for larger projects.
But if you want to keep it simple, I also recommend to check out autocalc. It is a very easy-to-use library, which lets you define the dependencies between your widgets/variables and let all the recalculation be triggered automatically. A tutorial can be found here.
Disclaimer: I am the author of the autocalc package.
The easiest way is to use the Mercury framework. You can reuse all your code. To convert the notebook to web app you will need to add the YAML header in the first cell of the notebook (very similar to R Markdown). The widgets are generated based on YAML. The end-user can tweak widgets values and click the Run button to execute the notebook from the top to the bottom. You can easily hide the notebook's code (if you want) by setting the show-code: False in the YAML. The example notebook and corresponding web app are below.
Example of the notebook with YAML header
Example web app generated from notebook with Mercury
Suppose I've created my wonderful IPython notebook (that is, a .ipynb file).
Now, is it possible to make it available for users of my website/blog?
With "available" I mean the following: they arrive to my website, find the notebook and immediately start to play with it (run code, display plots, change parameters etc etc)... But, without need the need to install anything on their local machine.
I already know the existence of Jupyther, that make it possible to share notebooks. But, as in this example, what the user would find is a simple web page, and in order to run the code he would have to download the .ipynb --> save it in local machine ---> open it with a pre-installed IPython interpreter.
This is something I would like to avoid.
Hope I was clear.
Thanks in advance for your time.
Gabriele
You can use tmpnb, which provides temporary notebook servers that get discarded after a while. If you want to have a different UI that better fits into a blog post, have a look at thebe.
I am trying to build a Rstudio/Shiny App and post it in our intranet so that everyone else in our office could see it. I am a windows guy, and the instructions online about how to setup a shiny server within Linux environment is a bit difficult for me. Is there an easy way that I can could accomplish this goal without messing up with Linux. Even if I have to do so, is there an easy way to just have my webpage available to people within our company, not everyone on the internet. Thanks!
you don't need shiny server for this, you just need to run an R instance with shiny
http://rstudio.github.io/shiny/tutorial/#ui-and-server
http://shiny.rstudio.com/
shiny automatically runs it at local host...
you need to change it to your own ip if you want your colleges be able to access it..
ip="192.168.178.10" # change this!
runApp("../microplate",host=ip) # change microplate to the name of your shiny package/app
RStudio also has a hosted Shiny option that is currently in Alpha. You can sign up here https://www.shinyapps.io/admin/#/signup
With hosted Shiny the intention is to let developers focus on building applications while RStudio will worry about managing servers, monitoring performance, and ensuring uptime.
I am sharing apps using the following:
runApp(list(ui=ui, server=server), host="0.0.0.0", port=1234)
(if your ui.R and server.R are in the same file)
runApp("C:/shinyapp", host="0.0.0.0", port=1234)
(if you have an ui.R and a server.R files as 2 files in the shinyapp folder)
After, I send my IP followed by the port that I set up as an hyperlink. Assuming that my IP is 192.168.178.10, I will send:
http://192.168.178.10:1234
Monitoring a shiny app shared in my internal network