mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
Problem: With hundreds/thousands of burgs and markers, building the FMG ID index one-by-one as you click each element is too slow. Users need instant lookups at scale. Solution: Build the complete index upfront on startup by reading ALL notes' frontmatter during the pre-warm phase. How it works: 1. On startup/connection test: Pre-warm cache runs 2. After scanning file list: buildCompleteIndex() runs 3. Reads frontmatter from ALL 13k+ files 4. Extracts fmg-id from each note 5. Builds complete fmg-id → path mapping 6. Saves to localStorage Benefits: - Day 1: All burgs/markers with notes have instant lookups - No gradual index building needed - Scales to thousands of elements - Index persists across page reloads Performance: - Initial build: One-time cost on startup (background, non-blocking) - All subsequent clicks: Instant O(1) lookup - Manual rebuild: ObsidianBridge.buildCompleteIndex() Console output shows: 'Complete FMG ID index built: X notes indexed, Y skipped' |
||
|---|---|---|
| .. | ||
| dynamic | ||
| io | ||
| renderers | ||
| ui | ||
| biomes.js | ||
| burgs-and-states.js | ||
| coa-generator.js | ||
| coa-renderer.js | ||
| cultures-generator.js | ||
| features.js | ||
| fonts.js | ||
| heightmap-generator.js | ||
| lakes.js | ||
| markers-generator.js | ||
| military-generator.js | ||
| names-generator.js | ||
| ocean-layers.js | ||
| provinces-generator.js | ||
| religions-generator.js | ||
| resample.js | ||
| river-generator.js | ||
| routes-generator.js | ||
| submap.js | ||
| voronoi.js | ||
| zones-generator.js | ||