@splunk/visualizations 27.5.0 → 28.0.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 (164) hide show
  1. package/Area.config.js +19 -21
  2. package/Area.config.js.map +3 -3
  3. package/Area.js +54 -32
  4. package/Area.js.map +3 -3
  5. package/Bar.config.js +18 -21
  6. package/Bar.config.js.map +3 -3
  7. package/Bar.js +48 -31
  8. package/Bar.js.map +3 -3
  9. package/Bubble.config.js +39 -44
  10. package/Bubble.config.js.map +4 -4
  11. package/Bubble.js +69 -51
  12. package/Bubble.js.map +4 -4
  13. package/CHANGELOG.external.md +35 -7
  14. package/ChoroplethSvg.config.js +47 -43
  15. package/ChoroplethSvg.config.js.map +4 -4
  16. package/ChoroplethSvg.js +72 -45
  17. package/ChoroplethSvg.js.map +4 -4
  18. package/Column.config.js +15 -20
  19. package/Column.config.js.map +3 -3
  20. package/Column.js +42 -29
  21. package/Column.js.map +3 -3
  22. package/Ellipse.config.js +16 -7
  23. package/Ellipse.config.js.map +2 -2
  24. package/Ellipse.js +45 -19
  25. package/Ellipse.js.map +2 -2
  26. package/Events.config.js +38 -27
  27. package/Events.config.js.map +4 -4
  28. package/Events.js +113 -97
  29. package/Events.js.map +4 -4
  30. package/FEATUREFLAGS.md +9 -9
  31. package/FillerGauge.config.js +20 -13
  32. package/FillerGauge.config.js.map +3 -3
  33. package/FillerGauge.js +76 -27
  34. package/FillerGauge.js.map +4 -4
  35. package/Image.config.js +5 -6
  36. package/Image.config.js.map +2 -2
  37. package/Image.js +29 -14
  38. package/Image.js.map +2 -2
  39. package/Line.config.js +15 -20
  40. package/Line.config.js.map +3 -3
  41. package/Line.js +50 -31
  42. package/Line.js.map +3 -3
  43. package/LinkGraph.config.js +39 -46
  44. package/LinkGraph.config.js.map +3 -3
  45. package/LinkGraph.js +70 -50
  46. package/LinkGraph.js.map +3 -3
  47. package/MIGRATION.md +169 -40
  48. package/Map.config.js +36 -13
  49. package/Map.config.js.map +4 -4
  50. package/Map.js +170 -105
  51. package/Map.js.map +4 -4
  52. package/Markdown.config.js +4 -5
  53. package/Markdown.config.js.map +2 -2
  54. package/Markdown.js +117 -72
  55. package/Markdown.js.map +3 -3
  56. package/MarkerGauge.config.js +14 -12
  57. package/MarkerGauge.config.js.map +3 -3
  58. package/MarkerGauge.js +107 -69
  59. package/MarkerGauge.js.map +4 -4
  60. package/ParallelCoordinates.config.js +14 -12
  61. package/ParallelCoordinates.config.js.map +3 -3
  62. package/ParallelCoordinates.js +113 -59
  63. package/ParallelCoordinates.js.map +3 -3
  64. package/Pie.config.js +51 -38
  65. package/Pie.config.js.map +4 -4
  66. package/Pie.js +109 -85
  67. package/Pie.js.map +4 -4
  68. package/Punchcard.config.js +36 -34
  69. package/Punchcard.config.js.map +4 -4
  70. package/Punchcard.js +153 -87
  71. package/Punchcard.js.map +4 -4
  72. package/README.internal.md +15 -15
  73. package/README.md +10 -10
  74. package/Rectangle.config.js +16 -7
  75. package/Rectangle.config.js.map +2 -2
  76. package/Rectangle.js +45 -19
  77. package/Rectangle.js.map +2 -2
  78. package/Sankey.config.js +69 -17
  79. package/Sankey.config.js.map +4 -4
  80. package/Sankey.js +178 -49
  81. package/Sankey.js.map +4 -4
  82. package/Scatter.config.js +37 -42
  83. package/Scatter.config.js.map +3 -3
  84. package/Scatter.js +70 -53
  85. package/Scatter.js.map +3 -3
  86. package/SingleValue.config.js +32 -18
  87. package/SingleValue.config.js.map +4 -4
  88. package/SingleValue.js +237 -93
  89. package/SingleValue.js.map +4 -4
  90. package/SingleValueBasic.js +1 -0
  91. package/SingleValueBasic.js.map +2 -2
  92. package/SingleValueIcon.config.js +22 -11
  93. package/SingleValueIcon.config.js.map +2 -2
  94. package/SingleValueIcon.js +84 -28
  95. package/SingleValueIcon.js.map +2 -2
  96. package/SingleValueRadial.config.js +34 -23
  97. package/SingleValueRadial.config.js.map +3 -3
  98. package/SingleValueRadial.js +89 -48
  99. package/SingleValueRadial.js.map +4 -4
  100. package/SparkLine.js +153 -49
  101. package/SparkLine.js.map +2 -2
  102. package/Table.config.js +71 -51
  103. package/Table.config.js.map +3 -3
  104. package/Table.js +282 -145
  105. package/Table.js.map +3 -3
  106. package/Timeline.config.js +36 -34
  107. package/Timeline.config.js.map +4 -4
  108. package/Timeline.js +67 -59
  109. package/Timeline.js.map +4 -4
  110. package/common/Charting.js +1 -0
  111. package/common/Charting.js.map +2 -2
  112. package/common/ChartingApi.js +1 -0
  113. package/common/ChartingApi.js.map +1 -1
  114. package/common/DocExampleWithVizSandbox.js +7 -2
  115. package/common/DocExampleWithVizSandbox.js.map +2 -2
  116. package/common/EventsDoc.js +31 -5
  117. package/common/EventsDoc.js.map +4 -4
  118. package/common/GaugeMajorTicks.js +4 -1
  119. package/common/GaugeMajorTicks.js.map +2 -2
  120. package/common/GaugeValueMarker.js +31 -3
  121. package/common/GaugeValueMarker.js.map +4 -4
  122. package/common/OptionsDoc.js +4 -1
  123. package/common/OptionsDoc.js.map +2 -2
  124. package/common/OverviewDoc.js +66 -50
  125. package/common/OverviewDoc.js.map +4 -4
  126. package/common/SplunkVisualization.js +1 -0
  127. package/common/SplunkVisualization.js.map +1 -1
  128. package/common/SplunkVisualizationApi.js +1 -0
  129. package/common/SplunkVisualizationApi.js.map +1 -1
  130. package/common/ThemedDefaults.js +67 -0
  131. package/common/ThemedDefaults.js.map +7 -0
  132. package/common/ThemesDoc.js +6 -9
  133. package/common/ThemesDoc.js.map +2 -2
  134. package/common/chartingUtils.js +1 -0
  135. package/common/chartingUtils.js.map +2 -2
  136. package/common/docUtils.js +6 -1
  137. package/common/docUtils.js.map +2 -2
  138. package/common/gaugeUtils.js +6 -1
  139. package/common/gaugeUtils.js.map +2 -2
  140. package/common/shapeUtils.js +6 -4
  141. package/common/shapeUtils.js.map +2 -2
  142. package/common/utils/configUtils.js +4 -5
  143. package/common/utils/configUtils.js.map +2 -2
  144. package/common/utils/dataUtils.js +1 -0
  145. package/common/utils/dataUtils.js.map +2 -2
  146. package/common/utils/featureFlagUtils.js +1 -0
  147. package/common/utils/featureFlagUtils.js.map +1 -1
  148. package/common/utils/hocUtils.js +1 -0
  149. package/common/utils/hocUtils.js.map +1 -1
  150. package/common/utils/mapUtils.js +35 -22
  151. package/common/utils/mapUtils.js.map +4 -4
  152. package/common/utils/singleValueUtils.js +8 -2
  153. package/common/utils/singleValueUtils.js.map +2 -2
  154. package/common/utils/styleUtils.js +1 -0
  155. package/common/utils/styleUtils.js.map +1 -1
  156. package/common/utils/testHelper.js +1 -0
  157. package/common/utils/testHelper.js.map +1 -1
  158. package/common/utils/trellisUtils.js +1 -0
  159. package/common/utils/trellisUtils.js.map +1 -1
  160. package/common/utils/urlUtils.js +1 -0
  161. package/common/utils/urlUtils.js.map +1 -1
  162. package/common/withDashboardViz.js +25 -8
  163. package/common/withDashboardViz.js.map +2 -2
  164. package/package.json +37 -35
