@splunk/visualizations 24.3.5 → 24.4.0

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 (298) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueRadial_basic_scp_theme.png +0 -0
  2. package/.loki/reference/chrome_docker_Visualizations_Area_Area_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  3. package/.loki/reference/chrome_docker_Visualizations_Area_Area_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  4. package/.loki/reference/chrome_docker_Visualizations_Bar_Bar_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  5. package/.loki/reference/chrome_docker_Visualizations_Bar_Bar_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  6. package/.loki/reference/chrome_docker_Visualizations_Bubble_Bubble_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  7. package/.loki/reference/chrome_docker_Visualizations_Bubble_Bubble_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  8. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Click.png +0 -0
  9. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Default.png +0 -0
  10. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Missing_Props_Message_When_No_Svg.png +0 -0
  11. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Placeholder_If_No_Svg_And_No_Data.png +0 -0
  12. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Set_the_color_of_multiple_areas_in_an_Svg_based_on_a_rangeValue_threshold.png +0 -0
  13. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Set_the_color_of_multiple_areas_in_an_Svg_based_on_areaIds.png +0 -0
  14. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Set_the_color_using_multiMap_formatter.png +0 -0
  15. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Svg_Shows_Even_When_No_Datasources.png +0 -0
  16. package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Use_Local_To_Download_Svg.png +0 -0
  17. package/.loki/reference/chrome_docker_Visualizations_Column_Column_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  18. package/.loki/reference/chrome_docker_Visualizations_Column_Column_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  19. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Background_Color_orange.png +0 -0
  20. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Basic_Filler_Gauge.png +0 -0
  21. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Gauge_Color_computed_using_rangeValue_formatter.png +0 -0
  22. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Gauge_Color_yellow.png +0 -0
  23. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Label_Display_number_default.png +0 -0
  24. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Label_Display_off.png +0 -0
  25. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Label_Display_percentage.png +0 -0
  26. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Major_Tick_Interval_10.png +0 -0
  27. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Major_Tick_Interval_auto_default.png +0 -0
  28. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Orientation_horizontal.png +0 -0
  29. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Orientation_horizontal_height_100_no_placeholder.png +0 -0
  30. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Orientation_vertical_default.png +0 -0
  31. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  32. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  33. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Value_Display_number_default.png +0 -0
  34. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Value_Display_off.png +0 -0
  35. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Value_Display_percentage.png +0 -0
  36. package/.loki/reference/chrome_docker_Visualizations_Filler_Gauge_Filler_Gauge_Value_Display_percentage_Label_Display_percentage.png +0 -0
  37. package/.loki/reference/chrome_docker_Visualizations_Image_Image_No_image_src_present_in_options.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Image_Image_No_options_present.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Basic_LinkGraph.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Field_Order_First_and_Last_Fields.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Field_Order_From_the_First_to_the_Last_Fields.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Field_Order_From_the_Last_to_the_First_Fields.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Node_Text_Highlight_Color.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Result_Limit_3.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_Show_Placeholder.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Basic_Map.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Additional_Cases.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Static_Coloring.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
  58. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
  59. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
  60. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_with_geostats_data_No_render.png +0 -0
  61. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
  62. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
  63. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
  64. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
  65. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
  66. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
  67. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Background_Color_blue.png +0 -0
  68. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Basic_Marker_Gauge.png +0 -0
  69. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Gauge_Ranges_0_to_30_purple_30_to_90_blue_90_to_100_pink.png +0 -0
  70. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Gauge_Ranges_negative_10_to_50_blue.png +0 -0
  71. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Label_Display_number_default.png +0 -0
  72. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Label_Display_off.png +0 -0
  73. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Label_Display_percentage.png +0 -0
  74. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Major_Tick_Interval_7.png +0 -0
  75. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Orientation_horizontal.png +0 -0
  76. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Orientation_vertical_default.png +0 -0
  77. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  78. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  79. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Value_Display_number_default.png +0 -0
  80. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Value_Display_off.png +0 -0
  81. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Value_Display_percentage.png +0 -0
  82. package/.loki/reference/chrome_docker_Visualizations_Marker_Gauge_Marker_Gauge_Value_Display_percentage_Label_Display_percentage.png +0 -0
  83. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Array_column_values.png +0 -0
  84. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Background_Color_yellow.png +0 -0
  85. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Basic_Parallel_Coordinates.png +0 -0
  86. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Categorical_dataSources_excessive_categorical_data.png +0 -0
  87. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Larger_Dimensions_width_800_height_500.png +0 -0
  88. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Line_Color_pink.png +0 -0
  89. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Line_Opacity_0_3.png +0 -0
  90. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Numerical_dataSources.png +0 -0
  91. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Show_Null_Axis_false.png +0 -0
  92. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Show_Placeholder.png +0 -0
  93. package/.loki/reference/chrome_docker_Visualizations_Parallel_Coordinates_Parallel_Coordinates_Stringified_Numerical_dataSources.png +0 -0
  94. package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  95. package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_values_in_datasource_are_all_invalid.png +0 -0
  96. package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  97. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Background_Color_green.png +0 -0
  98. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Basic_Punchcard.png +0 -0
  99. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Color_red.png +0 -0
  100. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Label_Display_all_default.png +0 -0
  101. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Label_Display_max.png +0 -0
  102. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Label_Display_off.png +0 -0
  103. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Row_Scale_global_default.png +0 -0
  104. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Row_Scale_row.png +0 -0
  105. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Max_50.png +0 -0
  106. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Max_75_Bubble_Size_Min_15_Bubble_Size_Method_radius_Bubble_Row_Scale_row.png +0 -0
  107. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Max_75_Bubble_Size_Min_15_Color_Mode_categorical.png +0 -0
  108. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Method_area_default.png +0 -0
  109. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Method_radius.png +0 -0
  110. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Bubble_Size_Min_10.png +0 -0
  111. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Color_Mode_categorical.png +0 -0
  112. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Color_Mode_categorical_Legend_Display_off.png +0 -0
  113. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Color_Mode_categorical_Legend_Display_right_default.png +0 -0
  114. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Color_Mode_categorical_Series_Color_red_blue_green_orange_cyan.png +0 -0
  115. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Color_Mode_dynamic_default.png +0 -0
  116. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Multi_Series.png +0 -0
  117. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  118. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  119. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Default_Sort_false_default.png +0 -0
  120. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Default_Sort_true.png +0 -0
  121. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_false.png +0 -0
  122. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_false_Bubble_Radius_Max_25.png +0 -0
  123. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_false_Bubble_Radius_Min_5.png +0 -0
  124. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_false_Bubble_Radius_Min_5_Bubble_Radius_Max_30_Bubble_Row_Scale_row.png +0 -0
  125. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_false_Bubble_Radius_Min_5_Bubble_Radius_Max_30_Color_Mode_categorical_Bubble_Size_Method_radius.png +0 -0
  126. package/.loki/reference/chrome_docker_Visualizations_Punchcard_Punchcard_Show_Dynamic_Bubble_Size_true_default.png +0 -0
  127. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Background_Color_pink.png +0 -0
  128. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Backward_Link_Self_Loop.png +0 -0
  129. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Basic_Sankey.png +0 -0
  130. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Color_Mode_dynamic.png +0 -0
  131. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Larger_Dimension.png +0 -0
  132. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Link_Opacity_0_8.png +0 -0
  133. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Link_Opacity_Changed.png +0 -0
  134. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Link_Values_Not_Default.png +0 -0
  135. package/.loki/reference/chrome_docker_Visualizations_Sankey_Sankey_Show_Placeholder.png +0 -0
  136. package/.loki/reference/chrome_docker_Visualizations_Scatter_Scatter_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  137. package/.loki/reference/chrome_docker_Visualizations_Scatter_Scatter_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  138. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon.png +0 -0
  139. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Change_Icon_Color_For_A_Remote_Icon.png +0 -0
  140. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_The_Icon_As_A_Remote_Icon.png +0 -0
  141. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_the_backgroundColor_based_on_the_majorValue.png +0 -0
  142. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_the_icon_color_based_on_the_majorValue.png +0 -0
  143. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_the_majorColor_based_on_the_majorValue.png +0 -0
  144. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_Mixed_Type_Series_Data.png +0 -0
  145. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_Numerical_Series_Data.png +0 -0
  146. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_String_Type_Series_Data.png +0 -0
  147. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_The_First_Series_Data_If_No_Matched_Type.png +0 -0
  148. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_Time_Type_Series_Data.png +0 -0
  149. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Background_From_Major_Value.png +0 -0
  150. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Background_From_Trend_Value.png +0 -0
  151. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial.png +0 -0
  152. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Major_Value_Color.png +0 -0
  153. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Major_Value_Color_By_Trend_Value.png +0 -0
  154. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Max_Value_1000.png +0 -0
  155. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Radial_Color_By_Major_Value.png +0 -0
  156. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Show_Placeholder.png +0 -0
  157. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Use_String_Type_Series_Data.png +0 -0
  158. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value.png +0 -0
  159. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Change_The_Color_Of_Major_Value_Based_On_Its_Value.png +0 -0
  160. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_No_Trend_Value.png +0 -0
  161. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Background_Color_Based_On_The_Major_Value.png +0 -0
  162. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Background_Color_Based_On_The_Trend_Value.png +0 -0
  163. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Color_Of_Major_Value_Based_On_The_Trend_Value.png +0 -0
  164. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Color_Of_The_Trend_Indicators_And_Number_Based_On_The_Trend_Value.png +0 -0
  165. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Show_Gaps_For_Null_Value_In_Sparkline.png +0 -0
  166. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Show_Placeholder.png +0 -0
  167. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Trend_Index_Out_Of_Range.png +0 -0
  168. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Trend_Value_Is_Zero.png +0 -0
  169. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_Mixed_Type_Series_Data.png +0 -0
  170. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_Numerical_Series_Data.png +0 -0
  171. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_String_Type_Series_Data.png +0 -0
  172. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_The_First_Series_Data_If_No_Matched_Type.png +0 -0
  173. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_Time_Type_Series_Data.png +0 -0
  174. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_No_Stripe.png +0 -0
  175. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_Stripe.png +0 -0
  176. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Placeholder.png +0 -0
  177. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Show_Internal_Fields_false.png +0 -0
  178. package/Area.config.js +40 -31
  179. package/Area.config.js.map +1 -1
  180. package/Area.js +150 -130
  181. package/Area.js.map +1 -1
  182. package/Bar.config.js +33 -24
  183. package/Bar.config.js.map +1 -1
  184. package/Bar.js +143 -123
  185. package/Bar.js.map +1 -1
  186. package/Bubble.config.js +26 -17
  187. package/Bubble.config.js.map +1 -1
  188. package/Bubble.js +136 -116
  189. package/Bubble.js.map +1 -1
  190. package/ChoroplethSvg.config.js +24 -15
  191. package/ChoroplethSvg.config.js.map +1 -1
  192. package/ChoroplethSvg.js +139 -119
  193. package/ChoroplethSvg.js.map +1 -1
  194. package/Column.config.js +33 -24
  195. package/Column.config.js.map +1 -1
  196. package/Column.js +143 -123
  197. package/Column.js.map +1 -1
  198. package/Ellipse.config.js +20 -19
  199. package/Ellipse.config.js.map +1 -1
  200. package/Ellipse.js +106 -94
  201. package/Ellipse.js.map +1 -1
  202. package/FillerGauge.config.js +31 -22
  203. package/FillerGauge.config.js.map +1 -1
  204. package/FillerGauge.js +124 -104
  205. package/FillerGauge.js.map +1 -1
  206. package/Image.config.js +10 -10
  207. package/Image.config.js.map +1 -1
  208. package/Image.js +90 -75
  209. package/Image.js.map +1 -1
  210. package/Line.config.js +33 -24
  211. package/Line.config.js.map +1 -1
  212. package/Line.js +143 -123
  213. package/Line.js.map +1 -1
  214. package/LinkGraph.config.js +52 -42
  215. package/LinkGraph.config.js.map +1 -1
  216. package/LinkGraph.js +143 -123
  217. package/LinkGraph.js.map +1 -1
  218. package/Map.config.js +30 -14
  219. package/Map.config.js.map +1 -1
  220. package/Map.js +1583 -1127
  221. package/Map.js.map +1 -1
  222. package/Markdown.config.js +8 -8
  223. package/Markdown.config.js.map +1 -1
  224. package/Markdown.js +176 -161
  225. package/Markdown.js.map +1 -1
  226. package/MarkerGauge.config.js +21 -11
  227. package/MarkerGauge.config.js.map +1 -1
  228. package/MarkerGauge.js +180 -162
  229. package/MarkerGauge.js.map +1 -1
  230. package/ParallelCoordinates.config.js +21 -11
  231. package/ParallelCoordinates.config.js.map +1 -1
  232. package/ParallelCoordinates.js +128 -108
  233. package/ParallelCoordinates.js.map +1 -1
  234. package/Pie.config.js +21 -11
  235. package/Pie.config.js.map +1 -1
  236. package/Pie.js +193 -109
  237. package/Pie.js.map +1 -1
  238. package/Punchcard.config.js +21 -11
  239. package/Punchcard.config.js.map +1 -1
  240. package/Punchcard.js +153 -133
  241. package/Punchcard.js.map +1 -1
  242. package/Rectangle.config.js +22 -22
  243. package/Rectangle.config.js.map +1 -1
  244. package/Rectangle.js +157 -149
  245. package/Rectangle.js.map +1 -1
  246. package/Sankey.config.js +31 -21
  247. package/Sankey.config.js.map +1 -1
  248. package/Sankey.js +3109 -2961
  249. package/Sankey.js.map +1 -1
  250. package/Scatter.config.js +25 -15
  251. package/Scatter.config.js.map +1 -1
  252. package/Scatter.js +173 -155
  253. package/Scatter.js.map +1 -1
  254. package/SingleValue.config.js +41 -32
  255. package/SingleValue.config.js.map +1 -1
  256. package/SingleValue.js +252 -234
  257. package/SingleValue.js.map +1 -1
  258. package/SingleValueBasic.js +16 -16
  259. package/SingleValueBasic.js.map +1 -1
  260. package/SingleValueIcon.config.js +38 -37
  261. package/SingleValueIcon.config.js.map +1 -1
  262. package/SingleValueIcon.js +2640 -2767
  263. package/SingleValueIcon.js.map +1 -1
  264. package/SingleValueRadial.config.js +174 -136
  265. package/SingleValueRadial.config.js.map +1 -1
  266. package/SingleValueRadial.js +164 -146
  267. package/SingleValueRadial.js.map +1 -1
  268. package/Table.config.js +30 -20
  269. package/Table.config.js.map +1 -1
  270. package/Table.js +261 -259
  271. package/Table.js.map +1 -1
  272. package/common/Charting.js +17 -16
  273. package/common/Charting.js.map +1 -1
  274. package/common/EventsDoc.js +15 -14
  275. package/common/EventsDoc.js.map +1 -1
  276. package/common/GaugeMajorTicks.js +2 -2
  277. package/common/GaugeMajorTicks.js.map +1 -1
  278. package/common/GaugeValueMarker.js +2 -2
  279. package/common/GaugeValueMarker.js.map +1 -1
  280. package/common/OptionsDoc.js +8 -7
  281. package/common/OptionsDoc.js.map +1 -1
  282. package/common/OverviewDoc.js +22 -22
  283. package/common/OverviewDoc.js.map +1 -1
  284. package/common/SplunkVisualizationApi.js +2 -2
  285. package/common/SplunkVisualizationApi.js.map +1 -1
  286. package/common/ThemesDoc.js +14 -14
  287. package/common/ThemesDoc.js.map +1 -1
  288. package/common/chartingUtils.js +2 -2
  289. package/common/chartingUtils.js.map +1 -1
  290. package/common/docUtils.js +4 -4
  291. package/common/docUtils.js.map +1 -1
  292. package/common/gaugeUtils.js +11 -11
  293. package/common/gaugeUtils.js.map +1 -1
  294. package/common/shapeUtils.js +12 -12
  295. package/common/shapeUtils.js.map +1 -1
  296. package/common/withDashboardViz.js +29 -16
  297. package/common/withDashboardViz.js.map +1 -1
  298. package/package.json +12 -11
package/Map.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 189);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 193);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -186,7 +186,7 @@ exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOp
186
186
 
187
187
  var lodash_1 = __webpack_require__(2);
188
188
 
189
- var schemaUtils_1 = __webpack_require__(14);
189
+ var schemaUtils_1 = __webpack_require__(15);
190
190
 
191
191
  var VizBehavior_1 = __webpack_require__(5);
192
192
 
@@ -498,10 +498,16 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
498
498
  /* 11 */
499
499
  /***/ (function(module, exports) {
500
500
 
501
- module.exports = require("@splunk/visualizations-shared/colorUtils");
501
+ module.exports = require("@splunk/themes/variables");
502
502
 
503
503
  /***/ }),
504
504
  /* 12 */
