shared/spatial library

Ultra-fast spatial indexing system for 2D objects

This module provides generic spatial indexing capabilities optimized for large numbers of objects with frequent position updates, such as nodes in a graph editor.

Key features:

  • Grid-based spatial hashing for O(visible) performance
  • Smart caching with automatic invalidation
  • Drag optimization mode for ultra-fast updates
  • Multi-tier performance strategy based on object count
  • Generic interface that can be adapted for any 2D objects

Classes

NodeSpatialAdapter<T>
Adapter to make Node work with the generic spatial index
NodeSpatialIndex<T>
Specialized spatial index for managing Node objects
SpatialIndex<T extends SpatialIndexable>
Ultra-fast spatial indexing system using grid-based hashing Optimized for large numbers of 2D objects with frequent position updates
SpatialIndexable
Generic spatial indexing interface for 2D objects
SpatialIndexStats
Performance statistics for the spatial index