package/MIGRATION.md CHANGED
@@ -1,5 +1,134 @@
1
1
  # Migration
2
2
 
3
+ <a name="28.0.0"></a>
4
+
5
+ ## 28.0.0
6
+
7
+ ### React 18 Upgrade
8
+
9
+ The codebase has been upgraded from React 16 to React 18.
10
+
11
+ **Breaking Changes:**
12
+
13
+ - All packages now require React 18 as a peer dependency.
14
+ - If your application or library is still using React 16, you must upgrade to React 18 to use these packages.
15
+ - Some APIs and lifecycle methods deprecated in React 18 may no longer work as expected.
16
+ - Older frameworks like Enzyme don’t support React 18, so unit tests should be migrated to RTL or another compatible framework.
17
+ - If you use third-party libraries, ensure they are compatible with React 18.
18
+
19
+ **Migration Steps:**
20
+
21
+ 1. Upgrade your project’s `react` and `react-dom` dependencies to version 18.
22
+ 2. Review your code for usage of deprecated lifecycle methods and update as needed.
23
+ 3. Test your application thoroughly for any changes in rendering or behavior.
24
+
25
+ ### SUI5 Upgrade
26
+
27
+ The codebase has been upgrade from SUI4 to SUI5.
28
+
29
+ #### SUI 5 Upgrade Summary
30
+
31
+ Splunk UI 5 (SUI5) introduces a unified design system with significant improvements and some breaking changes. Key updates include:
32
+
33
+ - **Consistent Spacing:** Margin has been removed from all components to ensure consistent layouts. Use the new `Layout` component or layout mixins for spacing between elements.
34
+ - **Typography Updates:** Font sizes, weights, and families are now managed through new mixins, and font size no longer changes with density.
35
+ - **Accessibility Improvements:** Disabled components now use a more accessible "dimmed" state by default, and various props have been updated or removed to improve accessibility and consistency.
36
+ - **Visual and Theming Changes:** Updated color palettes, background colors, and visual tokens to align with the new design system.
37
+
38
+ For detailed list of changes, see the [SUI5 Migration Guide](https://splunkui.splunk.com/Packages/react-ui/Migration).
39
+
40
+ #### Visual Changes
41
+
42
+ - Axis colors, text colors, and background colors have been updated to align with the new design system in SUI 5.
43
+ - You may notice differences in chart appearance, including:
44
+ - Updated axis and gridline colors
45
+ - New default background colors for charts and tables
46
+ - Refreshed text colors for improved accessibility
47
+ - Enterprise primary color now green
48
+ - If your application overrides these styles, review and update your customizations as needed.
49
+
50
+ **List of visual changes:**
51
+
52
+ - diffs are in the order of: before (left) | after (right)
53
+ - split snapshots order: top (enterprise light) | middle (enterprise dark) | bottom (prisma dark)
54
+
55
+ - All visualizations default background color for Prisma Dark theme updated to `#1a1c20`.
56
+
57
+ ![All Visualizations - Prisma dark - Default background color](./src/common/docs/migrations/assets/defaultbackgroundcolor-diff.png)
58
+
59
+ - Info/Warning icon updated.
60
+
61
+ ![Info icon - before](./src/common/docs/migrations/assets/info-before.png)
62
+ ![Info icon - after](./src/common/docs/migrations/assets/info-after.png)
63
+
64
+ - No Datasource icon updated.
65
+
66
+ ![No Datasource icon - before](./src/common/docs/migrations/assets/nodatasource-before.png)
67
+ ![No Datasource icon - after](./src/common/docs/migrations/assets/nodatasource-after.png)
68
+
69
+ - Events multiple elements updated.
70
+ - pagination spacing and focus color updated for enterprise.
71
+ - alternating table background color updated due to SUI5 upgrade.
72
+ - link styling updated.
73
+ - header and paginator container spacing updated.
74
+
75
+ ![Events - before](./src/common/docs/migrations/assets/eventsviz-before.png)
76
+ ![Events - after](./src/common/docs/migrations/assets/eventsviz-after.png)
77
+
78
+ - Events time control popover colors, size, and spacing updated.
79
+
80
+ ![Events time control popover dark - diff](./src/common/docs/migrations/assets/events-timecontrolpopover-dark-diff.png)
81
+ ![Events time control popover light - diff](./src/common/docs/migrations/assets/events-timecontrolpopover-light-diff.png)
82
+
83
+ - EventsViewer multiple elements updated.
84
+ - alternating table background color updated due to SUI5 upgrade.
85
+ - text color updated.
86
+ - text highlight color updated.
87
+ - border color of separate entries in expanded row updated.
88
+
89
+ ![EventsViewer - before](./src/common/docs/migrations/assets/eventsviewer-before.png)
90
+ ![EventsViewer - after](./src/common/docs/migrations/assets/eventsviewer-after.png)
91
+
92
+ - FieldSummary bar colors and dropdown select button colors updated.
93
+
94
+ ![FieldSummary enterprise - diff](./src/common/docs/migrations/assets/fieldsummary-enterprise-diff.png)
95
+ ![FieldSummary prisma - before](./src/common/docs/migrations/assets/fieldsummary-before.png)
96
+ ![FieldSummary prisma - after](./src/common/docs/migrations/assets/fieldsummary-after.png)
97
+
98
+ - LinkGraph default node background color updated.
99
+
100
+ ![LinkGraph node color](./src/common/docs/migrations/assets/linkgraph-before.png)
101
+ ![LinkGraph node color](./src/common/docs/migrations/assets/linkgraph-after.png)
102
+
103
+ - Map tooltip spacing and background color Dark updated.
104
+
105
+ ![Map tooltip - before](./src/common/docs/migrations/assets/map-tooltip-before.png)
106
+ ![Map tooltip - after](./src/common/docs/migrations/assets/map-tooltip-after.png)
107
+
108
+ - Markdown spacing updated.
109
+
110
+ ![Markdown - before](./src/common/docs/migrations/assets/markdown-before.png)
111
+ ![Markdown - after](./src/common/docs/migrations/assets/markdown-after.png)
112
+
113
+ - Punchcard bubble default text color auto selects white or black based on luminance calculated with bubble color, bubble opacity, and background color to meet WCAG contrast requirements.
114
+ - Punchcard gridlines updated.
115
+
116
+ ![Punchcard - before](./src/common/docs/migrations/assets/punchcard-before.png)
117
+ ![Punchcard - after](./src/common/docs/migrations/assets/punchcard-after.png)
118
+
119
+ - Table multiple elements updated.
120
+ - Sort by icon updated.
121
+ - Header dividers color updated.
122
+ - Pagination focus color updated for enterprise.
123
+
124
+ ![Table - before](./src/common/docs/migrations/assets/table-before.png)
125
+ ![Table - after](./src/common/docs/migrations/assets/table-after.png)
126
+
127
+ - Timeline axis border and text colors updated.
128
+
129
+ ![Timeline - before](./src/common/docs/migrations/assets/timeline-before.png)
130
+ ![Timeline - after](./src/common/docs/migrations/assets/timeline-after.png)
131
+
3
132
  <a name="27.0.0"></a>
4
133
 
5
134
  ## 27.0.0
@@ -24,35 +153,35 @@ The default formatting for time values in Table has been changed to YYYY-MM-DD H
24
153
 
25
154
  1. @splunk/charting dependency upgraded to v2.0.0 which has Highcharts v9 upgrade. This has visual and DOM rendering differences for charting components.The consuming applications will see these visual changes. Also there are some DOM rendering changes wrt tooltips, the corresponding test cases need to be updated.
26
155
 
27
- - Legend items have more spacing across all charts as part of legend item accessibility improvement in Highcharts
156
+ - Legend items have more spacing across all charts as part of legend item accessibility improvement in Highcharts
28
157
 
29
158
  ![Legend items difference](./src/common/docs/migrations/assets/render-diff1.gif)
30
159
 
31
- - On legend item hover, the gray color on inactive series is more pronounced, seems to be a good improvement for visibility
160
+ - On legend item hover, the gray color on inactive series is more pronounced, seems to be a good improvement for visibility
32
161
 
33
162
  ![Legend item hover difference](./src/common/docs/migrations/assets/render-diff2A.gif)
34
163
 
35
164
  ![Legend item hover difference](./src/common/docs/migrations/assets/render-diff2B.gif)
36
165
 
37
- - Bubble chart data point minor rendering difference
166
+ - Bubble chart data point minor rendering difference
38
167
 
39
168
  ![Bubble chart difference](./src/common/docs/migrations/assets/render-diff3.gif)
40
169
 
41
- - Line chart marker rendering minor difference
170
+ - Line chart marker rendering minor difference
42
171
 
43
172
  ![Line chart maker difference](./src/common/docs/migrations/assets/render-diff4.gif)
44
173
 
45
- - Slight shift up in the column/ bar charts with axis label rotated
174
+ - Slight shift up in the column/ bar charts with axis label rotated
46
175
 
47
176
  ![Column chart difference](./src/common/docs/migrations/assets/render-diff5.gif)
48
177
 
49
- - Scatter chart low datapoints showing full square aligning with the axis
178
+ - Scatter chart low datapoints showing full square aligning with the axis
50
179
 
51
180
  ![Scatter chart difference](./src/common/docs/migrations/assets/render-diff6.gif)
52
181
 
53
182
  The consuming applications will see these visual changes. Also there are some DOM rendering changes wrt tooltips, the corresponding test cases need to be updated.
54
183
 
55
- - `@splunk/highcharts-scaled-events` deprecated
184
+ - `@splunk/highcharts-scaled-events` deprecated
56
185
 
57
186
  `@splunk/highcharts-scaled-events` deprecated as the support of scale events and tooltip is supported in Highcharts v9 version
58
187
 
@@ -108,7 +237,7 @@ Axes charts (Area/Bar/Bubble/Column/Line/Scatter) now expose the configuration U
108
237
 
109
238
  There are a few indicators in the search meta data (apart from `_time` field) that can help infer on data type information:
110
239
 
111
- - `type` field
240
+ - `type` field
112
241
 
113
242
  When search result fields are coerced into a different type, the search result meta data will include a `type` field
114
243
 
@@ -636,8 +765,8 @@ New payload structure:
636
765
 
637
766
  ### Peer dependency changes
638
767
 
639
- - `@splunk/dashboard-visualizations`, `@splunk/react-visualizations` `@splunk/visualization-editors` and `@splunk/visualizations` now have styled-components@^5.1 as a peer dependency (was previously ^3 || ^4)
640
- - `@splunk/react-ui` is no longer a required peer dependency (it's bundled as a direct dependency in vision packages)
768
+ - `@splunk/dashboard-visualizations`, `@splunk/react-visualizations` `@splunk/visualization-editors` and `@splunk/visualizations` now have styled-components@^5.1 as a peer dependency (was previously ^3 || ^4)
769
+ - `@splunk/react-ui` is no longer a required peer dependency (it's bundled as a direct dependency in vision packages)
641
770
 
642
771
  ### Theming changes in visualizations
643
772
 
@@ -768,17 +897,17 @@ See https://cd.splunkdev.com/devplat/vision/-/merge_requests/1213#approach for a
768
897
 
769
898
  ### Other visual changes
770
899
 
771
- - visualizations in enterpriseDark use `#000000` for their background color, and `#0b0c0e` for their background color in prisma dark. `#ffffff` is still used as the background color in enterprise light
900
+ - visualizations in enterpriseDark use `#000000` for their background color, and `#0b0c0e` for their background color in prisma dark. `#ffffff` is still used as the background color in enterprise light
772
901
 
773
- - various minor theming changes for prisma dark (which was previously SCP) theme for visualizations and corresponding editors
902
+ - various minor theming changes for prisma dark (which was previously SCP) theme for visualizations and corresponding editors
774
903
 
775
- - Updated Single Value's sparkline area opacity from 75% to 20%. This causes the background color to shine through more prominently ( see [previous](https://cd.splunkdev.com/devplat/vision/-/blob/319742c672cd29f0a9c650cba7b6a08ef5604733/packages/dashboard-visualizations/tests/__image_snapshots__/visual-test-js-dashboard-visualizations-dashboard-single-value-encoding-fill-format-specified-sparkline-area-true-fill-color-red-1-snap.png) vs [new](https://cd.splunkdev.com/devplat/vision/-/blob/32dc99a9f2da52d17b244f0be2081760a2c2ae04/packages/dashboard-visualizations/tests/__image_snapshots__/visual-test-js-dashboard-visualizations-dashboard-single-value-encoding-fill-format-specified-sparkline-area-true-fill-color-red-1-snap.png) )
904
+ - Updated Single Value's sparkline area opacity from 75% to 20%. This causes the background color to shine through more prominently ( see [previous](https://cd.splunkdev.com/devplat/vision/-/blob/319742c672cd29f0a9c650cba7b6a08ef5604733/packages/dashboard-visualizations/tests/__image_snapshots__/visual-test-js-dashboard-visualizations-dashboard-single-value-encoding-fill-format-specified-sparkline-area-true-fill-color-red-1-snap.png) vs [new](https://cd.splunkdev.com/devplat/vision/-/blob/32dc99a9f2da52d17b244f0be2081760a2c2ae04/packages/dashboard-visualizations/tests/__image_snapshots__/visual-test-js-dashboard-visualizations-dashboard-single-value-encoding-fill-format-specified-sparkline-area-true-fill-color-red-1-snap.png) )
776
905
 
777
906
  <a name="21.0.0"></a>
778
907
 
779
908
  ## 21.0.0
780
909
 
781
- - Renamed the following options in @splunk/visualizations for SingleValue, SingleValueIcon and SingleValueRadial:
910
+ - Renamed the following options in @splunk/visualizations for SingleValue, SingleValueIcon and SingleValueRadial:
782
911
 
783
912
  | previous option naming | new option naming |
784
913
  | -------------------------- | ---------------------------- |
@@ -798,42 +927,42 @@ Visual changes related to Highcharts v7.2.1 upgrade can be summarized as
798
927
 
799
928
  ### Major
800
929
 
801
- - Axes are stretched to take up more space
802
- ![Axes Stretched](./src/common/docs/migrations/assets/axesstretch.png)
930
+ - Axes are stretched to take up more space
931
+ ![Axes Stretched](./src/common/docs/migrations/assets/axesstretch.png)
803
932
 
804
- - Displays the last label on a categorical axes
805
- ![Category Label](./src/common/docs/migrations/assets/categoricallabel.png)
933
+ - Displays the last label on a categorical axes
934
+ ![Category Label](./src/common/docs/migrations/assets/categoricallabel.png)
806
935
 
807
- - Legends are spaced equally
808
- ![Legends](./src/common/docs/migrations/assets/legends.png)
936
+ - Legends are spaced equally
937
+ ![Legends](./src/common/docs/migrations/assets/legends.png)
809
938
 
810
- - Pie Chart shows fewer labels when there are too many labels
811
- ![Piechart](./src/common/docs/migrations/assets/piechartlabel.png)
939
+ - Pie Chart shows fewer labels when there are too many labels
940
+ ![Piechart](./src/common/docs/migrations/assets/piechartlabel.png)
812
941
 
813
- - Zooming a chart maintains parent axis
814
- ![Zoom](./src/common/docs/migrations/assets/zoom.png)
942
+ - Zooming a chart maintains parent axis
943
+ ![Zoom](./src/common/docs/migrations/assets/zoom.png)
815
944
 
816
945
  ### Minor
817
946
 
818
- - Colors of the chart grid have changed
819
- - Minor pixel differences
947
+ - Colors of the chart grid have changed
948
+ - Minor pixel differences
820
949
 
821
950
  ### Known issues
822
951
 
823
- - [SPL-190515](https://jira.splunk.com/browse/SPL-190515) Bubble chart fails to render when `axisY.maximumNumber` and `axisLabelsX.integerUnits` are set ([workaround](https://jira.splunk.com/browse/SPL-190515?focusedCommentId=4960319&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-4960319))
952
+ - [SPL-190515](https://jira.splunk.com/browse/SPL-190515) Bubble chart fails to render when `axisY.maximumNumber` and `axisLabelsX.integerUnits` are set ([workaround](https://jira.splunk.com/browse/SPL-190515?focusedCommentId=4960319&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-4960319))
824
953
 
825
954
  For a detailed list of changes refer to [Splunk Charting upgrade review doc](https://docs.google.com/document/d/13GWdNsbLFvY_M824PsBokBfLbVFuyp4qRkaaT5syOUE/edit) or the [visual diffs](https://drive.google.com/drive/u/1/folders/0AGiuEeEGQemoUk9PVA)
826
955
 
827
956
  ### Deprecations
828
957
 
829
- - @splunk/react-visualization/numberUtils is deprecated. Use @splunk/visualizations-shared/numberUtils instead.
958
+ - @splunk/react-visualization/numberUtils is deprecated. Use @splunk/visualizations-shared/numberUtils instead.
830
959
 
831
960
  <a name="18.0.0"></a>
832
961
 
833
962
  ## 18.0.0
834
963
 
835
- - Support for `withError`, `withNoResultIndicator` and `withLoadingIndicator` higher order components (HOCs) has been dropped.
836
- - Visualizations will no longer display Title or Description. `withTitleAndDescription` HOC has been replaced by `withBackgroundColor`. The `withBackgroundColor` HOC retains the logic to apply a background color to the container surrounding the visualization, and calculate pixel sizes for height and width when needed.
964
+ - Support for `withError`, `withNoResultIndicator` and `withLoadingIndicator` higher order components (HOCs) has been dropped.
965
+ - Visualizations will no longer display Title or Description. `withTitleAndDescription` HOC has been replaced by `withBackgroundColor`. The `withBackgroundColor` HOC retains the logic to apply a background color to the container surrounding the visualization, and calculate pixel sizes for height and width when needed.
837
966
 
838
967
  Usage Example
839
968
 
@@ -848,9 +977,9 @@ withBackgroundColor({
848
977
 
849
978
  ## 17.0.0
850
979
 
851
- - In Single Value visualization, support for option 'sparklineFillOpacity' has been dropped. A constant sparkline fill opacity of 0.05 is used.
980
+ - In Single Value visualization, support for option 'sparklineFillOpacity' has been dropped. A constant sparkline fill opacity of 0.05 is used.
852
981
 
853
- - BaseVisualization received a new prop `onComputedProps`
982
+ - BaseVisualization received a new prop `onComputedProps`
854
983
 
855
984
  The `onComputedProps` prop allows dashboard-visualizations to communicate calculated props (e.g. a background color that is calculated based on data) upwards to its consumer.
856
985
 
@@ -954,8 +1083,8 @@ ChoroplethSvg remote URL input are now disabled by default. Please set the featu
954
1083
 
955
1084
  Please update your dependencies for the following packages to match peerDependency requirements:
956
1085
 
957
- - @splunk/react-ui@^2.16.0
958
- - @splunk/themes@^0.4.2
1086
+ - @splunk/react-ui@^2.16.0
1087
+ - @splunk/themes@^0.4.2
959
1088
 
960
1089
  <a name="15.3.0"></a>
961
1090
 
@@ -964,8 +1093,8 @@ Please update your dependencies for the following packages to match peerDependen
964
1093
  Standardize the format of visualization options that expect an 'array' or 'object', but are inputted as 'string'.
965
1094
  The option type 'string' for the following has been deprecated:
966
1095
 
967
- - seriesColors, legend.labels, data.fieldShowList, data.fieldHideList, gaugeColors, chart.rangeValues ('string' -> 'array')
968
- - fieldColors, annotation.categoryColors, fieldDashStyles ('string' -> 'object'),
1096
+ - seriesColors, legend.labels, data.fieldShowList, data.fieldHideList, gaugeColors, chart.rangeValues ('string' -> 'array')
1097
+ - fieldColors, annotation.categoryColors, fieldDashStyles ('string' -> 'object'),
969
1098
 
970
1099
  Before
971
1100
 
@@ -1011,8 +1140,8 @@ Users of DynamicEditor may pass a function `transformLayout={({ layout, visualiz
1011
1140
 
1012
1141
  ### BREAKING CHANGES
1013
1142
 
1014
- - add new marker gauge visualization, and remove splunk-charting based marker gauge. Encoding (value) is added to new marker gauge. Options are changed in new marker gauge.
1015
- Example:
1143
+ - add new marker gauge visualization, and remove splunk-charting based marker gauge. Encoding (value) is added to new marker gauge. Options are changed in new marker gauge.
1144
+ Example:
1016
1145
 
1017
1146
  ```
1018
1147
  import React from 'react';
@@ -1047,8 +1176,8 @@ export default () => (
1047
1176
 
1048
1177
  ### BREAKING CHANGES
1049
1178
 
1050
- - add new filler gauge visualization, and remove splunk-charting based filler gauge. Encoding (value, gaugeColor) is added to new filler gauge. Options are changed in new filler gauge.
1051
- Example:
1179
+ - add new filler gauge visualization, and remove splunk-charting based filler gauge. Encoding (value, gaugeColor) is added to new filler gauge. Options are changed in new filler gauge.
1180
+ Example:
1052
1181
 
1053
1182
  ```
1054
1183
  import React from 'react';
package/Map.config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /* Copyright © 2020 Splunk Inc.
2
2
  SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
3
3
  in part without a valid written license from Splunk Inc. is PROHIBITED. */
4
+ "use strict";
4
5
  var __create = Object.create;
5
6
  var __defProp = Object.defineProperty;
6
7
  var __defProps = Object.defineProperties;
@@ -129,11 +130,9 @@ var configUtils_default = "default" in defaultImport8 ? defaultImport8.default :
129
130
  // src/common/utils/configUtils.ts
130
131
  function enhanceConfig(vizConfig) {
131
132
  const enhancedConfig = __spreadValues({}, vizConfig);
132
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(
133
- (config2) => {
134
- return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
135
- }
136
- );
133
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map((config2) => {
134
+ return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
135
+ });
137
136
  return enhancedConfig;
138
137
  }
139
138
 
@@ -155,6 +154,33 @@ var background = ({
155
154
  ];
156
155
  var BackgroundColor_default = background;
157
156
 
157
+ // esm-externals:@splunk/themes/pick
158
+ var pick_exports = {};
159
+ __export(pick_exports, {
160
+ default: () => pick_default
161
+ });
162
+ var defaultImport9 = __toESM(require("@splunk/themes/pick"));
163
+ __reExport(pick_exports, require("@splunk/themes/pick"));
164
+ var pick_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
165
+
166
+ // esm-externals:@splunk/themes/variables
167
+ var variables_exports = {};
168
+ __export(variables_exports, {
169
+ default: () => variables_default
170
+ });
171
+ var defaultImport10 = __toESM(require("@splunk/themes/variables"));
172
+ __reExport(variables_exports, require("@splunk/themes/variables"));
173
+ var variables_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
174
+
175
+ // src/common/ThemedDefaults.tsx
176
+ var defaultBackgroundColor = (props) => pick_default({
177
+ enterprise: {
178
+ dark: variables_default.black(props),
179
+ light: variables_default.white(props)
180
+ },
181
+ prisma: variables_default.backgroundColorSection(props)
182
+ })(props);
183
+
158
184
  // src/Map/config.ts
159
185
  var defaultContext = {
160
186
  colorRangeConfig: [
@@ -183,13 +209,7 @@ var size = {
183
209
  initialHeight: 600
184
210
  };
185
211
  var themes = {
186
- defaultBackgroundColor: (props) => (0, themes_exports.pick)({
187
- enterprise: {
188
- dark: themes_exports.variables.black(props),
189
- light: themes_exports.variables.backgroundColor(props)
190
- },
191
- prisma: themes_exports.variables.backgroundColorSidebar(props)
192
- })(props),
212
+ defaultBackgroundColor,
193
213
  controlBackgroundColor: (props) => (0, themes_exports.pick)({
194
214
  enterprise: {
195
215
  dark: themes_exports.variables.gray22(props),
@@ -241,7 +261,10 @@ var editorConfig = [
241
261
  values: [
242
262
  { label: (0, i18n_exports._)("Bubble"), value: visualization_schemas_exports.LAYER_TYPE.Bubble },
243
263
  { label: (0, i18n_exports._)("Marker"), value: visualization_schemas_exports.LAYER_TYPE.Marker },
244
- { label: (0, i18n_exports._)("Choropleth"), value: visualization_schemas_exports.LAYER_TYPE.Choropleth }
264
+ {
265
+ label: (0, i18n_exports._)("Choropleth"),
266
+ value: visualization_schemas_exports.LAYER_TYPE.Choropleth
267
+ }
245
268
  ]
246
269
  }
247
270
  }
package/Map.config.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["src/Map/config.ts", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/themes", "esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-icons", "esm-externals:@splunk/visualization-icons/placeholders", "esm-externals:lodash", "esm-externals:@splunk/visualizations-shared/configUtils", "src/common/utils/configUtils.ts", "src/common/editorConfig/BackgroundColor.ts"],
4
- "sourcesContent": ["import { _ } from '@splunk/ui-utils/i18n';\nimport { pick, variables } from '@splunk/themes';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { mapOptionsSchema as optionsSchema, LAYER_TYPE } from '@splunk/visualization-schemas';\nimport { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\n\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n colorMatchConfig: [{ match: '', value: '#5C33FF' }],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n defaultChoroplethEmptyAreaColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.gray92(props),\n },\n prisma: {\n dark: variables.interactiveColorBackground(props),\n light: variables.neutral300(props),\n },\n })(props),\n defaultGradientMigrationConfig: props =>\n pick({\n enterprise: {\n dark: ['#4D4A5D', variables.syntaxPurple(props)],\n light: ['#D2CFDC', variables.syntaxPurple(props)],\n },\n prisma: {\n dark: ['#484558', variables.syntaxPurple(props)],\n light: ['#D8D4E1', variables.syntaxPurple(props)],\n },\n })(props),\n};\n\nconst isChoroplethLayer = options => options.layers?.[0]?.type === LAYER_TYPE.Choropleth;\n\nconst isLocalChoroplethLayer = options =>\n isChoroplethLayer(options) &&\n (options.layers[0].source === 'geo://default/us' || options.layers[0].source === 'geo://default/world');\n\nconst EDITOR_LABEL_WIDTH = 140;\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Layer type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n { label: _('Choropleth'), value: LAYER_TYPE.Choropleth },\n ],\n },\n },\n ],\n [\n {\n label: _('Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Area values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Bubble size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'layers[0].additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Tooltip header field'),\n option: 'layers[0].tooltipHeaderField',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'layers[0].resultLimit',\n editor: 'editor.number',\n showEditor: ({ options }) => !isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Latitude (initial map location)'),\n option: 'center[0]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -90,\n max: 90,\n },\n },\n ],\n [\n {\n label: _('Longitude (initial map location)'),\n option: 'center[1]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -180,\n max: 180,\n },\n },\n ],\n [\n {\n label: _('Zoom (initial map location)'),\n option: 'zoom',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n [\n {\n label: _('Show Latitude and Longitude'),\n option: 'showCoordinates',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show zoom controls'),\n option: 'showZoomControls',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show scale'),\n option: 'showScale',\n editor: 'editor.toggle',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Scale unit'),\n option: 'scaleUnit',\n editor: 'editor.radioBar',\n showEditor: ({ options }) => options.showScale !== false,\n editorProps: {\n values: [\n { label: _('Metric'), value: 'metric' },\n { label: _('Imperial'), value: 'imperial' },\n ],\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'layers[0].dataColors',\n context: 'colorRangeConfig',\n editor: 'editor.dynamicColorWithPrecedence',\n editorProps: {\n labelPosition: 'top',\n flyoutTitle: _('Dynamic coloring: value'),\n formatters: [\n {\n label: _('Ranges'),\n value: 'rangeValue',\n isDefault: true,\n defaults: {\n dataValues: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n dataValues: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'dataValues',\n },\n ],\n defaultPalettesConfig,\n },\n showEditor: ({ options }) => !isChoroplethLayer(options),\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'layers[0].dataValues',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && options.layers?.[0]?.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'layers[0].seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && !options.layers?.[0]?.dataColors,\n },\n ],\n [\n {\n label: _('Choropleth empty area'),\n option: 'layers[0].choroplethEmptyAreaColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth stroke'),\n option: 'layers[0].choroplethStrokeColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth opacity (%)'),\n option: 'layers[0].choroplethOpacity',\n editor: 'editor.percent',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n min: 0,\n },\n },\n ],\n // TODO: add support for seriesColorsByField option\n // [\n // {\n // label: _('Series colors by field name'),\n // option: 'seriesColorsByField',\n // editor: 'editor.seriesColorsByField',\n // },\n // ],\n getBackgroundColorEditor({ themes }),\n [\n {\n label: _('Show base layer'),\n option: 'showBaseLayer',\n editor: 'editor.toggle',\n },\n ],\n [\n {\n label: _('Base layer tile server'),\n option: 'baseLayerTileServer',\n editor: 'editor.text',\n showEditor: ({ options }) => options.showBaseLayer !== false,\n },\n ],\n [\n {\n label: _('Base layer tile server type'),\n option: 'baseLayerTileServerType',\n editor: 'editor.radioBar',\n showEditor: ({ options }) =>\n options.showBaseLayer === false\n ? false\n : !(\n typeof options.baseLayerTileServer === 'undefined' ||\n options.baseLayerTileServer === ''\n ),\n editorProps: {\n values: [\n { label: _('Vector'), value: 'vector' },\n { label: _('Raster'), value: 'raster' },\n ],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: _('Map'),\n category: VizCategory.SPATIAL,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n parentKeys: ['exec'],\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes\";\nexport * from \"@splunk/themes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport * from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons\";\nexport * from \"@splunk/visualization-icons\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons/placeholders\";\nexport * from \"@splunk/visualization-icons/placeholders\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/configUtils\";\nexport * from \"@splunk/visualizations-shared/configUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { get, range } from 'lodash';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\n// included for backwards compatibility\nexport { enhanceOptionsSchemaWithDynamicOptions } from '@splunk/visualization-schemas';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport { enhanceConfig, getInitialPreset, generatePrecisionValues, uncollapseEditorConfig, isDynamicOption };\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n", "import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background color'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,mCAAc;AACd,IAAO,yBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,0CAAc;AACd,IAAO,gCAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,wCAAc;AACd,IAAO,8BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;A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EACN,iBAAiB,qBAAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA,6CAAAC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,IACJ,YAAY;AAAA,MACR,aAAa;AAAA,MACb,YAAY,CAAC,MAAM;AAAA,IACvB;AAAA,IACA,aAAa;AAAA,MACT,aAAa;AAAA,IACjB;AAAA,EACJ;AAAA,EACA,UAAU,gGAAyE;AAAA,EACnF;AAAA,EACA,eAAe,CAAC;AACpB;AAEA,IAAO,iBAAQ,cAAc,MAAM;",
6
- "names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "config", "themes", "MapIcon", "MapPlaceholderIcon", "optionsSchema"]
3
+ "sources": ["src/Map/config.ts", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/themes", "esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-icons", "esm-externals:@splunk/visualization-icons/placeholders", "esm-externals:lodash", "esm-externals:@splunk/visualizations-shared/configUtils", "src/common/utils/configUtils.ts", "src/common/editorConfig/BackgroundColor.ts", "esm-externals:@splunk/themes/pick", "esm-externals:@splunk/themes/variables", "src/common/ThemedDefaults.tsx"],
4
+ "sourcesContent": ["import { _ } from '@splunk/ui-utils/i18n';\nimport { pick, variables } from '@splunk/themes';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { mapOptionsSchema as optionsSchema, LAYER_TYPE } from '@splunk/visualization-schemas';\nimport { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\n\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\nimport { defaultBackgroundColor } from '../common/ThemedDefaults';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n colorMatchConfig: [{ match: '', value: '#5C33FF' }],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor,\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n defaultChoroplethEmptyAreaColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.gray92(props),\n },\n prisma: {\n dark: variables.interactiveColorBackground(props),\n light: variables.neutral300(props),\n },\n })(props),\n defaultGradientMigrationConfig: props =>\n pick({\n enterprise: {\n dark: ['#4D4A5D', variables.syntaxPurple(props)],\n light: ['#D2CFDC', variables.syntaxPurple(props)],\n },\n prisma: {\n dark: ['#484558', variables.syntaxPurple(props)],\n light: ['#D8D4E1', variables.syntaxPurple(props)],\n },\n })(props),\n};\n\nconst isChoroplethLayer = options => options.layers?.[0]?.type === LAYER_TYPE.Choropleth;\n\nconst isLocalChoroplethLayer = options =>\n isChoroplethLayer(options) &&\n (options.layers[0].source === 'geo://default/us' || options.layers[0].source === 'geo://default/world');\n\nconst EDITOR_LABEL_WIDTH = 140;\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Layer type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n {\n label: _('Choropleth'),\n value: LAYER_TYPE.Choropleth,\n },\n ],\n },\n },\n ],\n [\n {\n label: _('Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Area values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Bubble size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'layers[0].additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Tooltip header field'),\n option: 'layers[0].tooltipHeaderField',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'layers[0].resultLimit',\n editor: 'editor.number',\n showEditor: ({ options }) => !isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Latitude (initial map location)'),\n option: 'center[0]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -90,\n max: 90,\n },\n },\n ],\n [\n {\n label: _('Longitude (initial map location)'),\n option: 'center[1]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -180,\n max: 180,\n },\n },\n ],\n [\n {\n label: _('Zoom (initial map location)'),\n option: 'zoom',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n [\n {\n label: _('Show Latitude and Longitude'),\n option: 'showCoordinates',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show zoom controls'),\n option: 'showZoomControls',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show scale'),\n option: 'showScale',\n editor: 'editor.toggle',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Scale unit'),\n option: 'scaleUnit',\n editor: 'editor.radioBar',\n showEditor: ({ options }) => options.showScale !== false,\n editorProps: {\n values: [\n { label: _('Metric'), value: 'metric' },\n { label: _('Imperial'), value: 'imperial' },\n ],\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'layers[0].dataColors',\n context: 'colorRangeConfig',\n editor: 'editor.dynamicColorWithPrecedence',\n editorProps: {\n labelPosition: 'top',\n flyoutTitle: _('Dynamic coloring: value'),\n formatters: [\n {\n label: _('Ranges'),\n value: 'rangeValue',\n isDefault: true,\n defaults: {\n dataValues: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n dataValues: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'dataValues',\n },\n ],\n defaultPalettesConfig,\n },\n showEditor: ({ options }) => !isChoroplethLayer(options),\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'layers[0].dataValues',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && options.layers?.[0]?.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'layers[0].seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && !options.layers?.[0]?.dataColors,\n },\n ],\n [\n {\n label: _('Choropleth empty area'),\n option: 'layers[0].choroplethEmptyAreaColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth stroke'),\n option: 'layers[0].choroplethStrokeColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth opacity (%)'),\n option: 'layers[0].choroplethOpacity',\n editor: 'editor.percent',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n min: 0,\n },\n },\n ],\n // TODO: add support for seriesColorsByField option\n // [\n // {\n // label: _('Series colors by field name'),\n // option: 'seriesColorsByField',\n // editor: 'editor.seriesColorsByField',\n // },\n // ],\n getBackgroundColorEditor({ themes }),\n [\n {\n label: _('Show base layer'),\n option: 'showBaseLayer',\n editor: 'editor.toggle',\n },\n ],\n [\n {\n label: _('Base layer tile server'),\n option: 'baseLayerTileServer',\n editor: 'editor.text',\n showEditor: ({ options }) => options.showBaseLayer !== false,\n },\n ],\n [\n {\n label: _('Base layer tile server type'),\n option: 'baseLayerTileServerType',\n editor: 'editor.radioBar',\n showEditor: ({ options }) =>\n options.showBaseLayer === false\n ? false\n : !(\n typeof options.baseLayerTileServer === 'undefined' ||\n options.baseLayerTileServer === ''\n ),\n editorProps: {\n values: [\n { label: _('Vector'), value: 'vector' },\n { label: _('Raster'), value: 'raster' },\n ],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: _('Map'),\n category: VizCategory.SPATIAL,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n parentKeys: ['exec'],\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes\";\nexport * from \"@splunk/themes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport * from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons\";\nexport * from \"@splunk/visualization-icons\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons/placeholders\";\nexport * from \"@splunk/visualization-icons/placeholders\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/configUtils\";\nexport * from \"@splunk/visualizations-shared/configUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { get, range } from 'lodash';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\n// included for backwards compatibility\nexport { enhanceOptionsSchemaWithDynamicOptions } from '@splunk/visualization-schemas';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n\n enhancedConfig.editorConfig = vizConfig.editorConfig.map((config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n });\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport { enhanceConfig, getInitialPreset, generatePrecisionValues, uncollapseEditorConfig, isDynamicOption };\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n", "import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background color'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n", "\nimport * as defaultImport from \"@splunk/themes/pick\";\nexport * from \"@splunk/themes/pick\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/variables\";\nexport * from \"@splunk/themes/variables\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\n\nexport const defaultBackgroundColor = props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorSection(props),\n })(props);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,mCAAc;AACd,IAAO,yBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,0CAAc;AACd,IAAO,gCAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,wCAAc;AACd,IAAO,8BAAS,a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O,SAAS;AAAA,YAC1C;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;AAKA,IAAM,SAAoB;AAAA;AAAA;AAAA;AAAA,EAItB,KAAK;AAAA;AAAA;AAAA;AAAA,EAIL,UAAM,gBAAE,KAAK;AAAA,EACb;AAAA,EACA,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIR,MAAM,4BAAAC;AAAA,EACN,iBAAiB,qBAAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA,6CAAAC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,IACJ,YAAY;AAAA,MACR,aAAa;AAAA,MACb,YAAY,CAAC,MAAM;AAAA,IACvB;AAAA,IACA,aAAa;AAAA,MACT,aAAa;AAAA,IACjB;AAAA,EACJ;AAAA,EACA,UAAU,gGAAyE;AAAA,EACnF;AAAA,EACA,eAAe,CAAC;AACpB;AAEA,IAAO,iBAAQ,cAAc,MAAM;",
6
+ "names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "config", "themes", "defaultImport", "defaultImport", "MapIcon", "MapPlaceholderIcon", "optionsSchema"]
7
7
  }