@aguacerowx/react-native 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +126 -60
  2. package/aguacerowx-react-native.podspec +53 -37
  3. package/android/build/.transforms/42e9b8fa82d77a1c205db5bf0d0ed519/results.bin +1 -0
  4. package/android/build/.transforms/42e9b8fa82d77a1c205db5bf0d0ed519/transformed/classes/classes_dex/classes.dex +0 -0
  5. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/results.bin +1 -0
  6. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/AguaceroPackage.dex +0 -0
  7. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/BuildConfig.dex +0 -0
  8. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.dex +0 -0
  9. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer.dex +0 -0
  10. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayerView.dex +0 -0
  11. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderManager.dex +0 -0
  12. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/InspectorModule.dex +0 -0
  13. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/ShaderUtils.dex +0 -0
  14. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/WeatherFrameProcessorModule.dex +0 -0
  15. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.dex +0 -0
  16. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.dex +0 -0
  17. package/android/build/.transforms/c8ab78b63f2cc835ac936d58e29a17ab/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  18. package/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  19. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +43 -0
  20. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +22 -0
  21. package/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec-generated.cpp +22 -0
  22. package/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec.h +24 -0
  23. package/android/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
  24. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI-generated.cpp +17 -0
  25. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI.h +19 -0
  26. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.cpp +22 -0
  27. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.h +24 -0
  28. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.cpp +16 -0
  29. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.h +23 -0
  30. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.cpp +62 -0
  31. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.h +40 -0
  32. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.cpp +17 -0
  33. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.h +32 -0
  34. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.cpp +16 -0
  35. package/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.h +20 -0
  36. package/android/build/generated/source/codegen/schema.json +1 -0
  37. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  38. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  39. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  40. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  41. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  42. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  43. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  44. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  45. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  46. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  47. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  48. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  49. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  50. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  51. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  52. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  53. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  54. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  55. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  56. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  57. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  58. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  59. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  60. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  61. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  62. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  63. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  64. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  65. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  66. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  67. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  68. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  69. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  70. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  71. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +152 -0
  72. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  73. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  74. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  75. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  76. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  77. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  78. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  79. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  80. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  81. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  82. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  83. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  84. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  85. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  86. package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  87. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  88. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  89. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  90. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  91. package/android/build.gradle +107 -83
  92. package/android/src/main/AndroidManifest.xml +6 -6
  93. package/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  94. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +657 -611
  95. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +304 -299
  96. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +125 -117
  97. package/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
  98. package/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  99. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
  100. package/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  101. package/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  102. package/android/src/main/res/raw/fragment_shader.glsl +151 -97
  103. package/android/src/main/res/raw/vertex_shader.glsl +19 -19
  104. package/index.js +2 -2
  105. package/ios/AguaceroPackage.m +18 -18
  106. package/ios/FragmentUniforms.swift +14 -13
  107. package/ios/GridRenderLayer.swift +995 -962
  108. package/ios/GridRenderLayerBridge.swift +29 -29
  109. package/ios/GridRenderLayerManager.mm +157 -145
  110. package/ios/GridRenderLayerView.h +16 -22
  111. package/ios/GridRenderLayerView.m +205 -199
  112. package/ios/InspectorDataCache.swift +65 -65
  113. package/ios/InspectorModule.m +9 -9
  114. package/ios/InspectorModule.swift +63 -63
  115. package/ios/Shaders.metal +178 -130
  116. package/ios/WeatherFrameProcessorModule.m +15 -15
  117. package/ios/WeatherFrameProcessorModule.swift +103 -103
  118. package/ios/compiled-shaders/Shaders-device.metallib +0 -0
  119. package/ios/compiled-shaders/Shaders-simulator.metallib +0 -0
  120. package/ios/compiled-shaders/Shaders.metallib +0 -0
  121. package/lib/commonjs/README.md +126 -60
  122. package/lib/commonjs/aguacerowx-react-native.podspec +53 -37
  123. package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  124. package/lib/commonjs/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +43 -0
  125. package/lib/commonjs/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +22 -0
  126. package/lib/commonjs/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec-generated.cpp +22 -0
  127. package/lib/commonjs/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec.h +24 -0
  128. package/lib/commonjs/android/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
  129. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI-generated.cpp +17 -0
  130. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI.h +19 -0
  131. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.cpp +22 -0
  132. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.h +24 -0
  133. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.cpp +16 -0
  134. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.h +23 -0
  135. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.cpp +62 -0
  136. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.h +40 -0
  137. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.cpp +17 -0
  138. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.h +32 -0
  139. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.cpp +16 -0
  140. package/lib/commonjs/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.h +20 -0
  141. package/lib/commonjs/android/build/generated/source/codegen/schema.json +1 -0
  142. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  143. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  144. package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  145. package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  146. package/lib/commonjs/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  147. package/lib/commonjs/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  148. package/lib/commonjs/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  149. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  150. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  151. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  152. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  153. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  154. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  155. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  156. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  157. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  158. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  159. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  160. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  161. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  162. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  163. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  164. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  165. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  166. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  167. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  168. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  169. package/lib/commonjs/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  170. package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  171. package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  172. package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  173. package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  174. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  175. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  176. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +152 -0
  177. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  178. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  179. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  180. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  181. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  182. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  183. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  184. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  185. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  186. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  187. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  188. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  189. package/lib/commonjs/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  190. package/lib/commonjs/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  191. package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  192. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  193. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  194. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  195. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  196. package/lib/commonjs/android/build.gradle +107 -83
  197. package/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
  198. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  199. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +657 -611
  200. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +304 -299
  201. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +125 -117
  202. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
  203. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  204. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
  205. package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  206. package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  207. package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +151 -97
  208. package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +19 -19
  209. package/lib/commonjs/babel.config.js.map +1 -1
  210. package/lib/commonjs/index.js.map +1 -1
  211. package/lib/commonjs/ios/AguaceroPackage.m +18 -18
  212. package/lib/commonjs/ios/FragmentUniforms.swift +14 -13
  213. package/lib/commonjs/ios/GridRenderLayer.swift +995 -962
  214. package/lib/commonjs/ios/GridRenderLayerBridge.swift +29 -29
  215. package/lib/commonjs/ios/GridRenderLayerManager.mm +157 -145
  216. package/lib/commonjs/ios/GridRenderLayerView.h +16 -22
  217. package/lib/commonjs/ios/GridRenderLayerView.m +205 -199
  218. package/lib/commonjs/ios/InspectorDataCache.swift +65 -65
  219. package/lib/commonjs/ios/InspectorModule.m +9 -9
  220. package/lib/commonjs/ios/InspectorModule.swift +63 -63
  221. package/lib/commonjs/ios/Shaders.metal +178 -130
  222. package/lib/commonjs/ios/WeatherFrameProcessorModule.m +15 -15
  223. package/lib/commonjs/ios/WeatherFrameProcessorModule.swift +103 -103
  224. package/lib/commonjs/ios/compiled-shaders/Shaders-device.metallib +0 -0
  225. package/lib/commonjs/ios/compiled-shaders/Shaders-simulator.metallib +0 -0
  226. package/lib/commonjs/ios/compiled-shaders/Shaders.metallib +0 -0
  227. package/lib/commonjs/package.json +72 -67
  228. package/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
  229. package/lib/commonjs/scripts/compile-shaders.js +62 -0
  230. package/lib/commonjs/scripts/compile-shaders.js.map +1 -0
  231. package/lib/commonjs/scripts/compile-shaders.sh +39 -0
  232. package/lib/commonjs/src/AguaceroContext.js.map +1 -1
  233. package/lib/commonjs/src/GridRenderLayer.js +8 -0
  234. package/lib/commonjs/src/GridRenderLayer.js.map +1 -1
  235. package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
  236. package/lib/commonjs/src/MapManager.js.map +1 -1
  237. package/lib/commonjs/src/MapRegistry.js.map +1 -1
  238. package/lib/commonjs/src/StyleApplicator.js +6 -6
  239. package/lib/commonjs/src/StyleApplicator.js.map +1 -1
  240. package/lib/commonjs/src/WeatherLayerManager.js +26 -16
  241. package/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
  242. package/lib/commonjs/tsconfig.json +23 -23
  243. package/lib/module/README.md +126 -60
  244. package/lib/module/aguacerowx-react-native.podspec +53 -37
  245. package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  246. package/lib/module/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +43 -0
  247. package/lib/module/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +22 -0
  248. package/lib/module/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec-generated.cpp +22 -0
  249. package/lib/module/android/build/generated/source/codegen/jni/AguaceroWxReactNativeSpec.h +24 -0
  250. package/lib/module/android/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
  251. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI-generated.cpp +17 -0
  252. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/AguaceroWxReactNativeSpecJSI.h +19 -0
  253. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.cpp +22 -0
  254. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ComponentDescriptors.h +24 -0
  255. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.cpp +16 -0
  256. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/EventEmitters.h +23 -0
  257. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.cpp +62 -0
  258. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/Props.h +40 -0
  259. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.cpp +17 -0
  260. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/ShadowNodes.h +32 -0
  261. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.cpp +16 -0
  262. package/lib/module/android/build/generated/source/codegen/jni/react/renderer/components/AguaceroWxReactNativeSpec/States.h +20 -0
  263. package/lib/module/android/build/generated/source/codegen/schema.json +1 -0
  264. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  265. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  266. package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  267. package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  268. package/lib/module/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  269. package/lib/module/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  270. package/lib/module/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  271. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  272. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  273. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  274. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  275. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  276. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  277. package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  278. package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  279. package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  280. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  281. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  282. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  283. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  284. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  285. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  286. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  287. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  288. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  289. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  290. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  291. package/lib/module/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  292. package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  293. package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  294. package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  295. package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  296. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  297. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  298. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +152 -0
  299. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  300. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  301. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  302. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  303. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  304. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  305. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  306. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  307. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  308. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  309. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.class +0 -0
  310. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.class +0 -0
  311. package/lib/module/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  312. package/lib/module/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  313. package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  314. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  315. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  316. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  317. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  318. package/lib/module/android/build.gradle +107 -83
  319. package/lib/module/android/src/main/AndroidManifest.xml +6 -6
  320. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  321. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +657 -611
  322. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +304 -299
  323. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +125 -117
  324. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
  325. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  326. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
  327. package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  328. package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  329. package/lib/module/android/src/main/res/raw/fragment_shader.glsl +151 -97
  330. package/lib/module/android/src/main/res/raw/vertex_shader.glsl +19 -19
  331. package/lib/module/babel.config.js.map +1 -1
  332. package/lib/module/index.js.map +1 -1
  333. package/lib/module/ios/AguaceroPackage.m +18 -18
  334. package/lib/module/ios/FragmentUniforms.swift +14 -13
  335. package/lib/module/ios/GridRenderLayer.swift +995 -962
  336. package/lib/module/ios/GridRenderLayerBridge.swift +29 -29
  337. package/lib/module/ios/GridRenderLayerManager.mm +157 -145
  338. package/lib/module/ios/GridRenderLayerView.h +16 -22
  339. package/lib/module/ios/GridRenderLayerView.m +205 -199
  340. package/lib/module/ios/InspectorDataCache.swift +65 -65
  341. package/lib/module/ios/InspectorModule.m +9 -9
  342. package/lib/module/ios/InspectorModule.swift +63 -63
  343. package/lib/module/ios/Shaders.metal +178 -130
  344. package/lib/module/ios/WeatherFrameProcessorModule.m +15 -15
  345. package/lib/module/ios/WeatherFrameProcessorModule.swift +103 -103
  346. package/lib/module/ios/compiled-shaders/Shaders-device.metallib +0 -0
  347. package/lib/module/ios/compiled-shaders/Shaders-simulator.metallib +0 -0
  348. package/lib/module/ios/compiled-shaders/Shaders.metallib +0 -0
  349. package/lib/module/lib/commonjs/README.md +126 -60
  350. package/lib/module/lib/commonjs/aguacerowx-react-native.podspec +53 -37
  351. package/lib/module/lib/commonjs/android/build.gradle +107 -83
  352. package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
  353. package/lib/module/lib/commonjs/babel.config.js.map +1 -1
  354. package/lib/module/lib/commonjs/index.js.map +1 -1
  355. package/lib/module/lib/commonjs/ios/AguaceroPackage.m +18 -18
  356. package/lib/module/lib/commonjs/ios/FragmentUniforms.swift +14 -13
  357. package/lib/module/lib/commonjs/ios/GridRenderLayer.swift +995 -962
  358. package/lib/module/lib/commonjs/ios/GridRenderLayerBridge.swift +29 -29
  359. package/lib/module/lib/commonjs/ios/GridRenderLayerManager.mm +157 -145
  360. package/lib/module/lib/commonjs/ios/GridRenderLayerView.h +16 -22
  361. package/lib/module/lib/commonjs/ios/GridRenderLayerView.m +205 -199
  362. package/lib/module/lib/commonjs/ios/InspectorDataCache.swift +65 -65
  363. package/lib/module/lib/commonjs/ios/InspectorModule.m +9 -9
  364. package/lib/module/lib/commonjs/ios/InspectorModule.swift +63 -63
  365. package/lib/module/lib/commonjs/ios/Shaders.metal +178 -130
  366. package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.m +15 -15
  367. package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.swift +103 -103
  368. package/lib/module/lib/commonjs/ios/compiled-shaders/Shaders-device.metallib +0 -0
  369. package/lib/module/lib/commonjs/ios/compiled-shaders/Shaders-simulator.metallib +0 -0
  370. package/lib/module/lib/commonjs/ios/compiled-shaders/Shaders.metallib +0 -0
  371. package/lib/module/lib/commonjs/package.json +72 -67
  372. package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
  373. package/lib/module/lib/commonjs/scripts/compile-shaders.js +62 -0
  374. package/lib/module/lib/commonjs/scripts/compile-shaders.js.map +1 -0
  375. package/lib/module/lib/commonjs/scripts/compile-shaders.sh +39 -0
  376. package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -1
  377. package/lib/module/lib/commonjs/src/GridRenderLayer.js +8 -0
  378. package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -1
  379. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
  380. package/lib/module/lib/commonjs/src/MapManager.js.map +1 -1
  381. package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -1
  382. package/lib/module/lib/commonjs/src/StyleApplicator.js +6 -6
  383. package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -1
  384. package/lib/module/lib/commonjs/src/WeatherLayerManager.js +26 -16
  385. package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
  386. package/lib/module/lib/commonjs/tsconfig.json +23 -23
  387. package/lib/module/package.json +72 -67
  388. package/lib/module/react-native-builder-bob.config.js.map +1 -1
  389. package/lib/module/scripts/compile-shaders.js +60 -0
  390. package/lib/module/scripts/compile-shaders.js.map +1 -0
  391. package/lib/module/scripts/compile-shaders.sh +39 -0
  392. package/lib/module/src/AguaceroContext.js.map +1 -1
  393. package/lib/module/src/GridRenderLayer.js +8 -0
  394. package/lib/module/src/GridRenderLayer.js.map +1 -1
  395. package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -1
  396. package/lib/module/src/MapManager.js.map +1 -1
  397. package/lib/module/src/MapRegistry.js.map +1 -1
  398. package/lib/module/src/StyleApplicator.js +6 -6
  399. package/lib/module/src/StyleApplicator.js.map +1 -1
  400. package/lib/module/src/WeatherLayerManager.js +26 -16
  401. package/lib/module/src/WeatherLayerManager.js.map +1 -1
  402. package/lib/module/tsconfig.json +23 -23
  403. package/lib/typescript/scripts/compile-shaders.d.ts +3 -0
  404. package/lib/typescript/scripts/compile-shaders.d.ts.map +1 -0
  405. package/lib/typescript/src/GridRenderLayer.d.ts.map +1 -1
  406. package/lib/typescript/src/WeatherLayerManager.d.ts.map +1 -1
  407. package/package.json +72 -67
  408. package/src/AguaceroContext.js +3 -3
  409. package/src/GridRenderLayer.js +217 -204
  410. package/src/GridRenderLayerNativeComponent.ts +15 -15
  411. package/src/MapManager.js +155 -155
  412. package/src/MapRegistry.js +34 -34
  413. package/src/StyleApplicator.js +240 -240
  414. package/src/WeatherLayerManager.js +891 -872
  415. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +0 -1003
  416. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +0 -1
  417. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +0 -381
  418. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +0 -1
  419. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +0 -1229
  420. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +0 -1
  421. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +0 -4023
  422. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +0 -1
  423. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +0 -38
  424. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +0 -1
  425. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +0 -30
  426. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +0 -1
  427. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +0 -27
  428. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +0 -1
  429. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +0 -47
  430. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +0 -1
  431. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +0 -301
  432. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +0 -1
  433. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +0 -126
  434. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +0 -1
  435. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +0 -48
  436. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +0 -1029
  437. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +0 -1
  438. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +0 -381
  439. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +0 -1
  440. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +0 -1229
  441. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +0 -1
  442. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +0 -4023
  443. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +0 -1
  444. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +0 -38
  445. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +0 -1
  446. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +0 -30
  447. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +0 -1
  448. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +0 -27
  449. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +0 -1
  450. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +0 -41
  451. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +0 -1
  452. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +0 -301
  453. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +0 -1
  454. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +0 -126
  455. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +0 -1
  456. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +0 -1003
  457. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +0 -1
  458. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +0 -381
  459. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +0 -1
  460. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +0 -1229
  461. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +0 -1
  462. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +0 -4023
  463. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +0 -1
  464. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +0 -38
  465. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +0 -1
  466. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +0 -30
  467. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +0 -1
  468. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +0 -27
  469. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +0 -1
  470. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +0 -47
  471. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +0 -1
  472. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +0 -301
  473. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +0 -1
  474. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +0 -126
  475. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +0 -1
  476. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +0 -48
  477. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +0 -1033
  478. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +0 -1
  479. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +0 -381
  480. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +0 -1
  481. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +0 -1229
  482. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +0 -1
  483. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +0 -4023
  484. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +0 -1
  485. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +0 -38
  486. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +0 -1
  487. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +0 -30
  488. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +0 -1
  489. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +0 -27
  490. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +0 -1
  491. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +0 -41
  492. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +0 -1
  493. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +0 -301
  494. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +0 -1
  495. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +0 -126
  496. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +0 -1
  497. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +0 -1003
  498. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +0 -1
  499. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +0 -381
  500. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +0 -1
  501. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +0 -1229
  502. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +0 -1
  503. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +0 -4023
  504. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +0 -1
  505. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js +0 -38
  506. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +0 -1
  507. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +0 -30
  508. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +0 -1
  509. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +0 -27
  510. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +0 -1
  511. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js +0 -47
  512. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +0 -1
  513. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +0 -301
  514. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +0 -1
  515. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +0 -126
  516. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +0 -1
  517. package/lib/module/node_modules/@aguacerowx/javascript-sdk/package.json +0 -48
  518. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +0 -1021
  519. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +0 -1
  520. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +0 -375
  521. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +0 -1
  522. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +0 -1223
  523. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +0 -1
  524. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +0 -4017
  525. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +0 -1
  526. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js +0 -31
  527. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +0 -1
  528. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +0 -29
  529. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +0 -1
  530. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +0 -21
  531. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +0 -1
  532. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js +0 -12
  533. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +0 -1
  534. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +0 -295
  535. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +0 -1
  536. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +0 -119
  537. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +0 -1
