cacheElement static method
Cache element data for performance
Implementation
static void cacheElement(String refId, Element element, Map<String, dynamic> bounds) {
final weakRef = WeakReference(element);
_elementCache[refId] = {
'bounds': bounds,
'element': weakRef,
'timestamp': DateTime.now().millisecondsSinceEpoch,
};
// Clean up old cache entries
_cleanupCache();
}