505
+ /***/ (function(module, exports) {
506
+
507
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
508
+
509
+ /***/ }),
510
+ /* 13 */
505
511
  /***/ (function(module, exports, __webpack_require__) {
506
512
 
507
513
  "use strict";
@@ -515,11 +521,11 @@ var React = __webpack_require__(1);
515
521
 
516
522
  var styled_components_1 = __webpack_require__(4);
517
523
 
518
- var SizeAwareWrapper_1 = __webpack_require__(16);
524
+ var SizeAwareWrapper_1 = __webpack_require__(17);
519
525
 
520
- var style_1 = __webpack_require__(13);
526
+ var style_1 = __webpack_require__(14);
521
527
 
522
- var colorUtils_1 = __webpack_require__(11);
528
+ var colorUtils_1 = __webpack_require__(12);
523
529
 
524
530
  var Item = styled_components_1.default.div.attrs(function (_ref) {
525
531
  var width = _ref.width;
@@ -576,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
576
582
 
577
583
  return React.createElement(FixSizeItem, {
578
584
  "data-test": "fix-size-item",
579
- "data-splunk-visualization-version": "24.3.5 - 8d7f16f22",
585
+ "data-splunk-visualization-version": "24.4.0 - 98920928c",
580
586
  width: width,
581
587
  height: height,
582
588
  backgroundColor: backgroundColor
@@ -597,31 +603,30 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
597
603
  exports.default = withFixedSizeContainer;
598
604
 
599
605
  /***/ }),
600
- /* 13 */
606
+ /* 14 */
601
607
  /***/ (function(module, exports) {
602
608
 
603
609
  module.exports = require("@splunk/visualizations-shared/style");
604
610
 
605
611
  /***/ }),
606
- /* 14 */
612
+ /* 15 */
607
613
  /***/ (function(module, exports) {
608
614
 
609
615
  module.exports = require("@splunk/visualizations-shared/schemaUtils");
610
616
 
611
617
  /***/ }),
612
- /* 15 */
618
+ /* 16 */
613
619
  /***/ (function(module, exports) {
614
620
 
615
621
  module.exports = require("@babel/runtime/helpers/createClass");
616
622
 
617
623
  /***/ }),
618
- /* 16 */
624
+ /* 17 */
619
625
  /***/ (function(module, exports) {
620
626
 
621
627
  module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
622
628
 
623
629
  /***/ }),
624
- /* 17 */,
625
630
  /* 18 */,
626
631
  /* 19 */,
627
632
  /* 20 */
@@ -638,6 +643,39 @@ module.exports = require("@babel/runtime/helpers/typeof");
638
643
  "use strict";
639
644
 
640
645
 
646
+ Object.defineProperty(exports, "__esModule", {
647
+ value: true
648
+ });
649
+ exports.pickFieldFromJSONSchema = void 0;
650
+
651
+ var lodash_1 = __webpack_require__(2);
652
+
653
+ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
654
+ var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
655
+ return Object.keys(optionsSchema).reduce(function (accum, k) {
656
+ if (lodash_1.has(optionsSchema[k], fieldName)) {
657
+ accum[k] = optionsSchema[k][fieldName];
658
+ } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
659
+ var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
660
+
661
+ if (!lodash_1.isEmpty(nestedSchema)) {
662
+ accum[k] = nestedSchema;
663
+ }
664
+ }
665
+
666
+ return accum;
667
+ }, {});
668
+ };
669
+
670
+ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
671
+
672
+ /***/ }),
673
+ /* 24 */
674
+ /***/ (function(module, exports, __webpack_require__) {
675
+
676
+ "use strict";
677
+
678
+
641
679
  var _defineProperty = __webpack_require__(8);
642
680
 
643
681
  Object.defineProperty(exports, "__esModule", {
@@ -702,7 +740,7 @@ var getSortingParams = function getSortingParams(_ref) {
702
740
  exports.getSortingParams = getSortingParams;
703
741
 
704
742
  /***/ }),
705
- /* 24 */
743
+ /* 25 */
706
744
  /***/ (function(module, exports, __webpack_require__) {
707
745
 
708
746
  "use strict";
@@ -765,39 +803,6 @@ var getPaginationParams = function getPaginationParams(_ref) {
765
803
 
766
804
  exports.getPaginationParams = getPaginationParams;
767
805
 
768
- /***/ }),
769
- /* 25 */
770
- /***/ (function(module, exports, __webpack_require__) {
771
-
772
- "use strict";
773
-
774
-
775
- Object.defineProperty(exports, "__esModule", {
776
- value: true
777
- });
778
- exports.pickFieldFromJSONSchema = void 0;
779
-
780
- var lodash_1 = __webpack_require__(2);
781
-
782
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
783
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
784
- return Object.keys(optionsSchema).reduce(function (accum, k) {
785
- if (lodash_1.has(optionsSchema[k], fieldName)) {
786
- accum[k] = optionsSchema[k][fieldName];
787
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
788
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
789
-
790
- if (!lodash_1.isEmpty(nestedSchema)) {
791
- accum[k] = nestedSchema;
792
- }
793
- }
794
-
795
- return accum;
796
- }, {});
797
- };
798
-
799
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
800
-
801
806
  /***/ }),
802
807
  /* 26 */
803
808
  /***/ (function(module, exports, __webpack_require__) {
@@ -820,7 +825,7 @@ var i18n_1 = __webpack_require__(3);
820
825
 
821
826
  var Message_1 = __webpack_require__(9);
822
827
 
823
- var FixedSizeContainer_1 = __webpack_require__(12);
828
+ var FixedSizeContainer_1 = __webpack_require__(13);
824
829
  /**
825
830
  * @method shouldShowIconPlaceholder
826
831
  * @param {object} dataSources
@@ -844,7 +849,8 @@ var propTypes = {
844
849
  width: T.oneOfType([T.string, T.number]),
845
850
  height: T.oneOfType([T.string, T.number]),
846
851
  // eslint-disable-next-line react/no-unused-prop-types
847
- backgroundColor: T.string
852
+ backgroundColor: T.string,
853
+ iconColor: T.string
848
854
  };
849
855
  /**
850
856
  * @method IconPlaceholder
@@ -855,14 +861,16 @@ var propTypes = {
855
861
  var IconPlaceholder = function IconPlaceholder(props) {
856
862
  var width = props.width,
857
863
  height = props.height,
858
- icon = props.icon;
864
+ icon = props.icon,
865
+ iconColor = props.iconColor;
859
866
 
860
867
  if (icon) {
861
868
  return React.createElement(icon, {
862
869
  style: {
863
870
  left: '50%',
864
871
  top: '50%',
865
- color: 'grey',
872
+ color: iconColor,
873
+ opacity: 0.15,
866
874
  position: 'absolute',
867
875
  transform: 'translate(-50%, -50%)'
868
876
  },
@@ -941,13 +949,13 @@ var SplunkVisualization_1 = __webpack_require__(32);
941
949
 
942
950
  var VizBehavior_1 = __webpack_require__(5);
943
951
 
944
- var getSorting_1 = __webpack_require__(23);
952
+ var getSorting_1 = __webpack_require__(24);
945
953
 
946
- var getPagination_1 = __webpack_require__(24);
954
+ var getPagination_1 = __webpack_require__(25);
947
955
 
948
956
  var useDeepMemo_1 = __webpack_require__(35);
949
957
 
950
- var JSONSchemaUtils_1 = __webpack_require__(25);
958
+ var JSONSchemaUtils_1 = __webpack_require__(23);
951
959
 
952
960
  var MissingPropsMessage_1 = __webpack_require__(36);
953
961
 
@@ -1316,7 +1324,7 @@ exports.default = SplunkVisualization;
1316
1324
 
1317
1325
  var _classCallCheck = __webpack_require__(10);
1318
1326
 
1319
- var _createClass = __webpack_require__(15);
1327
+ var _createClass = __webpack_require__(16);
1320
1328
 
1321
1329
  Object.defineProperty(exports, "__esModule", {
1322
1330
  value: true
@@ -1422,7 +1430,7 @@ var i18n_1 = __webpack_require__(3);
1422
1430
 
1423
1431
  var Message_1 = __webpack_require__(9);
1424
1432
 
1425
- var FixedSizeContainer_1 = __webpack_require__(12);
1433
+ var FixedSizeContainer_1 = __webpack_require__(13);
1426
1434
  /**
1427
1435
  * @method isMissing
1428
1436
  * @param {any} v
@@ -1504,7 +1512,7 @@ var Cover = styled_components_1.default.div.withConfig({
1504
1512
  componentId: "sc-1gsbnxb-0"
1505
1513
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1506
1514
  var Blocker = styled_components_1.default.div.attrs({
1507
- 'data-splunk-visualization-version': "24.3.5 - 8d7f16f22"
1515
+ 'data-splunk-visualization-version': "24.4.0 - 98920928c"
1508
1516
  }).withConfig({
1509
1517
  displayName: "withEditModeCover__Blocker",
1510
1518
  componentId: "sc-1gsbnxb-1"
@@ -1547,7 +1555,9 @@ Object.defineProperty(exports, "__esModule", {
1547
1555
 
1548
1556
  var React = __webpack_require__(1);
1549
1557
 
1550
- var colorUtils_1 = __webpack_require__(11);
1558
+ var colorUtils_1 = __webpack_require__(12);
1559
+
1560
+ var variables_1 = __webpack_require__(11);
1551
1561
 
1552
1562
  var IconPlaceholder_1 = __webpack_require__(26);
1553
1563
 
@@ -1561,7 +1571,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1561
1571
  var themes = config.themes;
1562
1572
 
1563
1573
  var Wrapper = function Wrapper(props) {
1564
- var _a;
1574
+ var _a, _b;
1565
1575
 
1566
1576
  var dataSources = props.dataSources,
1567
1577
  loading = props.loading,
@@ -1570,14 +1580,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1570
1580
  width = props.width;
1571
1581
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1572
1582
  var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1583
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1584
+ var iconColor = variables_1.default.contentColorActive(props);
1573
1585
 
1574
1586
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1575
1587
  return React.createElement(IconPlaceholder_1.default, {
1576
1588
  "data-test": "icon-placeholder",
1577
- icon: config.icon,
1589
+ icon: icon,
1578
1590
  width: width,
1579
1591
  height: height,
1580
- backgroundColor: bgColorFromTheme
1592
+ backgroundColor: bgColorFromTheme,
1593
+ iconColor: iconColor
1581
1594
  });
1582
1595
  }
1583
1596
 
@@ -1610,10 +1623,15 @@ module.exports = require("@splunk/visualization-color-palettes");
1610
1623
  /* 42 */
1611
1624
  /***/ (function(module, exports) {
1612
1625
 
1626
+ module.exports = require("@splunk/visualization-icons/placeholders");
1627
+
1628
+ /***/ }),
1629
+ /* 43 */
1630
+ /***/ (function(module, exports) {
1631
+
1613
1632
  module.exports = require("@splunk/visualization-icons");
1614
1633
 
1615
1634
  /***/ }),
1616
- /* 43 */,
1617
1635
  /* 44 */,
1618
1636
  /* 45 */,
1619
1637
  /* 46 */,
@@ -1644,19 +1662,19 @@ module.exports = require("@babel/runtime/helpers/slicedToArray");
1644
1662
  /* 66 */,
1645
1663
  /* 67 */,
1646
1664
  /* 68 */,
1647
- /* 69 */
1665
+ /* 69 */,
1666
+ /* 70 */
1648
1667
  /***/ (function(module, exports) {
1649
1668
 
1650
1669
  module.exports = require("d3-scale");
1651
1670
 
1652
1671
  /***/ }),
1653
- /* 70 */
1672
+ /* 71 */
1654
1673
  /***/ (function(module, exports) {
1655
1674
 
1656
1675
  module.exports = require("@splunk/themes");
1657
1676
 
1658
1677
  /***/ }),
1659
- /* 71 */,
1660
1678
  /* 72 */,
1661
1679
  /* 73 */,
1662
1680
  /* 74 */,
@@ -1685,337 +1703,474 @@ module.exports = require("@splunk/themes");
1685
1703
  /* 97 */,
1686
1704
  /* 98 */,
1687
1705
  /* 99 */,
1688
- /* 100 */
1689
- /***/ (function(module, exports) {
1690
-
1691
- module.exports = require("@splunk/react-ui/Popover");
1692
-
1693
- /***/ }),
1694
- /* 101 */,
1695
- /* 102 */,
1696
- /* 103 */,
1697
- /* 104 */,
1698
- /* 105 */,
1699
- /* 106 */,
1700
- /* 107 */,
1701
- /* 108 */,
1702
- /* 109 */,
1703
- /* 110 */,
1704
- /* 111 */,
1705
- /* 112 */,
1706
- /* 113 */,
1707
- /* 114 */,
1708
- /* 115 */,
1709
- /* 116 */,
1710
- /* 117 */,
1711
- /* 118 */,
1712
- /* 119 */,
1713
- /* 120 */,
1714
- /* 121 */,
1715
- /* 122 */,
1716
- /* 123 */
1706
+ /* 100 */,
1707
+ /* 101 */
1717
1708
  /***/ (function(module, exports) {
1718
1709
 
1719
- module.exports = require("maplibre-gl");
1710
+ module.exports = require("@splunk/visualization-encoding/utils/dsl");
1720
1711
 
1721
1712
  /***/ }),
1722
- /* 124 */,
1723
- /* 125 */,
1724
- /* 126 */,
1725
- /* 127 */,
1726
- /* 128 */,
1727
- /* 129 */,
1728
- /* 130 */,
1729
- /* 131 */,
1730
- /* 132 */,
1731
- /* 133 */,
1732
- /* 134 */,
1733
- /* 135 */,
1734
- /* 136 */,
1735
- /* 137 */,
1736
- /* 138 */,
1737
- /* 139 */,
1738
- /* 140 */,
1739
- /* 141 */,
1740
- /* 142 */,
1741
- /* 143 */,
1742
- /* 144 */,
1743
- /* 145 */,
1744
- /* 146 */,
1745
- /* 147 */,
1746
- /* 148 */,
1747
- /* 149 */,
1748
- /* 150 */,
1749
- /* 151 */,
1750
- /* 152 */,
1751
- /* 153 */,
1752
- /* 154 */,
1753
- /* 155 */,
1754
- /* 156 */,
1755
- /* 157 */,
1756
- /* 158 */,
1757
- /* 159 */,
1758
- /* 160 */,
1759
- /* 161 */,
1760
- /* 162 */,
1761
- /* 163 */,
1762
- /* 164 */,
1763
- /* 165 */,
1764
- /* 166 */,
1765
- /* 167 */,
1766
- /* 168 */,
1767
- /* 169 */,
1768
- /* 170 */,
1769
- /* 171 */,
1770
- /* 172 */,
1771
- /* 173 */,
1772
- /* 174 */,
1773
- /* 175 */,
1774
- /* 176 */,
1775
- /* 177 */,
1776
- /* 178 */,
1777
- /* 179 */,
1778
- /* 180 */,
1779
- /* 181 */,
1780
- /* 182 */,
1781
- /* 183 */,
1782
- /* 184 */,
1783
- /* 185 */,
1784
- /* 186 */,
1785
- /* 187 */,
1786
- /* 188 */,
1787
- /* 189 */
1713
+ /* 102 */
1788
1714
  /***/ (function(module, exports, __webpack_require__) {
1789
1715
 
1790
1716
  "use strict";
1791
1717
 
1792
1718
 
1793
- var __rest = this && this.__rest || function (s, e) {
1794
- var t = {};
1795
-
1796
- for (var p in s) {
1797
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1798
- }
1719
+ var _slicedToArray = __webpack_require__(49);
1799
1720
 
1800
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1801
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1802
- }
1803
- return t;
1804
- };
1721
+ var _toConsumableArray = __webpack_require__(39);
1805
1722
 
1806
1723
  Object.defineProperty(exports, "__esModule", {
1807
1724
  value: true
1808
1725
  });
1809
- exports.PureMap = exports.config = exports.themes = exports.computeVizProps = void 0;
1810
- /* eslint-disable no-sequences */
1726
+ exports.getGlobalLayerBoundaries = exports.isValidLatLon = exports.bakeBubbleData = exports.sanitizeValues = exports.transposeArray = exports.matchBubbleSize = exports.getStaticColors = exports.getZoomLevelFromGeobin = exports.getZoomConstraintsFromTileConfig = exports.getMapStyle = exports.getTilePreset = exports.MAX_BUBBLE_RADIUS = exports.MIN_BUBBLE_RADIUS = exports.MAP_STYLE_VERSION_NUMBER = exports.DEFAULT_SERIES_COLORS = exports.DEFAULT_CLUSTER_COLOR = exports.DEFAULT_RESULT_LIMIT = exports.MIN_LONGITUDE = exports.MAX_LONGITUDE = exports.MIN_LATITUDE = exports.MAX_LATITUDE = void 0;
1811
1727
 
1812
- var React = __webpack_require__(1);
1728
+ var lodash_1 = __webpack_require__(2);
1813
1729
 
1814
- var colorUtils_1 = __webpack_require__(11);
1730
+ var d3_scale_1 = __webpack_require__(70);
1815
1731
 
1816
- var types_1 = __webpack_require__(190);
1732
+ var colorUtils_1 = __webpack_require__(12);
1817
1733
 
1818
- var dsl_1 = __webpack_require__(191);
1734
+ var visualization_color_palettes_1 = __webpack_require__(41);
1819
1735
 
1820
- var JSONSchemaUtils_1 = __webpack_require__(25);
1736
+ exports.MAX_LATITUDE = 90;
1737
+ exports.MIN_LATITUDE = -90;
1738
+ exports.MAX_LONGITUDE = 180;
1739
+ exports.MIN_LONGITUDE = -180;
1740
+ exports.DEFAULT_RESULT_LIMIT = 1000;
1741
+ exports.DEFAULT_CLUSTER_COLOR = '#909090';
1742
+ exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL; // MapLibre requires a map style specification number which is always 8
1821
1743
 
1822
- var hocUtils_1 = __webpack_require__(7);
1744
+ exports.MAP_STYLE_VERSION_NUMBER = 8; // currently using one [min, max] value set for bubbles across all zoom levels
1745
+ // TODO: design choices on [min, max] bubble size for different zoom levels
1823
1746
 
1824
- var PureMap_1 = __webpack_require__(192);
1747
+ exports.MIN_BUBBLE_RADIUS = 4;
1748
+ exports.MAX_BUBBLE_RADIUS = 50;
1749
+ /**
1750
+ * Construct a tile preset {key: config} by combining the default + custom tile configs
1751
+ * Also returns the default tile config for each theme - light/dark
1752
+ * @param {MapContextInterface} args
1753
+ * @param {BaseTileConfig[]} args.defaultTileConfig
1754
+ * @param {BaseTileConfig[]} args.customTileConfig
1755
+ * @returns {Object} tile preset
1756
+ */
1825
1757
 
1826
- exports.PureMap = PureMap_1.default;
1758
+ var getTilePreset = function getTilePreset(_ref) {
1759
+ var _ref$defaultTileConfi = _ref.defaultTileConfig,
1760
+ defaultTileConfig = _ref$defaultTileConfi === void 0 ? [] : _ref$defaultTileConfi,
1761
+ _ref$customTileConfig = _ref.customTileConfig,
1762
+ customTileConfig = _ref$customTileConfig === void 0 ? [] : _ref$customTileConfig;
1827
1763
 
1828
- var config_1 = __webpack_require__(200);
1764
+ var _a, _b;
1829
1765
 
1830
- exports.config = config_1.default;
1766
+ var tilePreset = {};
1767
+ var defaultTileLight = {};
1768
+ var defaultTileDark = {};
1769
+ var tileConfigs = [].concat(defaultTileConfig).concat(customTileConfig);
1770
+ lodash_1.forEach(tileConfigs, function (tileConfig) {
1771
+ var key = tileConfig === null || tileConfig === void 0 ? void 0 : tileConfig.key;
1772
+ var updatedConfig = Object.assign(Object.assign({
1773
+ theme: 'all'
1774
+ }, tileConfig), {
1775
+ version: exports.MAP_STYLE_VERSION_NUMBER
1776
+ });
1777
+ tilePreset[key] = updatedConfig;
1778
+ });
1831
1779
 
1832
- var withDashboardViz_1 = __webpack_require__(28);
1780
+ if (defaultTileConfig.length > 0) {
1781
+ defaultTileLight = (_a = defaultTileConfig.find(function (config) {
1782
+ return config.theme === 'light';
1783
+ })) !== null && _a !== void 0 ? _a : defaultTileConfig.find(function (config) {
1784
+ return config.theme === undefined;
1785
+ });
1786
+ defaultTileDark = (_b = defaultTileConfig.find(function (config) {
1787
+ return config.theme === 'dark';
1788
+ })) !== null && _b !== void 0 ? _b : defaultTileConfig.find(function (config) {
1789
+ return config.theme === undefined;
1790
+ });
1791
+ }
1833
1792
 
1834
- var computeVizProps = function computeVizProps(_ref) {
1835
- var themeFunc = _ref.themeFunc,
1836
- theme = _ref.theme,
1837
- layers = _ref.layers,
1838
- dataSources = _ref.dataSources;
1839
- var themeColorVariables = ['controlBackgroundColor', 'controlForegroundColor'];
1840
- var themeColors = {};
1841
- themeColorVariables.forEach(function (variable) {
1842
- themeColors[variable] = themeFunc(variable);
1843
- }); // Markers use different icons, Bubbles has different styles for light and dark theme
1844
- // this prop is passed for that
1793
+ return {
1794
+ tilePreset: tilePreset,
1795
+ defaultTileLight: defaultTileLight,
1796
+ defaultTileDark: defaultTileDark
1797
+ };
1798
+ };
1845
1799
 
1846
- var themeColorScheme = (theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1) ? theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1.colorScheme : 'dark';
1847
- layers.forEach(function (l) {
1848
- var _a, _b, _c, _d; // add key `geobin` to the layer object if the data is returned from geostats commands
1849
- // to distinguish geostats commands from table commands
1800
+ exports.getTilePreset = getTilePreset;
1801
+ /**
1802
+ * Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.
1803
+ * If no, construct a mapStyle with baseLayerTilerServer and baseLayerTileServerType
1804
+ * Else return default tile config based on current theme
1805
+ * @param {Object} args
1806
+ * @param {BaseTileConfig[]} args.tilePreset
1807
+ * @param {String} args.baseLayerTilerServer
1808
+ * @param {String} args.baseLayerTileServerType
1809
+ * @param {String} args.colorScheme
1810
+ * @param {BaseTileConfig} args.defaultTileDark
1811
+ * @param {BaseTileConfig} args.defaultTileLight
1812
+ * @returns {BaseTileConfig} mapStyle
1813
+ */
1850
1814
 
1815
+ var getMapStyle = function getMapStyle(_ref2) {
1816
+ var _ref2$baseLayerTileSe = _ref2.baseLayerTileServer,
1817
+ baseLayerTileServer = _ref2$baseLayerTileSe === void 0 ? '' : _ref2$baseLayerTileSe,
1818
+ _ref2$baseLayerTileSe2 = _ref2.baseLayerTileServerType,
1819
+ baseLayerTileServerType = _ref2$baseLayerTileSe2 === void 0 ? '' : _ref2$baseLayerTileSe2,
1820
+ _ref2$tilePreset = _ref2.tilePreset,
1821
+ tilePreset = _ref2$tilePreset === void 0 ? {} : _ref2$tilePreset,
1822
+ _ref2$colorScheme = _ref2.colorScheme,
1823
+ colorScheme = _ref2$colorScheme === void 0 ? 'light' : _ref2$colorScheme,
1824
+ _ref2$defaultTileLigh = _ref2.defaultTileLight,
1825
+ defaultTileLight = _ref2$defaultTileLigh === void 0 ? {} : _ref2$defaultTileLigh,
1826
+ _ref2$defaultTileDark = _ref2.defaultTileDark,
1827
+ defaultTileDark = _ref2$defaultTileDark === void 0 ? {} : _ref2$defaultTileDark;
1851
1828
 
1852
- var dataSourceData = (_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {};
1853
- var geobinIdx = ((_c = dataSourceData.fields) !== null && _c !== void 0 ? _c : []).map(function (field) {
1854
- return typeof field === 'string' ? field : field.name;
1855
- }).indexOf('geobin');
1856
- var layer = l;
1829
+ if (baseLayerTileServer && tilePreset[baseLayerTileServer] && (tilePreset[baseLayerTileServer].theme === colorScheme || tilePreset[baseLayerTileServer].theme === 'all')) {
1830
+ return tilePreset[baseLayerTileServer];
1831
+ }
1857
1832
 
1858
- if (geobinIdx > -1) {
1859
- layer.geobin = dataSourceData.columns[geobinIdx];
1860
- }
1833
+ if (baseLayerTileServer && baseLayerTileServerType) {
1834
+ var tiles = [];
1835
+ /**
1836
+ * Tile Server URLs (eg: http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png) can specify the variable {s} which refers to a subdomain
1837
+ * Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'
1838
+ * Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers
1839
+ */
1861
1840
 
1862
- layer.bubbleSizeFields = ((_d = dataSourceData.fields) !== null && _d !== void 0 ? _d : []).map(function (field) {
1863
- return typeof field === 'string' ? field : field.name;
1864
- }).filter(function (field, index) {
1865
- var _a, _b;
1841
+ if (baseLayerTileServer.match(/^(https?):\/\/{(s|S)}\../)) {
1842
+ /**
1843
+ * sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains
1844
+ * In order to preserve this behavior during conversion to splunk.map,
1845
+ * if the variable {s} or {S} is detected, replace it with 'a', 'b' and 'c' - default values for subdomains
1846
+ * TODO: in the future, add an additional prop - baseLayerTileServerSubdomains: ['x', 'y', 'z'], default being ['a', 'b', 'c']
1847
+ */
1848
+ tiles = [baseLayerTileServer.replace(/{(s|S)}/, 'a'), baseLayerTileServer.replace(/{(s|S)}/, 'b'), baseLayerTileServer.replace(/{(s|S)}/, 'c')];
1849
+ } else {
1850
+ tiles = [baseLayerTileServer];
1851
+ } // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options
1866
1852
 
1867
- return !['latitude', 'longitude', 'geobin'].includes(field) && types_1.inferDataTypeFromData((_b = (_a = dataSourceData.columns) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : []) === 'number';
1868
- }); // Sanitize colors within layers
1869
1853
 
1870
- layer.seriesColors = Array.isArray(layer.seriesColors) ? colorUtils_1.sanitizeArrayOfColors(layer.seriesColors) : undefined;
1871
- layer.dataColors = Array.isArray(layer.dataColors) ? colorUtils_1.sanitizeArrayOfColors(layer.dataColors) : undefined;
1872
- });
1873
- return Object.assign(Object.assign(Object.assign({}, themeColors), {
1874
- themeColorScheme: themeColorScheme
1875
- }), layers);
1854
+ var mapStyle = {
1855
+ version: exports.MAP_STYLE_VERSION_NUMBER,
1856
+ sources: {
1857
+ 'base-tiles': {
1858
+ type: baseLayerTileServerType,
1859
+ tiles: tiles,
1860
+ tileSize: 256
1861
+ }
1862
+ },
1863
+ layers: [{
1864
+ id: 'base-layer',
1865
+ type: 'raster',
1866
+ source: 'base-tiles',
1867
+ minzoom: 0,
1868
+ maxzoom: 10
1869
+ }]
1870
+ };
1871
+ return mapStyle;
1872
+ } // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults
1873
+
1874
+
1875
+ return colorScheme === 'light' ? defaultTileLight : defaultTileDark;
1876
1876
  };
1877
1877
 
1878
- exports.computeVizProps = computeVizProps; // HOC for stripping the internal fields for Maps
1878
+ exports.getMapStyle = getMapStyle;
1879
1879
 
1880
- var withoutInternalFields = function withoutInternalFields(Viz) {
1881
- // eslint-disable-next-line react/display-name
1882
- var VizWithoutInternalFields = function VizWithoutInternalFields(_a) {
1883
- var dataSources = _a.dataSources,
1884
- otherProps = __rest(_a, ["dataSources"]);
1880
+ var getZoomConstraintsFromTileConfig = function getZoomConstraintsFromTileConfig(tileConfig) {
1881
+ var sources = tileConfig.sources,
1882
+ layers = tileConfig.layers; // check sources for minzoom maxzoom first
1885
1883
 
1886
- if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
1887
- return React.createElement(Viz, Object.assign({}, otherProps));
1884
+ var sourceKeys = Object.keys(sources);
1885
+
1886
+ for (var i = 0; i < sourceKeys.length; i += 1) {
1887
+ var _sources$sourceKeys$i = sources[sourceKeys[i]],
1888
+ minzoom = _sources$sourceKeys$i.minzoom,
1889
+ maxzoom = _sources$sourceKeys$i.maxzoom;
1890
+
1891
+ if (lodash_1.isNumber(minzoom) && lodash_1.isNumber(maxzoom)) {
1892
+ return {
1893
+ minZoom: minzoom,
1894
+ maxZoom: maxzoom
1895
+ };
1888
1896
  }
1897
+ } // then check layers
1889
1898
 
1890
- var primary = dataSources.primary;
1891
- var _primary$data = primary.data,
1892
- columns = _primary$data.columns,
1893
- fields = _primary$data.fields;
1894
- var newColumns = [];
1895
- var newFields = [];
1896
1899
 
1897
- if (fields && columns && fields.length === columns.length) {
1898
- // computed sorted index for removal
1899
- var indicesToRemove = new Set(fields.reduce(function (arr, e, i) {
1900
- return (typeof e === 'string' ? e.startsWith('_') : e.name.toString().startsWith('_')) && arr.push(i), arr;
1901
- }, []));
1902
- newFields = fields.filter(function (d, i) {
1903
- return !indicesToRemove.has(i);
1904
- });
1905
- newColumns = columns.filter(function (d, i) {
1906
- return !indicesToRemove.has(i);
1907
- });
1900
+ for (var _i = 0; _i < layers.length; _i += 1) {
1901
+ var _layers$_i = layers[_i],
1902
+ _minzoom = _layers$_i.minzoom,
1903
+ _maxzoom = _layers$_i.maxzoom;
1904
+
1905
+ if (lodash_1.isNumber(_minzoom) && lodash_1.isNumber(_maxzoom)) {
1906
+ return {
1907
+ minZoom: _minzoom,
1908
+ maxZoom: _maxzoom
1909
+ };
1908
1910
  }
1911
+ } // Maplibre default - would reset previous min/maxZoom
1909
1912
 
1910
- var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
1911
- primary: Object.assign(Object.assign({}, primary), {
1912
- data: Object.assign(Object.assign({}, primary.data), {
1913
- columns: newColumns,
1914
- fields: newFields
1915
- })
1916
- })
1917
- });
1918
- return React.createElement(Viz, Object.assign({
1919
- dataSources: modifiedDatasources
1920
- }, otherProps));
1913
+
1914
+ return {
1915
+ minZoom: 0,
1916
+ maxZoom: 22
1921
1917
  };
1918
+ };
1922
1919
 
1923
- VizWithoutInternalFields.propTypes = Viz.propTypes;
1924
- VizWithoutInternalFields.defaultProps = Viz.defaultProps;
1925
- VizWithoutInternalFields.config = Viz.config;
1926
- return VizWithoutInternalFields;
1927
- }; // HOC for updating all null values in data columns to zeros
1928
- // excluding 'latitude', 'longitude' and 'geobin'
1920
+ exports.getZoomConstraintsFromTileConfig = getZoomConstraintsFromTileConfig;
1929
1921
 
1922
+ var getZoomLevelFromGeobin = function getZoomLevelFromGeobin(geobinStr) {
1923
+ var _a;
1930
1924
 
1931
- var withNullToZeros = function withNullToZeros(Viz) {
1932
- // eslint-disable-next-line react/display-name
1933
- var VizWithColumnsNullToZeros = function VizWithColumnsNullToZeros(_a) {
1934
- var dataSources = _a.dataSources,
1935
- options = _a.options,
1936
- otherProps = __rest(_a, ["dataSources", "options"]);
1925
+ if (!geobinStr) {
1926
+ return null;
1927
+ } // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
1937
1928
 
1938
- if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
1939
- return React.createElement(Viz, Object.assign({}, otherProps));
1929
+
1930
+ var geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;
1931
+ var match = geobinPattern.exec(geobinStr);
1932
+ return (_a = (match === null || match === void 0 ? void 0 : match.length) && parseInt(match[1], 10)) !== null && _a !== void 0 ? _a : null;
1933
+ };
1934
+
1935
+ exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin; // Bubble colors - static
1936
+
1937
+ var getStaticColors = function getStaticColors(colorCount, colorArray) {
1938
+ if (colorCount < 0 || !colorCount) {
1939
+ return [exports.DEFAULT_CLUSTER_COLOR];
1940
+ }
1941
+
1942
+ if (!colorArray || !colorArray.length) {
1943
+ return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
1944
+ return exports.DEFAULT_SERIES_COLORS[i];
1945
+ });
1946
+ } // loop through colorArray to pick the first $colorCount colors
1947
+ // start from begining again if colorCount > colorArray.length
1948
+
1949
+
1950
+ return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
1951
+ return colorUtils_1.isColor(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : exports.DEFAULT_CLUSTER_COLOR;
1952
+ });
1953
+ };
1954
+
1955
+ exports.getStaticColors = getStaticColors; // Bubble size
1956
+
1957
+ var matchBubbleSize = function matchBubbleSize(dataRange, data) {
1958
+ var size = d3_scale_1.scalePow().exponent(0.2).domain(dataRange).range([exports.MIN_BUBBLE_RADIUS, exports.MAX_BUBBLE_RADIUS])(data);
1959
+
1960
+ if (size > exports.MAX_BUBBLE_RADIUS) {
1961
+ return exports.MAX_BUBBLE_RADIUS;
1962
+ }
1963
+
1964
+ if (size < exports.MIN_BUBBLE_RADIUS) {
1965
+ return exports.MIN_BUBBLE_RADIUS;
1966
+ }
1967
+
1968
+ return size;
1969
+ };
1970
+
1971
+ exports.matchBubbleSize = matchBubbleSize;
1972
+
1973
+ var transposeArray = function transposeArray(array) {
1974
+ if (!array || !array.length || !array[0] || !array[0].length) {
1975
+ return [];
1976
+ }
1977
+
1978
+ return array[0].map(function (_, i) {
1979
+ return array.map(function (row) {
1980
+ return row[i];
1981
+ });
1982
+ });
1983
+ };
1984
+
1985
+ exports.transposeArray = transposeArray; // sanitize values: update all null, undefined, or negative values to 0
1986
+
1987
+ var sanitizeValues = function sanitizeValues(values) {
1988
+ // null / undefined
1989
+ if (!values) {
1990
+ return 0;
1991
+ } // number
1992
+
1993
+
1994
+ if (!Array.isArray(values)) {
1995
+ return values > 0 ? values : 0;
1996
+ } // array
1997
+
1998
+
1999
+ return values.map(function (arr) {
2000
+ return exports.sanitizeValues(arr);
2001
+ });
2002
+ };
2003
+
2004
+ exports.sanitizeValues = sanitizeValues;
2005
+
2006
+ var bakeBubbleData = function bakeBubbleData(layer) {
2007
+ var _a;
2008
+
2009
+ if (!layer || !((_a = layer.bubbleSize) === null || _a === void 0 ? void 0 : _a.length) || !layer.geobin || !layer.geobin.length || !layer.latitude || !layer.latitude.length || !layer.longitude || !layer.longitude.length) {
2010
+ return null;
2011
+ } // if bubbleSize is passed as an array of single number array (data series)
2012
+ // e.g. [value0, value1, ...]
2013
+ // format each value as an array to unify data operations for data series and frames
2014
+
2015
+
2016
+ var sanitizedBubbleSize = exports.sanitizeValues(layer.bubbleSize);
2017
+ var transposedBubbleSize = layer.bubbleSize.map(function (n) {
2018
+ return [n];
2019
+ });
2020
+ var transposedSanitizedBubbleSize = sanitizedBubbleSize.map(function (n) {
2021
+ return [n];
2022
+ });
2023
+ var isPie = false; // format array if bubbleSize is passed as an array of array (data frame)
2024
+
2025
+ if (Array.isArray(layer.bubbleSize[0])) {
2026
+ // one-time array transpose,
2027
+ // e.g. from [column0data, column0data] (multi series)
2028
+ // to [[column0datum0, column1datum0], [column0datum1, column1data1], ...]
2029
+ // or e.g. from [column0data] (single series)
2030
+ // to [[column0data]]
2031
+ // for easy access of values at each geo location,
2032
+ // and min max pie size computation
2033
+ transposedBubbleSize = exports.transposeArray(layer.bubbleSize);
2034
+ transposedSanitizedBubbleSize = exports.transposeArray(sanitizedBubbleSize); // if multiple series in the dataframe, set isPie to true
2035
+
2036
+ if (layer.bubbleSize.length > 1) {
2037
+ isPie = true;
1940
2038
  }
2039
+ }
1941
2040
 
1942
- var primary = dataSources.primary;
1943
- var _primary$data2 = primary.data,
1944
- columns = _primary$data2.columns,
1945
- fields = _primary$data2.fields;
1946
- var newColumns = columns;
1947
- var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
2041
+ if (!transposedBubbleSize || !transposedBubbleSize.length) {
2042
+ return null;
2043
+ }
1948
2044
 
1949
- if (mergedOptions.layers && mergedOptions.layers.length && mergedOptions.layers[0].type === 'bubble') {
1950
- var latitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].latitude, dataSources)[0] || '';
1951
- var longitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].longitude, dataSources)[0] || '';
1952
- var excludedFields = [latitudeField, longitudeField, 'geobin'];
1953
- var indicesToEvaluate = new Set(fields.reduce(function (arr, e, i) {
1954
- var field = typeof e === 'string' ? e : e.name.toString();
2045
+ var data = layer.latitude.map(function (lat, i) {
2046
+ return {
2047
+ zoom: exports.getZoomLevelFromGeobin(layer.geobin[i]),
2048
+ values: transposedBubbleSize[i],
2049
+ sanitizedValues: transposedSanitizedBubbleSize[i],
2050
+ coordinates: [layer.longitude[i], lat],
2051
+ metadata: layer.metadata ? layer.metadata[i] : {}
2052
+ };
2053
+ }).filter(function (d) {
2054
+ return Boolean(d.values);
2055
+ }); // compute the min/max value to encode min/max pie or bubble size
1955
2056
 
1956
- if (!excludedFields.includes(field)) {
1957
- arr.push(i);
1958
- }
2057
+ var min = lodash_1.sum(transposedSanitizedBubbleSize[0]);
2058
+ var max = lodash_1.sum(transposedSanitizedBubbleSize[1]);
2059
+ transposedSanitizedBubbleSize.forEach(function (row) {
2060
+ var bubbleSize = lodash_1.sum(row);
2061
+ max = bubbleSize > max ? bubbleSize : max;
2062
+ min = bubbleSize < min ? bubbleSize : min;
2063
+ });
2064
+ return {
2065
+ data: data,
2066
+ dataRange: [min, max],
2067
+ isPie: isPie,
2068
+ resultLimit: layer.resultLimit,
2069
+ bubbleSizeFields: layer.bubbleSizeFields
2070
+ };
2071
+ };
1959
2072
 
1960
- return arr;
1961
- }, []));
1962
- newColumns = columns.map(function (column, i) {
1963
- if (indicesToEvaluate.has(i)) {
1964
- return column.map(function (value) {
1965
- return !value ? 0 : value;
1966
- });
1967
- }
2073
+ exports.bakeBubbleData = bakeBubbleData;
2074
+
2075
+ var isValidLatLon = function isValidLatLon(latlon) {
2076
+ if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {
2077
+ return false;
2078
+ }
2079
+
2080
+ var _latlon = _slicedToArray(latlon, 2),
2081
+ lat = _latlon[0],
2082
+ lon = _latlon[1];
2083
+
2084
+ if (typeof lat !== 'number' || !(lat >= exports.MIN_LATITUDE && lat <= exports.MAX_LATITUDE)) {
2085
+ return false;
2086
+ }
2087
+
2088
+ if (typeof lon !== 'number' || !(lon >= exports.MIN_LONGITUDE && lon <= exports.MAX_LONGITUDE)) {
2089
+ return false;
2090
+ }
2091
+
2092
+ return true;
2093
+ };
2094
+
2095
+ exports.isValidLatLon = isValidLatLon; // Returns the min and max LongLat pairs to determine the layer boundaries to fit all markers/bubbles
2096
+
2097
+ var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
2098
+ if (!layers || !Array.isArray(layers) || !layers.length) {
2099
+ return null;
2100
+ }
1968
2101
 
1969
- return column;
1970
- });
2102
+ var LONGITUDE = 'longitude';
2103
+ var LATITUDE = 'latitude';
2104
+
2105
+ var getMin = function getMin(field) {
2106
+ if (!layers.every(function (layer) {
2107
+ return layer[field];
2108
+ })) {
2109
+ return field === LONGITUDE ? exports.MIN_LONGITUDE : exports.MIN_LATITUDE;
1971
2110
  }
1972
2111
 
1973
- var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
1974
- primary: Object.assign(Object.assign({}, primary), {
1975
- data: Object.assign(Object.assign({}, primary.data), {
1976
- columns: newColumns
1977
- })
1978
- })
1979
- });
1980
- return React.createElement(Viz, Object.assign({
1981
- dataSources: modifiedDatasources,
1982
- options: options
1983
- }, otherProps));
2112
+ return layers.reduce(function (prevVal, layer) {
2113
+ var _a;
2114
+
2115
+ return lodash_1.min([prevVal].concat(_toConsumableArray(((_a = lodash_1.get(layer, field)) !== null && _a !== void 0 ? _a : []).slice(0, layer.type === 'marker' && layer.resultLimit ? layer.resultLimit : exports.DEFAULT_RESULT_LIMIT))));
2116
+ }, field === LONGITUDE ? exports.MAX_LONGITUDE : exports.MAX_LATITUDE);
1984
2117
  };
1985
2118
 
1986
- VizWithColumnsNullToZeros.propTypes = Viz.propTypes;
1987
- VizWithColumnsNullToZeros.defaultProps = Viz.defaultProps;
1988
- VizWithColumnsNullToZeros.config = Viz.config;
1989
- return VizWithColumnsNullToZeros;
2119
+ var getMax = function getMax(field) {
2120
+ if (!layers.every(function (layer) {
2121
+ return layer[field];
2122
+ })) {
2123
+ return field === LONGITUDE ? exports.MAX_LONGITUDE : exports.MAX_LATITUDE;
2124
+ }
2125
+
2126
+ return layers.reduce(function (prevVal, layer) {
2127
+ var _a;
2128
+
2129
+ return lodash_1.max([prevVal].concat(_toConsumableArray(((_a = lodash_1.get(layer, field)) !== null && _a !== void 0 ? _a : []).slice(0, layer.type === 'marker' && layer.resultLimit ? layer.resultLimit : exports.DEFAULT_RESULT_LIMIT))));
2130
+ }, field === LONGITUDE ? exports.MIN_LONGITUDE : exports.MIN_LATITUDE);
2131
+ };
2132
+
2133
+ return [[getMin(LONGITUDE), getMin(LATITUDE)], [getMax(LONGITUDE), getMax(LATITUDE)]];
1990
2134
  };
1991
2135
 
1992
- var Map = withoutInternalFields(withNullToZeros(withDashboardViz_1.default({
1993
- ReactViz: PureMap_1.default,
1994
- vizConfig: config_1.default,
1995
- computeVizProps: exports.computeVizProps,
1996
- disableEditModeCover: true,
1997
- useIconPlaceholder: function useIconPlaceholder() {
1998
- return false;
1999
- }
2000
- })));
2001
- var themes = config_1.default.themes;
2002
- exports.themes = themes;
2003
- exports.default = Map;
2136
+ exports.getGlobalLayerBoundaries = getGlobalLayerBoundaries;
2004
2137
 
2005
2138
  /***/ }),
