// Interactive data exploration and visualization skill. Use when users ask to visualize data, analyze datasets, create charts, or explore data files (CSV, Excel, Parquet, JSON). This skill guides through data exploration, proposes visualization strategies based on data characteristics, creates interactive Plotly charts in marimo notebooks, and generates analytical conclusions.
| name | data-viz-insight |
| description | Interactive data exploration and visualization skill. Use when users ask to visualize data, analyze datasets, create charts, or explore data files (CSV, Excel, Parquet, JSON). This skill guides through data exploration, proposes visualization strategies based on data characteristics, creates interactive Plotly charts in marimo notebooks, and generates analytical conclusions. |
This skill enables interactive data exploration, visualization planning, and automated chart generation in marimo notebooks.
Marimo server must be running with MCP support:
uv run marimo edit main.py --mcp --no-token
Follow this 5-step interactive process:
If the user hasn't provided a data file path, ask for it:
Verify the file exists before proceeding.
Option 1: Use the exploration script (recommended for comprehensive analysis)
uv run python .claude/skills/data-viz-insight/scripts/explore_data.py data.csv
The script provides:
Option 2: Use Polars directly for custom exploration
import polars as pl
# Read data (format detected automatically)
df = pl.read_csv("data.csv") # or read_excel, read_parquet, read_json
# Gather key information
schema = df.schema # Column names and types
shape = (df.height, df.width) # Rows, columns
stats = df.describe() # Summary statistics
nulls = df.null_count() # Missing values
Present findings in a structured summary:
For detailed Polars patterns, see references/polars-patterns.md.
After sharing initial insights, explicitly ask what aspects interest the user:
Listen for specific interests like:
Based on data characteristics and user interests, propose 3-5 specific charts with rationale:
Example proposal format:
Based on your data analysis, I propose these visualizations:
1. **[Metric] by [Category] (Bar Chart)** - Compare values across different groups
2. **[Metric] Over Time (Line Chart)** - Show trends and patterns
3. **[Category] Distribution (Pie Chart)** - Visualize proportions of the whole
4. **[Value] Distribution (Histogram)** - Understand the spread of values
5. **[Variable A] vs [Variable B] (Scatter)** - Explore relationships
Would you like me to create these visualizations?
Adapt to data type:
For chart type selection guidance, see references/plotly-charts.md.
Once approved, create visualizations in marimo notebook and write conclusions.
Use marimo MCP tools to inspect the notebook:
mcp__marimo__get_active_notebooks - Get session IDmcp__marimo__get_lightweight_cell_map - View structureAdd cells directly to the marimo file using the Edit tool. Each chart follows this pattern:
@app.cell
def _(df, go, pl):
import plotly.graph_objects as go
# Group data for visualization
category_totals = df.group_by("category").agg(
pl.col("amount").sum().alias("total")
).sort("total", descending=True)
# Create chart using Graph Objects
fig = go.Figure(data=[
go.Bar(
x=category_totals["category"].to_list(),
y=category_totals["total"].to_list(),
marker=dict(
color=category_totals["total"].to_list(),
colorscale='Blues',
showscale=False
)
)
])
fig.update_layout(
title="Spending by Category",
xaxis_title="Category",
yaxis_title="Total Amount (TWD)",
showlegend=False
)
return fig
Cell guidelines:
plotly.graph_objects), NOT Plotly Expressgo from plotly.graph_objects in the imports celldf).to_list() before passing to plotlyupdate_layout()Why Graph Objects over Express:
.to_list()Add a conclusion cell summarizing key findings:
@app.cell
def _():
import marimo as mo
mo.md("""
## Data Analysis Summary
**Key Findings:**
- [Finding 1: e.g., "Category A accounts for 45% of total (12,450 units)"]
- [Finding 2: e.g., "Peak activity occurs on [day/time] - 2.3x above average"]
- [Finding 3: e.g., "Largest value: 3,196 in [category] on [date]"]
**Insights:**
- [Pattern or trend observed from the data]
- [Notable anomaly or outlier identified]
""")
return
Keep conclusions:
After creating visualizations, use MCP tools to verify:
mcp__marimo__get_cell_outputs - View rendered chartsmcp__marimo__lint_notebook - Validate notebook structureWhen marimo runs with MCP enabled, these tools are available:
mcp__marimo__get_marimo_rules - Get marimo best practicesmcp__marimo__get_active_notebooks - List active sessions and file pathsmcp__marimo__get_lightweight_cell_map - Preview notebook structuremcp__marimo__get_tables_and_variables - Inspect data in sessionmcp__marimo__get_cell_outputs - View visualization resultsmcp__marimo__lint_notebook - Validate changesPolars supports these formats natively:
CSV:
df = pl.read_csv("data.csv")
Excel:
df = pl.read_excel("data.xlsx", sheet_name="Sheet1")
Parquet:
df = pl.read_parquet("data.parquet")
JSON:
df = pl.read_json("data.json")
Quick reference for choosing chart types:
Categorical comparisons โ Bar chart, horizontal bar Proportions โ Pie chart (<7 categories), treemap Time series โ Line chart, area chart Distributions โ Histogram, box plot, violin plot Relationships โ Scatter plot, bubble chart Correlations โ Heatmap Multi-category โ Grouped bar, stacked bar
For detailed examples and customization patterns, see references/plotly-charts.md.
This skill includes reference documentation for detailed patterns: