Skip to main content

Observable Notebooks and Cells in Shiny

Project description

shinyobservable

Embed Observable Notebooks in Shiny for Python.

Shinyobservable makes it a breeze to integrate libraries such as D3.

Create any kind of JavaScript visualizations and let Shiny handle your data and interactivity.

Features

  • Embed entire notebooks
  • Embed selected cells only
  • Update data cells to update visualizations

Installation

pip install shinyobservable

# Dev
pip install git+https://github.com/eodaGmbH/py-shiny-shinyobservable

Quickstart

from htmltools import a
from shiny.express import ui
from shinyobservable import Observable, ObservableRenderer

NOTEBOOK = "https://observablehq.com/@d3/zoomable-sunburst"

ui.h1("Observable Notebook in Shiny")
ui.div(a(NOTEBOOK, href=NOTEBOOK, target="_blank"))
ui.hr()

# Render entire notebook
@ObservableRenderer
def render_notebook():
    return Observable(NOTEBOOK)


# Render single cells only
@ObservableRenderer
def render_cells():
    return Observable(NOTEBOOK, cells=["chart"])

Enjoy your Observable Notebook in Shiny!

See this example on how to update the data of your notebook.

Docs

https://eodagmbh.github.io/py-shiny-observable/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shinyobservable-0.2.0.tar.gz (27.0 kB view hashes)

Uploaded Source

Built Distribution

shinyobservable-0.2.0-py3-none-any.whl (27.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page