Spaces:
Running
Running
|
Download README.md from thonguyen511/Heatmap: direct link, hf CLI and curl.
- Browser
- Download file 3.47 kB
-
https://huggingface.co/spaces/thonguyen511/Heatmap/resolve/main/README.md
- Command line
-
hf download hf://spaces/thonguyen511/Heatmap/README.md
-
curl -L -o README.md https://huggingface.co/spaces/thonguyen511/Heatmap/resolve/main/README.md
3.47 kB
metadata
title: Global Market Heatmap
emoji: π
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
Global Market Heatmap π
A beautiful, interactive 3D WebGL visualization of global financial markets utilizing Three.js and automated backend data scraping.
Overview
This project provides an interactive 3D visualization of the Earth and Moon. Global financial markets are plotted across the globe, with their indicators dynamically changing color in real-time based on actual UTC market hours and holidays.
Users can explore the data by interacting with specific countries to view their TradingView stock heatmaps, or by clicking the orbiting Moon to dive into the global cryptocurrency market.
Features
- 3D Globe & Moon: Built natively with Three.js. Features highly realistic textures, orbital mechanics, and dynamic day/night cycles synchronized to simulated or real time.
- Live Market Hours: Market dots update their color seamlessly based on their real-world open/close UTC schedules (Green = Open, Red = Closed, Blue = Holiday).
- Top Time Marquee: A continuous scrolling marquee tracking the real-world time across major global financial hubs.
- Automated Python Scrapers: Includes robust Playwright scripts (
scrape.pyandscrape_crypto.py) that run headlessly to navigate TradingView, enable dark mode, and download high-resolution market heatmaps into the local cache. - Smart Interactions:
- Earth Interaction: Hover over any market dot for a quick peek, or left-click to pin the Heatmap UI open.
- Moon Interaction: Click the moon to explore the global cryptocurrency market (no hover effect).
Technology Stack
- Three.js: 3D WebGL rendering, orbit controls, camera math, and custom shaders.
- D3.js: Equirectangular projection of GeoJSON data to map country borders onto the globe.
- date-holidays: Backend Node.js library utilized to autogenerate accurate worldwide market holiday schedules.
- HTML/CSS/JS: Pure Vanilla JS, styled elegantly with CSS backdrops and micro-animations.
Running Locally
You can run this project easily using Docker!
Using Docker
- Build the image:
docker build -t global-market-heatmap .
- Run the container:
docker run -p 8080:80 global-market-heatmap
- Open your browser and navigate to
http://localhost:8080.
Without Docker (Node.js)
If you prefer running it locally with Node.js:
npx serve .
Folder Structure
.
βββ assets/
β βββ cache_png/ # Autogenerated High-Res PNG Heatmaps
β βββ geo/ # GeoJSON borders & market_chosen.json config
β βββ textures/ # High-res 2k Earth & Moon maps
βββ css/ # Stylesheets
βββ scripts/ # Automated Scrapers
β βββ scrape.py # Playwright scraper for all global markets
β βββ scrape_crypto.py # Playwright scraper for the Crypto market
β βββ generate_holidays.js # Generates holiday JSON data for market schedules
βββ src/ # ES6 Modules
β βββ core/ # Scene setup and Time loop manager
β βββ objects/ # Earth, Moon, and Market dot generators
β βββ ui/ # Raycaster and interaction logic
β βββ main.js # Application entry point
βββ Dockerfile # Nginx static server image
βββ index.html # HTML layout