Skip to content

Commit 1a19747

Browse files
committed
Viz redesign — unified Cyan→Purple design tokens with landing page
1 parent d8e48f8 commit 1a19747

6 files changed

Lines changed: 303 additions & 171 deletions

File tree

docs/tutorials/07_visualization.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: "Tutorial 07 — Visualization"
44

55
# Tutorial 07 — Visualization
66

7+
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/eddmpython/vectrix/blob/master/notebooks/tutorials/07_visualization.ipynb)
8+
79
**Numbers tell the story, but charts sell it.** Vectrix's visualization module (`vectrix.viz`) provides publication-quality interactive charts built on Plotly — designed to work seamlessly with every Vectrix result object.
810

911
All charts follow a consistent pattern: pass a Vectrix result, get back a Plotly `go.Figure` you can display inline, save to HTML, or embed in dashboards.
@@ -266,7 +268,7 @@ All chart functions accept `theme="dark"` (default) or `theme="light"`.
266268

267269
### Dark Theme (Default)
268270

269-
Deep navy background (`#0f172a`), light text (`#f1f5f9`). Best for Jupyter notebooks and dark-mode dashboards.
271+
Deep navy background (`#0f172a`), light text (`#f8fafc`). Best for Jupyter notebooks and dark-mode dashboards.
270272

271273
### Light Theme
272274

@@ -294,16 +296,19 @@ fig.show()
294296

295297
| Key | Dark | Light | Usage |
296298
|-----|------|-------|-------|
297-
| `primary` | `#6366f1` | `#6366f1` | Main brand color (indigo) |
298-
| `accent` | `#a855f7` | `#a855f7` | Secondary highlight (purple) |
299-
| `positive` | `#22c55e` | `#16a34a` | Good values, below threshold |
299+
| `primary` | `#06b6d4` | `#06b6d4` | Main brand color (cyan) |
300+
| `accent` | `#8b5cf6` | `#8b5cf6` | Secondary highlight (purple) |
301+
| `positive` | `#10b981` | `#059669` | Good values, below threshold |
300302
| `negative` | `#ef4444` | `#dc2626` | Bad values, above threshold |
301303
| `warning` | `#f59e0b` | `#d97706` | Caution, averages |
302304
| `muted` | `#94a3b8` | `#64748b` | Historical data, secondary |
303-
| `bg` | `#0f172a` | `#ffffff` | Background |
304-
| `card` | `#1e293b` | `#f8fafc` | Card/panel background |
305-
| `text` | `#f1f5f9` | `#0f172a` | Primary text |
306-
| `grid` | `rgba(255,255,255,0.06)` | `rgba(0,0,0,0.06)` | Grid lines |
305+
| `bg` | `#0f172a` | `#ffffff` | Plot background |
306+
| `bgDarker` | `#020617` | `#f8fafc` | Paper background |
307+
| `card` | `#1e293b` | `#f1f5f9` | Card/panel background |
308+
| `text` | `#f8fafc` | `#0f172a` | Primary text |
309+
| `textMuted` | `#94a3b8` | `#64748b` | Secondary text |
310+
| `border` | `#334155` | `#e2e8f0` | Borders, dividers |
311+
| `grid` | `rgba(255,255,255,0.05)` | `rgba(0,0,0,0.05)` | Grid lines |
307312

308313
### Height Constants
309314

@@ -312,11 +317,11 @@ Standard heights for consistent layouts:
312317
```python
313318
from vectrix.viz import HEIGHT
314319

315-
HEIGHT["chart"] # 450 — individual charts
316-
HEIGHT["card"] # 220 — metrics cards
317-
HEIGHT["report"] # 600 — forecast report
318-
HEIGHT["analysis"] # 650 — analysis report
319-
HEIGHT["small"] # 350 — compact charts
320+
HEIGHT["chart"] # 480 — individual charts
321+
HEIGHT["card"] # 240 — metrics cards
322+
HEIGHT["report"] # 640 — forecast report
323+
HEIGHT["analysis"] # 680 — analysis report
324+
HEIGHT["small"] # 360 — compact charts
320325
```
321326

322327
## Saving Charts

