Flowstrates

1. Getting Started

1.1 Prerequisites

1.2 Installation

  1. Download the Project: Download the project files from the provided folder.
  2. Navigate to the Project Directory: Open your terminal and change your directory to the extracted project folder.
  3. Install the necessary packages using npm:
    npm install
  4. Running the Application:
    npm run dev
  5. Navigate to the Localhost Location

NOTE: The application was primarily developed and tested using Safari on a Mac M1.

2. Functions and Goals of the Visualization

2.1 Objective and Functions

Traditional maps often struggle to effectively represent temporal dimensions, making it challenging to analyze changes over time. The authors of the Flowstrates paper (Flowstrates: An approach to visually exploring temporal origin and destination data” by Ilya Boyandin, Enrico Bertini, Peter Bak, and Denis Lalanne) addressed this issue by creating an interactive visualization that combines two maps with a central heatmap, allowing users to explore temporal origin and destination data seamlessly.

My objective was to implement this foundational idea primarily using Three.js, while integrating additional functionalities to enhance interactivity and scalability. Additionally, I focused on making the visualization suitable for large datasets by incorporating real-time visualization strategies to maintain performance and responsiveness.

2.2 General Functions

2.3 Added Functions

2.4 Real-Time Challenges and Solutions

Problem 1: Slow Heatmap Rendering for Large Datasets

Problem 2: Slow Interactivity with World Maps

2.5 Data

2.5.1 Current Datasets

2.5.2 Adding a New Dataset

  1. Requirements:
    • CSV format with origin, destination, year, value columns. Optional: ATTR_1, ATTR_2 for filters.
  2. Steps:
    1. Place the CSV in src/data/.
    2. Update the dropdown in filter-attr.js:
      
      datasetSelect.append('option')
        .attr('value', 'src/data/new-dataset.csv')
        .text('name_of_the_dataset');
                    

3. Code Documentation

3.1 General Overview

File Structure and Descriptions

  1. index.html: Main entry point of the application.
  2. src/styles/style.css: Contains styles for the application.
  3. src/js/filter-attr.js: Handles dataset selection and filter dropdowns.
  4. src/js/left-map.js: Renders the origin map using Three.js.
  5. src/js/right-map.js: Similar to left-map.js, but for the destination map.
  6. src/js/map-interaction.js: Loads country geometries and adds them to the Three.js scene.
  7. src/js/map-quadtree.js: Implements a quadtree for efficient spatial queries on the maps.
  8. src/js/heatmap.js: Manages the rendering and interaction of the central heatmap.
  9. src/js/updateHeatmap.js: Defines the logic for filtering, aggregating, and progressively rendering heatmap data.
  10. src/js/tooltipHelpers.js: Provides reusable functions for creating and updating tooltips.
  11. src/data/: Contains datasets in CSV format.

Key Dependencies and Relationships

Screenshot

Flowstrates Screenshot

View the source code and documentation on GitHub: Flowstrates GitHub Repository