@aguacerowx/react-native 0.0.6 → 0.0.7

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