• Stars
    star
    157
  • Rank 230,054 (Top 5 %)
  • Language
    HTML
  • Created almost 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Observable notebooks as R htmlwidgets

CRAN status CRAN Downloads Lifecycle: maturing R build status

robservable

This package allows the use of Observable notebooks (or parts of them) as htmlwidgets in R.

Note that it is not an iframe embedding a whole notebook -- cells are <div> included directly in your document or application. You can choose what cells to display, update cell values from R, and add observers to cells to get their values back into a Shiny application.

The following GIF shows a quick example of reusing a bar chart race notebook inside R with our own data.

example

You'll find more examples and the associated R code in the robservable gallery.

Features

  • Display an entire published or shared notebook as an htmlwidget
  • Display specific cells of a published or shared notebook as an htmlwidget
  • Use R data to update cell values
  • Add observers on cell values to communicate with a Shiny app
  • Use inside Shiny app, Rmarkdown or Quarto document (as any htmlwidget)

Limitations

Warning: in Quarto documents, you must either use robservable or ojs cells. Using both in the same document will make at least one of both fail.

  • Named cells can be included by name, but unnamed cells are refenced by their index (1-based), which is sometimes a bit tricky to determine. An alternative is to fork the notebook and name the cell in Observable.
  • No offline support : the included notebooks have to be downloaded each time they are used.

Installation

The package is on CRAN, but you can also install the development version with:

remotes::install_github("juba/robservable")

Usage

For an introduction and examples, see the introduction to robservable vignette.

For a small gallery of interesting notebooks, see the robservable gallery vignette.

For usage in Shiny, see the robservable in Shiny applications vignette (work in progress).

Development notes

This package uses packer to manage JavaScript source code and dependencies. If you want to modify it, you'll need a working installation of Node.js.

After cloning this repository, run the following in a terminal at the project root :

npm install

Then, if you modify the JavaScript code in srcjs, you'll have to run the following command to bundle and update the widget JavaScript code :

packer::bundle_dev()

If you want to ship a minimized production version, use :

packer::bundle_prod()

More Repositories

1

rmdformats

HTML output formats for RMarkdown documents
CSS
705
star
2

explor

Interfaces for Multivariate Analysis in R
R
186
star
3

pyobsplot

Observable Plot in Jupyter notebooks and Quarto documents
HTML
163
star
4

scatterD3

R scatter plot htmlwidget based on D3.js
JavaScript
157
star
5

color-theme-tangotango

An emacs color theme based on the tango palette colors
Emacs Lisp
149
star
6

shinyglide

Glide.js component for Shiny apps
R
90
star
7

questionr

R package to make surveys processing easier
R
81
star
8

obsplot

Observable Plot bindings for R
R
59
star
9

rainette

R implementation of the Reinert text clustering method
R
50
star
10

tidyverse

Introduction à R et au tidyverse
SCSS
43
star
11

uniquanti

Small JavaScript app to visualize basic statistics
JavaScript
42
star
12

bookup-html

Bookup custom Quarto HTML format
SCSS
38
star
13

rwos

R interface to Web of Science Web Services API
R
21
star
14

scatterD3_shiny_app

Minimal example shiny app for the scatterD3 package : https://github.com/juba/scatterD3
R
12
star
15

textile-mode

An emacs major mode for Textile markup language editing.
Emacs Lisp
6
star
16

khi2_slides

Présentation sur le test du Khi2
HTML
6
star
17

intro-r

(Obsolète) Introduction à R
PostScript
6
star
18

shiny_prenoms

Shiny app for french first names at birth dataset
R
6
star
19

texplor

Interactive Interfaces for Textual Analysis in R
R
5
star
20

timeline-generator

PDF timeline generator (Ruby, LaTeX, TikZ)
Ruby
5
star
21

presid2012-bureaux-lyon

Résultats du premier tour des présidentielles de 2012 dans les bureaux de vote de Lyon
R
2
star
22

archive_doc_khi2

Archive d'un document d'introduction au test du Khi2
TeX
2
star
23

rgrs

R package that provides functions for beginners and social sciences students or researchers (cross-tabulation, weighting, results export, and maps plotting).
R
2
star
24

presid2012-classif-communes

Classification des communes de France selon leurs votes au premier tour de l'élection présidentielle 2012
R
2
star
25

StableDiffusionNotebook

Stable diffusion custom notebook
Jupyter Notebook
1
star
26

advent-2023

Advent of code 2023
Python
1
star
27

umapscan

UMAP dimensionality reduction and DBSCAN clustering R helper package
R
1
star
28

rmarkdown_rlyon_2014

Slides de présentation de Rmarkdown à RLyon - 20/11/2014
CSS
1
star
29

org-seenthis

Interface between emacs' org-mode and seenthis.net
Emacs Lisp
1
star
30

js-exos

Questions-réponses en html/javascript
JavaScript
1
star