2006
- /* 190 */
2139
+ /* 103 */
2007
2140
  /***/ (function(module, exports) {
2008
2141
 
2009
- module.exports = require("@splunk/visualization-encoding/utils/types");
2142
+ module.exports = require("@splunk/react-ui/Popover");
2010
2143
 
2011
2144
  /***/ }),
2012
- /* 191 */
2145
+ /* 104 */,
2146
+ /* 105 */,
2147
+ /* 106 */,
2148
+ /* 107 */,
2149
+ /* 108 */,
2150
+ /* 109 */,
2151
+ /* 110 */,
2152
+ /* 111 */,
2153
+ /* 112 */,
2154
+ /* 113 */,
2155
+ /* 114 */,
2156
+ /* 115 */,
2157
+ /* 116 */,
2158
+ /* 117 */,
2159
+ /* 118 */,
2160
+ /* 119 */,
2161
+ /* 120 */,
2162
+ /* 121 */,
2163
+ /* 122 */,
2164
+ /* 123 */,
2165
+ /* 124 */,
2166
+ /* 125 */,
2167
+ /* 126 */
2013
2168
  /***/ (function(module, exports) {
2014
2169
 
2015
- module.exports = require("@splunk/visualization-encoding/utils/dsl");
2170
+ module.exports = require("maplibre-gl");
2016
2171
 
2017
2172
  /***/ }),