notebooks/tutorials/07_visualization.ipynb

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -464,28 +464,7 @@
464464
{
465465
"cell_type": "markdown",
466466
"metadata": {},
467-
"source": [
468-
"### Color Reference\n",
469-
"\n",
470-
"| Key | Dark | Light | Usage |\n",
471-
"|-----|------|-------|-------|\n",
472-
"| `primary` | `#6366f1` | `#6366f1` | Main brand color (indigo) |\n",
473-
"| `accent` | `#a855f7` | `#a855f7` | Secondary highlight (purple) |\n",
474-
"| `positive` | `#22c55e` | `#16a34a` | Good values, below threshold |\n",
475-
"| `negative` | `#ef4444` | `#dc2626` | Bad values, above threshold |\n",
476-
"| `warning` | `#f59e0b` | `#d97706` | Caution, averages |\n",
477-
"| `muted` | `#94a3b8` | `#64748b` | Historical data, secondary |\n",
478-
"\n",
479-
"### Height Constants\n",
480-
"\n",
481-
"```python\n",
482-
"HEIGHT[\"chart\"] # 450 — individual charts\n",
483-
"HEIGHT[\"card\"] # 220 — metrics cards\n",
484-
"HEIGHT[\"report\"] # 600 — forecast report\n",
485-
"HEIGHT[\"analysis\"] # 650 — analysis report\n",
486-
"HEIGHT[\"small\"] # 350 — compact charts\n",
487-
"```"
488-
]
467+
"source": "### Color Reference\n\n| Key | Dark | Light | Usage |\n|-----|------|-------|-------|\n| `primary` | `#06b6d4` | `#06b6d4` | Main brand color (cyan) |\n| `accent` | `#8b5cf6` | `#8b5cf6` | Secondary highlight (purple) |\n| `positive` | `#10b981` | `#059669` | Good values, below threshold |\n| `negative` | `#ef4444` | `#dc2626` | Bad values, above threshold |\n| `warning` | `#f59e0b` | `#d97706` | Caution, averages |\n| `muted` | `#94a3b8` | `#64748b` | Historical data, secondary |\n| `bgDarker` | `#020617` | `#f8fafc` | Paper background |\n| `bg` | `#0f172a` | `#ffffff` | Plot background |\n| `card` | `#1e293b` | `#f1f5f9` | Card/panel background |\n| `text` | `#f8fafc` | `#0f172a` | Primary text |\n| `border` | `#334155` | `#e2e8f0` | Borders, dividers |\n\n### Height Constants\n\n```python\nHEIGHT[\"chart\"] # 480 — individual charts\nHEIGHT[\"card\"] # 240 — metrics cards\nHEIGHT[\"report\"] # 640 — forecast report\nHEIGHT[\"analysis\"] # 680 — analysis report\nHEIGHT[\"small\"] # 360 — compact charts\n```"
489468
},
490469
{
491470
"cell_type": "markdown",
@@ -590,4 +569,4 @@
590569
},
591570
"nbformat": 4,
592571
"nbformat_minor": 4
593-
}
572+
}

src/vectrix/viz/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Vectrix Visualization Module.
33
44
Interactive Plotly charts for time series analysis and forecasting.
5+
Design tokens unified with the landing page (Cyan→Purple gradient).
56
67
Requires: pip install vectrix[viz]
78
"""
@@ -23,7 +24,15 @@
2324
scenarioChart,
2425
)
2526
from .report import analysisReport, forecastReport
26-
from .theme import COLORS, HEIGHT, LAYOUT, LIGHT_COLORS, PALETTE, applyTheme
27+
from .theme import (
28+
COLORS,
29+
GRADIENT_COLORSCALE,
30+
HEATMAP_COLORSCALE,
31+
HEIGHT,
32+
LIGHT_COLORS,
33+
PALETTE,
34+
applyTheme,
35+
)
2736

2837
__all__ = [
2938
"forecastChart",
@@ -37,7 +46,8 @@
3746
"COLORS",
3847
"LIGHT_COLORS",
3948
"PALETTE",
40-
"LAYOUT",
49+
"GRADIENT_COLORSCALE",
50+
"HEATMAP_COLORSCALE",
4151
"HEIGHT",
4252
"applyTheme",
4353
]

0 commit comments

Comments
 (0)