TileDB Cloud supports dashboards written in python (ipywidgets, panel) or R (shiny) via voila in Jupyter notebooks. Dashboards are built by first creating a notebook, then marking the notebook as a dashboard.

Any TileDB Cloud Notebook can be enabled as a dashboard by toggling in the notebook settings:

R Shiny

TileDB provides a R library, shinybg, which faciliates running R shiny applications inside jupyter notebooks. This allows the shiny app to run as a background process and for the shiny app to be displayed for use as a dashboard.

Example Shiny App

Using a shiny app in TileDB works in a similar manner to a standalone shiny app. The main change is using the renderShinyApp function provided by shinybg to display it. Below is a reproduction of the old faithful 101 shiny app. This is also available as a dashboard and notebook in TileDB Cloud.


ui <- fluidPage(
  titlePanel("Old Faithful Geyser Data"),
      sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30)

server <- function(input, output) {
  output$distPlot <- renderPlot({
    x <- faithful[, 2]
    bins <- seq(min(x), max(x), length.out = input$bins + 1)
    hist(x, breaks = bins, col = 'darkgray', border = 'white')

renderShinyApp(ui = ui, server = server)


Ipywidgets can be used directly in a jupyter notebook and rendered as a dashboard. Below is an example from the ipywidgets 2x2 tutorial. This can be used directly as a dashboard in TileDB Cloud. This is also available as a dashboard and notebook in TileDB Cloud.

from ipywidgets import FloatSlider
from ipywidgets import Button, Layout, jslink, IntText, IntSlider
from ipywidgets import TwoByTwoLayout
import bqplot as bq
import numpy as np

size = 100

x_data = range(size)
y_data = np.random.randn(size)
y_data_2 = np.random.randn(size)
y_data_3 = np.cumsum(np.random.randn(size) * 100.)

x_ord = bq.OrdinalScale()
y_sc = bq.LinearScale()

bar = bq.Bars(x=np.arange(10), y=np.random.rand(10), scales={'x': x_ord, 'y': y_sc})
ax_x = bq.Axis(scale=x_ord)
ax_y = bq.Axis(scale=y_sc, tick_format='0.2f', orientation='vertical')

fig = bq.Figure(marks=[bar], axes=[ax_x, ax_y], padding_x=0.025, padding_y=0.025,
                layout=Layout(width='auto', height='90%'))

max_slider = FloatSlider(min=0, max=10, default_value=2, description="Max: ",
                         layout=Layout(width='auto', height='auto'))
min_slider = FloatSlider(min=-1, max=10, description="Min: ",
                         layout=Layout(width='auto', height='auto'))
app = TwoByTwoLayout(top_left=min_slider,

jslink((y_sc, 'max'), (max_slider, 'value'))
jslink((y_sc, 'min'), (min_slider, 'value'))
jslink((min_slider, 'max'), (max_slider, 'value'))
jslink((max_slider, 'min'), (min_slider, 'value'))

max_slider.value = 1.5


Similar to ipywidget panel can be used directly in a jupyter notebook and a dashboard. Below is the example from "Build an app" in panel that can be used directly in TileDB Cloud as a dashboard. This is also available as a dashboard and notebook in TileDB Cloud.

import pandas as pd
import numpy as np
mport matplotlib.pyplot as plt
from matplotlib.figure import Figure

import matplotlib as mpl

def mpl_plot(avg, highlight):
    fig = Figure()
    ax = fig.add_subplot()
    if len(highlight): highlight.plot(style='o', ax=ax)
    return fig

def find_outliers(variable='Temperature', window=30, sigma=10, view_fn=mpl_plot):
    avg = data[variable].rolling(window=window).mean()
    residual = data[variable] - avg
    std = residual.rolling(window=window).std()
    outliers = (np.abs(residual) > std * sigma)
    return view_fn(avg, avg[outliers])

csv_file = 'https://raw.githubusercontent.com/holoviz/panel/main/examples/assets/occupancy.csv'
data = pd.read_csv(csv_file, parse_dates=['date'], index_col='date')

find_outliers(variable='Temperature', window=20, sigma=10)

Last updated