/databricks-skills:cookbook-visualizationsfrom databricks-skills
Creates charts, graphs, and map visualizations in Databricks Apps using Streamlit, Dash, or Reflex. Covers bar, line, area charts and interactive maps with Folium.
Ships in databricks-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create charts, graphs, and interactive maps in your Databricks App using data from Unity Catalog tables.
Streamlit has built-in chart components. Load data from a UC table, then visualize:
import streamlit as st
from databricks import sql
from databricks.sdk.core import Config
import pandas as pd
cfg = Config()
@st.cache_resource(ttl=300)
def get_connection(http_path):
return sql.connect(
server_hostname=cfg.host,
http_path=http_path,
credentials_provider=lambda: cfg.authenticate,
)
def read_table(table_name, conn):
with conn.cursor() as cursor:
cursor.execute(f"SELECT * FROM {table_name} LIMIT 1000")
return cursor.fetchall_arrow().to_pandas()
conn = get_connection("/sql/1.0/warehouses/xxxxxx")
df = read_table("samples.nyctaxi.trips", conn)
df["tpep_pickup_datetime"] = pd.to_datetime(df["tpep_pickup_datetime"])
df["pickup_hour"] = df["tpep_pickup_datetime"].dt.hour
# Bar chart: trips by hour
hourly_demand = df["pickup_hour"].value_counts().sort_index()
st.bar_chart(hourly_demand)
# Line chart: average fare by hour
avg_fare = df.groupby("pickup_hour")["fare_amount"].mean()
st.line_chart(avg_fare)
# Area chart: cumulative revenue
revenue = df.set_index("tpep_pickup_datetime")[["fare_amount"]].sort_index()
revenue["cumulative"] = revenue["fare_amount"].cumsum()
st.area_chart(revenue["cumulative"])
Use Plotly with Dash for interactive charts:
from dash import dcc
import plotly.express as px
import pandas as pd
# Assuming df is loaded from a UC table (see tables skill)
fig = px.bar(df, x="pickup_hour", y="trip_count", title="Trips by Hour")
dcc.Graph(figure=fig)
fig_line = px.line(df, x="pickup_hour", y="avg_fare", title="Average Fare")
dcc.Graph(figure=fig_line)
import reflex as rx
# Reflex uses recharts under the hood
rx.recharts.bar_chart(
rx.recharts.bar(data_key="count", fill="#8884d8"),
rx.recharts.x_axis(data_key="hour"),
rx.recharts.y_axis(),
data=chart_data,
width="100%",
height=300,
)
Display geographic data with st.map or use Folium for interactive drawing:
import streamlit as st
from streamlit_folium import st_folium
import folium
from folium.plugins import Draw
# Simple map from a DataFrame with lat/lon columns
st.map(df, latitude="latitude", longitude="longitude")
# Interactive map with drawing tools (Folium)
m = folium.Map(location=[37.7749, -122.4194], zoom_start=13)
draw = Draw(
draw_options={
"marker": True,
"polygon": True,
"polyline": True,
"rectangle": True,
"circle": True,
"circlemarker": False,
},
edit_options={"edit": True},
)
draw.add_to(m)
output = st_folium(m, width=700, height=500)
if output["last_active_drawing"] and "geometry" in output["last_active_drawing"]:
geometry = output["last_active_drawing"]["geometry"]
st.json(geometry)
from dash import dcc
import plotly.express as px
fig = px.scatter_mapbox(
df, lat="latitude", lon="longitude",
zoom=10, mapbox_style="open-street-map"
)
dcc.Graph(figure=fig)
CAN USE on the SQL warehouseSELECT on the Unity Catalog table| Framework | Packages |
|---|---|
| Streamlit | streamlit, databricks-sdk, databricks-sql-connector, pandas |
| Streamlit + maps | Add streamlit-folium |
| Dash | dash, plotly, databricks-sdk, databricks-sql-connector, pandas |
| Reflex | reflex, databricks-sdk, pandas |
st.map requires columns named latitude/longitude (or lat/lon) -- rename if neededstreamlit-folium as an extra dependencyLIMIT 1000) to avoid rendering performance issuesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
databricks, visualization, charts, maps, streamlit, dash, reflex
12 skills in this plugin
/cookbook-aimlInvoke ML models, run vector search, and connect to MCP servers from Databricks Apps. Use when the user wants to call a model serving endpoint, query a vector search index, use LLMs/embeddings, or connect to an MCP server in Dash, Streamlit, Reflex, or FastAPI./cookbook-authenticationImplement authentication in Databricks Apps: get current user info, on-behalf-of-user (OBO) auth, service principal auth, and OAuth patterns. Use when the user asks about auth, user tokens, service principals, OAuth, or OBO in Dash, Streamlit, Reflex, or FastAPI./cookbook-biEmbed AI/BI dashboards and integrate Genie Spaces into Databricks Apps. Use when the user wants to embed a Databricks dashboard or build a chat interface with the Genie Conversations API in Dash, Streamlit, or Reflex./build-appBuild Databricks Apps from this cookbook: minimum folder layout and app.yaml per framework (Dash, Streamlit, Reflex, FastAPI), multi-page wiring, docs category-first workflow then README recipes, runtime rules, combining recipes. Feature code only from repo samples and docs/docs/*.mdx. After the app runs, follow [`productionize-app-dab`](../productionize-app-dab/SKILL.md) for Databricks Asset Bundles (DABs). Do not use for AppKit, Genie App Builder, AI/BI dashboards, or coding-agent MCP config — see When not to use this skill./cookbook-computeConnect Databricks Apps to shared clusters or serverless compute using Databricks Connect. Use when the user needs to run Spark SQL or Python on a cluster from a Dash, Streamlit, or Reflex app./cookbook-external-servicesConnect Databricks Apps to external services using Unity Catalog HTTP connections and retrieve Databricks secrets. Use when the user needs to call external APIs (GitHub, Jira, Slack), set up MCP connections, or access secrets from Dash, Streamlit, or Reflex apps.npx claudepluginhub databricks-solutions/databricks-apps-cookbook --plugin databricks-skillsOther plugins' skills for the same job