Overview
TheappState object is the central state container for the Network Analysis application. It stores all data, configuration, and cached statistics throughout the application lifecycle.
Defined in
app.js:5-42State Properties
Data Properties
The uploaded Excel file object from the file input
Name of the uploaded file for display purposes
Column headers extracted from the Excel file’s first row
Parsed data rows from the Excel sheet, where each row is an object with column headers as keys
Name of the selected worksheet when the Excel file has multiple sheets
Column Configuration
Name of the column containing origin/source nodes
Name of the column containing destination/target nodes
Name of the column containing edge weights. Empty string means automatic counting
Name of the column containing latitude coordinates for origin nodes
Name of the column containing longitude coordinates for origin nodes
Name of the column containing latitude coordinates for destination nodes
Name of the column containing longitude coordinates for destination nodes
Processed Data
Processed and aggregated edges with structure:
Set of all unique node names (both origins and destinations)
Flag indicating whether the data is valid and ready for visualization
Indices
Index mapping source nodes to their outgoing edges for fast lookups
Index mapping target nodes to their incoming edges for fast lookups
Map of node names to their geographic coordinates
Sankey Visualization Settings
Number of top edges to display in the Sankey diagram
Filter to show only edges from a specific origin node
Filter to show only edges to a specific destination node
Cached statistics for the Sankey visualization:
Network Visualization Settings
Number of top edges to display in the gravitational network
Filter to show only edges from a specific origin node
Filter to show only edges to a specific destination node
Cached statistics for the network visualization:
Map Visualization Settings
Filter to show only edges from a specific origin node on the map
Filter to show only edges to a specific destination node on the map
Column name to use for color-coding nodes on the map
Active legend filter for showing specific color groups
Toggle for cost mode: line width = distance × weight
Cached statistics for the map visualization:
Usage Examples
Accessing State Properties
Using Indices for Fast Lookups
Updating Visualization Settings
Working with Coordinates
State Lifecycle
Related Functions
handleFileSelect()- Loads file and initializes stateparseExcelData()- Populates headers and rowshandleColumnChange()- Updates column configurationprocessAggregatedEdges()- Generates aggregated edgesbuildIndices()- Creates index structures