2018
- /* 192 */
2173
+ /* 127 */
2019
2174
  /***/ (function(module, exports, __webpack_require__) {
2020
2175
 
2021
2176
  "use strict";
@@ -2023,393 +2178,420 @@ module.exports = require("@splunk/visualization-encoding/utils/dsl");
2023
2178
 
2024
2179
  var _slicedToArray = __webpack_require__(49);
2025
2180
 
2026
- Object.defineProperty(exports, "__esModule", {
2027
- value: true
2028
- });
2029
- exports.isLatLng = exports.formatColor = exports.DEFAULT_ZOOM = exports.DEFAULT_SHOW_SCALE = exports.DEFAULT_SCALE_UNIT = exports.DEFAULT_CONTROL_FOREGROUND_COLOR = exports.DEFAULT_CONTROL_BACKGROUND_COLOR = exports.DEFAULT_CENTER = void 0;
2030
-
2031
- var React = __webpack_require__(1);
2032
-
2033
- var lodash_1 = __webpack_require__(2);
2034
-
2035
- var react_1 = __webpack_require__(1);
2036
-
2037
- var T = __webpack_require__(0);
2181
+ var __rest = this && this.__rest || function (s, e) {
2182
+ var t = {};
2038
2183
 
2039
- var chroma = __webpack_require__(193);
2184
+ for (var p in s) {
2185
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2186
+ }
2040
2187
 
2041
- var maplibre_gl_1 = __webpack_require__(123);
2188
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2189
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2190
+ }
2191
+ return t;
2192
+ };
2042
2193
 
2043
- var MapContext_1 = __webpack_require__(194);
2194
+ Object.defineProperty(exports, "__esModule", {
2195
+ value: true
2196
+ });
2044
2197
 
2045
- var PureMapContainer_1 = __webpack_require__(195);
2198
+ var maplibre_gl_1 = __webpack_require__(126);
2046
2199
 
2047
- __webpack_require__(196);
2200
+ var React = __webpack_require__(1);
2048
2201
 
2049
- var MapUtils_1 = __webpack_require__(197);
2202
+ var Tooltip_1 = __webpack_require__(202);
2050
2203
 
2051
- var Tooltip_1 = __webpack_require__(199);
2204
+ var MarkerWrapper = function MarkerWrapper(_a) {
2205
+ var longitude = _a.longitude,
2206
+ latitude = _a.latitude,
2207
+ bubbleSize = _a.bubbleSize,
2208
+ map = _a.map,
2209
+ children = _a.children,
2210
+ otherProps = __rest(_a, ["longitude", "latitude", "bubbleSize", "map", "children"]);
2052
2211
 
2053
- exports.DEFAULT_CENTER = [0, 0];
2054
- exports.DEFAULT_CONTROL_BACKGROUND_COLOR = '#2b3033';
2055
- exports.DEFAULT_CONTROL_FOREGROUND_COLOR = '#B5B5B5';
2056
- exports.DEFAULT_SCALE_UNIT = 'imperial';
2057
- exports.DEFAULT_SHOW_SCALE = true;
2058
- exports.DEFAULT_ZOOM = 0; // convert rgb/rgba/hex color to encoded color & opacity for SVG strings
2212
+ var container = React.useRef();
2213
+ var marker = React.useRef();
2059
2214
 
2060
- var formatColor = function formatColor(color) {
2061
- var chromaColor = chroma(color);
2062
- return {
2063
- color: chroma(chromaColor.rgb()).hex().replace('#', '%23'),
2064
- opacity: chromaColor.alpha()
2065
- };
2215
+ var _React$useState = React.useState(false),
2216
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2217
+ isTooltipOpen = _React$useState2[0],
2218
+ setTooltipOpenStatus = _React$useState2[1];
2219
+
2220
+ var openTooltip = React.useCallback(function () {
2221
+ return setTooltipOpenStatus(true);
2222
+ }, []);
2223
+ var closeTooltip = React.useCallback(function () {
2224
+ return setTooltipOpenStatus(false);
2225
+ }, []);
2226
+ var cleanupMarker = React.useCallback(function () {
2227
+ if (marker.current) {
2228
+ marker.current.remove();
2229
+ marker.current = undefined;
2230
+ }
2231
+ }, []);
2232
+ React.useEffect(function () {
2233
+ try {
2234
+ if (marker.current) {
2235
+ marker.current.setLngLat([longitude, latitude]);
2236
+ } else {
2237
+ marker.current = new maplibre_gl_1.Marker(container.current);
2238
+ marker.current.setLngLat([longitude, latitude]);
2239
+ marker.current.addTo(map.current);
2240
+ }
2241
+ } catch (error) {
2242
+ console.error(error);
2243
+ cleanupMarker();
2244
+ }
2245
+ }, [latitude, longitude, map]);
2246
+ React.useEffect(function () {
2247
+ return cleanupMarker;
2248
+ }, []);
2249
+ return React.createElement("div", null, React.createElement("div", Object.assign({
2250
+ ref: container,
2251
+ "data-test": "map-marker",
2252
+ onMouseOver: openTooltip,
2253
+ onMouseLeave: closeTooltip,
2254
+ onFocus: openTooltip,
2255
+ onBlur: closeTooltip
2256
+ }, otherProps), children), React.createElement(Tooltip_1.default, {
2257
+ open: isTooltipOpen,
2258
+ anchor: container.current,
2259
+ latitude: latitude,
2260
+ longitude: longitude,
2261
+ bubbleSize: bubbleSize
2262
+ }));
2066
2263
  };
2067
2264
 
2068
- exports.formatColor = formatColor;
2069
- PureMapContainer_1.default.displayName = 'PureMapContainer';
2070
-
2071
- var PureMap = function PureMap(props) {
2072
- var width = props.width,
2073
- height = props.height,
2074
- backgroundColor = props.backgroundColor,
2075
- baseLayerTileServer = props.baseLayerTileServer,
2076
- baseLayerTileServerType = props.baseLayerTileServerType,
2077
- center = props.center,
2078
- controlBackgroundColor = props.controlBackgroundColor,
2079
- controlForegroundColor = props.controlForegroundColor,
2080
- layers = props.layers,
2081
- scaleUnit = props.scaleUnit,
2082
- showScale = props.showScale,
2083
- themeColorScheme = props.themeColorScheme,
2084
- zoom = props.zoom,
2085
- onMapLoad = props.onMapLoad;
2086
-
2087
- var _react_1$useContext = react_1.useContext(MapContext_1.default),
2088
- defaultTileConfig = _react_1$useContext.defaultTileConfig,
2089
- customTileConfig = _react_1$useContext.customTileConfig;
2090
-
2091
- var basemapContainer = react_1.useRef(null);
2092
- var map = react_1.useRef(null);
2093
- var scaleControl = react_1.useRef(null);
2094
- var zoomControl = react_1.useRef(null);
2265
+ exports.default = MarkerWrapper;
2095
2266
 
2096
- var _react_1$useMemo = react_1.useMemo(function () {
2097
- return MapUtils_1.getTilePreset({
2098
- defaultTileConfig: defaultTileConfig,
2099
- customTileConfig: customTileConfig
2100
- });
2101
- }, [defaultTileConfig, customTileConfig]),
2102
- tilePreset = _react_1$useMemo.tilePreset,
2103
- defaultTileLight = _react_1$useMemo.defaultTileLight,
2104
- defaultTileDark = _react_1$useMemo.defaultTileDark;
2267
+ /***/ }),
2268
+ /* 128 */,
2269
+ /* 129 */,
2270
+ /* 130 */,
2271
+ /* 131 */,
2272
+ /* 132 */,
2273
+ /* 133 */,
2274
+ /* 134 */,
2275
+ /* 135 */,
2276
+ /* 136 */,
2277
+ /* 137 */,
2278
+ /* 138 */,
2279
+ /* 139 */,
2280
+ /* 140 */,
2281
+ /* 141 */,
2282
+ /* 142 */,
2283
+ /* 143 */,
2284
+ /* 144 */,
2285
+ /* 145 */,
2286
+ /* 146 */,
2287
+ /* 147 */,
2288
+ /* 148 */,
2289
+ /* 149 */,
2290
+ /* 150 */,
2291
+ /* 151 */,
2292
+ /* 152 */,
2293
+ /* 153 */,
2294
+ /* 154 */,
2295
+ /* 155 */,
2296
+ /* 156 */,
2297
+ /* 157 */,
2298
+ /* 158 */,
2299
+ /* 159 */,
2300
+ /* 160 */,
2301
+ /* 161 */,
2302
+ /* 162 */,
2303
+ /* 163 */,
2304
+ /* 164 */,
2305
+ /* 165 */,
2306
+ /* 166 */,
2307
+ /* 167 */,
2308
+ /* 168 */,
2309
+ /* 169 */,
2310
+ /* 170 */,
2311
+ /* 171 */,
2312
+ /* 172 */,
2313
+ /* 173 */,
2314
+ /* 174 */,
2315
+ /* 175 */,
2316
+ /* 176 */,
2317
+ /* 177 */,
2318
+ /* 178 */,
2319
+ /* 179 */,
2320
+ /* 180 */,
2321
+ /* 181 */,
2322
+ /* 182 */,
2323
+ /* 183 */,
2324
+ /* 184 */,
2325
+ /* 185 */,
2326
+ /* 186 */,
2327
+ /* 187 */,
2328
+ /* 188 */,
2329
+ /* 189 */,
2330
+ /* 190 */,
2331
+ /* 191 */,
2332
+ /* 192 */,
2333
+ /* 193 */
2334
+ /***/ (function(module, exports, __webpack_require__) {
2105
2335
 
2106
- var _React$useState = React.useState({}),
2107
- _React$useState2 = _slicedToArray(_React$useState, 2),
2108
- tooltipProps = _React$useState2[0],
2109
- setTooltipProps = _React$useState2[1];
2336
+ "use strict";
2110
2337
 
2111
- var lngLatCenter = react_1.useMemo(function () {
2112
- return [center[1], center[0]];
2113
- }, [center]);
2114
- var initializeMap = react_1.useCallback(function (mapStyle) {
2115
- map.current = new maplibre_gl_1.Map(Object.assign({
2116
- container: basemapContainer.current,
2117
- style: mapStyle,
2118
- center: lngLatCenter,
2119
- zoom: zoom
2120
- }, MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle))); // Fired immediately after all necessary resources have been downloaded
2121
- // and the first visually complete rendering of the map has occurred.
2122
2338
 
2123
- map.current.on('load', function () {
2124
- onMapLoad();
2125
- }); // zoom
2339
+ var __rest = this && this.__rest || function (s, e) {
2340
+ var t = {};
2126
2341
 
2127
- zoomControl.current = new maplibre_gl_1.NavigationControl({
2128
- showCompass: false
2129
- });
2130
- map.current.addControl(zoomControl.current, 'top-left');
2131
- }, [lngLatCenter, zoom]);
2132
- var initializeScale = react_1.useCallback(function () {
2133
- scaleControl.current = new maplibre_gl_1.ScaleControl({
2134
- maxWidth: 70,
2135
- unit: scaleUnit
2136
- });
2137
- map.current.addControl(scaleControl.current);
2138
- }, [scaleUnit]);
2139
- var updateScale = react_1.useCallback(function () {
2140
- var _a;
2342
+ for (var p in s) {
2343
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2344
+ }
2141
2345
 
2142
- if (showScale) {
2143
- (_a = scaleControl === null || scaleControl === void 0 ? void 0 : scaleControl.current) === null || _a === void 0 ? void 0 : _a.setUnit(scaleUnit);
2144
- }
2145
- }, [scaleUnit, showScale]);
2146
- react_1.useEffect(function () {
2147
- if (map.current) {
2148
- map.current.resize();
2149
- }
2150
- }, [width, height]);
2151
- react_1.useEffect(function () {
2152
- // do not render when defaultTileConfig, customTileConfig and tileset are not configured
2153
- if (Object.keys(tilePreset).length === 0 && (!baseLayerTileServer || !baseLayerTileServerType)) {
2154
- // eslint-disable-next-line no-console
2155
- console.warn('Map Tile Server configuration is missing or invalid. Please provide a valid configuration');
2156
- return;
2157
- }
2346
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2347
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2348
+ }
2349
+ return t;
2350
+ };
2158
2351
 
2159
- var mapStyle = MapUtils_1.getMapStyle({
2160
- baseLayerTileServer: baseLayerTileServer,
2161
- baseLayerTileServerType: baseLayerTileServerType,
2162
- tilePreset: tilePreset,
2163
- colorScheme: themeColorScheme,
2164
- defaultTileLight: defaultTileLight,
2165
- defaultTileDark: defaultTileDark
2166
- });
2167
- mapStyle.version = MapUtils_1.MAP_STYLE_VERSION_NUMBER; // If the map has already been initialized, we update the styles
2352
+ Object.defineProperty(exports, "__esModule", {
2353
+ value: true
2354
+ });
2355
+ exports.PureMap = exports.config = exports.themes = exports.computeVizProps = exports.convertToArrOfObjects = void 0;
2356
+ /* eslint-disable no-sequences */
2168
2357
 
2169
- if (map.current) {
2170
- // Refer to https://maplibre.org/maplibre-gl-js-docs/api/map/#setstyle-example for options.diff (default is true)
2171
- map.current.setStyle(lodash_1.omit(mapStyle, ['theme', 'name', 'key']));
2358
+ var React = __webpack_require__(1);
2172
2359
 
2173
- var _MapUtils_1$getZoomCo = MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle),
2174
- minZoom = _MapUtils_1$getZoomCo.minZoom,
2175
- maxZoom = _MapUtils_1$getZoomCo.maxZoom;
2360
+ var colorUtils_1 = __webpack_require__(12);
2176
2361
 
2177
- map.current.setMinZoom(minZoom);
2178
- map.current.setMaxZoom(maxZoom);
2179
- updateScale();
2180
- } else {
2181
- // initialize the map only once with a constructed style from user configured options
2182
- // or default configs from the map context
2183
- initializeMap(lodash_1.omit(mapStyle, ['theme', 'name', 'key']));
2184
- initializeScale();
2185
- return;
2186
- } // eslint-disable-next-line consistent-return
2362
+ var types_1 = __webpack_require__(194);
2187
2363
 
2364
+ var dsl_1 = __webpack_require__(101);
2188
2365
 
2189
- return function () {
2190
- // free resources
2191
- map === null || map === void 0 ? void 0 : map.current.remove();
2192
- map.current = undefined;
2193
- };
2194
- }, [tilePreset, initializeMap, initializeScale, updateScale, defaultTileLight, defaultTileDark, baseLayerTileServer, baseLayerTileServerType, themeColorScheme]);
2195
- react_1.useEffect(function () {
2196
- if (map.current) {
2197
- map.current.flyTo({
2198
- center: lngLatCenter,
2199
- zoom: zoom
2200
- });
2201
- }
2202
- }, [lngLatCenter, zoom]);
2203
- react_1.useEffect(function () {
2204
- var cleanupLayer = function cleanupLayer() {};
2366
+ var JSONSchemaUtils_1 = __webpack_require__(23);
2205
2367
 
2206
- var markers = [];
2207
- var bubbles = [];
2368
+ var hocUtils_1 = __webpack_require__(7);
2208
2369
 
2209
- if (map.current && layers && layers.length && map.current.isStyleLoaded) {
2210
- try {
2211
- if (layers[0].type === 'marker' && !('geobin' in layers[0])) {
2212
- // support for only single layer
2213
- var markerLayer = layers[0];
2214
- markerLayer.seriesColors = markerLayer.seriesColors ? markerLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS;
2215
-
2216
- cleanupLayer = function cleanupLayer() {
2217
- if (markers) {
2218
- markers.forEach(function (marker) {
2219
- return marker === null || marker === void 0 ? void 0 : marker.remove();
2220
- });
2221
- markers = [];
2222
- }
2223
- };
2370
+ var PureMap_1 = __webpack_require__(195);
2224
2371
 
2225
- if (markerLayer) {
2226
- // Remove any existing markers
2227
- cleanupLayer();
2228
- var renderedMarkerLayer = MapUtils_1.renderMarkerLayer(markerLayer, themeColorScheme, map, setTooltipProps);
2229
- markers = renderedMarkerLayer && renderedMarkerLayer.markers;
2230
- }
2231
- }
2372
+ exports.PureMap = PureMap_1.default;
2232
2373
 
2233
- if (layers[0].type === 'bubble') {
2234
- // support for only single layer
2235
- var bubbleLayer = layers[0];
2236
- bubbleLayer.seriesColors = bubbleLayer.seriesColors ? bubbleLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS; // update bubbles on events
2237
-
2238
- cleanupLayer = function cleanupLayer() {
2239
- if (bubbles && bubbles.length) {
2240
- bubbles.forEach(function (bubble) {
2241
- return bubble.remove();
2242
- });
2243
- bubbles = [];
2244
- }
2245
- }; // render bubbles with data returned from geostats cmds
2374
+ var config_1 = __webpack_require__(204);
2246
2375
 
2376
+ exports.config = config_1.default;
2247
2377
 
2248
- if (bubbleLayer.geobin && bubbleLayer.bubbleSize) {
2249
- bubbleLayer.seriesColors = bubbleLayer.seriesColors ? bubbleLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS;
2250
- var data = MapUtils_1.bakeBubbleData(bubbleLayer);
2251
- var staticColors = MapUtils_1.getStaticColors(bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors);
2378
+ var withDashboardViz_1 = __webpack_require__(28); // util fn extracted from PureParallelCoordinates that transforms data structure to array of objects
2379
+ // TODO: pull this fn into common utils and utilize this fn in ParallelCoordinates
2252
2380
 
2253
- if (data && staticColors && staticColors.length) {
2254
- cleanupLayer(); // render bubbles when layers options get update
2255
2381
 
2256
- bubbles = MapUtils_1.updateBubbles(data, zoom, staticColors, bubbleLayer.dataColors, themeColorScheme, map, setTooltipProps); // render bubbles on zoom
2382
+ var convertToArrOfObjects = function convertToArrOfObjects(columns, fields) {
2383
+ if (!columns || !columns[0].length) return [];
2384
+ var data = [];
2257
2385
 
2258
- map.current.on('zoomend', function () {
2259
- cleanupLayer();
2260
- bubbles = MapUtils_1.updateBubbles(data, map.current.getZoom(), staticColors, bubbleLayer.dataColors, themeColorScheme, map, setTooltipProps);
2261
- });
2262
- }
2263
- }
2264
- }
2265
- } catch (err) {
2266
- console.error(err);
2386
+ var _loop = function _loop(i) {
2387
+ var newObj = {};
2388
+ fields.forEach(function (field, index) {
2389
+ var fieldName = typeof field === 'string' ? field : field.name;
2390
+
2391
+ if (columns[index][i] === '') {
2392
+ newObj[fieldName] = null;
2393
+ } else {
2394
+ newObj[fieldName] = columns[index][i];
2267
2395
  }
2268
- }
2396
+ });
2397
+ data.push(newObj);
2398
+ };
2269
2399
 
2270
- return function () {
2271
- cleanupLayer();
2272
- };
2273
- }, [layers, width, height, zoom, themeColorScheme]);
2274
- var baseMapLayer = React.createElement(React.Fragment, null, React.createElement(PureMapContainer_1.default, {
2275
- className: "puremap",
2276
- width: width,
2277
- height: height,
2278
- backgroundColor: backgroundColor,
2279
- controlBackgroundColor: controlBackgroundColor,
2280
- controlForegroundColor: controlForegroundColor,
2281
- controlIconColorEncoded: exports.formatColor(controlForegroundColor),
2282
- ref: basemapContainer,
2283
- showScale: showScale
2284
- }), React.createElement(Tooltip_1.default, Object.assign({}, tooltipProps)));
2285
- return baseMapLayer;
2400
+ for (var i = 0; i < columns[0].length; i += 1) {
2401
+ _loop(i);
2402
+ }
2403
+
2404
+ return data;
2286
2405
  };
2287
2406
 
2288
- var isLatLng = function isLatLng(props, propName, componentName) {
2289
- if (props[propName][0] >= -180 && props[propName][0] <= 180 && props[propName][1] >= -90 && props[propName][1] <= 90) {
2290
- throw new Error("".concat(componentName, " ").concat(propName, " may have reversed [lat, lon] ranges."));
2291
- }
2407
+ exports.convertToArrOfObjects = convertToArrOfObjects;
2292
2408
 
2293
- if (props[propName][0] < -90 || props[propName][0] > 90 || props[propName][1] < -180 || props[propName][1] > 180) {
2294
- throw new Error("".concat(componentName, " ").concat(propName, " incorrect [lat, lon] ranges."));
2295
- }
2409
+ var computeVizProps = function computeVizProps(_ref) {
2410
+ var themeFunc = _ref.themeFunc,
2411
+ theme = _ref.theme,
2412
+ layers = _ref.layers,
2413
+ dataSources = _ref.dataSources;
2296
2414
 
2297
- return null;
2298
- };
2415
+ var _a, _b;
2299
2416
 
2300
- exports.isLatLng = isLatLng;
2301
- PureMap.propTypes = {
2302
- // eslint-disable-next-line react/no-unused-prop-types
2303
- mode: T.string,
2304
- width: T.oneOfType([T.string, T.number]),
2305
- height: T.oneOfType([T.string, T.number]),
2306
- backgroundColor: T.string,
2307
- baseLayerTileServer: T.string,
2308
- baseLayerTileServerType: T.string,
2309
- center: exports.isLatLng,
2310
- controlBackgroundColor: T.string,
2311
- controlForegroundColor: T.string,
2312
- layers: T.arrayOf(T.shape({
2313
- type: T.string,
2314
- latitude: T.arrayOf(T.number),
2315
- longitude: T.arrayOf(T.number),
2316
- label: T.string,
2317
- showInLegend: T.bool,
2318
- dataColors: T.oneOfType([T.string, T.arrayOf(T.string)]),
2319
- seriesColors: T.arrayOf(T.string),
2320
- tooltipFields: T.arrayOf(T.string),
2321
- resultLimit: T.number
2322
- })),
2323
- scaleUnit: T.string,
2324
- showScale: T.bool,
2325
- themeColorScheme: T.string,
2326
- zoom: T.number,
2327
- onMapLoad: T.func
2328
- };
2329
- PureMap.defaultProps = {
2330
- mode: 'view',
2331
- width: 800,
2332
- height: 500,
2333
- backgroundColor: '#0b0c0e',
2334
- center: exports.DEFAULT_CENTER,
2335
- controlBackgroundColor: exports.DEFAULT_CONTROL_BACKGROUND_COLOR,
2336
- controlForegroundColor: exports.DEFAULT_CONTROL_FOREGROUND_COLOR,
2337
- scaleUnit: exports.DEFAULT_SCALE_UNIT,
2338
- showScale: exports.DEFAULT_SHOW_SCALE,
2339
- layers: [],
2340
- themeColorScheme: 'dark',
2341
- zoom: exports.DEFAULT_ZOOM,
2342
- onMapLoad: lodash_1.noop
2417
+ var themeColorVariables = ['controlBackgroundColor', 'controlForegroundColor'];
2418
+ var themeColors = {};
2419
+ themeColorVariables.forEach(function (variable) {
2420
+ themeColors[variable] = themeFunc(variable);
2421
+ }); // Markers use different icons, Bubbles has different styles for light and dark theme
2422
+ // this prop is passed for that
2423
+
2424
+ var themeColorScheme = (theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1) ? theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1.colorScheme : 'dark';
2425
+ var dataSourceData = (_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {}; // transforms data structure into array of objects to allow for indexing metadata at layer level
2426
+ // TODO: explore any potential changes when multiple layers are supported
2427
+
2428
+ var transformedData = exports.convertToArrOfObjects(dataSourceData.columns, dataSourceData.fields);
2429
+ layers.forEach(function (l) {
2430
+ var _a, _b; // add key `geobin` to the layer object if the data is returned from geostats commands
2431
+ // to distinguish geostats commands from table commands
2432
+
2433
+
2434
+ var geobinIdx = ((_a = dataSourceData.fields) !== null && _a !== void 0 ? _a : []).map(function (field) {
2435
+ return typeof field === 'string' ? field : field.name;
2436
+ }).indexOf('geobin');
2437
+ var layer = l;
2438
+
2439
+ if (geobinIdx > -1) {
2440
+ layer.geobin = dataSourceData.columns[geobinIdx];
2441
+ }
2442
+
2443
+ layer.bubbleSizeFields = ((_b = dataSourceData.fields) !== null && _b !== void 0 ? _b : []).map(function (field) {
2444
+ return typeof field === 'string' ? field : field.name;
2445
+ }).filter(function (field, index) {
2446
+ var _a, _b;
2447
+
2448
+ return !['latitude', 'longitude', 'geobin'].includes(field) && types_1.inferDataTypeFromData((_b = (_a = dataSourceData.columns) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : []) === 'number';
2449
+ }); // Sanitize colors within layers
2450
+
2451
+ layer.seriesColors = Array.isArray(layer.seriesColors) ? colorUtils_1.sanitizeArrayOfColors(layer.seriesColors) : undefined;
2452
+ layer.dataColors = Array.isArray(layer.dataColors) ? colorUtils_1.sanitizeArrayOfColors(layer.dataColors) : undefined;
2453
+ layer.metadata = transformedData;
2454
+ });
2455
+ return Object.assign(Object.assign(Object.assign({}, themeColors), {
2456
+ themeColorScheme: themeColorScheme
2457
+ }), layers);
2343
2458
  };
2344
- exports.default = PureMap;
2345
2459
 
2346
- /***/ }),
2347
- /* 193 */
2348
- /***/ (function(module, exports) {
2460
+ exports.computeVizProps = computeVizProps; // HOC for stripping the internal fields for Maps
2349
2461
 
2350
- module.exports = require("chroma-js");
2462
+ var withoutInternalFields = function withoutInternalFields(Viz) {
2463
+ // eslint-disable-next-line react/display-name
2464
+ var VizWithoutInternalFields = function VizWithoutInternalFields(_a) {
2465
+ var dataSources = _a.dataSources,
2466
+ otherProps = __rest(_a, ["dataSources"]);
2351
2467
 
2352
- /***/ }),
2353
- /* 194 */
2354
- /***/ (function(module, exports) {
2468
+ if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
2469
+ return React.createElement(Viz, Object.assign({}, otherProps));
2470
+ }
2355
2471
 
2356
- module.exports = require("@splunk/visualization-context/MapContext");
2472
+ var primary = dataSources.primary;
2473
+ var _primary$data = primary.data,
2474
+ columns = _primary$data.columns,
2475
+ fields = _primary$data.fields;
2476
+ var newColumns = [];
2477
+ var newFields = [];
2357
2478
 
2358
- /***/ }),
2359
- /* 195 */
2360
- /***/ (function(module, exports, __webpack_require__) {
2479
+ if (fields && columns && fields.length === columns.length) {
2480
+ // computed sorted index for removal
2481
+ var indicesToRemove = new Set(fields.reduce(function (arr, e, i) {
2482
+ return (typeof e === 'string' ? e.startsWith('_') : e.name.toString().startsWith('_')) && arr.push(i), arr;
2483
+ }, []));
2484
+ newFields = fields.filter(function (d, i) {
2485
+ return !indicesToRemove.has(i);
2486
+ });
2487
+ newColumns = columns.filter(function (d, i) {
2488
+ return !indicesToRemove.has(i);
2489
+ });
2490
+ }
2361
2491
 
2362
- "use strict";
2492
+ var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
2493
+ primary: Object.assign(Object.assign({}, primary), {
2494
+ data: Object.assign(Object.assign({}, primary.data), {
2495
+ columns: newColumns,
2496
+ fields: newFields
2497
+ })
2498
+ })
2499
+ });
2500
+ return React.createElement(Viz, Object.assign({
2501
+ dataSources: modifiedDatasources
2502
+ }, otherProps));
2503
+ };
2504
+
2505
+ VizWithoutInternalFields.propTypes = Viz.propTypes;
2506
+ VizWithoutInternalFields.defaultProps = Viz.defaultProps;
2507
+ VizWithoutInternalFields.config = Viz.config;
2508
+ return VizWithoutInternalFields;
2509
+ }; // HOC for updating all null values in data columns to zeros
2510
+ // excluding 'latitude', 'longitude' and 'geobin'
2363
2511
 
2364
2512
 
2365
- Object.defineProperty(exports, "__esModule", {
2366
- value: true
2367
- });
2513
+ var withNullToZeros = function withNullToZeros(Viz) {
2514
+ // eslint-disable-next-line react/display-name
2515
+ var VizWithColumnsNullToZeros = function VizWithColumnsNullToZeros(_a) {
2516
+ var dataSources = _a.dataSources,
2517
+ options = _a.options,
2518
+ otherProps = __rest(_a, ["dataSources", "options"]);
2519
+
2520
+ if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
2521
+ return React.createElement(Viz, Object.assign({}, otherProps));
2522
+ }
2523
+
2524
+ var primary = dataSources.primary;
2525
+ var _primary$data2 = primary.data,
2526
+ columns = _primary$data2.columns,
2527
+ fields = _primary$data2.fields;
2528
+ var newColumns = columns;
2529
+ var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
2530
+
2531
+ if (mergedOptions.layers && mergedOptions.layers.length && mergedOptions.layers[0].type === 'bubble') {
2532
+ var latitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].latitude, dataSources)[0] || '';
2533
+ var longitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].longitude, dataSources)[0] || '';
2534
+ var excludedFields = [latitudeField, longitudeField, 'geobin'];
2535
+ var indicesToEvaluate = new Set(fields.reduce(function (arr, e, i) {
2536
+ var field = typeof e === 'string' ? e : e.name.toString();
2537
+
2538
+ if (!excludedFields.includes(field)) {
2539
+ arr.push(i);
2540
+ }
2541
+
2542
+ return arr;
2543
+ }, []));
2544
+ newColumns = columns.map(function (column, i) {
2545
+ if (indicesToEvaluate.has(i)) {
2546
+ return column.map(function (value) {
2547
+ return !value ? 0 : value;
2548
+ });
2549
+ }
2368
2550
 
2369
- var styled_components_1 = __webpack_require__(4);
2551
+ return column;
2552
+ });
2553
+ }
2370
2554
 
