@splunk/visualizations 27.5.0 → 28.1.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 +55 -33
- package/Area.js.map +3 -3
- package/Bar.config.js +18 -21
- package/Bar.config.js.map +3 -3
- package/Bar.js +49 -32
- package/Bar.js.map +3 -3
- package/Bubble.config.js +39 -44
- package/Bubble.config.js.map +4 -4
- package/Bubble.js +70 -52
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +63 -7
- package/ChoroplethSvg.config.js +47 -43
- package/ChoroplethSvg.config.js.map +4 -4
- package/ChoroplethSvg.js +85 -54
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +15 -20
- package/Column.config.js.map +3 -3
- package/Column.js +43 -30
- package/Column.js.map +3 -3
- package/Ellipse.config.js +16 -7
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +46 -20
- package/Ellipse.js.map +2 -2
- package/Events.config.js +38 -27
- package/Events.config.js.map +4 -4
- package/Events.js +114 -98
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +9 -9
- package/FillerGauge.config.js +144 -16
- package/FillerGauge.config.js.map +3 -3
- package/FillerGauge.js +891 -101
- package/FillerGauge.js.map +4 -4
- package/Image.config.js +5 -6
- package/Image.config.js.map +2 -2
- package/Image.js +30 -15
- package/Image.js.map +2 -2
- package/Line.config.js +15 -20
- package/Line.config.js.map +3 -3
- package/Line.js +51 -32
- package/Line.js.map +3 -3
- package/LinkGraph.config.js +39 -46
- package/LinkGraph.config.js.map +3 -3
- package/LinkGraph.js +72 -52
- package/LinkGraph.js.map +3 -3
- package/MIGRATION.md +169 -40
- package/Map.config.js +83 -16
- package/Map.config.js.map +4 -4
- package/Map.js +218 -109
- package/Map.js.map +4 -4
- package/Markdown.config.js +4 -5
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +122 -74
- package/Markdown.js.map +3 -3
- package/MarkerGauge.config.js +14 -12
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +108 -70
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.config.js +14 -12
- package/ParallelCoordinates.config.js.map +3 -3
- package/ParallelCoordinates.js +114 -60
- package/ParallelCoordinates.js.map +3 -3
- package/Pie.config.js +51 -38
- package/Pie.config.js.map +4 -4
- package/Pie.js +110 -86
- package/Pie.js.map +4 -4
- package/Punchcard.config.js +36 -34
- package/Punchcard.config.js.map +4 -4
- package/Punchcard.js +154 -88
- 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 +46 -20
- package/Rectangle.js.map +2 -2
- package/Sankey.config.js +69 -17
- package/Sankey.config.js.map +4 -4
- package/Sankey.js +179 -50
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +37 -42
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +71 -54
- package/Scatter.js.map +3 -3
- package/SingleValue.config.js +32 -18
- package/SingleValue.config.js.map +4 -4
- package/SingleValue.js +240 -94
- 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 +85 -29
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.config.js +34 -23
- package/SingleValueRadial.config.js.map +3 -3
- package/SingleValueRadial.js +90 -49
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +153 -49
- package/SparkLine.js.map +2 -2
- package/TRELLIS.md +2 -2
- package/Table.config.js +93 -52
- package/Table.config.js.map +3 -3
- package/Table.js +513 -202
- package/Table.js.map +4 -4
- package/Timeline.config.js +36 -34
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +131 -83
- 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/tableUtils.js +59 -0
- package/common/utils/tableUtils.js.map +7 -0
- 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 +26 -9
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +41 -39
package/Timeline.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;
|
|
@@ -90,50 +91,30 @@ var defaultImport4 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
|
90
91
|
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
91
92
|
var i18n_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
93
|
|
|
93
|
-
// esm-externals:@splunk/themes/pick
|
|
94
|
-
var pick_exports = {};
|
|
95
|
-
__export(pick_exports, {
|
|
96
|
-
default: () => pick_default
|
|
97
|
-
});
|
|
98
|
-
var defaultImport5 = __toESM(require("@splunk/themes/pick"));
|
|
99
|
-
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
100
|
-
var pick_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
101
|
-
|
|
102
|
-
// esm-externals:@splunk/themes/variables
|
|
103
|
-
var variables_exports = {};
|
|
104
|
-
__export(variables_exports, {
|
|
105
|
-
default: () => variables_default
|
|
106
|
-
});
|
|
107
|
-
var defaultImport6 = __toESM(require("@splunk/themes/variables"));
|
|
108
|
-
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
109
|
-
var variables_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
110
|
-
|
|
111
94
|
// esm-externals:lodash
|
|
112
95
|
var lodash_exports = {};
|
|
113
96
|
__export(lodash_exports, {
|
|
114
97
|
default: () => lodash_default
|
|
115
98
|
});
|
|
116
|
-
var
|
|
99
|
+
var defaultImport5 = __toESM(require("lodash"));
|
|
117
100
|
__reExport(lodash_exports, require("lodash"));
|
|
118
|
-
var lodash_default = "default" in
|
|
101
|
+
var lodash_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
119
102
|
|
|
120
103
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
121
104
|
var configUtils_exports = {};
|
|
122
105
|
__export(configUtils_exports, {
|
|
123
106
|
default: () => configUtils_default
|
|
124
107
|
});
|
|
125
|
-
var
|
|
108
|
+
var defaultImport6 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
126
109
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
127
|
-
var configUtils_default = "default" in
|
|
110
|
+
var configUtils_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
128
111
|
|
|
129
112
|
// src/common/utils/configUtils.ts
|
|
130
113
|
function enhanceConfig(vizConfig) {
|
|
131
114
|
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
132
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
133
|
-
(config2)
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
);
|
|
115
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map((config2) => {
|
|
116
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
117
|
+
});
|
|
137
118
|
return enhancedConfig;
|
|
138
119
|
}
|
|
139
120
|
|
|
@@ -155,6 +136,33 @@ var background = ({
|
|
|
155
136
|
];
|
|
156
137
|
var BackgroundColor_default = background;
|
|
157
138
|
|
|
139
|
+
// esm-externals:@splunk/themes/pick
|
|
140
|
+
var pick_exports = {};
|
|
141
|
+
__export(pick_exports, {
|
|
142
|
+
default: () => pick_default
|
|
143
|
+
});
|
|
144
|
+
var defaultImport7 = __toESM(require("@splunk/themes/pick"));
|
|
145
|
+
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
146
|
+
var pick_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
147
|
+
|
|
148
|
+
// esm-externals:@splunk/themes/variables
|
|
149
|
+
var variables_exports = {};
|
|
150
|
+
__export(variables_exports, {
|
|
151
|
+
default: () => variables_default
|
|
152
|
+
});
|
|
153
|
+
var defaultImport8 = __toESM(require("@splunk/themes/variables"));
|
|
154
|
+
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
155
|
+
var variables_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
156
|
+
|
|
157
|
+
// src/common/ThemedDefaults.tsx
|
|
158
|
+
var defaultBackgroundColor = (props) => pick_default({
|
|
159
|
+
enterprise: {
|
|
160
|
+
dark: variables_default.black(props),
|
|
161
|
+
light: variables_default.white(props)
|
|
162
|
+
},
|
|
163
|
+
prisma: variables_default.backgroundColorSection(props)
|
|
164
|
+
})(props);
|
|
165
|
+
|
|
158
166
|
// src/Timeline/config.ts
|
|
159
167
|
var dataContract = {
|
|
160
168
|
requiredDataSources: [],
|
|
@@ -183,13 +191,7 @@ var defaultContext = {
|
|
|
183
191
|
colorMatchConfig: [{ match: "", value: "#5C33FF" }]
|
|
184
192
|
};
|
|
185
193
|
var themes = {
|
|
186
|
-
defaultBackgroundColor
|
|
187
|
-
enterprise: {
|
|
188
|
-
dark: variables_default.black(props),
|
|
189
|
-
light: variables_default.backgroundColor(props)
|
|
190
|
-
},
|
|
191
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
192
|
-
})(props)
|
|
194
|
+
defaultBackgroundColor
|
|
193
195
|
};
|
|
194
196
|
var editorConfig = [
|
|
195
197
|
{
|
package/Timeline.config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/Timeline/config.ts", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-icons", "esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes", "esm-externals:@splunk/ui-utils/i18n", "esm-externals
|
|
4
|
-
"sourcesContent": ["import { timelineOptionsSchema as optionsSchema } from '@splunk/visualization-schemas';\nimport { Timeline as TimelineIcon } from '@splunk/visualization-icons';\n// import { Timeline as TimelinePlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\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 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: 300,\n initialHeight: 300,\n};\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 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};\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('X'),\n option: 'x',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['time'],\n },\n },\n ],\n [\n {\n label: _('Y'),\n option: 'y',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string', 'number'],\n },\n },\n ],\n [\n {\n label: _('Duration'),\n option: 'duration',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Category'),\n option: 'category',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string', 'number'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'resultLimit',\n editor: 'editor.number',\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Lane label width'),\n option: 'yAxisLabelWidth',\n editor: 'editor.number',\n editorProps: {\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'dataColors',\n context: {\n colorRangeConfig: 'colorRangeConfig',\n colorMatchConfig: 'colorMatchConfig',\n },\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 duration: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n duration: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'duration',\n },\n ],\n defaultPalettesConfig,\n },\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'duration',\n showEditor: ({ options }) => options.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) => !options.dataColors,\n },\n ],\n getBackgroundColorEditor({ themes }),\n ],\n },\n {\n label: _('Legend'),\n layout: [\n [\n {\n label: _('Legend display'),\n option: 'legendDisplay',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Right'), value: 'right' },\n { label: _('Bottom'), value: 'bottom' },\n { label: _('Off'), value: 'off' },\n ],\n },\n // disable legend if dataColors is on\n isDisabled: ({ options }) => options.dataColors,\n },\n ],\n [\n {\n label: _('Truncation'),\n option: 'legendTruncation',\n editor: 'editor.radioBar',\n default: 'ellipsisOff',\n editorProps: {\n values: [\n { label: _('A...'), value: 'ellipsisEnd' },\n { label: _('A...Z'), value: 'ellipsisMiddle' },\n { label: _('...Z'), value: 'ellipsisStart' },\n { label: _('Off'), value: 'ellipsisOff' },\n ],\n },\n isDisabled: ({ options }) => options.dataColors,\n showEditor: ({ options }) => options.legendDisplay && options.legendDisplay !== 'off',\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.timeline',\n /**\n * viz name\n */\n name: _('Timeline'),\n category: VizCategory.TIMELINE,\n status: 'preview',\n /**\n * viz icon\n */\n icon: TimelineIcon,\n // placeholderIcon: TimelinePlaceholderIcon, TBD\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'event.click': {\n description: 'triggered when user clicks on an event',\n },\n 'lane.click': {\n description: 'triggered when user clicks on a lane label',\n },\n 'legend.click': {\n description: 'triggered when user clicks on chart legend',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.PLACEHOLDER, VizBehavior.EVENTS],\n themes,\n};\n\nexport default enhanceConfig(config);\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-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/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\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", "\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", "
|
|
3
|
+
"sources": ["src/Timeline/config.ts", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-icons", "esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes", "esm-externals:@splunk/ui-utils/i18n", "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 { timelineOptionsSchema as optionsSchema } from '@splunk/visualization-schemas';\nimport { Timeline as TimelineIcon } from '@splunk/visualization-icons';\n// import { Timeline as TimelinePlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { _ } from '@splunk/ui-utils/i18n';\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 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: 300,\n initialHeight: 300,\n};\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 themes: ThemedDefaults = {\n defaultBackgroundColor,\n};\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('X'),\n option: 'x',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['time'],\n },\n },\n ],\n [\n {\n label: _('Y'),\n option: 'y',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string', 'number'],\n },\n },\n ],\n [\n {\n label: _('Duration'),\n option: 'duration',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Category'),\n option: 'category',\n editor: 'editor.columnSelector',\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string', 'number'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'resultLimit',\n editor: 'editor.number',\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Lane label width'),\n option: 'yAxisLabelWidth',\n editor: 'editor.number',\n editorProps: {\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'dataColors',\n context: {\n colorRangeConfig: 'colorRangeConfig',\n colorMatchConfig: 'colorMatchConfig',\n },\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 duration: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n duration: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'duration',\n },\n ],\n defaultPalettesConfig,\n },\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'duration',\n showEditor: ({ options }) => options.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) => !options.dataColors,\n },\n ],\n getBackgroundColorEditor({ themes }),\n ],\n },\n {\n label: _('Legend'),\n layout: [\n [\n {\n label: _('Legend display'),\n option: 'legendDisplay',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Right'), value: 'right' },\n { label: _('Bottom'), value: 'bottom' },\n { label: _('Off'), value: 'off' },\n ],\n },\n // disable legend if dataColors is on\n isDisabled: ({ options }) => options.dataColors,\n },\n ],\n [\n {\n label: _('Truncation'),\n option: 'legendTruncation',\n editor: 'editor.radioBar',\n default: 'ellipsisOff',\n editorProps: {\n values: [\n { label: _('A...'), value: 'ellipsisEnd' },\n { label: _('A...Z'), value: 'ellipsisMiddle' },\n { label: _('...Z'), value: 'ellipsisStart' },\n { label: _('Off'), value: 'ellipsisOff' },\n ],\n },\n isDisabled: ({ options }) => options.dataColors,\n showEditor: ({ options }) => options.legendDisplay && options.legendDisplay !== 'off',\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.timeline',\n /**\n * viz name\n */\n name: _('Timeline'),\n category: VizCategory.TIMELINE,\n status: 'preview',\n /**\n * viz icon\n */\n icon: TimelineIcon,\n // placeholderIcon: TimelinePlaceholderIcon, TBD\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'event.click': {\n description: 'triggered when user clicks on an event',\n },\n 'lane.click': {\n description: 'triggered when user clicks on a lane label',\n },\n 'legend.click': {\n description: 'triggered when user clicks on chart legend',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.PLACEHOLDER, VizBehavior.EVENTS],\n themes,\n};\n\nexport default enhanceConfig(config);\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-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/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\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,0CAAc;AACd,IAAO,gCAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,wCAAc;AACd,IAAO,8BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,mCAAc;AACd,IAAO,yBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,gCAAc;AACd,IAAO,sBAAS,aAAaA,iBAA8B,yBAAUA;;;ACkBrE,SAAS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AAG,OAAO,iBAAiB;AAAA,cAC7C,EAAE,WAAO,gBAAE,MAAM,GAAG,OAAO,gBAAgB;AAAA,cAC3C,EAAE,WAAO,gBAAE,KAAK,GAAG,OAAO,cAAc;AAAA,YAC5C;AAAA,UACJ;AAAA,UACA,YAAY,CAAC,EAAE,QAAQ,MAAM,QAAQ;AAAA,UACrC,YAAY,CAAC,EAAE,QAAQ,MAAM,QAAQ,iBAAiB,QAAQ,kBAAkB;AAAA,QACpF;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;AAKA,IAAM,SAAoB;AAAA;AAAA;AAAA;AAAA,EAItB,KAAK;AAAA;AAAA;AAAA;AAAA,EAIL,UAAM,gBAAE,UAAU;AAAA,EAClB;AAAA,EACA,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIR,MAAM,4BAAAC;AAAA;AAAA,EAEN;AAAA,EACA;AAAA,EACA;AAAA,EACA,6CAAAC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,IACJ,eAAe;AAAA,MACX,aAAa;AAAA,IACjB;AAAA,IACA,cAAc;AAAA,MACV,aAAa;AAAA,IACjB;AAAA,IACA,gBAAgB;AAAA,MACZ,aAAa;AAAA,IACjB;AAAA,EACJ;AAAA,EACA,UAAU,gGAAyE;AAAA,EACnF;AACJ;AAEA,IAAO,iBAAQ,cAAc,MAAM;",
|
|
6
|
+
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "config", "themes", "defaultImport", "defaultImport", "TimelineIcon", "optionsSchema"]
|
|
7
7
|
}
|
package/Timeline.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;
|
|
@@ -141,41 +142,21 @@ var defaultImport8 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
|
141
142
|
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
142
143
|
var i18n_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
143
144
|
|
|
144
|
-
// esm-externals:@splunk/themes/pick
|
|
145
|
-
var pick_exports = {};
|
|
146
|
-
__export(pick_exports, {
|
|
147
|
-
default: () => pick_default
|
|
148
|
-
});
|
|
149
|
-
var defaultImport9 = __toESM(require("@splunk/themes/pick"));
|
|
150
|
-
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
151
|
-
var pick_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
152
|
-
|
|
153
|
-
// esm-externals:@splunk/themes/variables
|
|
154
|
-
var variables_exports = {};
|
|
155
|
-
__export(variables_exports, {
|
|
156
|
-
default: () => variables_default
|
|
157
|
-
});
|
|
158
|
-
var defaultImport10 = __toESM(require("@splunk/themes/variables"));
|
|
159
|
-
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
160
|
-
var variables_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
161
|
-
|
|
162
145
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
163
146
|
var configUtils_exports = {};
|
|
164
147
|
__export(configUtils_exports, {
|
|
165
148
|
default: () => configUtils_default
|
|
166
149
|
});
|
|
167
|
-
var
|
|
150
|
+
var defaultImport9 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
168
151
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
169
|
-
var configUtils_default = "default" in
|
|
152
|
+
var configUtils_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
170
153
|
|
|
171
154
|
// src/common/utils/configUtils.ts
|
|
172
155
|
function enhanceConfig(vizConfig) {
|
|
173
156
|
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
174
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
175
|
-
(config3)
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
);
|
|
157
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map((config3) => {
|
|
158
|
+
return __spreadProps(__spreadValues({}, config3), { open: config3.open || false });
|
|
159
|
+
});
|
|
179
160
|
return enhancedConfig;
|
|
180
161
|
}
|
|
181
162
|
|
|
@@ -197,6 +178,33 @@ var background = ({
|
|
|
197
178
|
];
|
|
198
179
|
var BackgroundColor_default = background;
|
|
199
180
|
|
|
181
|
+
// esm-externals:@splunk/themes/pick
|
|
182
|
+
var pick_exports = {};
|
|
183
|
+
__export(pick_exports, {
|
|
184
|
+
default: () => pick_default
|
|
185
|
+
});
|
|
186
|
+
var defaultImport10 = __toESM(require("@splunk/themes/pick"));
|
|
187
|
+
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
188
|
+
var pick_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
189
|
+
|
|
190
|
+
// esm-externals:@splunk/themes/variables
|
|
191
|
+
var variables_exports = {};
|
|
192
|
+
__export(variables_exports, {
|
|
193
|
+
default: () => variables_default
|
|
194
|
+
});
|
|
195
|
+
var defaultImport11 = __toESM(require("@splunk/themes/variables"));
|
|
196
|
+
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
197
|
+
var variables_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
|
|
198
|
+
|
|
199
|
+
// src/common/ThemedDefaults.tsx
|
|
200
|
+
var defaultBackgroundColor = (props) => pick_default({
|
|
201
|
+
enterprise: {
|
|
202
|
+
dark: variables_default.black(props),
|
|
203
|
+
light: variables_default.white(props)
|
|
204
|
+
},
|
|
205
|
+
prisma: variables_default.backgroundColorSection(props)
|
|
206
|
+
})(props);
|
|
207
|
+
|
|
200
208
|
// src/Timeline/config.ts
|
|
201
209
|
var dataContract = {
|
|
202
210
|
requiredDataSources: [],
|
|
@@ -225,13 +233,7 @@ var defaultContext = {
|
|
|
225
233
|
colorMatchConfig: [{ match: "", value: "#5C33FF" }]
|
|
226
234
|
};
|
|
227
235
|
var themes = {
|
|
228
|
-
defaultBackgroundColor
|
|
229
|
-
enterprise: {
|
|
230
|
-
dark: variables_default.black(props),
|
|
231
|
-
light: variables_default.backgroundColor(props)
|
|
232
|
-
},
|
|
233
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
234
|
-
})(props)
|
|
236
|
+
defaultBackgroundColor
|
|
235
237
|
};
|
|
236
238
|
var editorConfig = [
|
|
237
239
|
{
|
|
@@ -812,9 +814,14 @@ var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
|
812
814
|
position: relative;
|
|
813
815
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor}};
|
|
814
816
|
`;
|
|
815
|
-
var FixSizeItem = styled_components_default.div.attrs(
|
|
816
|
-
|
|
817
|
-
|
|
817
|
+
var FixSizeItem = styled_components_default.div.attrs(
|
|
818
|
+
({
|
|
819
|
+
width,
|
|
820
|
+
height
|
|
821
|
+
}) => ({
|
|
822
|
+
style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
|
|
823
|
+
})
|
|
824
|
+
)`
|
|
818
825
|
position: relative;
|
|
819
826
|
flex-direction: column;
|
|
820
827
|
flex: 1;
|
|
@@ -848,7 +855,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
848
855
|
FixSizeItem,
|
|
849
856
|
{
|
|
850
857
|
"data-test": "fix-size-item",
|
|
851
|
-
"data-splunk-visualization-version": "
|
|
858
|
+
"data-splunk-visualization-version": "28.1.0 - 4a1bff08b",
|
|
852
859
|
width,
|
|
853
860
|
height,
|
|
854
861
|
backgroundColor
|
|
@@ -914,7 +921,7 @@ var Cover = styled_components_default.div`
|
|
|
914
921
|
bottom: 0;
|
|
915
922
|
`;
|
|
916
923
|
var Blocker = styled_components_default.div.attrs({
|
|
917
|
-
"data-splunk-visualization-version": "
|
|
924
|
+
"data-splunk-visualization-version": "28.1.0 - 4a1bff08b"
|
|
918
925
|
})`
|
|
919
926
|
position: relative;
|
|
920
927
|
width: 100%;
|
|
@@ -1283,7 +1290,12 @@ var useGetXAndYFields = ({
|
|
|
1283
1290
|
y2Fields: options.y2 ? "> y2 | getField()" : void 0,
|
|
1284
1291
|
fieldTypes: "> primary | getType()"
|
|
1285
1292
|
};
|
|
1286
|
-
const {
|
|
1293
|
+
const {
|
|
1294
|
+
xField = "",
|
|
1295
|
+
yFields = [],
|
|
1296
|
+
y2Fields = [],
|
|
1297
|
+
fieldTypes
|
|
1298
|
+
} = Options_exports.Options.evaluate(
|
|
1287
1299
|
{ options: optionsToEvaluate, context },
|
|
1288
1300
|
dataSourcesWithOnlyOnePoint,
|
|
1289
1301
|
() => {
|
|
@@ -1564,7 +1576,9 @@ var withDashboardViz = (opts) => {
|
|
|
1564
1576
|
return result;
|
|
1565
1577
|
}
|
|
1566
1578
|
} catch (e) {
|
|
1567
|
-
|
|
1579
|
+
if (e instanceof Error) {
|
|
1580
|
+
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
1581
|
+
}
|
|
1568
1582
|
return {};
|
|
1569
1583
|
}
|
|
1570
1584
|
return {};
|
|
@@ -1621,9 +1635,13 @@ var withDashboardViz = (opts) => {
|
|
|
1621
1635
|
}
|
|
1622
1636
|
eventCallbackProps[eventCallbackPropName] = (ev) => {
|
|
1623
1637
|
if (ev && ev.payload) {
|
|
1624
|
-
payload = ev.payload;
|
|
1638
|
+
payload = __spreadValues({}, ev.payload);
|
|
1625
1639
|
}
|
|
1626
|
-
return onEventTrigger({
|
|
1640
|
+
return onEventTrigger({
|
|
1641
|
+
originalEvent: ev,
|
|
1642
|
+
payload,
|
|
1643
|
+
type: eventName
|
|
1644
|
+
});
|
|
1627
1645
|
};
|
|
1628
1646
|
if (parentKeys) {
|
|
1629
1647
|
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
@@ -1946,36 +1964,65 @@ var uplot_react_default = "default" in defaultImport33 ? defaultImport33.default
|
|
|
1946
1964
|
// src/Timeline/PureTimeline/src/CursorPlugin.tsx
|
|
1947
1965
|
var currentScaleFactor = 1;
|
|
1948
1966
|
var canvasScaleObserver = null;
|
|
1949
|
-
var updateScaleFactor = () => {
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}
|
|
1960
|
-
} else {
|
|
1961
|
-
currentScaleFactor = 1;
|
|
1962
|
-
}
|
|
1963
|
-
} else {
|
|
1967
|
+
var updateScaleFactor = (root) => {
|
|
1968
|
+
var _a;
|
|
1969
|
+
const fullscreenEl = document.fullscreenElement;
|
|
1970
|
+
if (fullscreenEl && fullscreenEl.tagName !== "BODY") {
|
|
1971
|
+
currentScaleFactor = 1;
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
const scope = root || document;
|
|
1975
|
+
const canvasElement = scope.querySelector('[data-test="canvas"]');
|
|
1976
|
+
if (!canvasElement) {
|
|
1964
1977
|
canvasScaleObserver == null ? void 0 : canvasScaleObserver.disconnect();
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
const scaleAttr = (_a = canvasElement == null ? void 0 : canvasElement.getAttribute) == null ? void 0 : _a.call(canvasElement, "data-test-scale");
|
|
1981
|
+
if (scaleAttr) {
|
|
1982
|
+
currentScaleFactor = parseFloat(scaleAttr) || 1;
|
|
1983
|
+
return;
|
|
1965
1984
|
}
|
|
1985
|
+
const transformMatrix = window.getComputedStyle(canvasElement).getPropertyValue("transform");
|
|
1986
|
+
if (transformMatrix && transformMatrix !== "none") {
|
|
1987
|
+
const matrixValues = transformMatrix.match(/matrix(?:3d)?\((.+)\)/);
|
|
1988
|
+
if (matrixValues) {
|
|
1989
|
+
const values = matrixValues[1].split(", ");
|
|
1990
|
+
currentScaleFactor = parseFloat(values[0]);
|
|
1991
|
+
return;
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
currentScaleFactor = 1;
|
|
1966
1995
|
};
|
|
1967
1996
|
var resetScaleFactorOnFullscreen = () => {
|
|
1968
1997
|
document.addEventListener("fullscreenchange", () => {
|
|
1998
|
+
updateScaleFactor();
|
|
1969
1999
|
if (document.fullscreenElement) {
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
2000
|
+
if (canvasScaleObserver) {
|
|
2001
|
+
canvasScaleObserver.disconnect();
|
|
2002
|
+
}
|
|
1973
2003
|
}
|
|
1974
2004
|
});
|
|
1975
2005
|
};
|
|
1976
2006
|
var initObserver = () => {
|
|
2007
|
+
const gridElement = document.querySelector('[data-test="grid-layout"]');
|
|
1977
2008
|
const canvasElement = document.querySelector('[data-test="canvas"]');
|
|
1978
|
-
if (
|
|
2009
|
+
if (gridElement) {
|
|
2010
|
+
canvasScaleObserver = new MutationObserver((mutationsList) => {
|
|
2011
|
+
mutationsList.forEach((mutation) => {
|
|
2012
|
+
if (mutation.type === "attributes" && mutation.attributeName === "data-test-scale") {
|
|
2013
|
+
if (!document.fullscreenElement) {
|
|
2014
|
+
updateScaleFactor();
|
|
2015
|
+
} else {
|
|
2016
|
+
currentScaleFactor = 1;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
});
|
|
2020
|
+
});
|
|
2021
|
+
canvasScaleObserver.observe(gridElement, {
|
|
2022
|
+
attributes: true,
|
|
2023
|
+
attributeFilter: ["data-test-scale"]
|
|
2024
|
+
});
|
|
2025
|
+
} else if (canvasElement) {
|
|
1979
2026
|
canvasScaleObserver = new MutationObserver((mutationsList) => {
|
|
1980
2027
|
mutationsList.forEach((mutation) => {
|
|
1981
2028
|
if (mutation.type === "attributes" && mutation.attributeName === "style") {
|
|
@@ -1983,7 +2030,10 @@ var initObserver = () => {
|
|
|
1983
2030
|
}
|
|
1984
2031
|
});
|
|
1985
2032
|
});
|
|
1986
|
-
canvasScaleObserver.observe(canvasElement, {
|
|
2033
|
+
canvasScaleObserver.observe(canvasElement, {
|
|
2034
|
+
attributes: true,
|
|
2035
|
+
attributeFilter: ["style"]
|
|
2036
|
+
});
|
|
1987
2037
|
}
|
|
1988
2038
|
};
|
|
1989
2039
|
document.addEventListener("DOMContentLoaded", () => {
|
|
@@ -2036,11 +2086,22 @@ var CursorPlugin = ({
|
|
|
2036
2086
|
init: (u) => {
|
|
2037
2087
|
const chartContainer = u.root;
|
|
2038
2088
|
chartContainer.addEventListener("click", handleClick);
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2089
|
+
updateScaleFactor();
|
|
2090
|
+
const pointerLeaveHandler = (e) => {
|
|
2091
|
+
if (!chartContainer.contains(e.relatedTarget)) {
|
|
2092
|
+
handleMouseLeave(u);
|
|
2093
|
+
}
|
|
2094
|
+
};
|
|
2095
|
+
chartContainer.addEventListener("pointerleave", pointerLeaveHandler);
|
|
2096
|
+
const pointerOutHandler = (e) => {
|
|
2097
|
+
if (!chartContainer.contains(e.relatedTarget)) {
|
|
2098
|
+
handleMouseLeave(u);
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
document.addEventListener("pointerout", pointerOutHandler, true);
|
|
2042
2102
|
return () => {
|
|
2043
|
-
chartContainer.removeEventListener("
|
|
2103
|
+
chartContainer.removeEventListener("pointerleave", pointerLeaveHandler);
|
|
2104
|
+
document.removeEventListener("pointerout", pointerOutHandler, true);
|
|
2044
2105
|
chartContainer.removeEventListener("click", handleClick);
|
|
2045
2106
|
};
|
|
2046
2107
|
},
|
|
@@ -2342,7 +2403,7 @@ var XAxisPlugin = ({
|
|
|
2342
2403
|
ctx.save();
|
|
2343
2404
|
ctx.scale(dpr, dpr);
|
|
2344
2405
|
ctx.font = `10px ${VIZ_FONT_FAMILY}`;
|
|
2345
|
-
ctx.fillStyle = themes3.
|
|
2406
|
+
ctx.fillStyle = themes3.contentColorDefault;
|
|
2346
2407
|
ctx.textAlign = "left";
|
|
2347
2408
|
ctx.textBaseline = "top";
|
|
2348
2409
|
const tickHeight = 5;
|
|
@@ -2402,11 +2463,7 @@ var YAxisLane = styled_components_default.div`
|
|
|
2402
2463
|
justify-content: flex-start;
|
|
2403
2464
|
text-align: left;
|
|
2404
2465
|
font-size: 14px;
|
|
2405
|
-
border-right: 1px solid
|
|
2406
|
-
${(0, themes_exports.pick)({
|
|
2407
|
-
enterprise: themes_exports.variables.borderColorWeak,
|
|
2408
|
-
prisma: themes_exports.variables.interactiveColorBackgroundDisabled
|
|
2409
|
-
})};
|
|
2466
|
+
border-right: 1px solid ${themes_exports.variables.borderColorWeak};
|
|
2410
2467
|
background-color: ${({ isEven, backgroundColor }) => isEven ? hexToRgba(backgroundColor) : getAlternateColor(backgroundColor, 0.1)};
|
|
2411
2468
|
box-sizing: border-box;
|
|
2412
2469
|
color: ${({ color }) => `${color}`};
|
|
@@ -2607,10 +2664,7 @@ var useSplunkTheme_default = "default" in defaultImport34 ? defaultImport34.defa
|
|
|
2607
2664
|
var TooltipContainer = styled_components_default.div`
|
|
2608
2665
|
position: absolute;
|
|
2609
2666
|
background-color: ${({ backgroundColor }) => `${backgroundColor}`};
|
|
2610
|
-
box-shadow: ${
|
|
2611
|
-
enterprise: themes_exports.variables.overlayShadow,
|
|
2612
|
-
prisma: themes_exports.variables.overlayShadow
|
|
2613
|
-
})};
|
|
2667
|
+
box-shadow: ${themes_exports.variables.overlayShadow};
|
|
2614
2668
|
padding: 12px 16px;
|
|
2615
2669
|
border-radius: 3px;
|
|
2616
2670
|
pointer-events: none;
|
|
@@ -2649,16 +2703,10 @@ var TooltipContainer = styled_components_default.div`
|
|
|
2649
2703
|
}
|
|
2650
2704
|
`;
|
|
2651
2705
|
var TooltipLabel = styled_components_default.div`
|
|
2652
|
-
color: ${
|
|
2653
|
-
enterprise: themes_exports.variables.contentColorDefault,
|
|
2654
|
-
prisma: themes_exports.variables.contentColorDefault
|
|
2655
|
-
})};
|
|
2706
|
+
color: ${themes_exports.variables.contentColorDefault};
|
|
2656
2707
|
`;
|
|
2657
2708
|
var TooltipValue = styled_components_default.div`
|
|
2658
|
-
color: ${
|
|
2659
|
-
enterprise: themes_exports.variables.contentColorActive,
|
|
2660
|
-
prisma: themes_exports.variables.contentColorActive
|
|
2661
|
-
})};
|
|
2709
|
+
color: ${themes_exports.variables.contentColorActive};
|
|
2662
2710
|
`;
|
|
2663
2711
|
var TooltipContent = styled_components_default.div`
|
|
2664
2712
|
display: flex;
|