@aguacerowx/react-native 0.0.20 → 0.0.21

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