@splunk/visualizations 26.0.0 → 26.1.1

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 (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/MIGRATION.md ADDED
@@ -0,0 +1,1082 @@
1
+ # Migration
2
+
3
+ <a name="26.0.0"></a>
4
+
5
+ ## 26.0.0
6
+
7
+ 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.
8
+
9
+ - Legend items have more spacing across all charts as part of legend item accessibility improvement in Highcharts
10
+
11
+ ![Legend items difference](./src/common/docs/migrations/assets/render-diff1.gif)
12
+
13
+ - On legend item hover, the gray color on inactive series is more pronounced, seems to be a good improvement for visibility
14
+
15
+ ![Legend item hover difference](./src/common/docs/migrations/assets/render-diff2A.gif)
16
+
17
+ ![Legend item hover difference](./src/common/docs/migrations/assets/render-diff2B.gif)
18
+
19
+ - Bubble chart data point minor rendering difference
20
+
21
+ ![Bubble chart difference](./src/common/docs/migrations/assets/render-diff3.gif)
22
+
23
+ - Line chart marker rendering minor difference
24
+
25
+ ![Line chart maker difference](./src/common/docs/migrations/assets/render-diff4.gif)
26
+
27
+ - Slight shift up in the column/ bar charts with axis label rotated
28
+
29
+ ![Column chart difference](./src/common/docs/migrations/assets/render-diff5.gif)
30
+
31
+ - Scatter chart low datapoints showing full square aligning with the axis
32
+
33
+ ![Scatter chart difference](./src/common/docs/migrations/assets/render-diff6.gif)
34
+
35
+ 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.
36
+
37
+ - `@splunk/highcharts-scaled-events` deprecated
38
+
39
+ `@splunk/highcharts-scaled-events` deprecated as the support of scale events and tooltip is supported in Highcharts v9 version
40
+
41
+ 2. Single Value Radial's major value's dynamic color's "Match Value" is removed. Any pre-existing dashboard using "Match Value" can no longer be edited in the editor. Match value can only be edited in the source code. Clicking on "Customized in source" then "Reset to default" will remove any pre-existing "Match Value" data and change major value's dynamic color into a "Range Value" configuration (this will cause you to lose pre-existing "Match Value" data).
42
+
43
+ ![Remove match value](./src/common/docs/migrations/assets/svr_remove_match_value.png)
44
+
45
+ To avoid losing pre-existing "Match Value" data, you can either edit the data in the source code. Or you can manually convert your pre-existing "Match Value" data into a "Range Value" configuration (recommended).
46
+
47
+ ## 25.5.5
48
+
49
+ Visualization type Choropleth World (`viz.geojson.world`) and Choropleth USA (`viz.geojson.us`) will be deprecated and migrated to Map `splunk.map`
50
+
51
+ Old:Choropleth World (`viz.geojson.world`)
52
+
53
+ ![Choropleth World `viz.geojson.world`](./src/common/docs/migrations/assets/viz.geojson.world.png)
54
+
55
+ New: Map (`splunk.map`)
56
+
57
+ ![Map `splunk.map`](./src/common/docs/migrations/assets/splunk.map_world.png)
58
+
59
+ Old:Choropleth USA (`viz.geojson.us`)
60
+
61
+ ![Choropleth USA `viz.geojson.us`](./src/common/docs/migrations/assets/viz.geojson.us.png)
62
+
63
+ New: Map (`splunk.map`)
64
+
65
+ ![Map `splunk.map`](./src/common/docs/migrations/assets/splunk.map_us.png)
66
+
67
+ ## 25.0.0
68
+
69
+ ### Add support to space in field names
70
+
71
+ `overlayFields` and `Column.y2Fields` now support space inside the names of fields (i.e. “top user”, “max all time”).
72
+
73
+ For example, Column Chart - `y2Fields: ['test name', 'another test name']`
74
+
75
+ Old:
76
+ ![Column Chart - Overlay Field with space specified in field names](./src/common/docs/migrations/assets/columncharty2fieldsold.png)
77
+
78
+ New:
79
+ ![Column Chart - Overlay Field with space specified in field names](./src/common/docs/migrations/assets/columncharty2fieldsnew.png)
80
+
81
+ <br />
82
+
83
+ ### Axes charts editing UI
84
+
85
+ Axes charts (Area/Bar/Bubble/Column/Line/Scatter) now expose the configuration UI for most options and regroups the editors in new panels. Please expect editor snapshot changes.
86
+
87
+ <br />
88
+
89
+ ### Infer data type from the search result meta data fields - `type`, if present
90
+
91
+ There are a few indicators in the search meta data (apart from `_time` field) that can help infer on data type information:
92
+
93
+ - `type` field
94
+
95
+ When search result fields are coerced into a different type, the search result meta data will include a `type` field
96
+
97
+ Example
98
+
99
+ ```js
100
+ | eval foo = tostring(some_numeric_field) | table foo
101
+
102
+ {
103
+ name: 'foo',
104
+ type: 'str'
105
+ }
106
+ ```
107
+
108
+ As a result, if we had `eval productId=tostring(12345)`, the visualization will treat **12345** as a `string` and dynamic coloring formatters like `rangeValue()` will not work as they require a `number` data type
109
+
110
+ <br />
111
+
112
+ ### Visualization displays the original data value, and we move type coercion to the formatters
113
+
114
+ Previously, we used to coerce data into the inferred data type and, in the process, lost useful formatting context coming from a search result. We've updated this behavior to allow visualizations to directly render the data passed down, and moved type coercion into the DSL formatters.
115
+
116
+ For example, if the timestamp passed to us is `2020-09-02T09:09:36`, the visualization will display `2020-09-02T09:09:36` instead of `2020-09-02T09:09:36+00:00` (previous behavior)
117
+
118
+ <br />
119
+
120
+ ### Update the data type inference algorithm to be more robust and handle mixed data types and `NULL` values
121
+
122
+ Type prioritization
123
+
124
+ Previously the type inference for a dataseries was performed by using a very basic method, basically compare the `first`, `mid` and `end` datavalue's types and return the majority type.
125
+
126
+ We've updated this inference technique to more robust method, instead of comparing just the `first`, `mid` and `end` datavalue's types, we create a map of actual count of each type in the data series. If only a single type exists in a dataseries, then that `type` will be returned as the inferred type. If more than one type exist, then type will be returned based on the prioritization rule `geojson > sparkline > array > string > color > number > time > null > unknown`. Empty strings ('') will be typed as unknown.
127
+
128
+ DSL selectors based on type `seriesByType`, `seriesByTypes`, `frameBySeriesTypes` and `seriesByPrioritizedTypes` are impacted. Viz's using these dsl selectors may return a different series now based on new type matching if the dataset has mixed types.
129
+
130
+ Example
131
+ Type inference update for data series
132
+
133
+ Old
134
+ ['1','2','3','4','5','6','7','8','9','10'] // => type inferred as 'number'
135
+ [null,'2','3','4','5','6','7','8','9', null] // => type inferred as 'null'
136
+ ['200','201','400','success','failure'] // => type inferred as 'number'
137
+ ['','',''] // => type inferred as 'string'
138
+ ['1','',''] // => type inferred as 'string'
139
+
140
+
141
+ New
142
+ ['1','2','3','4','5','6','7','8','9','10'] // => type inferred as 'number', all values 'number' type
143
+ [null,'2','3','4','5','6','7','8','9',null] // => type inferred as 'number', mixed type values (number & null), based on priority 'number' > 'null'
144
+ ['200','201','400','success','failure'] // => type inferred as 'string', mixed type values (number & string), based on priority 'string' > 'number'
145
+ ['','',''] // => type inferred as 'unknown', all values 'unknown' type
146
+ ['1','',''] // => type inferred as 'number', mixed type values (number & unknown), based on priority 'number' > 'string',
147
+
148
+ <a name="24.0.0"></a>
149
+
150
+ ## 24.0.0
151
+
152
+ ### SingleValueRadial design and option updates
153
+
154
+ SingleValueRadial is updated with new designs and options.
155
+ A list of SingleValueRadial's options have been updated such as `majorValue`, `trendValue`, `majorColor`, `trendColor`, `majorValueField`, `trendIndicatorPosition` (removed), and `maxValue` (added). See the [documentation page](https://eng-docs.splunkeng.com/visualizations/24.0.0/?path=%2FSingleValueRadial) for the new design, updated option names, types, and default values.
156
+
157
+ The `viz.singlevalueradial` to `splunk.singlevalueradial` conversion script has also been implemented to account for the updates. For example, if the `trendIndicatorPosition` is configured in `viz.singlevalueradial`, it will be automatically removed in `splunk.singlevalueradial`. And the default `majorValue` and `trendValue` will be preserved in the converted `splunk.singlevalueradial`.
158
+
159
+ Example:
160
+
161
+ ```jsx
162
+ import React from 'react';
163
+ import SingleValueRadial from '@splunk/visualizations/SingleValueRadial';
164
+
165
+ export default () => (
166
+ <SingleValueRadial
167
+ options={{
168
+ majorValue: '> primary | seriesByName("bar") | lastPoint()', // Specify the dataSource applied to the major value.
169
+ trendValue: '> primary | seriesByName("bar") | delta(-2)', // Specify the dataSource applied to the trend value.
170
+ maxValue: 1000, // Specify the value the radial fills up to.
171
+ backgroundColor: '#aaaaff',
172
+ }}
173
+ dataSources={{
174
+ primary: {
175
+ data: {
176
+ columns: [
177
+ ['1', '62', '103', '308', '587', '876', '70', '80'],
178
+ ['1', '2', '3', '4', '5', '6', '7', '3200'],
179
+ ],
180
+ fields: [
181
+ {
182
+ name: 'foo',
183
+ },
184
+ {
185
+ name: 'bar',
186
+ },
187
+ ],
188
+ },
189
+ meta: {},
190
+ },
191
+ }}
192
+ />
193
+ );
194
+ ```
195
+
196
+ ### FillerGauge default gaugeColor update
197
+
198
+ `splunk.fillergauge`'s default `gaugeColor` is updated to `#7B56DB`.
199
+ The `viz.fillergauge` to `splunk.fillergauge` conversion script has taken into account for this change.
200
+
201
+ Example:
202
+
203
+ ```jsx
204
+ import React from 'react';
205
+ import FillerGauge from '@splunk/visualizations/FillerGauge';
206
+
207
+ export default () => (
208
+ <FillerGauge
209
+ options={{
210
+ gaugeColor: '> value | rangeValue(gaugeColorRangeValueContext)', // viz.fillergauge default
211
+ value: 123,
212
+ }}
213
+ context={{
214
+ gaugeColorRangeValueContext: [
215
+ {
216
+ from: 70,
217
+ to: 210,
218
+ value: '#ff7152',
219
+ },
220
+ {
221
+ from: 50,
222
+ to: 70,
223
+ value: '#fc9850',
224
+ },
225
+ {
226
+ from: 30,
227
+ to: 50,
228
+ value: '#f4df7a',
229
+ },
230
+ {
231
+ from: 20,
232
+ to: 30,
233
+ value: '#4beba8',
234
+ },
235
+ {
236
+ from: 0,
237
+ to: 20,
238
+ value: '#5fbcff',
239
+ },
240
+ ],
241
+ }}
242
+ dataSources={{
243
+ primary: {
244
+ requestParams: { offset: 0, count: 20 },
245
+ data: {
246
+ fields: [{ name: 'count' }],
247
+ columns: [['78']],
248
+ },
249
+ meta: { totalCount: 200 },
250
+ },
251
+ }}
252
+ />
253
+ );
254
+ ```
255
+
256
+ ### Pie chart option renames
257
+
258
+ `seriesColorsByValue` was previously used for specifying field colors in a Pie visualization. This option has been renamed to `seriesColorsByField`. No functionality has been changed other than the rename.
259
+
260
+ The `viz.pie` to `splunk.pie` conversion script has also been modified to account for this rename.
261
+
262
+ ```jsx
263
+ import React from 'react';
264
+ import Pie from '@splunk/visualizations/Pie';
265
+
266
+ export default () => (
267
+ <Pie
268
+ options={{ seriesColorsByField: { December: '#008000', May: '#FF0000' } }} // was previously seriesColorsByValue
269
+ dataSources={{
270
+ primary: {
271
+ requestParams: { offset: 0, count: 20 },
272
+ data: {
273
+ fields: [{ name: 'component' }, { name: 'count' }],
274
+ columns: [
275
+ [
276
+ 'January',
277
+ 'February',
278
+ 'March',
279
+ 'April',
280
+ 'May',
281
+ 'June',
282
+ 'July',
283
+ 'August',
284
+ 'September',
285
+ 'October',
286
+ 'November',
287
+ 'December',
288
+ ],
289
+ ['1', '1', '1', '2', '10', '10', '5', '5', '5', '5', '5', '50'],
290
+ ],
291
+ },
292
+ meta: { totalCount: 20 },
293
+ },
294
+ }}
295
+ />
296
+ );
297
+ ```
298
+
299
+ <a name="23.0.0"></a>
300
+
301
+ ## 23.0.0
302
+
303
+ ### onEventTrigger and hasEventHandler flag
304
+
305
+ Previously, ChoroplethSVG, SingleValue (SV, SVI, and SVR), and shape (Ellipse + Rectangle) visualizations were the only visualizations to require a `hasEventHandler` flag for their respective event callback handlers to be invoked when an event occurred. As such, charting-based visualizations were the only exception to this invocation pattern.
306
+
307
+ e.g.
308
+
309
+ ```jsx
310
+ import React from 'react';
311
+ import SingleValue from '@splunk/visualizations/SingleValue';
312
+
313
+ export default () => (
314
+ <SingleValue
315
+ options={{
316
+ unit: '$',
317
+ unitPosition: 'before',
318
+ }}
319
+ hasEventHandlers
320
+ onEventTrigger={(...ev) => console.log(ev)}
321
+ dataSources={{
322
+ primary: {
323
+ data: {
324
+ columns: [
325
+ ['1', '62', '103', '308', '587', '876', '930', '1320'],
326
+ [
327
+ '2018-08-19T00:00:00.000+00:00',
328
+ '2018-08-20T00:00:00.000+00:00',
329
+ '2018-08-21T00:00:00.000+00:00',
330
+ '2018-08-22T00:00:00.000+00:00',
331
+ '2018-08-23T00:00:00.000+00:00',
332
+ '2018-08-24T00:00:00.000+00:00',
333
+ '2018-08-25T00:00:00.000+00:00',
334
+ '2018-08-26T00:00:00.000+00:00',
335
+ ],
336
+ ],
337
+ fields: [
338
+ {
339
+ name: 'foo',
340
+ },
341
+ {
342
+ name: '_time',
343
+ },
344
+ ],
345
+ },
346
+ meta: {},
347
+ },
348
+ }}
349
+ />
350
+ );
351
+ ```
352
+
353
+ The `hasEventHandlers` flag has now been extended to charting-based visualizations as well.
354
+
355
+ ```jsx
356
+ import React from 'react';
357
+ import Area from '@splunk/visualizations/Area';
358
+
359
+ export default () => (
360
+ <Area
361
+ options={{}}
362
+ hasEventHandlers
363
+ onEventTrigger={(...ev) => console.log(ev)}
364
+ dataSources={{
365
+ primary: {
366
+ requestParams: { offset: 0, count: 20 },
367
+ data: {
368
+ fields: [
369
+ {
370
+ name: 'sourcetype',
371
+ },
372
+ {
373
+ name: 'count',
374
+ type_special: 'count',
375
+ },
376
+ {
377
+ name: 'percent',
378
+ type_special: 'percent',
379
+ },
380
+ ],
381
+ columns: [
382
+ [
383
+ 'splunkd',
384
+ 'splunkd_ui_access',
385
+ 'splunkd_access',
386
+ 'splunk_web_access',
387
+ 'scheduler',
388
+ 'splunk_web_service',
389
+ ],
390
+ ['600', '525', '295', '213', '122', '19'],
391
+ ['87.966380', '50.381304', '60.023780', '121.183272', '70.250513', '90.194752'],
392
+ ],
393
+ },
394
+ meta: { totalCount: 100 },
395
+ },
396
+ }}
397
+ />
398
+ );
399
+ ```
400
+
401
+ ### Event Payload Changes
402
+
403
+ To support consistency in event payloads, name, value, and `row.<fieldname>.value` have been uniformly applied to refer to the datasource field name, the corresponding value for the datapoint, and the corresponding value in the specified field for the datapoint row for which an interaction was triggered respectively (when applicable). Payload keys which contained duplicate information were removed. Moving forward, UDF will support these as tokens available in dashboards. For additional background information, refer to the [Viz epic](https://jira.splunk.com/browse/SCP-42105) and [UDF epic](https://jira.splunk.com/browse/SCP-39586).
404
+
405
+ Note: Not all visualizations, such as Single Value, support `row.<fieldname>.value`
406
+
407
+ #### Charting-based visualizations event payload changes
408
+
409
+ In addition to the changes mentioned above, it should be noted that `name2` and `value2` have been removed from charting-based platform visualizations, with `name` and `value` taking on values that were previously held by `name2` and `value2`. This corresponds to the y-fieldname and y-value for the datapoint that was interacted with. Additionally, the `rowContext` field has been flattened by adhering to a consistent `row.<fieldName>.value` structure.
410
+
411
+ Previous charting-viz event payloads:
412
+
413
+ ```js
414
+ {
415
+ type: "point.mouseout",
416
+ originalEvent: "...Original Event instance...",
417
+ payload: {
418
+ name: "_time",
419
+ value: "1525310146.000",
420
+ name2: "count",
421
+ value2: "2",
422
+ _span: 1,
423
+ rowContext: {
424
+ "row._time": "1525310146.000",
425
+ "row.count": "2"
426
+ },
427
+ tooltipContext: {
428
+ tooltipX: 204.3,
429
+ tooltipY: 166.86666666666667
430
+ }
431
+ }
432
+ }
433
+ ```
434
+
435
+ Updated event payloads
436
+
437
+ ```js
438
+ {
439
+ type: "point.mouseout",
440
+ originalEvent: "...Original Event instance...",
441
+ payload: {
442
+ _span: 1,
443
+ tooltipContext: {
444
+ tooltipX: 204.3,
445
+ tooltipY: 166.86666666666667
446
+ },
447
+ name: "count", // refers to the y-field
448
+ value: "2", // refers to the y-value
449
+ "row._time.value": "1525310146.000",
450
+ "row.count.value": "2"
451
+ }
452
+ }
453
+ ```
454
+
455
+ #### ChoroplethSVG event payload changes
456
+
457
+ `dataName` and `dataValue` have been renamed to `name` and `value`.
458
+
459
+ Previous area.click payload:
460
+
461
+ ```js
462
+ {
463
+ originalEvent: "...Original Event instance...",
464
+ payload: {
465
+ clientX: 940,
466
+ clientY: 453,
467
+ dataValue: "10000",
468
+ dataName: "ATX-270-B"
469
+ },
470
+ type: "area.click"
471
+ }
472
+ ```
473
+
474
+ New area.click payload:
475
+
476
+ ```js
477
+ {
478
+ originalEvent: "...Original Event instance...",
479
+ payload: {
480
+ clientX: 940,
481
+ clientY: 453,
482
+ value: "10000",
483
+ name: "ATX-270-B"
484
+ },
485
+ type: "area.click"
486
+ }
487
+ ```
488
+
489
+ #### SingleValue event payload changes
490
+
491
+ `majorValue` has been renamed to `value`, and `name` has been added to the payload.
492
+
493
+ Previous value.click payload:
494
+
495
+ ```js
496
+ {
497
+ originalEvent: "...Original Event instance...",
498
+ payload: {
499
+ majorValue: 1320,
500
+ trendValue: 390
501
+ },
502
+ type: "value.click"
503
+ }
504
+ ```
505
+
506
+ New value.click payload
507
+
508
+ ```js
509
+ {
510
+ originalEvent: "...Original Event instance...",
511
+ payload: {
512
+ trendValue: 390,
513
+ value: 1320,
514
+ name: "foo"
515
+ },
516
+ type: "value.click"
517
+ }
518
+ ```
519
+
520
+ #### Table event payload changes
521
+
522
+ Similarly to charting-based visualizations, the `row` payloads have been flattened using the `row.<fieldName>.value` structure. Consequently, `rowValues` has been removed to avoid duplicating information already contained in the flattened structure. `name` and `value` are added to establish consistency with other event payloads emitted by other visualizations.
523
+
524
+ Previous cell.click payload:
525
+
526
+ ```js
527
+ {
528
+ originalEvent: "...Original Event instance...",
529
+ payload: {
530
+ cellIndex: 0,
531
+ rowIndex: 0,
532
+ fieldValue: "sourcetype",
533
+ cellValue: "splunkd",
534
+ cellRawValue: "splunkd",
535
+ rowValues: [
536
+ "splunkd",
537
+ 500,
538
+ [
539
+ "/opt1/dev",
540
+ "/opt1/qa",
541
+ "/root"
542
+ ],
543
+ [
544
+ "##__SPARKLINE__##",
545
+ 38.41707347607988,
546
+ 89.761764861815,
547
+ 21.557911515120654,
548
+ ]
549
+ ],
550
+ value: "splunkd",
551
+ name: "sourcetype",
552
+ row: {
553
+ #: {
554
+ value: 1
555
+ },
556
+ sourcetype: {
557
+ value: "splunkd"
558
+ },
559
+ count: {
560
+ value: 500
561
+ },
562
+ values(source): {
563
+ value: [
564
+ "/opt1/dev",
565
+ "/opt1/qa",
566
+ "/root"
567
+ ]
568
+ },
569
+ sparkline: {
570
+ value: [
571
+ "##__SPARKLINE__##",
572
+ 38.41707347607988,
573
+ 89.761764861815,
574
+ 21.557911515120654,
575
+ ]
576
+ }
577
+ }
578
+ },
579
+ type: "cell.click"
580
+ }
581
+ ```
582
+
583
+ New payload structure:
584
+
585
+ ```js
586
+ {
587
+ originalEvent: "...Original Event instance...",
588
+ payload: {
589
+ cellIndex: 0,
590
+ rowIndex: 0,
591
+ fieldValue: "sourcetype",
592
+ cellValue: "splunkd",
593
+ cellRawValue: "splunkd",
594
+ value: "splunkd",
595
+ name: "sourcetype",
596
+ "row.#.value": 1,
597
+ "row.sourcetype.value": "splunkd",
598
+ "row.count.value": 500,
599
+ "row.values(source).value": [
600
+ "/opt1/dev",
601
+ "/opt1/qa",
602
+ "/root"
603
+ ],
604
+ "row.sparkline.value": [
605
+ "##__SPARKLINE__##",
606
+ 38.41707347607988,
607
+ 89.761764861815,
608
+ 21.557911515120654,
609
+ ]
610
+ },
611
+ type: "cell.click"
612
+ }
613
+ ```
614
+
615
+ <a name="22.0.0"></a>
616
+
617
+ ## 22.0.0
618
+
619
+ ### Peer dependency changes
620
+
621
+ - `@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)
622
+ - `@splunk/react-ui` is no longer a required peer dependency (it's bundled as a direct dependency in vision packages)
623
+
624
+ ### Theming changes in visualizations
625
+
626
+ With the SUI 4.0 uptake (@splunk/react-ui@^4, @splunk/themes@^0.7.0), visualizations and editors no longer export their own themes. Instead, themes are consolidated as part of the visualization directly.
627
+ If no `<SplunkThemeProvider>` is specified, visualizations will default to using their prisma dark theme configuration. Previously, visualizations defaulted to enterprise light if no theming information was given.
628
+
629
+ Previous usage:
630
+
631
+ ```jsx
632
+ import React from 'react';
633
+ import { ThemeProvider } from 'styled-components';
634
+ import SingleValue, { themes as SingleValueThemes } from '@splunk/visualizations/SingleValue';
635
+
636
+ // ...
637
+
638
+ export const MyComponent = props => (
639
+ <ThemeProvider theme={SingleValueThemes}>
640
+ <SingleValue {...props}>
641
+ </ThemeProvider>
642
+ );
643
+ ```
644
+
645
+ **New usage with SUI4**:
646
+
647
+ ```jsx
648
+ import React from 'react';
649
+ import SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';
650
+ import SingleValue from '@splunk/visualizations/SingleValue';
651
+
652
+ // ...
653
+
654
+ export const MyComponent = props => (
655
+ <SplunkThemeProvider family="prisma" colorScheme="dark" density="comfortable">
656
+ <SingleValue {...props}>
657
+ </SplunkThemeProvider>
658
+ );
659
+ ```
660
+
661
+ ### Inferring themed default values for editors
662
+
663
+ The editorConfig for DynamicEditor has a new `pickForTheme` editorProp for displaying themed default values in editors.
664
+
665
+ ```js
666
+ const config = {
667
+ label: _('Font'),
668
+ layout: [
669
+ [
670
+ {
671
+ label: _('Header Text Color'),
672
+ option: 'headerTextColor',
673
+ editor: 'editor.color',
674
+ editorProps: {
675
+ pickFromTheme: theme =>
676
+ pick({
677
+ enterprise: variables.textColor,
678
+ prisma: {
679
+ light: variables.contentColorDefault,
680
+ dark: variables.neutral500,
681
+ },
682
+ })({ theme }),
683
+ },
684
+ },
685
+ ],
686
+ ],
687
+ };
688
+ ```
689
+
690
+ However, the `themeVariable` editorProp can be used if the theme variable name exists in all SUI themes. This is most often used for prisma theme variables that have corresponding enterprise aliases.
691
+ Example usage:
692
+
693
+ ```jsx
694
+ const config = {
695
+ label: _('Font'),
696
+ layout: [
697
+ [
698
+ {
699
+ label: _('Header Text Color'),
700
+ option: 'headerTextColor',
701
+ editor: 'editor.color',
702
+ editorProps: {
703
+ // for the color editor, this would display #3c444d in enterprise light, #ffffff in enterprise dark, and rgba(255, 255, 255, 0.7) in prisma dark.
704
+ themeVariable: 'contentColorDefault',
705
+ },
706
+ },
707
+ ],
708
+ ],
709
+ };
710
+ ```
711
+
712
+ For more complex use cases which require editors to infer theme defaults from DSL, a `themes` object which denotes key-value pairs of functions that return resolved values (hence the `variables.color(props)` invocation) must be specified.
713
+
714
+ ```jsx
715
+ const themes = {
716
+ defaultFontColor: props =>
717
+ pick({
718
+ enterprise: {
719
+ dark: variables.textColor(props),
720
+ light: variables.gray20(props),
721
+ },
722
+ prisma: variables.contentColorActive(props),
723
+ })(props),
724
+ defaultBlockFontColor: props =>
725
+ pick({
726
+ enterprise: variables.white(props),
727
+ prisma: variables.contentColorActive(props),
728
+ })(props),
729
+ };
730
+ const config = {
731
+ label: _('Major Color'),
732
+ layout: [
733
+ [
734
+ {
735
+ label: _('Major Color'),
736
+ option: 'majorColor',
737
+ editor: 'editor.color',
738
+ // in this example, majorColor would have a default of `> themes.defaultFontColor` or `themes.defaultBlockFontColor`
739
+ // DSL needs to receive a function that returns a resolved theme value
740
+ editorProps: {
741
+ themes,
742
+ },
743
+ },
744
+ ],
745
+ ],
746
+ };
747
+ ```
748
+
749
+ See https://cd.splunkdev.com/devplat/vision/-/merge_requests/1213#approach for a background regarding this approach.
750
+
751
+ ### Other visual changes
752
+
753
+ - 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
754
+
755
+ - various minor theming changes for prisma dark (which was previously SCP) theme for visualizations and corresponding editors
756
+
757
+ - 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) )
758
+
759
+ <a name="21.0.0"></a>
760
+
761
+ ## 21.0.0
762
+
763
+ - Renamed the following options in @splunk/visualizations for SingleValue, SingleValueIcon and SingleValueRadial:
764
+
765
+ | previous option naming | new option naming |
766
+ | -------------------------- | ---------------------------- |
767
+ | `deltaValue` | `trendValue` |
768
+ | `deltaColor` | `trendColor` |
769
+ | `deltaFontSize` | `trendFontSize` |
770
+ | `shouldTruncateDeltaValue` | `shouldAbbreviateTrendValue` |
771
+ | `deltaDisplayMode` | `trendDisplayMode` |
772
+
773
+ <a name="19.0.0"></a>
774
+
775
+ ## 19.0.0
776
+
777
+ No API changes.
778
+
779
+ Visual changes related to Highcharts v7.2.1 upgrade can be summarized as
780
+
781
+ ### Major
782
+
783
+ - Axes are stretched to take up more space
784
+ ![Axes Stretched](./src/common/docs/migrations/assets/axesstretch.png)
785
+
786
+ - Displays the last label on a categorical axes
787
+ ![Category Label](./src/common/docs/migrations/assets/categoricallabel.png)
788
+
789
+ - Legends are spaced equally
790
+ ![Legends](./src/common/docs/migrations/assets/legends.png)
791
+
792
+ - Pie Chart shows fewer labels when there are too many labels
793
+ ![Piechart](./src/common/docs/migrations/assets/piechartlabel.png)
794
+
795
+ - Zooming a chart maintains parent axis
796
+ ![Zoom](./src/common/docs/migrations/assets/zoom.png)
797
+
798
+ ### Minor
799
+
800
+ - Colors of the chart grid have changed
801
+ - Minor pixel differences
802
+
803
+ ### Known issues
804
+
805
+ - [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))
806
+
807
+ 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)
808
+
809
+ ### Deprecations
810
+
811
+ - @splunk/react-visualization/numberUtils is deprecated. Use @splunk/visualizations-shared/numberUtils instead.
812
+
813
+ <a name="18.0.0"></a>
814
+
815
+ ## 18.0.0
816
+
817
+ - Support for `withError`, `withNoResultIndicator` and `withLoadingIndicator` higher order components (HOCs) has been dropped.
818
+ - 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.
819
+
820
+ Usage Example
821
+
822
+ ```js
823
+ withBackgroundColor({
824
+ defaultBackgroundColor: themeRegistry.themeVariable('defaultBackgroundColor'),
825
+ enableBackgroundColorOption: true,
826
+ })(Visualization);
827
+ ```
828
+
829
+ <a name="17.0.0"></a>
830
+
831
+ ## 17.0.0
832
+
833
+ - In Single Value visualization, support for option 'sparklineFillOpacity' has been dropped. A constant sparkline fill opacity of 0.05 is used.
834
+
835
+ - BaseVisualization received a new prop `onComputedProps`
836
+
837
+ 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.
838
+
839
+ For the time being only Single Value and Single Value Radial make use of this callback to communicate a data driven background color to dashboards-framework.
840
+
841
+ Usage Example
842
+
843
+ ```js
844
+ const TitleContainer = styled.div`
845
+ background-color: ${props => props.backgroundColor};
846
+ `;
847
+ const DashboardWrapper = props => {
848
+ const [state, setState] = useState({ backgroundColor: '#f00' });
849
+ const { title, ...otherVizProps } = props;
850
+ return (
851
+ <>
852
+ <TitleContainer backgroundColor={state.backgroundColor}>{title}</TitleContainer>
853
+ <Visualization {...otherVizProps} onComputedProps={setState} />
854
+ </>
855
+ );
856
+ };
857
+ ```
858
+
859
+ <a name="16.0.0"></a>
860
+
861
+ ## 16.0.0
862
+
863
+ The Single Value delta colorization behavior changed:
864
+
865
+ 1. Delta color is not affected by major color anymore
866
+ 2. By default when using a fill/background, delta will use the block font color (white)
867
+ 3. When using a default background, in all themes delta will be colored unless customized with encoding
868
+
869
+ If required, the old delta colorization behavior can be retained to some extent:
870
+
871
+ 1: set delta color encoding to same as major color encoding
872
+
873
+ ```
874
+ encoding={{
875
+ majorColor: {
876
+ field: 'primary[0]',
877
+ format: {
878
+ type: 'rangevalue',
879
+ ranges: [{
880
+ from: 0,
881
+ value: '#fff',
882
+ }, {
883
+ to: 0,
884
+ value: '#fff',
885
+ }]
886
+ },
887
+ },
888
+ // matching with major color
889
+ deltaColor: {
890
+ field: 'primary[0]',
891
+ format: {
892
+ type: 'rangevalue',
893
+ ranges: [{
894
+ from: 0,
895
+ value: '#fff',
896
+ }, {
897
+ to: 0,
898
+ value: '#fff',
899
+ }]
900
+ },
901
+ }
902
+ }}
903
+ ```
904
+
905
+ 2 & 3: set a delta color encoding to translate to a color instead of falling back to the default
906
+
907
+ ```
908
+ encoding={{
909
+ //...
910
+ // colorizes delta white
911
+ deltaColor: {
912
+ field: 'primary[0]',
913
+ format: {
914
+ type: 'rangevalue',
915
+ ranges: [{
916
+ from: 0,
917
+ value: '#fff',
918
+ }, {
919
+ to: 0,
920
+ value: '#fff',
921
+ }]
922
+ },
923
+ }
924
+ }}
925
+ ```
926
+
927
+ <a name="15.6.0"></a>
928
+
929
+ ## 15.6.0
930
+
931
+ ChoroplethSvg remote URL input are now disabled by default. Please set the feature flag enableSvgHttpDownloader to true to enable http and https downloads.
932
+
933
+ <a name="15.4.0"></a>
934
+
935
+ ## 15.4.0
936
+
937
+ Please update your dependencies for the following packages to match peerDependency requirements:
938
+
939
+ - @splunk/react-ui@^2.16.0
940
+ - @splunk/themes@^0.4.2
941
+
942
+ <a name="15.3.0"></a>
943
+
944
+ ## 15.3.0
945
+
946
+ Standardize the format of visualization options that expect an 'array' or 'object', but are inputted as 'string'.
947
+ The option type 'string' for the following has been deprecated:
948
+
949
+ - seriesColors, legend.labels, data.fieldShowList, data.fieldHideList, gaugeColors, chart.rangeValues ('string' -> 'array')
950
+ - fieldColors, annotation.categoryColors, fieldDashStyles ('string' -> 'object'),
951
+
952
+ Before
953
+
954
+ ```
955
+ option={{
956
+ seriesColors: '[0x0000F, 0x00001]',
957
+ 'legend.labels': '[foo, bar]',
958
+ 'data.fieldShowList': '[percent, count]',
959
+ 'data.fieldHideList': '[percent, count]',
960
+ gaugeColors: '[0x0000F, 0x00001]',
961
+ 'chart.rangeValues': '[1, 23]',
962
+ fieldColors: '{"count": 0x008000, "percent": 0xFFA500}',
963
+ 'annotation.categoryColors': '{"count": 0x008000, "percent": 0xFFA500}',
964
+ fieldDashStyles: '{"count": shortDash, "percent": dotDash}',
965
+ }}
966
+ ```
967
+
968
+ After
969
+
970
+ ```
971
+ option={{
972
+ seriesColors: ['0x0000F', '0x00001'],
973
+ 'legend.labels': ['foo', 'bar'],
974
+ 'data.fieldShowList': ['percent', 'count'],
975
+ 'data.fieldHideList': ['percent', 'count'],
976
+ gaugeColors: ['0x0000F', '0x00001'],
977
+ 'chart.rangeValues': [1, 23],
978
+ fieldColors: {count: '0x008000', percent: '0xFFA500'},
979
+ 'annotation.categoryColors': {count: '0x008000', percent: '0xFFA500'},
980
+ fieldDashStyles: {count: '0x008000', percent: '0xFFA500'},
981
+ }}
982
+ ```
983
+
984
+ <a name="15.1.0"></a>
985
+
986
+ ## 15.1.0
987
+
988
+ Users of DynamicEditor may pass a function `transformLayout={({ layout, visualization }) => layout}` as a prop which can be used to dynamically alter the editor layout at runtime.
989
+
990
+ <a name="11.0.0"></a>
991
+
992
+ ## [10.2.0] to [11.0.0]
993
+
994
+ ### BREAKING CHANGES
995
+
996
+ - 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.
997
+ Example:
998
+
999
+ ```
1000
+ import React from 'react';
1001
+ import MarkerGauge from '@splunk/dashboard-visualizations/MarkerGauge';
1002
+
1003
+ export default () => (
1004
+ <MarkerGauge
1005
+ encoding={{
1006
+ value: "primary[0]",
1007
+ }}
1008
+ options={{
1009
+ orientation: "horizontal",
1010
+ majorUnit: "10",
1011
+ }}
1012
+ dataSources={{
1013
+ primary: {
1014
+ requestParams: { offset: 0, count: 20 },
1015
+ data: {
1016
+ fields: [{ name: 'count' }],
1017
+ columns: [['78']],
1018
+ },
1019
+ meta: { totalCount: 20 },
1020
+ },
1021
+ }}
1022
+ />
1023
+ );
1024
+ ```
1025
+
1026
+ <a name="7.0.0"></a>
1027
+
1028
+ ## 6.0.0 to 7.0.0
1029
+
1030
+ ### BREAKING CHANGES
1031
+
1032
+ - 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.
1033
+ Example:
1034
+
1035
+ ```
1036
+ import React from 'react';
1037
+ import FillerGauge from '@splunk/dashboard-visualizations/FillerGauge';
1038
+
1039
+ export default () => (
1040
+ <FillerGauge
1041
+ encoding={{
1042
+ value: "primary[0]",
1043
+ }}
1044
+ options={{
1045
+ orientation: "horizontal",
1046
+ majorUnit: "10",
1047
+ }}
1048
+ dataSources={{
1049
+ primary: {
1050
+ requestParams: { offset: 0, count: 20 },
1051
+ data: {
1052
+ fields: [{ name: 'count' }],
1053
+ columns: [['78']],
1054
+ },
1055
+ meta: { totalCount: 20 },
1056
+ },
1057
+ }}
1058
+ />
1059
+ );
1060
+ ```
1061
+
1062
+ <a name="6.0.0"></a>
1063
+
1064
+ ## 5.2.0 to 6.0.0
1065
+
1066
+ ### BREAKING CHANGES
1067
+
1068
+ Removed the following options from SingleValueRadial and SingleValueIcon: 'colorBy', 'colorMode', 'trendColorInterpretation', 'rangeValues', 'rangeColors'. Some of these have been replaced by `fill` encoding.
1069
+ Example:
1070
+
1071
+ ```
1072
+ encoding={{
1073
+ trend: 'primary[0]',
1074
+ fill: {
1075
+ field: 'primary[0]',
1076
+ format: {
1077
+ ranges: [0, 100, 500, 1000, 5000],
1078
+ values: ['#0000FF', '#800080', '#FFFF00', '#FFA500', '#A52A2A'],
1079
+ },
1080
+ },
1081
+ }}
1082
+ ```