@@ -1,1029 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AguaceroCore = void 0;
7
- var _events = require("./events.js");
8
- var _coordinate_configs = require("./coordinate_configs.js");
9
- var _unitConversions = require("./unitConversions.js");
10
- var _dictionaries = require("./dictionaries.js");
11
- var _defaultColormaps = require("./default-colormaps.js");
12
- var _proj = _interopRequireDefault(require("proj4"));
13
- var _getBundleId = require("./getBundleId");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- // AguaceroCore.js - The Headless "Engine"
16
-
17
- // --- Non-UI Imports ---
18
-
19
- // --- Non-UI Helper Functions ---
20
- function hrdpsObliqueTransform(rotated_lon, rotated_lat) {
21
- const o_lat_p = 53.91148;
22
- const o_lon_p = 245.305142;
23
- const DEG_TO_RAD = Math.PI / 180.0;
24
- const RAD_TO_DEG = 180.0 / Math.PI;
25
- const o_lat_p_rad = o_lat_p * DEG_TO_RAD;
26
- const rot_lon_rad = rotated_lon * DEG_TO_RAD;
27
- const rot_lat_rad = rotated_lat * DEG_TO_RAD;
28
- const sin_rot_lat = Math.sin(rot_lat_rad);
29
- const cos_rot_lat = Math.cos(rot_lat_rad);
30
- const sin_rot_lon = Math.sin(rot_lon_rad);
31
- const cos_rot_lon = Math.cos(rot_lon_rad);
32
- const sin_o_lat_p = Math.sin(o_lat_p_rad);
33
- const cos_o_lat_p = Math.cos(o_lat_p_rad);
34
- const sin_lat = cos_o_lat_p * sin_rot_lat + sin_o_lat_p * cos_rot_lat * cos_rot_lon;
35
- let lat = Math.asin(sin_lat) * RAD_TO_DEG;
36
- const sin_lon_num = cos_rot_lat * sin_rot_lon;
37
- const sin_lon_den = -sin_o_lat_p * sin_rot_lat + cos_o_lat_p * cos_rot_lat * cos_rot_lon;
38
- let lon = Math.atan2(sin_lon_num, sin_lon_den) * RAD_TO_DEG + o_lon_p;
39
- if (lon > 180) lon -= 360;else if (lon < -180) lon += 360;
40
- return [lon, lat];
41
- }
42
- function findLatestModelRun(modelsData, modelName) {
43
- const model = modelsData?.[modelName];
44
- if (!model) return null;
45
- const availableDates = Object.keys(model).sort((a, b) => b.localeCompare(a));
46
- for (const date of availableDates) {
47
- const runs = model[date];
48
- if (!runs) continue;
49
- const availableRuns = Object.keys(runs).sort((a, b) => b.localeCompare(a));
50
- if (availableRuns.length > 0) return {
51
- date: date,
52
- run: availableRuns[0]
53
- };
54
- }
55
- return null;
56
- }
57
- class AguaceroCore extends _events.EventEmitter {
58
- constructor(options = {}) {
59
- super();
60
- this.isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
61
- this.apiKey = options.apiKey;
62
- this.bundleId = (0, _getBundleId.getBundleId)();
63
- this.baseGridUrl = 'https://d3dc62msmxkrd7.cloudfront.net';
64
- if (!this.isReactNative) {
65
- this.worker = this.createWorker();
66
- this.workerRequestId = 0;
67
- this.workerResolvers = new Map();
68
- this.worker.addEventListener('message', this._handleWorkerMessage.bind(this));
69
- this.resultQueue = [];
70
- this.isProcessingQueue = false;
71
- } else {
72
- this.worker = null;
73
- }
74
- this.statusUrl = 'https://d3dc62msmxkrd7.cloudfront.net/model-status';
75
- this.modelStatus = null;
76
- this.mrmsStatus = null;
77
- this.dataCache = new Map();
78
- this.abortControllers = new Map();
79
- this.isPlaying = false;
80
- this.playIntervalId = null;
81
- this.playbackSpeed = options.playbackSpeed || 500;
82
- this.customColormaps = options.customColormaps || {};
83
- const userLayerOptions = options.layerOptions || {};
84
- const initialVariable = userLayerOptions.variable || null;
85
- this.state = {
86
- model: userLayerOptions.model || 'gfs',
87
- isMRMS: false,
88
- mrmsTimestamp: null,
89
- variable: initialVariable,
90
- date: null,
91
- run: null,
92
- forecastHour: 0,
93
- visible: true,
94
- opacity: userLayerOptions.opacity ?? 1,
95
- units: options.initialUnit || 'imperial',
96
- shaderSmoothingEnabled: options.shaderSmoothingEnabled ?? true
97
- };
98
- this.autoRefreshEnabled = options.autoRefresh ?? false;
99
- this.autoRefreshIntervalSeconds = options.autoRefreshInterval ?? 60;
100
- this.autoRefreshIntervalId = null;
101
- }
102
- async setState(newState) {
103
- Object.assign(this.state, newState);
104
- this._emitStateChange();
105
- }
106
- _emitStateChange() {
107
- const {
108
- colormap,
109
- baseUnit
110
- } = this._getColormapForVariable(this.state.variable);
111
- const toUnit = this._getTargetUnit(baseUnit, this.state.units);
112
- const displayColormap = this._convertColormapUnits(colormap, baseUnit, toUnit);
113
- let availableTimestamps = [];
114
- if (this.state.isMRMS && this.state.variable && this.mrmsStatus) {
115
- const timestamps = this.mrmsStatus[this.state.variable] || [];
116
- availableTimestamps = [...timestamps].reverse();
117
- }
118
- const eventPayload = {
119
- ...this.state,
120
- availableModels: this.modelStatus ? Object.keys(this.modelStatus).sort() : [],
121
- availableRuns: this.modelStatus?.[this.state.model] || {},
122
- availableHours: this.state.isMRMS ? [] : this.modelStatus?.[this.state.model]?.[this.state.date]?.[this.state.run] || [],
123
- availableVariables: this.getAvailableVariables(this.state.isMRMS ? 'mrms' : this.state.model),
124
- // We need to confirm this line is working as expected.
125
- availableMRMSVariables: this.getAvailableVariables('mrms'),
126
- availableTimestamps: availableTimestamps,
127
- isPlaying: this.isPlaying,
128
- colormap: displayColormap,
129
- colormapBaseUnit: toUnit
130
- };
131
- this.emit('state:change', eventPayload);
132
- }
133
- async initialize(options = {}) {
134
- await this.fetchModelStatus(true);
135
- await this.fetchMRMSStatus(true);
136
- const latestRun = findLatestModelRun(this.modelStatus, this.state.model);
137
- let initialState = this.state;
138
- if (latestRun && !this.state.isMRMS) {
139
- initialState = {
140
- ...this.state,
141
- ...latestRun,
142
- forecastHour: 0
143
- };
144
- const availableVariables = this.getAvailableVariables(initialState.model);
145
- if (availableVariables && availableVariables.length > 0) {
146
- initialState.variable = availableVariables[0];
147
- }
148
- }
149
- await this.setState(initialState);
150
- if (options.autoRefresh ?? this.autoRefreshEnabled) {
151
- this.startAutoRefresh(options.refreshInterval ?? this.autoRefreshIntervalSeconds);
152
- }
153
- }
154
- destroy() {
155
- this.pause();
156
- this.stopAutoRefresh();
157
- this.dataCache.clear();
158
- if (this.worker) {
159
- this.worker.terminate();
160
- }
161
- this.callbacks = {};
162
- console.log(`AguaceroCore has been destroyed.`);
163
- }
164
-
165
- // --- Public API Methods ---
166
-
167
- play() {
168
- if (this.isPlaying) return;
169
- this.isPlaying = true;
170
- clearInterval(this.playIntervalId);
171
- this.playIntervalId = setInterval(() => {
172
- this.step(1);
173
- }, this.playbackSpeed);
174
- this.emit('playback:start', {
175
- speed: this.playbackSpeed
176
- });
177
- this._emitStateChange(); // Notify UI that isPlaying is now true
178
- }
179
- pause() {
180
- if (!this.isPlaying) return;
181
- this.isPlaying = false;
182
- clearInterval(this.playIntervalId);
183
- this.playIntervalId = null;
184
- this.emit('playback:stop');
185
- this._emitStateChange(); // Notify UI that isPlaying is now false
186
- }
187
- togglePlay() {
188
- this.isPlaying ? this.pause() : this.play();
189
- }
190
- step(direction = 1) {
191
- // --- THIS IS THE CORRECTED MRMS LOGIC ---
192
- if (this.state.isMRMS) {
193
- const {
194
- variable,
195
- mrmsTimestamp
196
- } = this.state;
197
- if (!this.mrmsStatus || !this.mrmsStatus[variable]) {
198
- console.warn('[Core.step] MRMS status or variable not available.');
199
- return;
200
- }
201
-
202
- // CRITICAL FIX: The UI and state emissions use a REVERSED array (newest first).
203
- // The step logic MUST use the same reversed array for indexes to match.
204
- const availableTimestamps = [...(this.mrmsStatus[variable] || [])].reverse();
205
- if (availableTimestamps.length === 0) return;
206
- const currentIndex = availableTimestamps.indexOf(mrmsTimestamp);
207
- if (currentIndex === -1) {
208
- // If not found, reset to the first (newest) frame
209
- this.setState({
210
- mrmsTimestamp: availableTimestamps[0]
211
- });
212
- return;
213
- }
214
- const maxIndex = availableTimestamps.length - 1;
215
- let nextIndex = currentIndex + direction;
216
-
217
- // Loop animation
218
- if (nextIndex > maxIndex) nextIndex = 0;
219
- if (nextIndex < 0) nextIndex = maxIndex;
220
- const newTimestamp = availableTimestamps[nextIndex];
221
- this.setState({
222
- mrmsTimestamp: newTimestamp
223
- });
224
- } else {
225
- const {
226
- model,
227
- date,
228
- run,
229
- forecastHour
230
- } = this.state;
231
- const forecastHours = this.modelStatus?.[model]?.[date]?.[run];
232
- if (!forecastHours || forecastHours.length === 0) return;
233
- const currentIndex = forecastHours.indexOf(forecastHour);
234
- if (currentIndex === -1) return;
235
- const maxIndex = forecastHours.length - 1;
236
- let nextIndex = currentIndex + direction;
237
- if (nextIndex > maxIndex) nextIndex = 0;
238
- if (nextIndex < 0) nextIndex = maxIndex;
239
- const newHour = forecastHours[nextIndex];
240
- this.setState({
241
- forecastHour: newHour
242
- });
243
- }
244
- }
245
- setPlaybackSpeed(speed) {
246
- if (speed > 0) {
247
- this.playbackSpeed = speed;
248
- if (this.isPlaying) this.play();
249
- }
250
- }
251
- async setShaderSmoothing(enabled) {
252
- if (typeof enabled !== 'boolean' || enabled === this.state.shaderSmoothingEnabled) return;
253
- await this.setState({
254
- shaderSmoothingEnabled: enabled
255
- });
256
- }
257
- async setOpacity(newOpacity) {
258
- const clampedOpacity = Math.max(0, Math.min(1, newOpacity));
259
- if (clampedOpacity === this.state.opacity) return;
260
- await this.setState({
261
- opacity: clampedOpacity
262
- });
263
- }
264
- async setVariable(variable) {
265
- await this.setState({
266
- variable
267
- });
268
- }
269
- async setModel(modelName) {
270
- if (modelName === this.state.model || !this.modelStatus?.[modelName]) return;
271
- const latestRun = findLatestModelRun(this.modelStatus, modelName);
272
- if (latestRun) {
273
- await this.setState({
274
- model: modelName,
275
- date: latestRun.date,
276
- run: latestRun.run,
277
- forecastHour: 0
278
- });
279
- }
280
- }
281
- async setRun(runString) {
282
- const [date, run] = runString.split(':');
283
- if (date !== this.state.date || run !== this.state.run) {
284
- await this.setState({
285
- date,
286
- run,
287
- forecastHour: 0
288
- });
289
- }
290
- }
291
- async setUnits(newUnits) {
292
- if (newUnits === this.state.units || !['metric', 'imperial'].includes(newUnits)) return;
293
- await this.setState({
294
- units: newUnits
295
- });
296
- }
297
- async setMRMSVariable(variable) {
298
- const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
299
- const initialTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
300
- await this.setState({
301
- variable,
302
- isMRMS: true,
303
- mrmsTimestamp: initialTimestamp
304
- });
305
- }
306
- async setMRMSTimestamp(timestamp) {
307
- if (!this.state.isMRMS) return;
308
- await this.setState({
309
- mrmsTimestamp: timestamp
310
- });
311
- }
312
- async switchMode(options) {
313
- const {
314
- mode,
315
- variable,
316
- model,
317
- forecastHour,
318
- mrmsTimestamp
319
- } = options;
320
- if (!mode || !variable) {
321
- console.error("switchMode requires 'mode' ('mrms' | 'model') and 'variable' properties.");
322
- return;
323
- }
324
- if (mode === 'model' && !model) {
325
- console.error("switchMode with mode 'model' requires a 'model' property.");
326
- return;
327
- }
328
- let targetState = {};
329
- if (mode === 'mrms') {
330
- let finalTimestamp = mrmsTimestamp;
331
- if (finalTimestamp === undefined) {
332
- const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
333
- finalTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
334
- }
335
- targetState = {
336
- isMRMS: true,
337
- variable: variable,
338
- mrmsTimestamp: finalTimestamp,
339
- model: this.state.model,
340
- date: null,
341
- run: null,
342
- forecastHour: 0
343
- };
344
- } else if (mode === 'model') {
345
- const latestRun = findLatestModelRun(this.modelStatus, model);
346
- if (!latestRun) {
347
- console.error(`Could not find a valid run for model: ${model}`);
348
- return;
349
- }
350
- targetState = {
351
- isMRMS: false,
352
- model: model,
353
- variable: variable,
354
- date: latestRun.date,
355
- run: latestRun.run,
356
- forecastHour: forecastHour !== undefined ? forecastHour : 0,
357
- mrmsTimestamp: null
358
- };
359
- } else {
360
- console.error(`Invalid mode specified in switchMode: '${mode}'`);
361
- return;
362
- }
363
- await this.setState(targetState);
364
- }
365
-
366
- // --- Data and Calculation Methods ---
367
-
368
- _reconstructData(decompressedDeltas, encoding) {
369
- const expectedLength = encoding.length;
370
- const reconstructedData = new Int8Array(expectedLength);
371
- if (decompressedDeltas.length > 0 && expectedLength > 0) {
372
- // First value is absolute
373
- reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
374
-
375
- // Subsequent values are deltas from the previous one
376
- for (let i = 1; i < expectedLength; i++) {
377
- const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
378
- reconstructedData[i] = reconstructedData[i - 1] + delta;
379
- }
380
- }
381
- // Return as a Uint8Array, which is what the rest of the code expects
382
- return new Uint8Array(reconstructedData.buffer);
383
- }
384
- async _loadGridData(state) {
385
- if (this.isReactNative) {
386
- console.warn(`[AguaceroCore] _loadGridData was called in React Native. This is a bypass. Data loading is handled natively.`);
387
- return null;
388
- }
389
- const {
390
- model,
391
- date,
392
- run,
393
- forecastHour,
394
- variable,
395
- isMRMS,
396
- mrmsTimestamp
397
- } = state;
398
- let effectiveSmoothing = 0;
399
- const customVariableSettings = this.customColormaps[variable];
400
- if (customVariableSettings && typeof customVariableSettings.smoothing === 'number') {
401
- effectiveSmoothing = customVariableSettings.smoothing;
402
- }
403
- let resourcePath;
404
- let dataUrlIdentifier;
405
- if (isMRMS) {
406
- if (!mrmsTimestamp) return null;
407
- const mrmsDate = new Date(mrmsTimestamp * 1000);
408
- const y = mrmsDate.getUTCFullYear(),
409
- m = (mrmsDate.getUTCMonth() + 1).toString().padStart(2, '0'),
410
- d = mrmsDate.getUTCDate().toString().padStart(2, '0');
411
- dataUrlIdentifier = `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}`;
412
- resourcePath = `/grids/mrms/${y}${m}${d}/${mrmsTimestamp}/0/${variable}/${effectiveSmoothing}`;
413
- } else {
414
- dataUrlIdentifier = `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
415
- resourcePath = `/grids/${model}/${date}/${run}/${forecastHour}/${variable}/${effectiveSmoothing}`;
416
- }
417
- if (this.dataCache.has(dataUrlIdentifier)) {
418
- return this.dataCache.get(dataUrlIdentifier);
419
- }
420
-
421
- // --- EDITED ---
422
- // If we are in React Native, this function should NOT do any work.
423
- // The native WeatherFrameProcessorModule is now responsible for all data loading.
424
- // This function might still be called by a "cache miss" fallback, but it
425
- // should not fetch data from JS anymore. We return null so the fallback knows
426
- // that the native module is the only source of truth for new data.
427
- if (this.isReactNative) {
428
- console.warn(`_loadGridData was called in React Native for ${dataUrlIdentifier}. This should be handled by the native module. Returning null.`);
429
- return null;
430
- }
431
- const abortController = new AbortController();
432
- this.abortControllers.set(dataUrlIdentifier, abortController);
433
- const loadPromise = (async () => {
434
- if (!this.apiKey) {
435
- throw new Error('API key is not configured.');
436
- }
437
- try {
438
- const baseUrl = `${this.baseGridUrl}${resourcePath}`;
439
- const urlWithApiKeyParam = `${baseUrl}?apiKey=${this.apiKey}`;
440
- const headers = {
441
- 'x-api-key': this.apiKey
442
- };
443
- if (this.bundleId && this.isReactNative) {
444
- headers['x-app-identifier'] = this.bundleId;
445
- }
446
- const response = await fetch(urlWithApiKeyParam, {
447
- headers: headers,
448
- signal: abortController.signal
449
- });
450
- if (!response.ok) {
451
- throw new Error(`Failed to fetch grid data: ${response.status} ${response.statusText}`);
452
- }
453
- const {
454
- data: b64Data,
455
- encoding
456
- } = await response.json();
457
- const compressedData = Uint8Array.from(atob(b64Data), c => c.charCodeAt(0));
458
-
459
- // This path is now ONLY for the web worker
460
- const requestId = this.workerRequestId++;
461
- const workerPromise = new Promise((resolve, reject) => {
462
- this.workerResolvers.set(requestId, {
463
- resolve,
464
- reject
465
- });
466
- });
467
- this.worker.postMessage({
468
- requestId,
469
- compressedData,
470
- encoding
471
- }, [compressedData.buffer]);
472
- const result = await workerPromise;
473
- const finalData = result.data;
474
- const transformedData = new Uint8Array(finalData.length);
475
- for (let i = 0; i < finalData.length; i++) {
476
- const signedValue = finalData[i] > 127 ? finalData[i] - 256 : finalData[i];
477
- transformedData[i] = signedValue + 128;
478
- }
479
- this.abortControllers.delete(dataUrlIdentifier);
480
- return {
481
- data: transformedData,
482
- encoding
483
- };
484
- } catch (error) {
485
- if (error.name === 'AbortError') {
486
- console.log(`Request cancelled for ${resourcePath}`);
487
- } else {
488
- console.error(`Failed to load data for path ${resourcePath}:`, error);
489
- }
490
- this.dataCache.delete(dataUrlIdentifier);
491
- this.abortControllers.delete(dataUrlIdentifier);
492
- return null;
493
- }
494
- })();
495
- this.dataCache.set(dataUrlIdentifier, loadPromise);
496
- return loadPromise;
497
- }
498
- cancelAllRequests() {
499
- // Abort all in-flight requests
500
- this.abortControllers.forEach((controller, key) => {
501
- controller.abort();
502
- });
503
-
504
- // Clear both maps
505
- this.abortControllers.clear();
506
- this.dataCache.clear();
507
- console.log('All pending requests cancelled');
508
- }
509
- async getValueAtLngLat(lng, lat) {
510
- const {
511
- variable,
512
- isMRMS,
513
- mrmsTimestamp,
514
- model,
515
- date,
516
- run,
517
- forecastHour,
518
- units
519
- } = this.state;
520
- if (!variable) return null;
521
- const gridIndices = this._getGridIndexFromLngLat(lng, lat);
522
- if (!gridIndices) return null;
523
- const {
524
- i,
525
- j
526
- } = gridIndices;
527
- const gridModel = isMRMS ? 'mrms' : model;
528
- const normalizedGridModel = this._normalizeModelName(gridModel);
529
- const {
530
- nx
531
- } = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel].grid_params;
532
- const customSettings = this.customColormaps[variable];
533
- const effectiveSmoothing = customSettings && typeof customSettings.smoothing === 'number' ? customSettings.smoothing : 0;
534
- const dataUrlIdentifier = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
535
- const gridDataPromise = this.dataCache.get(dataUrlIdentifier);
536
- if (!gridDataPromise) return null;
537
- try {
538
- const gridData = await gridDataPromise;
539
- if (!gridData || !gridData.data) return null;
540
- const index1D = j * nx + i;
541
- const byteValue = gridData.data[index1D];
542
- const signedQuantizedValue = byteValue - 128;
543
-
544
- // --- START OF FIX ---
545
- // You were missing 'scale_type' in this destructuring assignment.
546
- const {
547
- scale,
548
- offset,
549
- missing_quantized,
550
- scale_type
551
- } = gridData.encoding;
552
- // --- END OF FIX ---
553
-
554
- if (signedQuantizedValue === missing_quantized) return null;
555
- const intermediateValue = signedQuantizedValue * scale + offset;
556
-
557
- // Step 2: Apply non-linear scaling if specified
558
- let nativeValue = intermediateValue;
559
- if (scale_type === 'sqrt') {
560
- // Square the value while preserving its sign
561
- nativeValue = intermediateValue < 0 ? -(intermediateValue * intermediateValue) : intermediateValue * intermediateValue;
562
- }
563
- const {
564
- colormap,
565
- baseUnit
566
- } = this._getColormapForVariable(variable);
567
-
568
- // If the value is outside the colormap's bounds, return null.
569
- if (colormap && colormap.length >= 2) {
570
- const minBound = colormap[0];
571
- const maxBound = colormap[colormap.length - 2];
572
- if (nativeValue < minBound || nativeValue > maxBound) {
573
- return null;
574
- }
575
- }
576
- let dataNativeUnit = baseUnit || (_dictionaries.DICTIONARIES.fld[variable] || {}).defaultUnit || 'none';
577
- const displayUnit = this._getTargetUnit(dataNativeUnit, units);
578
- const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(dataNativeUnit, displayUnit);
579
- const displayValue = conversionFunc ? conversionFunc(nativeValue) : nativeValue;
580
- return {
581
- lngLat: {
582
- lng,
583
- lat
584
- },
585
- variable: {
586
- code: variable,
587
- name: this.getVariableDisplayName(variable)
588
- },
589
- value: displayValue,
590
- unit: displayUnit
591
- };
592
- } catch (error) {
593
- return null;
594
- }
595
- }
596
- getAvailableVariables(modelName = null) {
597
- const model = modelName || this.state.model;
598
- return _dictionaries.MODEL_CONFIGS[model]?.vars || [];
599
- }
600
- getVariableDisplayName(variableCode) {
601
- const varInfo = _dictionaries.DICTIONARIES.fld[variableCode];
602
- return varInfo?.displayName || varInfo?.name || variableCode;
603
- }
604
- _getColormapForVariable(variable) {
605
- if (!variable) return {
606
- colormap: [],
607
- baseUnit: ''
608
- };
609
- if (this.customColormaps[variable] && this.customColormaps[variable].colormap) {
610
- return {
611
- colormap: this.customColormaps[variable].colormap,
612
- baseUnit: this.customColormaps[variable].baseUnit || ''
613
- };
614
- }
615
- const colormapKey = _dictionaries.DICTIONARIES.variable_cmap[variable] || variable;
616
- const customColormap = this.customColormaps[colormapKey];
617
- if (customColormap && customColormap.colormap) {
618
- return {
619
- colormap: customColormap.colormap,
620
- baseUnit: customColormap.baseUnit || ''
621
- };
622
- }
623
- const defaultColormapData = _defaultColormaps.DEFAULT_COLORMAPS[colormapKey];
624
- if (defaultColormapData && defaultColormapData.units) {
625
- // ✅ Get defaultUnit from the field dictionary
626
- const fieldInfo = _dictionaries.DICTIONARIES.fld[variable] || {};
627
- const baseUnit = fieldInfo.defaultUnit || Object.keys(defaultColormapData.units)[0];
628
- const unitData = defaultColormapData.units[baseUnit];
629
- if (unitData && unitData.colormap) {
630
- return {
631
- colormap: unitData.colormap,
632
- baseUnit: baseUnit
633
- };
634
- }
635
- }
636
- return {
637
- colormap: [],
638
- baseUnit: ''
639
- };
640
- }
641
- _convertColormapUnits(colormap, fromUnits, toUnits) {
642
- if (fromUnits === toUnits) return colormap;
643
- const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(fromUnits, toUnits);
644
- if (!conversionFunc) return colormap;
645
- const newColormap = [];
646
- for (let i = 0; i < colormap.length; i += 2) {
647
- newColormap.push(conversionFunc(colormap[i]), colormap[i + 1]);
648
- }
649
- return newColormap;
650
- }
651
- _normalizeModelName(modelName) {
652
- const mapping = {
653
- 'hrrr': ['mpashn', 'mpasrt', 'mpasht', 'hrrrsub', 'rrfs', 'namnest', 'mpasrn', 'mpasrn3', 'mpasht2'],
654
- 'arw': ['arw2', 'fv3', 'href'],
655
- 'rtma': ['nbm'],
656
- 'ecmwf': ['ecmwfaifs'],
657
- 'gfs': ['arpege', 'graphcastgfs']
658
- };
659
- for (const [normalized, aliases] of Object.entries(mapping)) {
660
- if (aliases.includes(modelName)) return normalized;
661
- }
662
- return modelName;
663
- }
664
- _getGridCornersAndDef(model) {
665
- const normalizedModel = this._normalizeModelName(model);
666
- const gridDef = {
667
- ..._coordinate_configs.COORDINATE_CONFIGS[normalizedModel],
668
- modelName: model
669
- };
670
- if (!gridDef) return null;
671
- const {
672
- nx,
673
- ny
674
- } = gridDef.grid_params;
675
- const gridType = gridDef.type;
676
- let corners;
677
- if (gridType === 'latlon') {
678
- let {
679
- lon_first,
680
- lat_first,
681
- lat_last,
682
- lon_last,
683
- dx_degrees,
684
- dy_degrees
685
- } = gridDef.grid_params;
686
- corners = {
687
- lon_tl: lon_first,
688
- lat_tl: lat_first,
689
- lon_tr: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
690
- lat_tr: lat_first,
691
- lon_bl: lon_first,
692
- lat_bl: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees,
693
- lon_br: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
694
- lat_br: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees
695
- };
696
- } else if (gridType === 'rotated_latlon') {
697
- const [lon_tl, lat_tl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first);
698
- const [lon_tr, lat_tr] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first);
699
- const [lon_bl, lat_bl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
700
- const [lon_br, lat_br] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
701
- corners = {
702
- lon_tl,
703
- lat_tl,
704
- lon_tr,
705
- lat_tr,
706
- lon_bl,
707
- lat_bl,
708
- lon_br,
709
- lat_br
710
- };
711
- } else if (gridType === 'lambert_conformal_conic' || gridType === 'polar_ stereographic') {
712
- let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
713
- if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
714
- const {
715
- x_origin,
716
- y_origin,
717
- dx,
718
- dy
719
- } = gridDef.grid_params;
720
- const [lon_tl, lat_tl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin]);
721
- const [lon_tr, lat_tr] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin]);
722
- const [lon_bl, lat_bl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin + (ny - 1) * dy]);
723
- const [lon_br, lat_br] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin + (ny - 1) * dy]);
724
- corners = {
725
- lon_tl,
726
- lat_tl,
727
- lon_tr,
728
- lat_tr,
729
- lon_bl,
730
- lat_bl,
731
- lon_br,
732
- lat_br
733
- };
734
- } else {
735
- return null;
736
- }
737
- return {
738
- corners,
739
- gridDef
740
- };
741
- }
742
- _getTargetUnit(defaultUnit, system) {
743
- if (system === 'metric') {
744
- if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°C';
745
- if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'km/h';
746
- if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'mm';
747
- }
748
- if (system === 'imperial') {
749
- if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°F';
750
- if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'mph';
751
- if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'in';
752
- }
753
- return defaultUnit;
754
- }
755
- _getGridIndexFromLngLat(lng, lat) {
756
- const gridModel = this.state.isMRMS ? 'mrms' : this.state.model;
757
- const normalizedGridModel = this._normalizeModelName(gridModel);
758
- const gridDef = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel];
759
- if (!gridDef) return null;
760
- const {
761
- nx,
762
- ny
763
- } = gridDef.grid_params;
764
- const pixelCoords = this.latLonToGridPixel(lat, lng, gridDef, gridModel);
765
- if (!pixelCoords || !isFinite(pixelCoords.x) || !isFinite(pixelCoords.y) || pixelCoords.x < 0 || pixelCoords.y < 0) return null;
766
- const i = Math.round(pixelCoords.x);
767
- const j = Math.round(pixelCoords.y);
768
- if (i >= 0 && i < nx && j >= 0 && j < ny) return {
769
- i,
770
- j
771
- };
772
- return null;
773
- }
774
- latLonToProjected(lat, lon, gridDef) {
775
- if (!isFinite(lat) || !isFinite(lon)) throw new Error(`Invalid coordinates: lat=${lat}, lon=${lon}`);
776
- const gridType = gridDef.type;
777
- if (gridType === 'latlon') return {
778
- x: lon,
779
- y: lat
780
- };
781
- let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
782
- if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
783
- const projected = (0, _proj.default)('EPSG:4326', projString, [lon, lat]);
784
- return {
785
- x: projected[0],
786
- y: projected[1]
787
- };
788
- }
789
- latLonToGridPixel(lat, lon, gridDef, modelName) {
790
- if (!gridDef) return null;
791
- if (modelName === 'rgem' && gridDef.type === 'polar_stereographic') return this.latLonToGridPixelPolarStereographic(lat, lon, gridDef);
792
- const projected = this.latLonToProjected(lat, lon, gridDef);
793
- let x, y;
794
- const gridOrigin = {
795
- x: gridDef.grid_params.lon_first,
796
- y: gridDef.grid_params.lat_first
797
- };
798
- const gridPixelSize = {
799
- x: gridDef.grid_params.dx_degrees,
800
- y: gridDef.grid_params.dy_degrees
801
- };
802
- if (gridDef.type === 'latlon' || gridDef.type === 'rotated_latlon') {
803
- let adjustedLon = projected.x;
804
- if (modelName === 'mrms') {
805
- if (adjustedLon < 0) adjustedLon += 360;
806
- x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
807
- y = (gridOrigin.y - projected.y) / gridPixelSize.y;
808
- } else {
809
- const isGFSType = gridDef.grid_params && gridDef.grid_params.lon_first === 0.0 && Math.abs(gridDef.grid_params.lat_first) === 90.0;
810
- const isECMWFType = gridDef.grid_params && gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === 90.0;
811
- const isGEMType = modelName === 'gem' || gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === -90.0 && gridDef.grid_params.lon_last === 179.85;
812
- if (isGEMType) {
813
- while (adjustedLon < gridOrigin.x) adjustedLon += 360;
814
- x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
815
- y = (projected.y - gridOrigin.y) / gridPixelSize.y;
816
- return {
817
- x,
818
- y
819
- };
820
- }
821
- let isFlippedGrid = isECMWFType ? true : gridDef.grid_params.lat_first < (gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees);
822
- if (isGFSType) adjustedLon = projected.x + 180;else if (isECMWFType) {
823
- if (adjustedLon < gridOrigin.x) adjustedLon += 360;
824
- } else if (['arome1', 'arome25', 'arpegeeu', 'iconeu', 'icond2'].includes(modelName)) {
825
- while (adjustedLon < 0) adjustedLon += 360;
826
- while (adjustedLon >= 360) adjustedLon -= 360;
827
- x = adjustedLon >= gridOrigin.x ? (adjustedLon - gridOrigin.x) / gridPixelSize.x : (adjustedLon + 360 - gridOrigin.x) / gridPixelSize.x;
828
- if (['arome1', 'arome25', 'arpegeeu'].includes(modelName)) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else if (['iconeu', 'icond2'].includes(modelName)) y = (projected.y - gridOrigin.y) / gridPixelSize.y;
829
- return {
830
- x,
831
- y
832
- };
833
- } else {
834
- const lonFirst = gridOrigin.x;
835
- if (lonFirst > 180 && adjustedLon < 0) adjustedLon += 360;else if (lonFirst < 0 && adjustedLon > 180) adjustedLon -= 360;
836
- }
837
- x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
838
- if (isFlippedGrid) {
839
- if (isECMWFType) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else {
840
- const maxLat = gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees;
841
- y = (maxLat - projected.y) / Math.abs(gridPixelSize.y);
842
- }
843
- } else y = (projected.y - gridOrigin.y) / gridPixelSize.y;
844
- }
845
- } else {
846
- const projOrigin = {
847
- x: gridDef.grid_params.x_origin,
848
- y: gridDef.grid_params.y_origin
849
- };
850
- const projPixelSize = {
851
- x: gridDef.grid_params.dx,
852
- y: gridDef.grid_params.dy
853
- };
854
- x = (projected.x - projOrigin.x) / projPixelSize.x;
855
- y = (projOrigin.y - projected.y) / Math.abs(projPixelSize.y);
856
- }
857
- return {
858
- x,
859
- y
860
- };
861
- }
862
- latLonToGridPixelPolarStereographic(lat, lon, gridDef) {
863
- try {
864
- const projParams = gridDef.proj_params;
865
- let projectionString = `+proj=${projParams.proj}`;
866
- Object.keys(projParams).forEach(key => {
867
- if (key !== 'proj') projectionString += ` +${key}=${projParams[key]}`;
868
- });
869
- projectionString += ' +lat_0=90 +no_defs';
870
- const {
871
- nx,
872
- ny,
873
- dx,
874
- dy,
875
- x_origin,
876
- y_origin
877
- } = gridDef.grid_params;
878
- const x_min = x_origin;
879
- const x_max = x_origin + (nx - 1) * dx;
880
- const y_max = y_origin;
881
- const y_min = y_origin + (ny - 1) * dy;
882
- const [proj_x, proj_y] = (0, _proj.default)('EPSG:4326', projectionString, [lon, lat]);
883
- if (!isFinite(proj_x) || !isFinite(proj_y)) return {
884
- x: -1,
885
- y: -1
886
- };
887
- const t_x = (proj_x - x_min) / (x_max - x_min);
888
- const t_y = (proj_y - y_max) / (y_min - y_max);
889
- const x = t_x * (nx - 1);
890
- const y = t_y * (ny - 1);
891
- return {
892
- x,
893
- y
894
- };
895
- } catch (error) {
896
- console.warn(`[GridAccessor] RGEM polar stereographic conversion failed for ${lat}, ${lon}:`, error);
897
- return {
898
- x: -1,
899
- y: -1
900
- };
901
- }
902
- }
903
-
904
- // --- Worker and Status Methods ---
905
-
906
- createWorker() {
907
- if (this.isReactNative) return null;
908
- const workerCode = `
909
- import { decompress } from 'https://cdn.skypack.dev/fzstd@0.1.1';
910
-
911
- function _reconstructData(decompressedDeltas, encoding) {
912
- const expectedLength = encoding.length;
913
- const reconstructedData = new Int8Array(expectedLength);
914
- if (decompressedDeltas.length > 0 && expectedLength > 0) {
915
- reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
916
- for (let i = 1; i < expectedLength; i++) {
917
- const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
918
- reconstructedData[i] = reconstructedData[i - 1] + delta;
919
- }
920
- }
921
- return new Uint8Array(reconstructedData.buffer);
922
- }
923
-
924
- self.onmessage = async (e) => {
925
- const { requestId, compressedData, encoding } = e.data;
926
- try {
927
- const decompressedDeltas = await decompress(compressedData);
928
- const finalData = _reconstructData(decompressedDeltas, encoding);
929
- self.postMessage({ success: true, requestId: requestId, decompressedData: finalData, encoding: encoding }, [finalData.buffer]);
930
- } catch (error) {
931
- self.postMessage({ success: false, requestId: requestId, error: error.message });
932
- }
933
- };
934
- `;
935
- const blob = new Blob([workerCode], {
936
- type: 'application/javascript'
937
- });
938
- return new Worker(URL.createObjectURL(blob), {
939
- type: 'module'
940
- });
941
- }
942
- _processResultQueue() {
943
- while (this.resultQueue.length > 0) {
944
- const {
945
- success,
946
- requestId,
947
- decompressedData,
948
- encoding,
949
- error
950
- } = this.resultQueue.shift();
951
- if (this.workerResolvers.has(requestId)) {
952
- const {
953
- resolve,
954
- reject
955
- } = this.workerResolvers.get(requestId);
956
- if (success) {
957
- resolve({
958
- data: decompressedData
959
- }); // Return as { data: ... }
960
- } else {
961
- reject(new Error(error));
962
- }
963
- this.workerResolvers.delete(requestId);
964
- }
965
- }
966
- this.isProcessingQueue = false;
967
- }
968
- _handleWorkerMessage(e) {
969
- if (this.isReactNative) return;
970
- const {
971
- success,
972
- requestId,
973
- decompressedData,
974
- encoding,
975
- error
976
- } = e.data;
977
- this.resultQueue.push({
978
- success,
979
- requestId,
980
- decompressedData,
981
- encoding,
982
- error
983
- });
984
- if (!this.isProcessingQueue) {
985
- this.isProcessingQueue = true;
986
- requestAnimationFrame(() => this._processResultQueue());
987
- }
988
- }
989
- async fetchModelStatus(force = false) {
990
- if (!this.modelStatus || force) {
991
- try {
992
- const response = await fetch(this.statusUrl);
993
- if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
994
- this.modelStatus = (await response.json()).models;
995
- } catch (error) {
996
- this.modelStatus = null;
997
- }
998
- }
999
- return this.modelStatus;
1000
- }
1001
- async fetchMRMSStatus(force = false) {
1002
- const mrmsStatusUrl = 'https://h3dfvh5pq6euq36ymlpz4zqiha0obqju.lambda-url.us-east-2.on.aws';
1003
- if (!this.mrmsStatus || force) {
1004
- try {
1005
- const response = await fetch(mrmsStatusUrl);
1006
- if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
1007
- this.mrmsStatus = await response.json();
1008
- } catch (error) {
1009
- this.mrmsStatus = null;
1010
- }
1011
- }
1012
- return this.mrmsStatus;
1013
- }
1014
- startAutoRefresh(intervalSeconds) {
1015
- this.stopAutoRefresh();
1016
- this.autoRefreshIntervalId = setInterval(async () => {
1017
- await this.fetchModelStatus(true);
1018
- this._emitStateChange();
1019
- }, (intervalSeconds || 60) * 1000);
1020
- }
1021
- stopAutoRefresh() {
1022
- if (this.autoRefreshIntervalId) {
1023
- clearInterval(this.autoRefreshIntervalId);
1024
- this.autoRefreshIntervalId = null;
1025
- }
1026
- }
1027
- }
1028
- exports.AguaceroCore = AguaceroCore;
1029
- //# sourceMappingURL=AguaceroCore.js.map