Analytics UI Patterns
Purpose: This document defines the standard visual patterns for displaying data within the PenguinMails application. It focuses on how to present information to ensure consistency, readability, and actionable insights.
1. Data Presentation Hierarchy
We follow a âProgressive Disclosureâ philosophy for analytics:
-
Headline Metrics (Data Cards): Immediate, high-level health check.
-
Trends (Charts): Visual context over time.
-
Details (Tables): Granular data for deep dives.
2. Data Cards (Headline Metrics)
Data cards are the primary entry point for understanding performance. They should be used at the top of dashboards.
Visual Structure
-
Label: Uppercase, small, muted (e.g., âTOTAL REVENUEâ).
-
Value: Large, bold, high-contrast (e.g., â$12,450â).
-
Trend Indicator: Small pill or text showing % change vs. previous period (e.g., ââ 12% vs last monthâ).
-
Green: Positive change (Good).
-
Red: Negative change (Bad).
-
Neutral: No significant change.
-
-
Sparkline (Optional): A simplified line chart background to show the trend shape.
Usage Rules
-
Grouping: Group related cards (e.g., âEngagementâ group: Sent, Opened, Clicked).
-
Clickability: If a card represents a summary of a detailed report, the entire card should be clickable and link to that report.
3. Charts & Graphs
Charts provide context to the raw numbers.
Standard Chart Types
-
Line/Area Charts: Use for trends over time (e.g., âDaily Email Opensâ).
- Style: Smooth curves (monotone), gradient fill below the line for depth.
-
Bar Charts: Use for categorical comparisons (e.g., âOpens by Device Typeâ).
-
Heatmaps: Use for density data (e.g., âBest Time to Sendâ - Day vs. Hour).
Interaction Patterns
-
Tooltips: Essential. Hovering over any data point must reveal the exact value and date.
-
Cross-Filtering: Clicking a data point (e.g., a bar for âMobileâ) should filter adjacent components (e.g., the Data Table below) to show only that segment.
-
Empty States: Never show a blank space. If no data exists, show a âNo data available for this periodâ placeholder with a call to action (e.g., âStart a campaignâ).
4. Data Tables
Tables are for detailed analysis and individual record management.
Visual Patterns
-
Density: Offer âComfortableâ (default) and âCompactâ modes.
-
Zebra Striping: Avoid. Use subtle border separators for a cleaner look.
-
Row Hover: Highlight the entire row on hover to aid readability.
-
Sticky Header: Column headers must remain visible when scrolling.
Columns & Data Types
-
Status Pills: Use colored pills for status (e.g., Active, Paused, Error).
-
Numbers: Always right-align numerical data. Use monospaced fonts for tabular figures if possible.
-
Actions: The last column should contain row actions (Edit, Delete, View) or a ââŚâ menu.
5. Linking & Navigation Strategy
How users move from a high-level metric to the underlying data.
The âDrill-Downâ Pattern
-
From Card to Report: Clicking a âBouncesâ data card should navigate to the
Reports > Bouncesview. -
From Chart to Filtered List: Clicking a spike in a âDaily Errorsâ chart should navigate to the Logs table, pre-filtered for that specific date.
Contextual Links
-
âView Detailsâ: Use a standard âView Details ->â link or icon in the top-right of a card or chart container to take the user to the full-page version of that metric.
-
Breadcrumbs: When drilling down, ensure breadcrumbs reflect the path (e.g.,
Dashboard > Campaigns > Summer Sale > Analytics).
6. Color Palette for Data
Use the semantic colors defined in Design Tokens to ensure accessibility and consistency.
-
Primary Data: Brand Primary Color.
-
Secondary Data: Brand Secondary or Neutral Gray.
-
Success/Good: Semantic Green.
-
Warning: Semantic Yellow/Orange.
-
Error/Bad: Semantic Red.
-
Categorical: Use the defined âData Visualizationâ palette (distinct from UI colors) to ensure distinguishable categories.