2371
- var lodash_1 = __webpack_require__(2);
2555
+ var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
2556
+ primary: Object.assign(Object.assign({}, primary), {
2557
+ data: Object.assign(Object.assign({}, primary.data), {
2558
+ columns: newColumns
2559
+ })
2560
+ })
2561
+ });
2562
+ return React.createElement(Viz, Object.assign({
2563
+ dataSources: modifiedDatasources,
2564
+ options: options
2565
+ }, otherProps));
2566
+ };
2372
2567
 
2373
- var style_1 = __webpack_require__(13);
2568
+ VizWithColumnsNullToZeros.propTypes = Viz.propTypes;
2569
+ VizWithColumnsNullToZeros.defaultProps = Viz.defaultProps;
2570
+ VizWithColumnsNullToZeros.config = Viz.config;
2571
+ return VizWithColumnsNullToZeros;
2572
+ };
2374
2573
 
2375
- var PureMapContainer = styled_components_1.default.div.withConfig({
2376
- displayName: "PureMapContainer",
2377
- componentId: "sc-1gjwxfv-0"
2378
- })(["overflow:hidden;position:relative;z-index:0;background-color:", ";", ";.custom-marker{width:22px;height:28px;cursor:pointer;}.custom-bubble{cursor:pointer;}.maplibregl-ctrl-top-left{position:absolute;top:12px;left:16px;.maplibregl-ctrl-group{width:40px !important;height:87px !important;border-radius:4px;margin:8px 0px;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.64),0px 11px 18px rgba(0,0,0,0.32),0px 3px 6px rgba(0,0,0,0.3);& button{width:40px;height:43px;border-top:0;}.mapboxgl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9 1C9 0.447715 8.55229 0 8 0C7.44772 0 7 0.447715 7 1V7H1C0.447715 7 0 7.44772 0 8C0 8.55229 0.447715 9 1 9H7V15C7 15.5523 7.44772 16 8 16C8.55229 16 9 15.5523 9 15V9H15C15.5523 9 16 8.55229 16 8C16 7.44772 15.5523 7 15 7H9V1Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"14\" height=\"3\" viewBox=\"0 0 14 3\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0 1.99707C0 1.44479 0.447715 0.99707 1 0.99707H13C13.5523 0.99707 14 1.44479 14 1.99707C14 2.54936 13.5523 2.99707 13 2.99707H1C0.447715 2.99707 0 2.54936 0 1.99707Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}}}.maplibregl-ctrl-bottom-left{display:", ";position:absolute;z-index:0;bottom:16px;left:12px;width:86px;height:29px;border-radius:4px;margin:0;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.13),0px 11px 18px rgba(0,0,0,0.06),0px 3px 6px rgba(0,0,0,0.06);.maplibregl-ctrl-scale{background-color:", ";color:", ";border:2px solid ", ";border-top:0;border-left:0;border-right:0;padding:0;margin:6px 8px 8px 8px;line-height:13px;letter-spacing:0.02em;font-family:sans-serif;font-size:10px;}}"], function (props) {
2379
- return props.backgroundColor;
2380
- }, function (props) {
2381
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2382
- }, function (props) {
2383
- return props.controlBackgroundColor;
2384
- }, function (props) {
2385
- return props.controlIconColorEncoded.color;
2386
- }, function (props) {
2387
- return props.controlIconColorEncoded.opacity;
2388
- }, function (props) {
2389
- return props.controlIconColorEncoded.color;
2390
- }, function (props) {
2391
- return props.controlIconColorEncoded.opacity;
2392
- }, function (props) {
2393
- return props.showScale ? 'inline' : 'none';
2394
- }, function (props) {
2395
- return props.controlBackgroundColor;
2396
- }, function (props) {
2397
- return props.controlBackgroundColor;
2398
- }, function (props) {
2399
- return props.controlForegroundColor;
2400
- }, function (props) {
2401
- return props.controlForegroundColor;
2402
- });
2403
- exports.default = PureMapContainer;
2574
+ var Map = withoutInternalFields(withNullToZeros(withDashboardViz_1.default({
2575
+ ReactViz: PureMap_1.default,
2576
+ vizConfig: config_1.default,
2577
+ computeVizProps: exports.computeVizProps,
2578
+ disableEditModeCover: true,
2579
+ useIconPlaceholder: function useIconPlaceholder() {
2580
+ return false;
2581
+ }
2582
+ })));
2583
+ var themes = config_1.default.themes;
2584
+ exports.themes = themes;
2585
+ exports.default = Map;
2404
2586
 
2405
2587
  /***/ }),
2406
- /* 196 */
2588
+ /* 194 */
2407
2589
  /***/ (function(module, exports) {
2408
2590
 
2409
- module.exports = require("maplibre-gl/dist/maplibre-gl.css");
2591
+ module.exports = require("@splunk/visualization-encoding/utils/types");
2410
2592
 
2411
2593
  /***/ }),
