MappIt Core is a Node.js-based desktop application for visualizing and analyzing Google Location History data. Built with Electron, it provides a command-line interface to load, filter, and render large-scale location datasets exported from Google Takeout.
- Big Data Handling: Processes JSON files larger than 500MB using streaming parsers
- Date Filtering: Filter location records by date ranges
- Multiple Visualization Modes:
- Raw scatter plots
- Velocity-based color coding
- Heatmap visualization
- Data Export: Simplify and export filtered location data
- Interactive Maps: Uses Plotly.js with Mapbox for interactive map rendering
- Runtime: Node.js with Electron for desktop GUI
- Visualization: Plotly.js with Mapbox integration
- Data Processing: big-json and stream-json for handling large files
- CLI: yargs for command-line argument parsing
- Utilities: simple-statistics for statistical operations
This tool is designed for users who want to explore and visualize their Google Location History data locally without uploading it to cloud services. It's particularly useful for:
- Travel pattern analysis
- Location timeline visualization
- Personal data exploration and privacy-conscious analysis
- Exporting filtered/simplified location datasets
mappit-core/
├── src/ # Source code directory
│ ├── main.js # Electron entry point and CLI orchestration
│ ├── data.js # Data loading, filtering, and simplification
│ ├── plot.js # Visualization data preparation
│ ├── utils.js # Utility functions (distance, mean, etc.)
│ └── defaults.js # Color scales and configuration defaults
├── index.html # Electron window HTML template
├── package.json # NPM dependencies and scripts
├── package-lock.json # Locked dependency versions
├── README.md # User documentation and usage guide
├── LICENSE # MIT License
├── .gitignore # Git ignore rules (node_modules, Takeout)
├── Records.json # Sample location data for testing
├── simplified_data.json # Sample output file
└── test_data.js # Simple test script
Purpose: Application entry point and orchestration
- Initializes Electron app
- Parses CLI arguments using yargs
- Coordinates data loading, filtering, plotting, and rendering
- Creates browser window with appropriate security settings
- Manages app lifecycle events
Key CLI Commands:
--loadfile: Load locations from file--filterdate [start, end]: Filter by date range--plot byvelocity/heatmap: Select visualization mode--render: Render plot in Electron window--writeOutput: Write filtered data to file
Security Note: Currently uses nodeIntegration: true which is noted in code as acceptable for local-only tool but should be refactored.
Purpose: Data loading and manipulation
loadData(): Streams and parses large JSON files using big-jsonfilterData(): Filters locations by date range with validationsimplifyData(): Reduces data size by extracting essential fieldsprintFileStats(): Displays dataset statistics
Data Format: Handles Google Location History JSON with locations array containing:
- timestamp (ISO string)
- latitudeE7/longitudeE7 (E7 format: degrees × 10^7)
- velocity, heading, altitude, accuracy
- activity array with type and confidence
Purpose: Visualization data preparation for Plotly
prepareData(): Router function for plot type selectionplotByVelocity(): Creates velocity-colored scatter plotscatterRaw(): Basic scatter plot of all pointsplotHeatmap(): Generates density heatmap using densitymapbox
Plot Characteristics:
- Auto-centers map on data mean coordinates
- Configurable zoom, bearing, and pitch
- Multiple Mapbox styles (dark, satellite-streets, outdoors)
- Custom colorscales for different visualizations
Purpose: Mathematical and geographical utilities
degToRad(): Degree to radian conversiondistance(): Haversine formula for Earth distance calculationcountNearbyPoints(): Finds points within 1km radiusnormalize(): Normalizes array to 0-100 scalemean(): Calculates array average
Purpose: Configuration constants
- Color scales (custom and viridis-modified)
- Activity type to color mapping
- Layout margin defaults
Purpose: Electron renderer process template
- Imports and configures Plotly with Mapbox token
- IPC communication setup to receive plot data from main process
- Simple full-screen graph container
Purpose: Basic test script
- Loads sample Records.json
- Filters to a specific time range
- Exports simplified data
For detailed improvement suggestions and prioritized recommendations, see suggestions.md.
- Clean Separation of Concerns: Data, plotting, and UI logic are well-separated
- Streaming Data Processing: Smart use of big-json for handling large files
- CLI-First Design: Enables automation and scripting
- Mapbox Integration: Professional-quality map rendering
- Simple Deployment: Single npm install, no complex setup
- Node.js 12+
- npm
npm installnpm start -- --loadfile ./Records.json --filterdate '2022-08-06' '2022-08-17' --plot heatmap --rendernode test_data.js- All processing happens locally
- No data sent to external services (except Mapbox for tiles)
- Mapbox token in code should be replaced for production use
- Users maintain full control of their location data
- Manage big json data (bigger than 500 MB) ✅
- Replace plotly with deck.gl (for better performance)
- Download canvas and result data
- Show progress bar (cli-progress)
- Reworking plot types
- Merge multiple Records.json files
MIT License - Copyright (c) 2020 D/Vision Lab
Last Updated: 2026-02-16 Repository: ronzim/mappit-core Lines of Code: ~461 (excluding dependencies)