CACS455 Data Analysis and Visualization

Data Analysis and VisualizationUnit 28 min read

Fundamentals of Data Visualization: Principles, Techniques & Real-World Impact

Unit 2 of Data Analysis and Visualization explores the core principles of data visualization—why we visualize data, how to represent it effectively, and the perceptual rules that guide design. This note covers visualization types (spatial vs. non-spatial), the separate-order-align framework, mark and channel theory, an

Why Visualize Data?

Data visualization transforms raw numbers into meaningful patterns, enabling faster insights, clearer communication, and better decision-making. Without visualization, complex datasets (e.g., NEPSE stock trends or Daraz order queues) become unreadable. Key goals:

  • Reveal trends (e.g., seasonal sales spikes on Daraz).
  • Compare distributions (e.g., income levels across Nepal’s districts).
  • Spot anomalies (e.g., sudden drops in Ncell network coverage).
  • Tell stories (e.g., eSewa’s user growth over time).

1. Levels of Text Representation

Text data is visualized at three levels, each requiring different techniques:

Level Description Example Visualization Technique
Raw Text Unstructured data (e.g., tweets, news articles). Customer reviews on Daraz. Word clouds, frequency tables.
Processed Text Structured but semantic (e.g., keywords, entities). NEPSE’s annual reports extracted for "profit" mentions. Tag clouds, network graphs of terms.
Derived Text Abstracted insights (e.g., sentiment scores, themes). Sentiment analysis of Pathao driver complaints. Heatmaps, stacked bar charts of sentiment scores.

Worked Example: Analyzing eSewa Complaints

  1. Raw Data: 1000 complaints like "Transaction failed on 2023-10-15" → tokenize into words.
  2. Processed: Extract entities: ["transaction", "failed", "2023-10-15", "eSewa"].
  3. Derived: Count "failed" → 30% of complaints → visualize as a pie chart slice.
graph LR
    A["Raw Text\n(eSewa complaints)"] --> B["Processed\n(Tokens/Entities)"]
    B --> C["Derived\n(Sentiment/Counts)"]
    C --> D["Visualized\n(Pie Chart: 30% 'Failed')"]

2. Separate, Order, and Align (SOA) Framework

The SOA framework organizes non-spatial data into three dimensions to avoid clutter:

  • Separate: Group related data (e.g., separate bars for each district in a GDP chart).
  • Order: Sort data logically (e.g., descending order for sales figures).
  • Align: Use grids or baselines for consistency (e.g., aligned axes in a line chart).

Real-World Tie-In: Kathmandu Traffic Routes

  • Separate: Color-code routes by vehicle type (red for buses, blue for cars).
  • Order: Sort by congestion time (peak hours first).
  • Align: Use a parallel coordinates plot to align time (x-axis) with route (y-axis).

3. Visual Encoding: Marks and Channels

Data is visualized using marks (symbols) and channels (visual properties):

Mark Channel Example
Point Color, Size Scatter plot of NEPSE stock prices (red = down, blue = up).
Line X/Y Position YouTube’s watch-time trend over years.
Bar Length, Color Daraz’s monthly sales by product category.
Text Font, Position eSewa’s transaction IDs in a table.

Worked Example: WhatsApp Message Trends

  • Mark: Bars (for monthly counts).
  • Channels:
    • X-axis: Months (ordered chronologically).
    • Y-axis: Message count (aligned to grid).
    • Color: User type (green = personal, blue = business).
  • Result: A bar chart showing WhatsApp usage spikes during festivals.
0125250375500Jan120Feb150Mar180Apr200May250Jun300Jul400Aug500Sep450Oct350Nov280Dec320Message Count
WhatsApp usage spikes during festivals (e.g., Dashain in Oct, Tihar in Nov)

4. The Power of Color

Do’s:

  • Use colorblind-friendly palettes (e.g., viridis for scientific plots).
  • Categorical data: Distinct colors (e.g., red for "high risk" in bank loans).
  • Sequential data: Gradients (e.g., blue→red for temperature maps).