2412
- /* 197 */
2594
+ /* 195 */
2413
2595
  /***/ (function(module, exports, __webpack_require__) {
2414
2596
 
2415
2597
  "use strict";
@@ -2417,537 +2599,486 @@ module.exports = require("maplibre-gl/dist/maplibre-gl.css");
2417
2599
 
2418
2600
  var _slicedToArray = __webpack_require__(49);
2419
2601
 
2420
- var _toConsumableArray = __webpack_require__(39);
2421
-
2422
2602
  Object.defineProperty(exports, "__esModule", {
2423
2603
  value: true
2424
2604
  });
2425
- exports.pieSegment = exports.createPieChart = exports.updateBubbles = exports.bakeBubbleData = exports.sanitizeValues = exports.transposeArray = exports.matchSize = exports.getStaticColors = exports.getZoomLevelFromGeobin = exports.getZoomConstraintsFromTileConfig = exports.getMapStyle = exports.getTilePreset = exports.renderMarkerLayer = exports.getMarkerSVGBackgroundImg = exports.MAX_BUBBLE_RADIUS = exports.MIN_BUBBLE_RADIUS = exports.MAP_STYLE_VERSION_NUMBER = exports.DEFAULT_SERIES_COLORS = exports.DEFAULT_CLUSTER_COLOR = exports.DEFAULT_RESULT_LIMIT = void 0;
2605
+ exports.isLatLng = exports.formatColor = exports.DEFAULT_ZOOM = exports.DEFAULT_SHOW_SCALE = exports.DEFAULT_SCALE_UNIT = exports.DEFAULT_CONTROL_FOREGROUND_COLOR = exports.DEFAULT_CONTROL_BACKGROUND_COLOR = exports.DEFAULT_CENTER = void 0;
2426
2606
 
2427
- var maplibre_gl_1 = __webpack_require__(123);
2607
+ var React = __webpack_require__(1);
2428
2608
 
2429
2609
  var lodash_1 = __webpack_require__(2);
2430
2610
 
2431
- var d3_scale_1 = __webpack_require__(69);
2432
-
2433
- var colorUtils_1 = __webpack_require__(11);
2434
-
2435
- var visualization_color_palettes_1 = __webpack_require__(41);
2436
-
2437
- var MarkerIcons_1 = __webpack_require__(198);
2438
-
2439
- exports.DEFAULT_RESULT_LIMIT = 1000;
2440
- exports.DEFAULT_CLUSTER_COLOR = '#909090';
2441
- exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL; // MapLibre requires a map style specification number which is always 8
2442
-
2443
- exports.MAP_STYLE_VERSION_NUMBER = 8; // currently using one [min, max] value set for bubbles across all zoom levels
2444
- // TODO: design choices on [min, max] bubble size for different zoom levels
2445
-
2446
- exports.MIN_BUBBLE_RADIUS = 4;
2447
- exports.MAX_BUBBLE_RADIUS = 50; // Returns marker background img with the requiref fillColor based on the theme
2448
-
2449
- var getMarkerSVGBackgroundImg = function getMarkerSVGBackgroundImg(color, theme) {
2450
- var fillColor = color.replace('#', '%23');
2451
- return theme === 'light' ? MarkerIcons_1.defaultMarkerLightTheme(fillColor) : MarkerIcons_1.defaultMarkerDarkTheme(fillColor);
2452
- };
2453
-
2454
- exports.getMarkerSVGBackgroundImg = getMarkerSVGBackgroundImg; // Given a map instance and marker layer inputs, this method adds marker layers
2455
- // Note :- Separated this as a util function for better testability
2456
-
2457
- var renderMarkerLayer = function renderMarkerLayer(markerLayer, themeColorScheme, map, setTooltipProps) {
2458
- if (!markerLayer || !map || !map.current || !Array.isArray(markerLayer.latitude) || !Array.isArray(markerLayer.longitude)) {
2459
- return null;
2460
- }
2461
-
2462
- var lat = markerLayer.latitude;
2463
- var lon = markerLayer.longitude;
2464
- var isStaticColor = !markerLayer.dataColors;
2465
- var limit = Math.min(lat.length, lon.length, markerLayer.resultLimit ? markerLayer.resultLimit : exports.DEFAULT_RESULT_LIMIT);
2466
- var markers = [];
2467
- var colors = [];
2611
+ var react_1 = __webpack_require__(1);
2468
2612
 
2469
- var _loop = function _loop(i) {
2470
- var staticColor = markerLayer.seriesColors && colorUtils_1.isColor(markerLayer.seriesColors[0]) ? markerLayer.seriesColors[0] : exports.DEFAULT_CLUSTER_COLOR;
2471
- var dynamicColor = markerLayer.dataColors && colorUtils_1.isColor(markerLayer.dataColors[i]) ? markerLayer.dataColors[i] : exports.DEFAULT_CLUSTER_COLOR;
2472
- var color = isStaticColor ? staticColor : dynamicColor;
2473
- colors.push(color); // create a HTML element for each marker
2474
-
2475
- var el = document.createElement('div');
2476
- el.className = 'custom-marker';
2477
- el.style.backgroundImage = "url('data:image/svg+xml;charset=UTF-8,".concat(exports.getMarkerSVGBackgroundImg(color, themeColorScheme), "')");
2478
- el.addEventListener('mouseover', function () {
2479
- setTooltipProps({
2480
- anchor: el,
2481
- longitude: lon[i],
2482
- latitude: lat[i]
2483
- });
2484
- });
2485
- el.addEventListener('mouseleave', function () {
2486
- setTooltipProps({
2487
- longitude: lon[i],
2488
- latitude: lat[i]
2489
- });
2490
- }); // make a marker for each [lon,lat] and add to the map
2613
+ var T = __webpack_require__(0);
2491
2614
 
2492
- markers.push(new maplibre_gl_1.Marker(el).setLngLat([lon[i], lat[i]]).addTo(map.current));
2493
- };
2615
+ var chroma = __webpack_require__(196);
2494
2616
 
2495
- for (var i = 0; i < limit; i += 1) {
2496
- _loop(i);
2497
- }
2617
+ var maplibre_gl_1 = __webpack_require__(126);
2498
2618
 
2499
- return {
2500
- markers: markers,
2501
- colors: colors
2502
- };
2503
- };
2619
+ var MapContext_1 = __webpack_require__(197);
2504
2620
 
2505
- exports.renderMarkerLayer = renderMarkerLayer;
2506
- /**
2507
- * Construct a tile preset {key: config} by combining the default + custom tile configs
2508
- * Also returns the default tile config for each theme - light/dark
2509
- * @param {MapContextInterface} args
2510
- * @param {BaseTileConfig[]} args.defaultTileConfig
2511
- * @param {BaseTileConfig[]} args.customTileConfig
2512
- * @returns {Object} tile preset
2513
- */
2621
+ var PureMapContainer_1 = __webpack_require__(198);
2514
2622
 
2515
- var getTilePreset = function getTilePreset(_ref) {
2516
- var _ref$defaultTileConfi = _ref.defaultTileConfig,
2517
- defaultTileConfig = _ref$defaultTileConfi === void 0 ? [] : _ref$defaultTileConfi,
2518
- _ref$customTileConfig = _ref.customTileConfig,
2519
- customTileConfig = _ref$customTileConfig === void 0 ? [] : _ref$customTileConfig;
2623
+ __webpack_require__(199);
2520
2624
 
2521
- var _a, _b;
2625
+ var MapUtils_1 = __webpack_require__(102);
2522
2626
 
2523
- var tilePreset = {};
2524
- var defaultTileLight = {};
2525
- var defaultTileDark = {};
2526
- var tileConfigs = [].concat(defaultTileConfig).concat(customTileConfig);
2527
- lodash_1.forEach(tileConfigs, function (tileConfig) {
2528
- var key = tileConfig === null || tileConfig === void 0 ? void 0 : tileConfig.key;
2529
- var updatedConfig = Object.assign(Object.assign({
2530
- theme: 'all'
2531
- }, tileConfig), {
2532
- version: exports.MAP_STYLE_VERSION_NUMBER
2533
- });
2534
- tilePreset[key] = updatedConfig;
2535
- });
2627
+ var ClusterLayer_1 = __webpack_require__(200);
2536
2628
 
2537
- if (defaultTileConfig.length > 0) {
2538
- defaultTileLight = (_a = defaultTileConfig.find(function (config) {
2539
- return config.theme === 'light';
2540
- })) !== null && _a !== void 0 ? _a : defaultTileConfig.find(function (config) {
2541
- return config.theme === undefined;
2542
- });
2543
- defaultTileDark = (_b = defaultTileConfig.find(function (config) {
2544
- return config.theme === 'dark';
2545
- })) !== null && _b !== void 0 ? _b : defaultTileConfig.find(function (config) {
2546
- return config.theme === undefined;
2547
- });
2548
- }
2629
+ exports.DEFAULT_CENTER = [0, 0];
2630
+ exports.DEFAULT_CONTROL_BACKGROUND_COLOR = '#2b3033';
2631
+ exports.DEFAULT_CONTROL_FOREGROUND_COLOR = '#B5B5B5';
2632
+ exports.DEFAULT_SCALE_UNIT = 'imperial';
2633
+ exports.DEFAULT_SHOW_SCALE = true;
2634
+ exports.DEFAULT_ZOOM = 0; // convert rgb/rgba/hex color to encoded color & opacity for SVG strings
2549
2635
 
2636
+ var formatColor = function formatColor(color) {
2637
+ var chromaColor = chroma(color);
2550
2638
  return {
2551
- tilePreset: tilePreset,
2552
- defaultTileLight: defaultTileLight,
2553
- defaultTileDark: defaultTileDark
2639
+ color: chroma(chromaColor.rgb()).hex().replace('#', '%23'),
2640
+ opacity: chromaColor.alpha()
2554
2641
  };
2555
2642
  };
2556
2643
 
2557
- exports.getTilePreset = getTilePreset;
2558
- /**
2559
- * Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.
2560
- * If no, construct a mapStyle with baseLayerTilerServer and baseLayerTileServerType
2561
- * Else return default tile config based on current theme
2562
- * @param {Object} args
2563
- * @param {BaseTileConfig[]} args.tilePreset
2564
- * @param {String} args.baseLayerTilerServer
2565
- * @param {String} args.baseLayerTileServerType
2566
- * @param {String} args.colorScheme
2567
- * @param {BaseTileConfig} args.defaultTileDark
2568
- * @param {BaseTileConfig} args.defaultTileLight
2569
- * @returns {BaseTileConfig} mapStyle
2570
- */
2571
-
2572
- var getMapStyle = function getMapStyle(_ref2) {
2573
- var _ref2$baseLayerTileSe = _ref2.baseLayerTileServer,
2574
- baseLayerTileServer = _ref2$baseLayerTileSe === void 0 ? '' : _ref2$baseLayerTileSe,
2575
- _ref2$baseLayerTileSe2 = _ref2.baseLayerTileServerType,
2576
- baseLayerTileServerType = _ref2$baseLayerTileSe2 === void 0 ? '' : _ref2$baseLayerTileSe2,
2577
- _ref2$tilePreset = _ref2.tilePreset,
2578
- tilePreset = _ref2$tilePreset === void 0 ? {} : _ref2$tilePreset,
2579
- _ref2$colorScheme = _ref2.colorScheme,
2580
- colorScheme = _ref2$colorScheme === void 0 ? 'light' : _ref2$colorScheme,
2581
- _ref2$defaultTileLigh = _ref2.defaultTileLight,
2582
- defaultTileLight = _ref2$defaultTileLigh === void 0 ? {} : _ref2$defaultTileLigh,
2583
- _ref2$defaultTileDark = _ref2.defaultTileDark,
2584
- defaultTileDark = _ref2$defaultTileDark === void 0 ? {} : _ref2$defaultTileDark;
2585
-
2586
- if (baseLayerTileServer && tilePreset[baseLayerTileServer] && (tilePreset[baseLayerTileServer].theme === colorScheme || tilePreset[baseLayerTileServer].theme === 'all')) {
2587
- return tilePreset[baseLayerTileServer];
2588
- }
2589
-
2590
- if (baseLayerTileServer && baseLayerTileServerType) {
2591
- var tiles = [];
2592
- /**
2593
- * Tile Server URLs (eg: http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png) can specify the variable {s} which refers to a subdomain
2594
- * Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'
2595
- * Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers
2596
- */
2597
-
2598
- if (baseLayerTileServer.match(/^(https?):\/\/{(s|S)}\../)) {
2599
- /**
2600
- * sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains
2601
- * In order to preserve this behavior during conversion to splunk.map,
2602
- * if the variable {s} or {S} is detected, replace it with 'a', 'b' and 'c' - default values for subdomains
2603
- * TODO: in the future, add an additional prop - baseLayerTileServerSubdomains: ['x', 'y', 'z'], default being ['a', 'b', 'c']
2604
- */
2605
- tiles = [baseLayerTileServer.replace(/{(s|S)}/, 'a'), baseLayerTileServer.replace(/{(s|S)}/, 'b'), baseLayerTileServer.replace(/{(s|S)}/, 'c')];
2606
- } else {
2607
- tiles = [baseLayerTileServer];
2608
- } // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options
2609
-
2644
+ exports.formatColor = formatColor;
2645
+ PureMapContainer_1.default.displayName = 'PureMapContainer';
2610
2646
 
2611
- var mapStyle = {
2612
- version: exports.MAP_STYLE_VERSION_NUMBER,
2613
- sources: {
2614
- 'base-tiles': {
2615
- type: baseLayerTileServerType,
2616
- tiles: tiles,
2617
- tileSize: 256
2618
- }
2619
- },
2620
- layers: [{
2621
- id: 'base-layer',
2622
- type: 'raster',
2623
- source: 'base-tiles',
2624
- minzoom: 0,
2625
- maxzoom: 10
2626
- }]
2627
- };
2628
- return mapStyle;
2629
- } // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults
2647
+ var PureMap = function PureMap(props) {
2648
+ var width = props.width,
2649
+ height = props.height,
2650
+ backgroundColor = props.backgroundColor,
2651
+ baseLayerTileServer = props.baseLayerTileServer,
2652
+ baseLayerTileServerType = props.baseLayerTileServerType,
2653
+ center = props.center,
2654
+ controlBackgroundColor = props.controlBackgroundColor,
2655
+ controlForegroundColor = props.controlForegroundColor,
2656
+ _props$layers = props.layers,
2657
+ layers = _props$layers === void 0 ? [] : _props$layers,
2658
+ scaleUnit = props.scaleUnit,
2659
+ showScale = props.showScale,
2660
+ themeColorScheme = props.themeColorScheme,
2661
+ zoom = props.zoom,
2662
+ onMapLoad = props.onMapLoad,
2663
+ onMapClick = props.onMapClick;
2630
2664
 
2665
+ var _react_1$useContext = react_1.useContext(MapContext_1.default),
2666
+ defaultTileConfig = _react_1$useContext.defaultTileConfig,
2667
+ customTileConfig = _react_1$useContext.customTileConfig;
2631
2668
 
2632
- return colorScheme === 'light' ? defaultTileLight : defaultTileDark;
2633
- };
2669
+ var basemapContainer = react_1.useRef(null);
2670
+ var map = react_1.useRef(null);
2671
+ var scaleControl = react_1.useRef(null);
2672
+ var zoomControl = react_1.useRef(null);
2634
2673
 
2635
- exports.getMapStyle = getMapStyle;
2674
+ var _react_1$useMemo = react_1.useMemo(function () {
2675
+ return MapUtils_1.getTilePreset({
2676
+ defaultTileConfig: defaultTileConfig,
2677
+ customTileConfig: customTileConfig
2678
+ });
2679
+ }, [defaultTileConfig, customTileConfig]),
2680
+ tilePreset = _react_1$useMemo.tilePreset,
2681
+ defaultTileLight = _react_1$useMemo.defaultTileLight,
2682
+ defaultTileDark = _react_1$useMemo.defaultTileDark;
2636
2683
 
2637
- var getZoomConstraintsFromTileConfig = function getZoomConstraintsFromTileConfig(tileConfig) {
2638
- var sources = tileConfig.sources,
2639
- layers = tileConfig.layers; // check sources for minzoom maxzoom first
2684
+ var _React$useState = React.useState(zoom !== null && zoom !== void 0 ? zoom : exports.DEFAULT_ZOOM),
2685
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2686
+ currentZoomLevel = _React$useState2[0],
2687
+ setCurrentZoomLevel = _React$useState2[1];
2640
2688
 
2641
- var sourceKeys = Object.keys(sources);
2689
+ var _React$useState3 = React.useState(false),
2690
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2691
+ isMapLoaded = _React$useState4[0],
2692
+ setMapIsLoaded = _React$useState4[1]; // Assign default center when no center is defined
2642
2693
 
2643
- for (var i = 0; i < sourceKeys.length; i += 1) {
2644
- var _sources$sourceKeys$i = sources[sourceKeys[i]],
2645
- minzoom = _sources$sourceKeys$i.minzoom,
2646
- maxzoom = _sources$sourceKeys$i.maxzoom;
2647
2694
 
2648
- if (lodash_1.isNumber(minzoom) && lodash_1.isNumber(maxzoom)) {
2649
- return {
2650
- minZoom: minzoom,
2651
- maxZoom: maxzoom
2652
- };
2695
+ var lngLatCenter = react_1.useMemo(function () {
2696
+ if (!MapUtils_1.isValidLatLon(center)) {
2697
+ return exports.DEFAULT_CENTER;
2653
2698
  }
2654
- } // then check layers
2655
2699
 
2700
+ return [center[1], center[0]];
2701
+ }, [center]); // Assign default zoom when no zoom is defined
2656
2702
 
2657
- for (var _i = 0; _i < layers.length; _i += 1) {
2658
- var _layers$_i = layers[_i],
2659
- _minzoom = _layers$_i.minzoom,
2660
- _maxzoom = _layers$_i.maxzoom;
2661
-
2662
- if (lodash_1.isNumber(_minzoom) && lodash_1.isNumber(_maxzoom)) {
2663
- return {
2664
- minZoom: _minzoom,
2665
- maxZoom: _maxzoom
2666
- };
2703
+ var zoomLevel = react_1.useMemo(function () {
2704
+ if (zoom === undefined) {
2705
+ return exports.DEFAULT_ZOOM;
2667
2706
  }
2668
- } // Maplibre default - would reset previous min/maxZoom
2669
2707
 
2708
+ return zoom;
2709
+ }, [zoom]);
2670
2710
 
2671
- return {
2672
- minZoom: 0,
2673
- maxZoom: 22
2711
+ var fitMapToContent = function fitMapToContent() {
2712
+ var lngLatBounds = MapUtils_1.getGlobalLayerBoundaries([layers[0]]);
2713
+ map.current.fitBounds(lngLatBounds, {
2714
+ padding: MapUtils_1.MAX_BUBBLE_RADIUS + 5,
2715
+ animate: false
2716
+ });
2674
2717
  };
2675
- };
2676
-
2677
- exports.getZoomConstraintsFromTileConfig = getZoomConstraintsFromTileConfig;
2678
2718
 
2679
- var getZoomLevelFromGeobin = function getZoomLevelFromGeobin(geobinStr) {
2680
- var _a;
2719
+ var initializeMap = react_1.useCallback(function (mapStyle) {
2720
+ map.current = new maplibre_gl_1.Map(Object.assign({
2721
+ container: basemapContainer.current,
2722
+ preserveDrawingBuffer: true,
2723
+ style: mapStyle,
2724
+ center: lngLatCenter,
2725
+ zoom: zoomLevel
2726
+ }, MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle))); // Fired immediately after all necessary resources have been downloaded
2727
+ // and the first visually complete rendering of the map has occurred.
2681
2728
 
2682
- if (!geobinStr) {
2683
- return null;
2684
- } // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
2729
+ map.current.on('load', function () {
2730
+ if (layers.length > 0 && center === undefined && zoom === undefined) {
2731
+ fitMapToContent();
2732
+ }
2685
2733
 
2734
+ setMapIsLoaded(true); // TODO :- Temp timeout added for onMapLoad event to avoid flaky screenshots caused by
2735
+ // https://maplibre.org/maplibre-gl-js-docs/api/map/#map#fitbounds. Need alternate approach to handle the same.
2686
2736
 
2687
- var geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;
2688
- var match = geobinPattern.exec(geobinStr);
2689
- return (_a = (match === null || match === void 0 ? void 0 : match.length) && parseInt(match[1], 10)) !== null && _a !== void 0 ? _a : null;
2690
- };
2737
+ setTimeout(function () {
2738
+ return onMapLoad();
2739
+ }, 500);
2740
+ });
2741
+ map.current.on('zoomend', function () {
2742
+ setCurrentZoomLevel(map.current.getZoom());
2743
+ }); // zoom
2691
2744
 
2692
- exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin; // Bubble colors - static
2745
+ zoomControl.current = new maplibre_gl_1.NavigationControl({
2746
+ showCompass: false
2747
+ });
2748
+ map.current.addControl(zoomControl.current, 'top-left');
2749
+ }, [lngLatCenter, zoomLevel, layers.length, fitMapToContent]);
2750
+ var initializeScale = react_1.useCallback(function () {
2751
+ scaleControl.current = new maplibre_gl_1.ScaleControl({
2752
+ maxWidth: 70,
2753
+ unit: scaleUnit
2754
+ });
2755
+ map.current.addControl(scaleControl.current);
2756
+ }, [scaleUnit]);
2757
+ var updateScale = react_1.useCallback(function () {
2758
+ var _a;
2693
2759
 
2694
- var getStaticColors = function getStaticColors(colorCount, colorArray) {
2695
- if (colorCount < 0 || !colorCount) {
2696
- return [exports.DEFAULT_CLUSTER_COLOR];
2697
- }
2760
+ if (showScale) {
2761
+ (_a = scaleControl === null || scaleControl === void 0 ? void 0 : scaleControl.current) === null || _a === void 0 ? void 0 : _a.setUnit(scaleUnit);
2762
+ }
2763
+ }, [scaleUnit, showScale]);
2764
+ react_1.useEffect(function () {
2765
+ if (map.current) {
2766
+ map.current.resize();
2767
+ }
2768
+ }, [width, height]);
2769
+ react_1.useEffect(function () {
2770
+ // do not render when defaultTileConfig, customTileConfig and tileset are not configured
2771
+ if (Object.keys(tilePreset).length === 0 && (!baseLayerTileServer || !baseLayerTileServerType)) {
2772
+ // eslint-disable-next-line no-console
2773
+ console.warn('Map Tile Server configuration is missing or invalid. Please provide a valid configuration');
2774
+ return;
2775
+ }
2698
2776
 
2699
- if (!colorArray || !colorArray.length) {
2700
- return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
2701
- return exports.DEFAULT_SERIES_COLORS[i];
2777
+ var mapStyle = MapUtils_1.getMapStyle({
2778
+ baseLayerTileServer: baseLayerTileServer,
2779
+ baseLayerTileServerType: baseLayerTileServerType,
2780
+ tilePreset: tilePreset,
2781
+ colorScheme: themeColorScheme,
2782
+ defaultTileLight: defaultTileLight,
2783
+ defaultTileDark: defaultTileDark
2702
2784
  });
2703
- } // loop through colorArray to pick the first $colorCount colors
2704
- // start from begining again if colorCount > colorArray.length
2785
+ mapStyle.version = MapUtils_1.MAP_STYLE_VERSION_NUMBER; // If the map has already been initialized, we update the styles
2705
2786
 
2787
+ if (map.current) {
2788
+ // Refer to https://maplibre.org/maplibre-gl-js-docs/api/map/#setstyle-example for options.diff (default is true)
2789
+ map.current.setStyle(lodash_1.omit(mapStyle, ['theme', 'name', 'key']));
2706
2790
 
2707
- return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
2708
- return colorUtils_1.isColor(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : exports.DEFAULT_CLUSTER_COLOR;
2709
- });
2791
+ var _MapUtils_1$getZoomCo = MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle),
2792
+ minZoom = _MapUtils_1$getZoomCo.minZoom,
2793
+ maxZoom = _MapUtils_1$getZoomCo.maxZoom;
2794
+
2795
+ map.current.setMinZoom(minZoom);
2796
+ map.current.setMaxZoom(maxZoom);
2797
+ updateScale();
2798
+ } else {
2799
+ // initialize the map only once with a constructed style from user configured options
2800
+ // or default configs from the map context
2801
+ initializeMap(lodash_1.omit(mapStyle, ['theme', 'name', 'key']));
2802
+ initializeScale();
2803
+ }
2804
+ }, [tilePreset, initializeMap, initializeScale, updateScale, defaultTileLight, defaultTileDark, baseLayerTileServer, baseLayerTileServerType, themeColorScheme]);
2805
+ react_1.useEffect(function () {
2806
+ if (map.current) {
2807
+ map.current.flyTo({
2808
+ center: lngLatCenter,
2809
+ zoom: zoomLevel
2810
+ });
2811
+ }
2812
+ }, [lngLatCenter, zoom]);
2813
+ react_1.useEffect(function () {
2814
+ return function () {
2815
+ if (map.current) {
2816
+ map.current.remove();
2817
+ }
2818
+ };
2819
+ }, []);
2820
+
2821
+ var _layers = _slicedToArray(layers, 1),
2822
+ clusterLayer = _layers[0];
2823
+
2824
+ return React.createElement(React.Fragment, null, React.createElement(PureMapContainer_1.default, {
2825
+ className: "puremap",
2826
+ width: width,
2827
+ height: height,
2828
+ backgroundColor: backgroundColor,
2829
+ controlBackgroundColor: controlBackgroundColor,
2830
+ controlForegroundColor: controlForegroundColor,
2831
+ controlIconColorEncoded: exports.formatColor(controlForegroundColor),
2832
+ ref: basemapContainer,
2833
+ showScale: showScale
2834
+ }, isMapLoaded && clusterLayer && React.createElement(ClusterLayer_1.default, {
2835
+ clusterLayer: clusterLayer,
2836
+ themeColorScheme: themeColorScheme,
2837
+ map: map,
2838
+ zoom: currentZoomLevel,
2839
+ onMapClick: onMapClick
2840
+ })));
2710
2841
  };
2711
2842
 
2712
- exports.getStaticColors = getStaticColors; // Bubble size
2843
+ var isLatLng = function isLatLng(props, propName, componentName) {
2844
+ if (!props[propName]) {
2845
+ return null;
2846
+ }
2713
2847
 
2714
- var matchSize = function matchSize(dataRange, data) {
2715
- var size = d3_scale_1.scalePow().exponent(0.2).domain(dataRange).range([exports.MIN_BUBBLE_RADIUS, exports.MAX_BUBBLE_RADIUS])(data);
2848
+ var latAbs = Math.abs(props[propName][0]);
2849
+ var lonAbs = Math.abs(props[propName][1]);
2850
+ var latlon = props[propName];
2716
2851
 
2717
- if (size > exports.MAX_BUBBLE_RADIUS) {
2718
- return exports.MAX_BUBBLE_RADIUS;
2852
+ if (latAbs > MapUtils_1.MAX_LATITUDE && lonAbs <= MapUtils_1.MAX_LATITUDE) {
2853
+ throw new Error("".concat(componentName, " ").concat(propName, " may have reversed [lat, lon] ranges."));
2719
2854
  }
2720
2855
 
2721
- if (size < exports.MIN_BUBBLE_RADIUS) {
2722
- return exports.MIN_BUBBLE_RADIUS;
2856
+ if (!MapUtils_1.isValidLatLon(latlon)) {
2857
+ throw new Error("".concat(componentName, " ").concat(propName, " incorrect [lat, lon] ranges."));
2723
2858
  }
2724
2859
 
2725
- return size;
2860
+ return null;
2861
+ };
2862
+
2863
+ exports.isLatLng = isLatLng;
2864
+ PureMap.propTypes = {
2865
+ // eslint-disable-next-line react/no-unused-prop-types
2866
+ mode: T.string,
2867
+ width: T.oneOfType([T.string, T.number]),
2868
+ height: T.oneOfType([T.string, T.number]),
2869
+ backgroundColor: T.string,
2870
+ baseLayerTileServer: T.string,
2871
+ baseLayerTileServerType: T.string,
2872
+ center: exports.isLatLng,
2873
+ controlBackgroundColor: T.string,
2874
+ controlForegroundColor: T.string,
2875
+ layers: T.arrayOf(T.shape({
2876
+ type: T.string,
2877
+ latitude: T.arrayOf(T.number),
2878
+ longitude: T.arrayOf(T.number),
2879
+ label: T.string,
2880
+ showInLegend: T.bool,
2881
+ dataColors: T.oneOfType([T.string, T.arrayOf(T.string)]),
2882
+ seriesColors: T.arrayOf(T.string),
2883
+ tooltipFields: T.arrayOf(T.string),
2884
+ resultLimit: T.number
2885
+ })),
2886
+ scaleUnit: T.string,
2887
+ showScale: T.bool,
2888
+ themeColorScheme: T.string,
2889
+ zoom: T.number,
2890
+ onMapLoad: T.func,
2891
+ onMapClick: T.func
2892
+ };
2893
+ PureMap.defaultProps = {
2894
+ mode: 'view',
2895
+ width: 800,
2896
+ height: 500,
2897
+ backgroundColor: '#0b0c0e',
2898
+ controlBackgroundColor: exports.DEFAULT_CONTROL_BACKGROUND_COLOR,
2899
+ controlForegroundColor: exports.DEFAULT_CONTROL_FOREGROUND_COLOR,
2900
+ scaleUnit: exports.DEFAULT_SCALE_UNIT,
2901
+ showScale: exports.DEFAULT_SHOW_SCALE,
2902
+ layers: [],
2903
+ themeColorScheme: 'dark',
2904
+ onMapLoad: lodash_1.noop,
2905
+ onMapClick: lodash_1.noop
2726
2906
  };
2907
+ exports.default = PureMap;
2908
+
2909
+ /***/ }),
2910
+ /* 196 */
2911
+ /***/ (function(module, exports) {
2912
+
2913
+ module.exports = require("chroma-js");
2914
+
2915
+ /***/ }),
2916
+ /* 197 */
2917
+ /***/ (function(module, exports) {
2918
+
2919
+ module.exports = require("@splunk/visualization-context/MapContext");
2920
+
2921
+ /***/ }),
2922
+ /* 198 */
2923
+ /***/ (function(module, exports, __webpack_require__) {
2924
+
2925
+ "use strict";
2926
+
2927
+
2928
+ Object.defineProperty(exports, "__esModule", {
2929
+ value: true
2930
+ });
2931
+
2932
+ var styled_components_1 = __webpack_require__(4);
2933
+
2934
+ var lodash_1 = __webpack_require__(2);
2935
+
2936
+ var style_1 = __webpack_require__(14);
2937
+
2938
+ var PureMapContainer = styled_components_1.default.div.withConfig({
2939
+ displayName: "PureMapContainer",
2940
+ componentId: "sc-1gjwxfv-0"
2941
+ })(["overflow:hidden;position:relative;z-index:0;background-color:", ";", ";.maplibregl-ctrl-top-left{position:absolute;top:12px;left:16px;.maplibregl-ctrl-group{width:40px !important;height:87px !important;border-radius:4px;margin:8px 0px;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.64),0px 11px 18px rgba(0,0,0,0.32),0px 3px 6px rgba(0,0,0,0.3);& button{width:40px;height:43px;border-top:0;}.mapboxgl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9 1C9 0.447715 8.55229 0 8 0C7.44772 0 7 0.447715 7 1V7H1C0.447715 7 0 7.44772 0 8C0 8.55229 0.447715 9 1 9H7V15C7 15.5523 7.44772 16 8 16C8.55229 16 9 15.5523 9 15V9H15C15.5523 9 16 8.55229 16 8C16 7.44772 15.5523 7 15 7H9V1Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"14\" height=\"3\" viewBox=\"0 0 14 3\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0 1.99707C0 1.44479 0.447715 0.99707 1 0.99707H13C13.5523 0.99707 14 1.44479 14 1.99707C14 2.54936 13.5523 2.99707 13 2.99707H1C0.447715 2.99707 0 2.54936 0 1.99707Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}}}.maplibregl-ctrl-bottom-left{display:", ";position:absolute;z-index:0;bottom:16px;left:12px;width:86px;height:29px;border-radius:4px;margin:0;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.13),0px 11px 18px rgba(0,0,0,0.06),0px 3px 6px rgba(0,0,0,0.06);.maplibregl-ctrl-scale{background-color:", ";color:", ";border:2px solid ", ";border-top:0;border-left:0;border-right:0;padding:0;margin:6px 8px 8px 8px;line-height:13px;letter-spacing:0.02em;font-family:sans-serif;font-size:10px;}}"], function (props) {
2942
+ return props.backgroundColor;
2943
+ }, function (props) {
2944
+ return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2945
+ }, function (props) {
2946
+ return props.controlBackgroundColor;
2947
+ }, function (props) {
2948
+ return props.controlIconColorEncoded.color;
2949
+ }, function (props) {
2950
+ return props.controlIconColorEncoded.opacity;
2951
+ }, function (props) {
2952
+ return props.controlIconColorEncoded.color;
2953
+ }, function (props) {
2954
+ return props.controlIconColorEncoded.opacity;
2955
+ }, function (props) {
2956
+ return props.showScale ? 'inline' : 'none';
2957
+ }, function (props) {
2958
+ return props.controlBackgroundColor;
2959
+ }, function (props) {
2960
+ return props.controlBackgroundColor;
2961
+ }, function (props) {
2962
+ return props.controlForegroundColor;
2963
+ }, function (props) {
2964
+ return props.controlForegroundColor;
2965
+ });
2966
+ exports.default = PureMapContainer;
2727
2967
 
2728
- exports.matchSize = matchSize;
2968
+ /***/ }),
2969
+ /* 199 */
2970
+ /***/ (function(module, exports) {
2729
2971
 
2730
- var transposeArray = function transposeArray(array) {
2731
- if (!array || !array.length || !array[0] || !array[0].length) {
2732
- return [];
2733
- }
2972
+ module.exports = require("maplibre-gl/dist/maplibre-gl.css");
2734
2973
 
2735
- return array[0].map(function (_, i) {
2736
- return array.map(function (row) {
2737
- return row[i];
2738
- });
2739
- });
2740
- };
2974
+ /***/ }),
2975
+ /* 200 */
2976
+ /***/ (function(module, exports, __webpack_require__) {
2741
2977
 
2742
- exports.transposeArray = transposeArray; // sanitize values: update all null, undefined, or negative values to 0
2978
+ "use strict";
2743
2979
 
2744
- var sanitizeValues = function sanitizeValues(values) {
2745
- // null / undefined
2746
- if (!values) {
2747
- return 0;
2748
- } // number
2749
2980
 
2981
+ Object.defineProperty(exports, "__esModule", {
2982
+ value: true
2983
+ });
2750
2984
 
2751
- if (!Array.isArray(values)) {
2752
- return values > 0 ? values : 0;
2753
- } // array
2985
+ var React = __webpack_require__(1);
2754
2986
 
2987
+ var BubbleLayer_1 = __webpack_require__(201);
2755
2988
 
2756
- return values.map(function (arr) {
2757
- return exports.sanitizeValues(arr);
2758
- });
2759
- };
2989
+ var MarkerLayer_1 = __webpack_require__(203);
2760
2990
 
2761
- exports.sanitizeValues = sanitizeValues;
2991
+ var ClusterLayer = function ClusterLayer(_ref) {
2992
+ var clusterLayer = _ref.clusterLayer,
2993
+ themeColorScheme = _ref.themeColorScheme,
2994
+ zoom = _ref.zoom,
2995
+ map = _ref.map,
2996
+ onMapClick = _ref.onMapClick;
2762
2997
 
2763
- var bakeBubbleData = function bakeBubbleData(layer) {
2764
2998
  var _a;
2765
2999
 
2766
- if (!layer || !((_a = layer.bubbleSize) === null || _a === void 0 ? void 0 : _a.length) || !layer.geobin || !layer.geobin.length || !layer.latitude || !layer.latitude.length || !layer.longitude || !layer.longitude.length) {
2767
- return null;
2768
- } // if bubbleSize is passed as an array of single number array (data series)
2769
- // e.g. [value0, value1, ...]
2770
- // format each value as an array to unify data operations for data series and frames
2771
-
2772
-
2773
- var sanitizedBubbleSize = exports.sanitizeValues(layer.bubbleSize);
2774
- var transposedBubbleSize = layer.bubbleSize.map(function (n) {
2775
- return [n];
2776
- });
2777
- var transposedSanitizedBubbleSize = sanitizedBubbleSize.map(function (n) {
2778
- return [n];
2779
- });
2780
- var isPie = false; // format array if bubbleSize is passed as an array of array (data frame)
2781
-
2782
- if (typeof layer.bubbleSize[0] !== 'number') {
2783
- // one-time array transpose,
2784
- // e.g. from [column0data, column0data] (multi series)
2785
- // to [[column0datum0, column1datum0], [column0datum1, column1data1], ...]
2786
- // or e.g. from [column0data] (single series)
2787
- // to [[column0data]]
2788
- // for easy access of values at each geo location,
2789
- // and min max pie size computation
2790
- transposedBubbleSize = exports.transposeArray(layer.bubbleSize);
2791
- transposedSanitizedBubbleSize = exports.transposeArray(sanitizedBubbleSize); // if multiple series in the dataframe, set isPie to true
2792
-
2793
- if (layer.bubbleSize.length > 1) {
2794
- isPie = true;
3000
+ if (((_a = map === null || map === void 0 ? void 0 : map.current) === null || _a === void 0 ? void 0 : _a.isStyleLoaded) && [clusterLayer.longitude, clusterLayer.latitude].every(Array.isArray)) {
3001
+ if ((clusterLayer === null || clusterLayer === void 0 ? void 0 : clusterLayer.type) === 'marker' && !('geobin' in clusterLayer)) {
3002
+ return React.createElement(MarkerLayer_1.default, {
3003
+ markerLayer: clusterLayer,
3004
+ themeColorScheme: themeColorScheme,
3005
+ map: map,
3006
+ onMapClick: onMapClick
3007
+ });
2795
3008
  }
2796
- }
2797
3009
 
2798
- if (!transposedBubbleSize || !transposedBubbleSize.length) {
2799
- return null;
3010
+ if ((clusterLayer === null || clusterLayer === void 0 ? void 0 : clusterLayer.type) === 'bubble' && 'geobin' in clusterLayer && 'bubbleSize' in clusterLayer) {
3011
+ return React.createElement(BubbleLayer_1.default, {
3012
+ bubbleLayer: clusterLayer,
3013
+ themeColorScheme: themeColorScheme,
3014
+ map: map,
3015
+ zoom: zoom,
3016
+ onMapClick: onMapClick
3017
+ });
3018
+ }
2800
3019
  }
2801
3020
 
2802
- var data = layer.latitude.map(function (lat, i) {
2803
- return {
2804
- zoom: exports.getZoomLevelFromGeobin(layer.geobin[i]),
2805
- values: transposedBubbleSize[i],
2806
- sanitizedValues: transposedSanitizedBubbleSize[i],
2807
- coordinates: [layer.longitude[i], lat]
2808
- };
2809
- }).filter(function (d) {
2810
- return Boolean(d.values);
2811
- }); // compute the min/max value to encode min/max pie or bubble size
2812
-
2813
- var min = lodash_1.sum(transposedSanitizedBubbleSize[0]);
2814
- var max = lodash_1.sum(transposedSanitizedBubbleSize[1]);
2815
- transposedSanitizedBubbleSize.forEach(function (row) {
2816
- var bubbleSize = lodash_1.sum(row);
2817
- max = bubbleSize > max ? bubbleSize : max;
2818
- min = bubbleSize < min ? bubbleSize : min;
2819
- });
2820
- return {
2821
- data: data,
2822
- dataRange: [min, max],
2823
- isPie: isPie,
2824
- resultLimit: layer.resultLimit,
2825
- bubbleSizeFields: layer.bubbleSizeFields
2826
- };
3021
+ return null;
2827
3022
  };
2828
3023
 
2829
- exports.bakeBubbleData = bakeBubbleData; // Update bubbles on each zoom level
2830
-
2831
- var updateBubbles = function updateBubbles(dataObj, zoomLevel, staticColors, dynamicColors, theme, map, setTooltipProps) {
2832
- if (!dataObj || !dataObj.data.length || !map || !map.current) {
2833
- return null;
2834
- }
2835
-
2836
- var data = dataObj.data,
2837
- dataRange = dataObj.dataRange,
2838
- resultLimit = dataObj.resultLimit,
2839
- bubbleSizeFields = dataObj.bubbleSizeFields,
2840
- isPie = dataObj.isPie;
2841
-
2842
- if (!data || !data.length || !dataRange || !dataRange.length) {
2843
- return null;
2844
- }
2845
-
2846
- var roundedZoom = Math.round(zoomLevel);
2847
- var themeColor = theme === 'light' ? '#ffffff' : '#1a1c20'; // filter data for the current zoom level and sort base on values
3024
+ exports.default = ClusterLayer;
2848
3025
 
2849
- var dataToRender = data.reduce(function (acc, datum, i) {
2850
- if (datum.zoom === roundedZoom) {
2851
- acc.push({
2852
- data: datum,
2853
- idx: i
2854
- });
2855
- }
3026
+ /***/ }),
3027
+ /* 201 */
3028
+ /***/ (function(module, exports, __webpack_require__) {
2856
3029
 
2857
- return acc;
2858
- }, []).slice(0, resultLimit || exports.DEFAULT_RESULT_LIMIT).sort(function (a, b) {
2859
- return lodash_1.sum(b.data.values) - lodash_1.sum(a.data.values);
2860
- });
2861
- return dataToRender.map(function (datum, i) {
2862
- // create an HTML element for each bubble
2863
- var colors = dynamicColors ? [dataToRender.map(function (obj) {
2864
- return colorUtils_1.isColor(dynamicColors[obj.idx]) ? dynamicColors[obj.idx] : exports.DEFAULT_CLUSTER_COLOR;
2865
- })[i]] : staticColors;
2866
- var el = exports.createPieChart(datum.data.sanitizedValues, dataRange, colors, themeColor, isPie);
3030
+ "use strict";
2867
3031
 
2868
- var _datum$data$coordinat = _slicedToArray(datum.data.coordinates, 2),
2869
- longitude = _datum$data$coordinat[0],
2870
- latitude = _datum$data$coordinat[1];
2871
3032
 
2872
- var bubbleSize = datum.data.values.map(function (count, index) {
2873
- return {
2874
- name: bubbleSizeFields[index],
2875
- count: count,
2876
- color: colors[index]
2877
- };
2878
- });
2879
- el.addEventListener('mouseover', function () {
2880
- setTooltipProps({
2881
- anchor: el,
2882
- longitude: longitude,
2883
- latitude: latitude,
2884
- bubbleSize: bubbleSize
2885
- });
2886
- });
2887
- el.addEventListener('mouseleave', function () {
2888
- setTooltipProps({
2889
- longitude: longitude,
2890
- latitude: latitude,
2891
- bubbleSize: bubbleSize
2892
- });
2893
- });
2894
- return new maplibre_gl_1.Marker({
2895
- element: el
2896
- }).setLngLat(datum.data.coordinates).addTo(map.current);
2897
- });
2898
- };
3033
+ var _slicedToArray = __webpack_require__(49);
2899
3034
 
2900
- exports.updateBubbles = updateBubbles; // Create an SVG pie from column values
3035
+ var _defineProperty = __webpack_require__(8);
2901
3036
 
2902
- var createPieChart = function createPieChart(orginalValues, valueRange, colors, themeColor, isPie) {
2903
- // create a div for pie (bubble)
2904
- var el = document.createElement('div');
2905
- var allZeros = true;
2906
- orginalValues.forEach(function (v) {
2907
- if (v !== 0) {
2908
- allZeros = false;
2909
- }
2910
- });
3037
+ Object.defineProperty(exports, "__esModule", {
3038
+ value: true
3039
+ });
3040
+ exports.Bubble = exports.PieSegment = void 0;
2911
3041
 
2912
- if (allZeros || !orginalValues || !orginalValues.length) {
2913
- return el;
2914
- } // sanitize values
3042
+ var React = __webpack_require__(1);
2915
3043
 
3044
+ var styled_components_1 = __webpack_require__(4);
2916
3045
 
2917
- var values = orginalValues.map(function (v) {
2918
- return v > 0 ? v : 0;
2919
- }); // compute offsets for pie segments
3046
+ var lodash_1 = __webpack_require__(2);
2920
3047
 
2921
- var offsets = [];
2922
- var total = 0;
2923
- values.forEach(function (count) {
2924
- offsets.push(total);
2925
- total += count;
2926
- });
2927
- var radius = exports.matchSize(valueRange, total);
2928
- var width = radius * 2; // create bubble svg
3048
+ var colorUtils_1 = __webpack_require__(12);
2929
3049
 
2930
- var html = "<div>\n <svg width=\"".concat(width, "\" height=\"").concat(width, "\" viewbox=\"-3 -3 ").concat(width + 6, " ").concat(width + 6, "\" >"); // add border for pie
3050
+ var MapUtils_1 = __webpack_require__(102);
2931
3051
 
2932
- if (isPie) {
2933
- html += "<circle cx=".concat(radius, " cy=").concat(radius, " r=").concat(radius, " fill='none' stroke-width=\"2\" stroke=").concat(themeColor, " stroke-opacity=\"0.3\"/>");
2934
- } // create pie segments
3052
+ var MarkerWrapper_1 = __webpack_require__(127);
2935
3053
 
3054
+ exports.PieSegment = React.memo(function (_ref) {
3055
+ var start = _ref.start,
3056
+ end = _ref.end,
3057
+ radius = _ref.radius,
3058
+ color = _ref.color,
3059
+ themeColor = _ref.themeColor,
3060
+ segmentMetadata = _ref.segmentMetadata,
3061
+ handleBubbleClick = _ref.handleBubbleClick;
2936
3062
 
2937
- values.forEach(function (v, i) {
2938
- html += exports.pieSegment(offsets[i] / total, (offsets[i] + v) / total, radius, colors[i], themeColor);
2939
- });
2940
- html += "</svg>\n </div>";
2941
- el.className = 'custom-bubble';
2942
- el.innerHTML = html;
2943
- return el;
2944
- };
3063
+ var _ref2 = segmentMetadata !== null && segmentMetadata !== void 0 ? segmentMetadata : {},
3064
+ name = _ref2.name,
3065
+ count = _ref2.count;
2945
3066
 
2946
- exports.createPieChart = createPieChart; // Create a pie segment
3067
+ var handleSegmentClick = React.useCallback(function (e) {
3068
+ handleBubbleClick(e, name, count);
3069
+ }, [name, count, handleBubbleClick]);
2947
3070
 
2948
- var pieSegment = function pieSegment(start, end, radius, color, themeColor) {
2949
3071
  if (end - start === 1) {
2950
- return "<circle cx=".concat(radius, " cy=").concat(radius, " r=").concat(radius - 1, " fill=").concat(color, " fill-opacity=\"0.5\" stroke-width=\"1.5\" stroke=").concat(color, " />");
3072
+ return React.createElement("circle", {
3073
+ onClick: handleSegmentClick,
3074
+ cx: radius,
3075
+ cy: radius,
3076
+ r: radius - 1,
3077
+ fill: color,
3078
+ fillOpacity: 0.5,
3079
+ strokeWidth: 1.5,
3080
+ stroke: color
3081
+ });
2951
3082
  }
2952
3083
 
2953
3084
  var a0 = 2 * Math.PI * (start - 0.25);
@@ -2957,37 +3088,198 @@ var pieSegment = function pieSegment(start, end, radius, color, themeColor) {
2957
3088
  var x1 = Math.cos(a1);
2958
3089
  var y1 = Math.sin(a1);
2959
3090
  var arc = end - start > 0.5 ? 1 : 0;
2960
- return "<path d=\"M ".concat(radius, " ").concat(radius, " L ").concat(radius + radius * x0, " ").concat(radius + radius * y0, " A ").concat(radius, " ").concat(radius, " 0 ").concat(arc, " 1 ").concat(radius + radius * x1, " ").concat(radius + radius * y1, " L ").concat(radius, " ").concat(radius, " A 0 0 0 ").concat(arc, " 0 ").concat(radius, " ").concat(radius, "\" fill=\"").concat(color, "\" fill-opacity=\"0.8\" stroke=\"").concat(themeColor, "\" stroke-width=\"2\" stroke-opacity=\"0.3\" />");
2961
- };
3091
+ return React.createElement("path", {
3092
+ onClick: handleSegmentClick,
3093
+ d: "M ".concat(radius, " ").concat(radius, " L ").concat(radius + radius * x0, " ").concat(radius + radius * y0, " A ").concat(radius, " ").concat(radius, " 0 ").concat(arc, " 1 ").concat(radius + radius * x1, " ").concat(radius + radius * y1, " L ").concat(radius, " ").concat(radius, " A 0 0 0 ").concat(arc, " 0 ").concat(radius, " ").concat(radius),
3094
+ fill: color,
3095
+ fillOpacity: 0.8,
3096
+ stroke: themeColor,
3097
+ strokeWidth: 2,
3098
+ strokeOpacity: 0.3
3099
+ });
3100
+ });
3101
+ exports.PieSegment.displayName = 'MapBubblePieSegment';
3102
+ var StyledMarkerWrapper = styled_components_1.default(MarkerWrapper_1.default).withConfig({
3103
+ displayName: "BubbleLayer__StyledMarkerWrapper",
3104
+ componentId: "sc-8aqbb-0"
3105
+ })(["cursor:pointer;"]);
3106
+ exports.Bubble = React.memo(function (_ref3) {
3107
+ var originalValues = _ref3.originalValues,
3108
+ valueRange = _ref3.valueRange,
3109
+ colors = _ref3.colors,
3110
+ themeColor = _ref3.themeColor,
3111
+ isPie = _ref3.isPie,
3112
+ latitude = _ref3.latitude,
3113
+ longitude = _ref3.longitude,
3114
+ bubbleSize = _ref3.bubbleSize,
3115
+ map = _ref3.map,
3116
+ handleMapClick = _ref3.handleMapClick;
3117
+ var onBubbleClick = React.useCallback(function (e, name, value) {
3118
+ handleMapClick(e, name, value);
3119
+ e.stopPropagation();
3120
+ }, [bubbleSize]);
3121
+ var bubble = React.useMemo(function () {
3122
+ var allZeros = originalValues.every(function (v) {
3123
+ return v === 0;
3124
+ });
2962
3125
 
2963
- exports.pieSegment = pieSegment;
3126
+ if (allZeros || !originalValues.length) {
3127
+ return null;
3128
+ } // sanitize values
2964
3129
 
2965
- /***/ }),
2966
- /* 198 */
2967
- /***/ (function(module, exports, __webpack_require__) {
2968
3130
 
2969
- "use strict";
3131
+ var values = originalValues.map(function (v) {
3132
+ return v > 0 ? v : 0;
3133
+ }); // compute offsets for pie segments
2970
3134
 
3135
+ var offsets = [];
3136
+ var total = 0;
3137
+ values.forEach(function (count) {
3138
+ offsets.push(total);
3139
+ total += count;
3140
+ });
3141
+ var radius = MapUtils_1.matchBubbleSize(valueRange, total);
3142
+ var width = radius * 2;
3143
+ return React.createElement("svg", {
3144
+ width: width,
3145
+ height: width,
3146
+ viewBox: "-3 -3 ".concat(width + 6, " ").concat(width + 6)
3147
+ }, isPie ? React.createElement("circle", {
3148
+ cx: radius,
3149
+ cy: radius,
3150
+ r: radius,
3151
+ fill: "none",
3152
+ strokeWidth: 2,
3153
+ stroke: themeColor,
3154
+ strokeOpacity: 0.3
3155
+ }) : null, values.map(function (v, i) {
3156
+ return React.createElement(exports.PieSegment, {
3157
+ key: String(i),
3158
+ start: offsets[i] / total,
3159
+ end: (offsets[i] + v) / total,
3160
+ radius: radius,
3161
+ color: colors[i],
3162
+ themeColor: themeColor,
3163
+ segmentMetadata: bubbleSize[i],
3164
+ handleBubbleClick: onBubbleClick
3165
+ });
3166
+ }));
3167
+ }, [colors, isPie, originalValues, themeColor, valueRange]);
2971
3168
 
2972
- Object.defineProperty(exports, "__esModule", {
2973
- value: true
3169
+ if (!bubble) {
3170
+ return null;
3171
+ }
3172
+
3173
+ return React.createElement(StyledMarkerWrapper, {
3174
+ longitude: longitude,
3175
+ latitude: latitude,
3176
+ bubbleSize: bubbleSize,
3177
+ map: map,
3178
+ "data-test-type": "bubble"
3179
+ }, bubble);
2974
3180
  });
2975
- exports.defaultMarkerDarkTheme = exports.defaultMarkerLightTheme = void 0;
3181
+ exports.Bubble.displayName = 'MapBubble';
2976
3182
 
2977
- var defaultMarkerLightTheme = function defaultMarkerLightTheme(fillColor) {
2978
- return "<svg width=\"22\" height=\"28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" fill=\"".concat(fillColor, "\"/><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" stroke=\"%2308090A\"/><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" stroke=\"").concat(fillColor, "\" stroke-opacity=\".7\"/></svg>");
2979
- };
3183
+ var BubbleLayer = function BubbleLayer(props) {
3184
+ var bubbleLayer = props.bubbleLayer,
3185
+ themeColorScheme = props.themeColorScheme,
3186
+ map = props.map,
3187
+ zoom = props.zoom,
3188
+ onMapClick = props.onMapClick;
3189
+ bubbleLayer.seriesColors = bubbleLayer.seriesColors || MapUtils_1.DEFAULT_SERIES_COLORS;
3190
+ bubbleLayer.bubbleSize = bubbleLayer.bubbleSize || [];
3191
+ var bakedData = React.useMemo(function () {
3192
+ return MapUtils_1.bakeBubbleData(bubbleLayer);
3193
+ }, [bubbleLayer]);
3194
+ var staticColors = React.useMemo(function () {
3195
+ return MapUtils_1.getStaticColors(bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors);
3196
+ }, [bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors]);
3197
+
3198
+ var _ref4 = bakedData !== null && bakedData !== void 0 ? bakedData : {},
3199
+ _ref4$data = _ref4.data,
3200
+ data = _ref4$data === void 0 ? [] : _ref4$data,
3201
+ _ref4$dataRange = _ref4.dataRange,
3202
+ dataRange = _ref4$dataRange === void 0 ? [] : _ref4$dataRange,
3203
+ resultLimit = _ref4.resultLimit,
3204
+ bubbleSizeFields = _ref4.bubbleSizeFields,
3205
+ isPie = _ref4.isPie;
3206
+
3207
+ var roundedZoom = Math.round(zoom);
3208
+ var themeColor = themeColorScheme === 'light' ? '#ffffff' : '#1a1c20';
3209
+ var dynamicColors = bubbleLayer.dataColors; // filter data for the current zoom level and sort base on values
3210
+
3211
+ var dataToRender = React.useMemo(function () {
3212
+ return data.reduce(function (acc, datum, i) {
3213
+ if (datum.zoom === roundedZoom) {
3214
+ acc.push({
3215
+ data: datum,
3216
+ idx: i
3217
+ });
3218
+ }
3219
+
3220
+ return acc;
3221
+ }, []).slice(0, resultLimit || MapUtils_1.DEFAULT_RESULT_LIMIT).sort(function (a, b) {
3222
+ return lodash_1.sum(b.data.values) - lodash_1.sum(a.data.values);
3223
+ });
3224
+ }, [data, resultLimit, roundedZoom]);
2980
3225
 
2981
- exports.defaultMarkerLightTheme = defaultMarkerLightTheme;
3226
+ var _handleMapClick = React.useCallback(function (e, name, value, i) {
3227
+ var _a, _b, _c; // retrieve metadata from the appropriate datum, indexed by i
2982
3228
 
2983
- var defaultMarkerDarkTheme = function defaultMarkerDarkTheme(fillColor) {
2984
- return "<svg width=\"22\" height=\"28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" fill=\"".concat(fillColor, "\"/><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" stroke=\"%2308090A\"/><path d=\"M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z\" stroke=\"").concat(fillColor, "\" stroke-opacity=\".15\"/></svg>");
3229
+
3230
+ var metadata = (_c = (_b = (_a = dataToRender[i]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.metadata) !== null && _c !== void 0 ? _c : {};
3231
+ var payload = Object.keys(metadata).reduce(function (acc, curr) {
3232
+ var key = "row.".concat(curr, ".value");
3233
+ var val = String(metadata[curr]);
3234
+ return Object.assign(Object.assign({}, acc), _defineProperty({}, key, val));
3235
+ }, {
3236
+ name: name,
3237
+ value: String(value)
3238
+ });
3239
+ onMapClick({
3240
+ e: e,
3241
+ payload: payload
3242
+ });
3243
+ }, [dataToRender]);
3244
+
3245
+ return React.createElement(React.Fragment, null, dataToRender.map(function (datum, i) {
3246
+ var colors = dynamicColors ? [dataToRender.map(function (obj) {
3247
+ return colorUtils_1.isColor(dynamicColors[obj.idx]) ? dynamicColors[obj.idx] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
3248
+ })[i]] : staticColors;
3249
+
3250
+ var _datum$data$coordinat = _slicedToArray(datum.data.coordinates, 2),
3251
+ longitude = _datum$data$coordinat[0],
3252
+ latitude = _datum$data$coordinat[1];
3253
+
3254
+ var bubbleSize = datum.data.values.map(function (count, index) {
3255
+ return {
3256
+ name: bubbleSizeFields[index],
3257
+ count: count,
3258
+ color: colors[index]
3259
+ };
3260
+ });
3261
+ return React.createElement(exports.Bubble, {
3262
+ key: String(i),
3263
+ originalValues: datum.data.values,
3264
+ valueRange: dataRange,
3265
+ colors: colors,
3266
+ themeColor: themeColor,
3267
+ isPie: isPie,
3268
+ longitude: longitude,
3269
+ latitude: latitude,
3270
+ bubbleSize: bubbleSize,
3271
+ map: map,
3272
+ handleMapClick: function handleMapClick(e, name, value) {
3273
+ return _handleMapClick(e, name, value, i);
3274
+ }
3275
+ });
3276
+ }));
2985
3277
  };
2986
3278
 
2987
- exports.defaultMarkerDarkTheme = defaultMarkerDarkTheme;
3279
+ exports.default = BubbleLayer;
2988
3280
 
2989
3281
  /***/ }),
2990
- /* 199 */
3282
+ /* 202 */
2991
3283
  /***/ (function(module, exports, __webpack_require__) {
2992
3284
 
2993
3285
  "use strict";
@@ -3002,7 +3294,7 @@ var React = __webpack_require__(1);
3002
3294
 
3003
3295
  var styled_components_1 = __webpack_require__(4);
3004
3296
 
3005
- var Popover_1 = __webpack_require__(100);
3297
+ var Popover_1 = __webpack_require__(103);
3006
3298
 
3007
3299
  var i18n_1 = __webpack_require__(3);
3008
3300
 
@@ -3013,7 +3305,7 @@ var StyledPopover = styled_components_1.default(Popover_1.default).withConfig({
3013
3305
  var StyledTable = styled_components_1.default.table.withConfig({
3014
3306
  displayName: "Tooltip__StyledTable",
3015
3307
  componentId: "xwewsa-1"
3016
- })(["padding:2px 6px 2px 6px;width:100%;"]);
3308
+ })(["margin:2px 6px 2px 6px;width:calc(100% - 12px);"]);
3017
3309
  var StyledTitleColumn = styled_components_1.default.td.withConfig({
3018
3310
  displayName: "Tooltip__StyledTitleColumn",
3019
3311
  componentId: "xwewsa-2"
@@ -3063,13 +3355,14 @@ var convertDegToDMS = function convertDegToDMS(decimalDegree, type) {
3063
3355
  exports.convertDegToDMS = convertDegToDMS;
3064
3356
 
3065
3357
  var Tooltip = function Tooltip(_ref) {
3066
- var anchor = _ref.anchor,
3358
+ var open = _ref.open,
3359
+ anchor = _ref.anchor,
3067
3360
  latitude = _ref.latitude,
3068
3361
  longitude = _ref.longitude,
3069
3362
  _ref$bubbleSize = _ref.bubbleSize,
3070
3363
  bubbleSize = _ref$bubbleSize === void 0 ? [] : _ref$bubbleSize;
3071
3364
  return React.createElement(StyledPopover, {
3072
- open: !!anchor,
3365
+ open: open,
3073
3366
  anchor: anchor,
3074
3367
  "data-test": "map-marker-tooltip",
3075
3368
  defaultPlacement: "above"
@@ -3096,7 +3389,161 @@ var Tooltip = function Tooltip(_ref) {
3096
3389
  exports.default = Tooltip;
3097
3390
 
3098
3391
  /***/ }),
3099
- /* 200 */
3392
+ /* 203 */
3393
+ /***/ (function(module, exports, __webpack_require__) {
3394
+
3395
+ "use strict";
3396
+
3397
+
3398
+ var _defineProperty = __webpack_require__(8);
3399
+
3400
+ var __rest = this && this.__rest || function (s, e) {
3401
+ var t = {};
3402
+
3403
+ for (var p in s) {
3404
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
3405
+ }
3406
+
3407
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3408
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
3409
+ }
3410
+ return t;
3411
+ };
3412
+
3413
+ Object.defineProperty(exports, "__esModule", {
3414
+ value: true
3415
+ });
3416
+ exports.generateMarkerWrapperProps = exports.MarkerIcon = void 0;
3417
+
3418
+ var styled_components_1 = __webpack_require__(4);
3419
+
3420
+ var React = __webpack_require__(1);
3421
+
3422
+ var colorUtils_1 = __webpack_require__(12);
3423
+
3424
+ var MapUtils_1 = __webpack_require__(102);
3425
+
3426
+ var MarkerWrapper_1 = __webpack_require__(127);
3427
+
3428
+ var MarkerIcon = function MarkerIcon(_a) {
3429
+ var theme = _a.theme,
3430
+ color = _a.color,
3431
+ otherProps = __rest(_a, ["theme", "color"]);
3432
+
3433
+ var strokeOpacity = theme === 'light' ? 0.7 : 0.15;
3434
+ return React.createElement("svg", Object.assign({
3435
+ width: 22,
3436
+ height: 28,
3437
+ fill: "none"
3438
+ }, otherProps), React.createElement("path", {
3439
+ d: "M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z",
3440
+ fill: color
3441
+ }), React.createElement("path", {
3442
+ d: "M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z",
3443
+ stroke: "#08090A"
3444
+ }), React.createElement("path", {
3445
+ d: "M11 .5C5.201.5.5 5.201.5 11c0 3.136 1.376 5.952 3.555 7.875 2.839 2.506 4.144 4.58 4.893 6.02.183.35.334.665.469.946l.014.03c.136.285.263.548.387.766.235.412.571.863 1.182.863.61 0 .947-.45 1.182-.863.124-.218.25-.48.387-.765l.014-.03c.135-.282.286-.597.469-.947.75-1.44 2.054-3.514 4.893-6.02A10.476 10.476 0 0 0 21.5 11C21.5 5.201 16.799.5 11 .5Z",
3446
+ stroke: color,
3447
+ strokeOpacity: strokeOpacity
3448
+ }));
3449
+ };
3450
+
3451
+ exports.MarkerIcon = MarkerIcon;
3452
+ var Marker = React.memo(function (_ref) {
3453
+ var latitude = _ref.latitude,
3454
+ longitude = _ref.longitude,
3455
+ color = _ref.color,
3456
+ themeColorScheme = _ref.themeColorScheme,
3457
+ map = _ref.map,
3458
+ handleLayerClick = _ref.handleLayerClick;
3459
+ var icon = React.useMemo(function () {
3460
+ return React.createElement(exports.MarkerIcon, {
3461
+ color: color,
3462
+ theme: themeColorScheme,
3463
+ onClick: handleLayerClick
3464
+ });
3465
+ }, [color, themeColorScheme]);
3466
+ return React.createElement(StyledMarkerWrapper, {
3467
+ latitude: latitude,
3468
+ longitude: longitude,
3469
+ map: map,
3470
+ "data-test-type": "marker"
3471
+ }, icon);
3472
+ });
3473
+ Marker.displayName = 'MapMarker';
3474
+ var StyledMarkerWrapper = styled_components_1.default(MarkerWrapper_1.default).withConfig({
3475
+ displayName: "MarkerLayer__StyledMarkerWrapper",
3476
+ componentId: "ej9u2l-0"
3477
+ })(["width:22px;height:28px;cursor:pointer;"]);
3478
+
3479
+ var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer) {
3480
+ var latArray = markerLayer.latitude;
3481
+ var lonArray = markerLayer.longitude;
3482
+ var isStaticColor = !markerLayer.dataColors;
3483
+ var limit = Math.min(latArray.length, lonArray.length, markerLayer.resultLimit ? markerLayer.resultLimit : MapUtils_1.DEFAULT_RESULT_LIMIT);
3484
+ var markerProps = [];
3485
+
3486
+ for (var i = 0; i < limit; i += 1) {
3487
+ var staticColor = markerLayer.seriesColors && colorUtils_1.isColor(markerLayer.seriesColors[0]) ? markerLayer.seriesColors[0] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
3488
+ var dynamicColor = markerLayer.dataColors && colorUtils_1.isColor(markerLayer.dataColors[i]) ? markerLayer.dataColors[i] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
3489
+ var color = isStaticColor ? staticColor : dynamicColor;
3490
+ markerProps.push({
3491
+ latitude: latArray[i],
3492
+ longitude: lonArray[i],
3493
+ color: color
3494
+ });
3495
+ }
3496
+
3497
+ return markerProps;
3498
+ };
3499
+
3500
+ exports.generateMarkerWrapperProps = generateMarkerWrapperProps;
3501
+
3502
+ var MarkerLayer = function MarkerLayer(props) {
3503
+ var map = props.map,
3504
+ themeColorScheme = props.themeColorScheme,
3505
+ markerLayer = props.markerLayer,
3506
+ onMapClick = props.onMapClick;
3507
+ markerLayer.seriesColors = markerLayer.seriesColors || MapUtils_1.DEFAULT_SERIES_COLORS;
3508
+ var markerProps = React.useMemo(function () {
3509
+ return exports.generateMarkerWrapperProps(markerLayer);
3510
+ }, [markerLayer]);
3511
+ var onMarkerClick = React.useCallback(function (e, i) {
3512
+ var _a;
3513
+
3514
+ var metadata = (_a = markerLayer === null || markerLayer === void 0 ? void 0 : markerLayer.metadata[i]) !== null && _a !== void 0 ? _a : {};
3515
+ var payload = Object.keys(metadata).reduce(function (acc, curr) {
3516
+ var key = "row.".concat(curr, ".value");
3517
+ var value = String(metadata[curr]);
3518
+ return Object.assign(Object.assign({}, acc), _defineProperty({}, key, value));
3519
+ }, {});
3520
+ onMapClick({
3521
+ e: e,
3522
+ payload: payload
3523
+ });
3524
+ }, [markerLayer, onMapClick]);
3525
+ return React.createElement(React.Fragment, null, markerProps.map(function (_ref2, i) {
3526
+ var latitude = _ref2.latitude,
3527
+ longitude = _ref2.longitude,
3528
+ color = _ref2.color;
3529
+ return React.createElement(Marker, {
3530
+ key: String(i),
3531
+ latitude: latitude,
3532
+ longitude: longitude,
3533
+ color: color,
3534
+ themeColorScheme: themeColorScheme,
3535
+ map: map,
3536
+ handleLayerClick: function handleLayerClick(e) {
3537
+ return onMarkerClick(e, i);
3538
+ }
3539
+ });
3540
+ }));
3541
+ };
3542
+
3543
+ exports.default = MarkerLayer;
3544
+
3545
+ /***/ }),
3546
+ /* 204 */
3100
3547
  /***/ (function(module, exports, __webpack_require__) {
3101
3548
 
3102
3549
  "use strict";
@@ -3106,13 +3553,15 @@ Object.defineProperty(exports, "__esModule", {
3106
3553
  value: true
3107
3554
  });
3108
3555
 
3109
- var visualization_icons_1 = __webpack_require__(42);
3556
+ var visualization_icons_1 = __webpack_require__(43);
3110
3557
 
3111
- var schemaUtils_1 = __webpack_require__(14);
3558
+ var placeholders_1 = __webpack_require__(42);
3559
+
3560
+ var schemaUtils_1 = __webpack_require__(15);
3112
3561
 
3113
3562
  var visualization_color_palettes_1 = __webpack_require__(41);
3114
3563
 
3115
- var themes_1 = __webpack_require__(70);
3564
+ var themes_1 = __webpack_require__(71);
3116
3565
 
3117
3566
  var i18n_1 = __webpack_require__(3);
3118
3567
 
@@ -3168,9 +3617,8 @@ var optionsSchema = {
3168
3617
  type: 'string'
3169
3618
  },
3170
3619
  center: {
3171
- default: [37.7749, -122.4194],
3172
3620
  type: 'array',
3173
- description: 'Specify the center of the map in coordinates, in the form of [latitude, longitude]. When not provided, will automatically calculate map center based on available location data. When no location data available will fall back to [37.7749, -122.4194].',
3621
+ description: 'Specify the center of the map in coordinates, in the form of [latitude, longitude]. When not provided, will automatically calculate map center based on available location data. When no location data available will fall back to [0,0].',
3174
3622
  items: {
3175
3623
  type: 'number'
3176
3624
  }
@@ -3330,7 +3778,6 @@ var optionsSchema = {
3330
3778
  pattern: schemaUtils_1.getPattern(['vector', 'raster'])
3331
3779
  },
3332
3780
  zoom: {
3333
- default: 5,
3334
3781
  description: 'Specify the zoom level of the map.',
3335
3782
  type: 'number'
3336
3783
  }
@@ -3381,14 +3828,16 @@ var editorConfig = [{
3381
3828
  option: 'layers[0].latitude',
3382
3829
  editor: 'editor.columnSelector',
3383
3830
  editorProps: {
3384
- dataSourceKey: 'primary'
3831
+ dataSourceKey: 'primary',
3832
+ shouldShowInternalFields: false
3385
3833
  }
3386
3834
  }], [{
3387
3835
  label: i18n_1._('Longitude'),
3388
3836
  option: 'layers[0].longitude',
3389
3837
  editor: 'editor.columnSelector',
3390
3838
  editorProps: {
3391
- dataSourceKey: 'primary'
3839
+ dataSourceKey: 'primary',
3840
+ shouldShowInternalFields: false
3392
3841
  }
3393
3842
  }], [{
3394
3843
  label: i18n_1._('Size'),
@@ -3399,7 +3848,10 @@ var editorConfig = [{
3399
3848
  return !(options.layers && options.layers.length && options.layers[0].type === 'marker');
3400
3849
  },
3401
3850
  editorProps: {
3402
- dataSourceKey: 'primary'
3851
+ dataSourceKey: 'primary',
3852
+ isMultiSelect: true,
3853
+ shouldShowInternalFields: false,
3854
+ excludeByNames: ['latitude', 'longitude', 'geobin']
3403
3855
  }
3404
3856
  }]]
3405
3857
  }];
@@ -3424,6 +3876,7 @@ var config = {
3424
3876
  * viz icon
3425
3877
  */
3426
3878
  icon: visualization_icons_1.Map,
3879
+ placeholderIcon: placeholders_1.Map,
3427
3880
  dataContract: dataContract,
3428
3881
  size: size,
3429
3882
  defaultContext: defaultContext,
@@ -3432,6 +3885,9 @@ var config = {
3432
3885
  events: {
3433
3886
  'map.load': {
3434
3887
  description: 'triggered when map is fully loaded'
3888
+ },
3889
+ 'map.click': {
3890
+ description: 'trigger when user clicks map layer'
3435
3891
  }
3436
3892
  },
3437
3893
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],