mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
Problem: Every time you click on a burg/marker, it had to scan through all 13,496 vault files looking for a matching fmg-id. This was extremely slow and made the feature unusable for large vaults. Solution: Implement a smart index that maps fmg-id to file paths. How it works: - Index stored in memory (fmgIdIndex object) - Persisted to localStorage (survives page reloads) - Loaded on init, saved on changes - When looking up by fmg-id: 1. Check index first (instant!) 2. If found, verify file still exists and ID matches 3. If not in index, search vault and add to index - Automatically updates when notes are created/saved through FMG - Handles stale entries (file deleted/modified) Performance improvement: - Before: O(n) - scan all 13k files (very slow) - After: O(1) - instant lookup from index - First click on burg: May need to search (builds index) - Second click on same burg: Instant! Opens note directly This makes the Obsidian integration actually usable. Create a note once for a burg, and every time you click that burg again, it opens instantly. |
||
|---|---|---|
| .. | ||
| 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 | ||