Don’ts:

  • Overuse colors (stick to 3–5 hues max).
  • Use red/green for data (hard for 1 in 12 men to distinguish).

Real-World Example: Ncell Network Coverage

  • Color map: Green = 4G, Yellow = 3G, Red = No signal.
  • Impact: Helps users avoid dead zones when planning routes.

5. Hierarchical Data Visualization

Hierarchical data (e.g., organizational charts, file systems) is visualized using:

  • Tree maps: Rectangles sized by value (e.g., Daraz’s revenue by category).
  • Sunburst charts: Radial trees (e.g., YouTube’s video categories).
  • Dendrograms: Cluster hierarchies (e.g., genealogy trees).

Worked Example: eSewa Transaction Flow

  1. Data: Transactions → Payee → Amount → Time.
  2. Visualization: Sunburst chart with:
    • Center: "eSewa".
    • Level 1: Payment type (bill, transfer, loan).
    • Level 2: Amount ranges.
    • Color: Frequency (darker = more transactions).
pie
    title eSewa Transactions by Type
    "Bill Payments" : 45
    "Transfers" : 35
    "Loans" : 20

Exam Tip

  1. For short questions (2–3 marks):

    • Define terms concisely (e.g., "Data visualization is the graphical representation of data to communicate insights").
    • Link techniques to real tools (e.g., "Tableau uses marks like bars/points to encode channels like color and size").
  2. For long questions (6–7 marks):

    • Structure: Use headings (e.g., "5.1 Separate-Order-Align").
    • Visuals: Always sketch a mermaid diagram or describe a graph (e.g., "A bar chart with X=months, Y=sales, color=product category").
    • Examples: Tie answers to Nepali contexts (e.g., "NEPSE stock data can be visualized as a line chart with moving averages").
  3. Avoid:

    • Generic definitions without examples.
    • Overcomplicating visuals (stick to 1–2 per answer).

In the Real World

  1. eSewa’s Transaction Dashboard

    • Idea Used: Separate-Order-Align + Marks/Channels
    • How: Transactions are grouped by user type (separate), ordered by date (order), and aligned in a table with color-coded status (green = success, red = failed). The dashboard uses bar charts for daily volumes and pie charts for payment method breakdowns.
  2. Pathao’s Driver Earnings

    • Idea Used: Hierarchical Visualization (Sunburst Chart)
    • How: Pathao’s analytics tool shows earnings by city (outer ring), then by hour (inner segments), with color intensity representing income. Drivers use this to identify peak hours in Kathmandu vs. Pokhara.
  3. Daraz’s Inventory Management

    • Idea Used: Tree Maps for Hierarchical Data
    • How: Daraz’s backend visualizes inventory as a tree map where:
      • Larger rectangles = high-demand products (e.g., mobile phones).
      • Smaller rectangles = niche items (e.g., kitchenware).
    • Impact: Helps managers spot stockouts before they affect sales.
  4. NTC’s Internet Speed Maps

    • Idea Used: Spatial Data Visualization + Color Gradients
    • How: NTC’s website uses a choropleth map of Nepal where:
      • Dark green = high-speed fiber zones (e.g., Kathmandu).
      • Light gray = limited 3G areas (e.g., remote hills).
    • Why It Matters: Helps users and ISPs identify infrastructure gaps.

Key Takeaways

  • SOA is your toolkit: Always ask "How can I separate, order, and align this data?" before designing.
  • Marks and channels are interchangeable: A bar’s length can encode quantity, while its color encodes category.
  • Color is communication: Use it intentionally—never as decoration.
  • Hierarchy matters: Tree maps and sunbursts turn complex structures (like eSewa’s transactions) into digestible insights.
  • Real-world data is messy: Practice with Nepali datasets (e.g., NEPSE, Daraz, or NTC) to master visualization techniques.

Based on the TU BCA syllabus for Data Analysis and Visualization (CACS455), unit 2.

Discussion

Loading…