@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.
- package/Area.config.js +19 -21
- package/Area.config.js.map +3 -3
- package/Area.js +54 -32
- package/Area.js.map +3 -3
- package/Bar.config.js +18 -21
- package/Bar.config.js.map +3 -3
- package/Bar.js +48 -31
- package/Bar.js.map +3 -3
- package/Bubble.config.js +39 -44
- package/Bubble.config.js.map +4 -4
- package/Bubble.js +69 -51
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +35 -7
- package/ChoroplethSvg.config.js +47 -43
- package/ChoroplethSvg.config.js.map +4 -4
- package/ChoroplethSvg.js +72 -45
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +15 -20
- package/Column.config.js.map +3 -3
- package/Column.js +42 -29
- package/Column.js.map +3 -3
- package/Ellipse.config.js +16 -7
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +45 -19
- package/Ellipse.js.map +2 -2
- package/Events.config.js +38 -27
- package/Events.config.js.map +4 -4
- package/Events.js +113 -97
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +9 -9
- package/FillerGauge.config.js +20 -13
- package/FillerGauge.config.js.map +3 -3
- package/FillerGauge.js +76 -27
- package/FillerGauge.js.map +4 -4
- package/Image.config.js +5 -6
- package/Image.config.js.map +2 -2
- package/Image.js +29 -14
- package/Image.js.map +2 -2
- package/Line.config.js +15 -20
- package/Line.config.js.map +3 -3
- package/Line.js +50 -31
- package/Line.js.map +3 -3
- package/LinkGraph.config.js +39 -46
- package/LinkGraph.config.js.map +3 -3
- package/LinkGraph.js +70 -50
- package/LinkGraph.js.map +3 -3
- package/MIGRATION.md +169 -40
- package/Map.config.js +36 -13
- package/Map.config.js.map +4 -4
- package/Map.js +170 -105
- package/Map.js.map +4 -4
- package/Markdown.config.js +4 -5
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +117 -72
- package/Markdown.js.map +3 -3
- package/MarkerGauge.config.js +14 -12
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +107 -69
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.config.js +14 -12
- package/ParallelCoordinates.config.js.map +3 -3
- package/ParallelCoordinates.js +113 -59
- package/ParallelCoordinates.js.map +3 -3
- package/Pie.config.js +51 -38
- package/Pie.config.js.map +4 -4
- package/Pie.js +109 -85
- package/Pie.js.map +4 -4
- package/Punchcard.config.js +36 -34
- package/Punchcard.config.js.map +4 -4
- package/Punchcard.js +153 -87
- package/Punchcard.js.map +4 -4
- package/README.internal.md +15 -15
- package/README.md +10 -10
- package/Rectangle.config.js +16 -7
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +45 -19
- package/Rectangle.js.map +2 -2
- package/Sankey.config.js +69 -17
- package/Sankey.config.js.map +4 -4
- package/Sankey.js +178 -49
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +37 -42
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +70 -53
- package/Scatter.js.map +3 -3
- package/SingleValue.config.js +32 -18
- package/SingleValue.config.js.map +4 -4
- package/SingleValue.js +237 -93
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +1 -0
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon.config.js +22 -11
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +84 -28
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.config.js +34 -23
- package/SingleValueRadial.config.js.map +3 -3
- package/SingleValueRadial.js +89 -48
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +153 -49
- package/SparkLine.js.map +2 -2
- package/Table.config.js +71 -51
- package/Table.config.js.map +3 -3
- package/Table.js +282 -145
- package/Table.js.map +3 -3
- package/Timeline.config.js +36 -34
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +67 -59
- package/Timeline.js.map +4 -4
- package/common/Charting.js +1 -0
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.js +1 -0
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +7 -2
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/EventsDoc.js +31 -5
- package/common/EventsDoc.js.map +4 -4
- package/common/GaugeMajorTicks.js +4 -1
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +31 -3
- package/common/GaugeValueMarker.js.map +4 -4
- package/common/OptionsDoc.js +4 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +66 -50
- package/common/OverviewDoc.js.map +4 -4
- package/common/SplunkVisualization.js +1 -0
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +1 -0
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemedDefaults.js +67 -0
- package/common/ThemedDefaults.js.map +7 -0
- package/common/ThemesDoc.js +6 -9
- package/common/ThemesDoc.js.map +2 -2
- package/common/chartingUtils.js +1 -0
- package/common/chartingUtils.js.map +2 -2
- package/common/docUtils.js +6 -1
- package/common/docUtils.js.map +2 -2
- package/common/gaugeUtils.js +6 -1
- package/common/gaugeUtils.js.map +2 -2
- package/common/shapeUtils.js +6 -4
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/configUtils.js +4 -5
- package/common/utils/configUtils.js.map +2 -2
- package/common/utils/dataUtils.js +1 -0
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +1 -0
- package/common/utils/featureFlagUtils.js.map +1 -1
- package/common/utils/hocUtils.js +1 -0
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/mapUtils.js +35 -22
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/singleValueUtils.js +8 -2
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/styleUtils.js +1 -0
- package/common/utils/styleUtils.js.map +1 -1
- package/common/utils/testHelper.js +1 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +1 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +1 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +25 -8
- package/common/withDashboardViz.js.map +2 -2
- 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
|
+

|
|
58
|
+
|
|
59
|
+
- Info/Warning icon updated.
|
|
60
|
+
|
|
61
|
+

|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
- No Datasource icon updated.
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+

|
|
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
|
+

|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
- Events time control popover colors, size, and spacing updated.
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+

|
|
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
|
+

|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
- FieldSummary bar colors and dropdown select button colors updated.
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+

|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
- LinkGraph default node background color updated.
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
- Map tooltip spacing and background color Dark updated.
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+

|
|
107
|
+
|
|
108
|
+
- Markdown spacing updated.
|
|
109
|
+
|
|
110
|
+

|
|
111
|
+

|
|
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
|
+

|
|
117
|
+

|
|
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
|
+

|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
- Timeline axis border and text colors updated.
|
|
128
|
+
|
|
129
|
+

|
|
130
|
+

|
|
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
|
-
-
|
|
156
|
+
- Legend items have more spacing across all charts as part of legend item accessibility improvement in Highcharts
|
|
28
157
|
|
|
29
158
|

|
|
30
159
|
|
|
31
|
-
-
|
|
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
|

|
|
34
163
|
|
|
35
164
|

|
|
36
165
|
|
|
37
|
-
-
|
|
166
|
+
- Bubble chart data point minor rendering difference
|
|
38
167
|
|
|
39
168
|

|
|
40
169
|
|
|
41
|
-
-
|
|
170
|
+
- Line chart marker rendering minor difference
|
|
42
171
|
|
|
43
172
|

|
|
44
173
|
|
|
45
|
-
-
|
|
174
|
+
- Slight shift up in the column/ bar charts with axis label rotated
|
|
46
175
|
|
|
47
176
|

|
|
48
177
|
|
|
49
|
-
-
|
|
178
|
+
- Scatter chart low datapoints showing full square aligning with the axis
|
|
50
179
|
|
|
51
180
|

|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
640
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
902
|
+
- various minor theming changes for prisma dark (which was previously SCP) theme for visualizations and corresponding editors
|
|
774
903
|
|
|
775
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
802
|
-
|
|
930
|
+
- Axes are stretched to take up more space
|
|
931
|
+

|
|
803
932
|
|
|
804
|
-
-
|
|
805
|
-
|
|
933
|
+
- Displays the last label on a categorical axes
|
|
934
|
+

|
|
806
935
|
|
|
807
|
-
-
|
|
808
|
-
|
|
936
|
+
- Legends are spaced equally
|
|
937
|
+

|
|
809
938
|
|
|
810
|
-
-
|
|
811
|
-
|
|
939
|
+
- Pie Chart shows fewer labels when there are too many labels
|
|
940
|
+

|
|
812
941
|
|
|
813
|
-
-
|
|
814
|
-
|
|
942
|
+
- Zooming a chart maintains parent axis
|
|
943
|
+

|
|
815
944
|
|
|
816
945
|
### Minor
|
|
817
946
|
|
|
818
|
-
-
|
|
819
|
-
-
|
|
947
|
+
- Colors of the chart grid have changed
|
|
948
|
+
- Minor pixel differences
|
|
820
949
|
|
|
821
950
|
### Known issues
|
|
822
951
|
|
|
823
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
836
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
958
|
-
-
|
|
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
|
-
-
|
|
968
|
-
-
|
|
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
|
-
-
|
|
1015
|
-
|
|
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
|
-
-
|
|
1051
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
{
|
|
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": "
|
|
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;AA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,wBAAwB,eACvC,QAAQ,wBAAwB;AAAA,UAE9C,aAAa;AAAA,YACT,QAAQ;AAAA,cACJ,EAAE,WAAO,gBAAE,QAAQ,GAAG,OAAO,SAAS;AAAA,cACtC,EAAE,WAAO,gBAAE,QAAQ,GAAG,OAAO,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
|
}
|