@splunk/visualizations 27.3.0 → 27.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +17 -3
- package/Area.config.js.map +2 -2
- package/Area.js +19 -5
- package/Area.js.map +2 -2
- package/Bar.config.js +17 -3
- package/Bar.config.js.map +3 -3
- package/Bar.js +19 -5
- package/Bar.js.map +3 -3
- package/Bubble.config.js +1 -1
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +3 -3
- package/Bubble.js.map +2 -2
- package/CHANGELOG.external.md +1610 -0
- package/ChoroplethSvg.js +2 -2
- package/Column.config.js +17 -3
- package/Column.config.js.map +3 -3
- package/Column.js +19 -5
- package/Column.js.map +3 -3
- package/Ellipse.js +2 -2
- package/Events.js +2 -2
- package/FillerGauge.config.js +8 -28
- package/FillerGauge.config.js.map +2 -2
- package/FillerGauge.js +10 -30
- package/FillerGauge.js.map +2 -2
- package/Image.js +2 -2
- package/Line.config.js +17 -3
- package/Line.config.js.map +3 -3
- package/Line.js +19 -5
- package/Line.js.map +3 -3
- package/LinkGraph.js +2 -2
- package/Map.config.js +11 -0
- package/Map.config.js.map +2 -2
- package/Map.js +64 -27
- package/Map.js.map +2 -2
- package/Markdown.js +2 -2
- package/MarkerGauge.config.js +8 -25
- package/MarkerGauge.config.js.map +2 -2
- package/MarkerGauge.js +10 -27
- package/MarkerGauge.js.map +2 -2
- package/ParallelCoordinates.js +2 -2
- package/Pie.config.js +123 -3
- package/Pie.config.js.map +3 -3
- package/Pie.js +736 -16
- package/Pie.js.map +4 -4
- package/Punchcard.js +2 -2
- package/Rectangle.js +2 -2
- package/Sankey.js +2 -2
- package/Scatter.config.js +313 -113
- package/Scatter.config.js.map +4 -4
- package/Scatter.js +922 -125
- package/Scatter.js.map +4 -4
- package/SingleValue.js +2 -2
- package/SingleValueIcon.js +2 -2
- package/SingleValueRadial.js +2 -2
- package/TRELLIS.md +12 -3
- package/Table.js +2 -2
- package/Timeline.js +81 -63
- package/Timeline.js.map +4 -4
- package/common/utils/mapUtils.js +16 -8
- package/common/utils/mapUtils.js.map +2 -2
- package/common/withDashboardViz.js +2 -2
- package/package.json +17 -17
package/LinkGraph.js
CHANGED
|
@@ -3048,7 +3048,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
3048
3048
|
FixSizeItem,
|
|
3049
3049
|
{
|
|
3050
3050
|
"data-test": "fix-size-item",
|
|
3051
|
-
"data-splunk-visualization-version": "27.
|
|
3051
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c",
|
|
3052
3052
|
width,
|
|
3053
3053
|
height,
|
|
3054
3054
|
backgroundColor
|
|
@@ -3118,7 +3118,7 @@ var Cover = styled_components_default.div`
|
|
|
3118
3118
|
bottom: 0;
|
|
3119
3119
|
`;
|
|
3120
3120
|
var Blocker = styled_components_default.div.attrs({
|
|
3121
|
-
"data-splunk-visualization-version": "27.
|
|
3121
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c"
|
|
3122
3122
|
})`
|
|
3123
3123
|
position: relative;
|
|
3124
3124
|
width: 100%;
|
package/Map.config.js
CHANGED
|
@@ -372,6 +372,17 @@ var editorConfig = [
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
],
|
|
375
|
+
[
|
|
376
|
+
{
|
|
377
|
+
label: (0, i18n_exports._)("Show Latitude and Longitude"),
|
|
378
|
+
option: "showCoordinates",
|
|
379
|
+
editor: "editor.checkbox",
|
|
380
|
+
editorProps: {
|
|
381
|
+
labelPosition: "right",
|
|
382
|
+
labelWidth: EDITOR_LABEL_WIDTH
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
],
|
|
375
386
|
[
|
|
376
387
|
{
|
|
377
388
|
label: (0, i18n_exports._)("Show zoom controls"),
|
package/Map.config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/Map/config.ts", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/themes", "esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-icons", "esm-externals:@splunk/visualization-icons/placeholders", "esm-externals:lodash", "esm-externals:@splunk/visualizations-shared/configUtils", "src/common/utils/configUtils.ts", "src/common/editorConfig/BackgroundColor.ts"],
|
|
4
|
-
"sourcesContent": ["import { _ } from '@splunk/ui-utils/i18n';\nimport { pick, variables } from '@splunk/themes';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { mapOptionsSchema as optionsSchema, LAYER_TYPE } from '@splunk/visualization-schemas';\nimport { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\n\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n colorMatchConfig: [{ match: '', value: '#5C33FF' }],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n defaultChoroplethEmptyAreaColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.gray92(props),\n },\n prisma: {\n dark: variables.interactiveColorBackground(props),\n light: variables.neutral300(props),\n },\n })(props),\n defaultGradientMigrationConfig: props =>\n pick({\n enterprise: {\n dark: ['#4D4A5D', variables.syntaxPurple(props)],\n light: ['#D2CFDC', variables.syntaxPurple(props)],\n },\n prisma: {\n dark: ['#484558', variables.syntaxPurple(props)],\n light: ['#D8D4E1', variables.syntaxPurple(props)],\n },\n })(props),\n};\n\nconst isChoroplethLayer = options => options.layers?.[0]?.type === LAYER_TYPE.Choropleth;\n\nconst isLocalChoroplethLayer = options =>\n isChoroplethLayer(options) &&\n (options.layers[0].source === 'geo://default/us' || options.layers[0].source === 'geo://default/world');\n\nconst EDITOR_LABEL_WIDTH = 140;\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Layer type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n { label: _('Choropleth'), value: LAYER_TYPE.Choropleth },\n ],\n },\n },\n ],\n [\n {\n label: _('Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Area values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Bubble size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'layers[0].additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'layers[0].resultLimit',\n editor: 'editor.number',\n showEditor: ({ options }) => !isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Latitude (initial map location)'),\n option: 'center[0]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -90,\n max: 90,\n },\n },\n ],\n [\n {\n label: _('Longitude (initial map location)'),\n option: 'center[1]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -180,\n max: 180,\n },\n },\n ],\n [\n {\n label: _('Zoom (initial map location)'),\n option: 'zoom',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n [\n {\n label: _('Show zoom controls'),\n option: 'showZoomControls',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show scale'),\n option: 'showScale',\n editor: 'editor.toggle',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Scale unit'),\n option: 'scaleUnit',\n editor: 'editor.radioBar',\n showEditor: ({ options }) => options.showScale !== false,\n editorProps: {\n values: [\n { label: _('Metric'), value: 'metric' },\n { label: _('Imperial'), value: 'imperial' },\n ],\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'layers[0].dataColors',\n context: 'colorRangeConfig',\n editor: 'editor.dynamicColorWithPrecedence',\n editorProps: {\n labelPosition: 'top',\n flyoutTitle: _('Dynamic coloring: value'),\n formatters: [\n {\n label: _('Ranges'),\n value: 'rangeValue',\n isDefault: true,\n defaults: {\n dataValues: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n dataValues: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'dataValues',\n },\n ],\n defaultPalettesConfig,\n },\n showEditor: ({ options }) => !isChoroplethLayer(options),\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'layers[0].dataValues',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && options.layers?.[0]?.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'layers[0].seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && !options.layers?.[0]?.dataColors,\n },\n ],\n [\n {\n label: _('Choropleth empty area'),\n option: 'layers[0].choroplethEmptyAreaColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth stroke'),\n option: 'layers[0].choroplethStrokeColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth opacity (%)'),\n option: 'layers[0].choroplethOpacity',\n editor: 'editor.percent',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n min: 0,\n },\n },\n ],\n // TODO: add support for seriesColorsByField option\n // [\n // {\n // label: _('Series colors by field name'),\n // option: 'seriesColorsByField',\n // editor: 'editor.seriesColorsByField',\n // },\n // ],\n getBackgroundColorEditor({ themes }),\n [\n {\n label: _('Show base layer'),\n option: 'showBaseLayer',\n editor: 'editor.toggle',\n },\n ],\n [\n {\n label: _('Base layer tile server'),\n option: 'baseLayerTileServer',\n editor: 'editor.text',\n showEditor: ({ options }) => options.showBaseLayer !== false,\n },\n ],\n [\n {\n label: _('Base layer tile server type'),\n option: 'baseLayerTileServerType',\n editor: 'editor.radioBar',\n showEditor: ({ options }) =>\n options.showBaseLayer === false\n ? false\n : !(\n typeof options.baseLayerTileServer === 'undefined' ||\n options.baseLayerTileServer === ''\n ),\n editorProps: {\n values: [\n { label: _('Vector'), value: 'vector' },\n { label: _('Raster'), value: 'raster' },\n ],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: _('Map'),\n category: VizCategory.SPATIAL,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n parentKeys: ['exec'],\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes\";\nexport * from \"@splunk/themes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport * from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons\";\nexport * from \"@splunk/visualization-icons\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons/placeholders\";\nexport * from \"@splunk/visualization-icons/placeholders\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/configUtils\";\nexport * from \"@splunk/visualizations-shared/configUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { get, range } from 'lodash';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\n// included for backwards compatibility\nexport { enhanceOptionsSchemaWithDynamicOptions } from '@splunk/visualization-schemas';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport { enhanceConfig, getInitialPreset, generatePrecisionValues, uncollapseEditorConfig, isDynamicOption };\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n", "import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background color'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,mCAAc;AACd,IAAO,yBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,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CAAC,EAAE,QAAQ,MAAM,CAAC,kBAAkB,OAAO;AAAA,QAC3D;AAAA,MACJ;AAAA,MACA;AAAA,QACI;AAAA,UACI,WAAO,gBAAE,aAAa;AAAA,UACtB,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,YAAY,CAAC,EAAE,QAAQ,MAAG;
|
|
4
|
+
"sourcesContent": ["import { _ } from '@splunk/ui-utils/i18n';\nimport { pick, variables } from '@splunk/themes';\nimport { defaultPalettesConfig } from '@splunk/visualization-color-palettes/editors/PresetPalettes';\nimport { mapOptionsSchema as optionsSchema, LAYER_TYPE } from '@splunk/visualization-schemas';\nimport { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\n\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n colorMatchConfig: [{ match: '', value: '#5C33FF' }],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n defaultChoroplethEmptyAreaColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.gray92(props),\n },\n prisma: {\n dark: variables.interactiveColorBackground(props),\n light: variables.neutral300(props),\n },\n })(props),\n defaultGradientMigrationConfig: props =>\n pick({\n enterprise: {\n dark: ['#4D4A5D', variables.syntaxPurple(props)],\n light: ['#D2CFDC', variables.syntaxPurple(props)],\n },\n prisma: {\n dark: ['#484558', variables.syntaxPurple(props)],\n light: ['#D8D4E1', variables.syntaxPurple(props)],\n },\n })(props),\n};\n\nconst isChoroplethLayer = options => options.layers?.[0]?.type === LAYER_TYPE.Choropleth;\n\nconst isLocalChoroplethLayer = options =>\n isChoroplethLayer(options) &&\n (options.layers[0].source === 'geo://default/us' || options.layers[0].source === 'geo://default/world');\n\nconst EDITOR_LABEL_WIDTH = 140;\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Layer type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n { label: _('Choropleth'), value: LAYER_TYPE.Choropleth },\n ],\n },\n },\n ],\n [\n {\n label: _('Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Area values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => !isChoroplethLayer(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Bubble size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n [\n {\n label: _('Additional tooltip fields'),\n option: 'layers[0].additionalTooltipFields',\n editor: 'editor.columnMultiSelectionByFieldNameEditor',\n },\n ],\n [\n {\n label: _('Result limit'),\n option: 'layers[0].resultLimit',\n editor: 'editor.number',\n showEditor: ({ options }) => !isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n ],\n },\n {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Latitude (initial map location)'),\n option: 'center[0]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -90,\n max: 90,\n },\n },\n ],\n [\n {\n label: _('Longitude (initial map location)'),\n option: 'center[1]',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: -180,\n max: 180,\n },\n },\n ],\n [\n {\n label: _('Zoom (initial map location)'),\n option: 'zoom',\n editor: 'editor.number',\n editorProps: {\n themes,\n labelPosition: 'top',\n min: 0,\n },\n },\n ],\n [\n {\n label: _('Show Latitude and Longitude'),\n option: 'showCoordinates',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show zoom controls'),\n option: 'showZoomControls',\n editor: 'editor.checkbox',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Show scale'),\n option: 'showScale',\n editor: 'editor.toggle',\n editorProps: {\n labelPosition: 'right',\n labelWidth: EDITOR_LABEL_WIDTH,\n },\n },\n ],\n [\n {\n label: _('Scale unit'),\n option: 'scaleUnit',\n editor: 'editor.radioBar',\n showEditor: ({ options }) => options.showScale !== false,\n editorProps: {\n values: [\n { label: _('Metric'), value: 'metric' },\n { label: _('Imperial'), value: 'imperial' },\n ],\n },\n },\n ],\n ],\n },\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Data colors'),\n option: 'layers[0].dataColors',\n context: 'colorRangeConfig',\n editor: 'editor.dynamicColorWithPrecedence',\n editorProps: {\n labelPosition: 'top',\n flyoutTitle: _('Dynamic coloring: value'),\n formatters: [\n {\n label: _('Ranges'),\n value: 'rangeValue',\n isDefault: true,\n defaults: {\n dataValues: defaultContext.colorRangeConfig,\n },\n },\n {\n label: _('Matches'),\n value: 'matchValue',\n defaults: {\n dataValues: defaultContext.colorMatchConfig,\n },\n },\n ],\n dataSelectors: [\n {\n label: _('Data values'),\n value: 'dataValues',\n },\n ],\n defaultPalettesConfig,\n },\n showEditor: ({ options }) => !isChoroplethLayer(options),\n },\n ],\n [\n {\n label: _('Data values'),\n editor: 'editor.columnSelector',\n option: 'layers[0].dataValues',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && options.layers?.[0]?.dataColors,\n editorProps: {\n dataSourceKey: 'primary',\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Series colors'),\n option: 'layers[0].seriesColors',\n editor: 'editor.seriesColors',\n showEditor: ({ options }) =>\n !isChoroplethLayer(options) && !options.layers?.[0]?.dataColors,\n },\n ],\n [\n {\n label: _('Choropleth empty area'),\n option: 'layers[0].choroplethEmptyAreaColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isLocalChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth stroke'),\n option: 'layers[0].choroplethStrokeColor',\n editor: 'editor.color',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n },\n },\n ],\n [\n {\n label: _('Choropleth opacity (%)'),\n option: 'layers[0].choroplethOpacity',\n editor: 'editor.percent',\n showEditor: ({ options }) => isChoroplethLayer(options),\n editorProps: {\n themes,\n min: 0,\n },\n },\n ],\n // TODO: add support for seriesColorsByField option\n // [\n // {\n // label: _('Series colors by field name'),\n // option: 'seriesColorsByField',\n // editor: 'editor.seriesColorsByField',\n // },\n // ],\n getBackgroundColorEditor({ themes }),\n [\n {\n label: _('Show base layer'),\n option: 'showBaseLayer',\n editor: 'editor.toggle',\n },\n ],\n [\n {\n label: _('Base layer tile server'),\n option: 'baseLayerTileServer',\n editor: 'editor.text',\n showEditor: ({ options }) => options.showBaseLayer !== false,\n },\n ],\n [\n {\n label: _('Base layer tile server type'),\n option: 'baseLayerTileServerType',\n editor: 'editor.radioBar',\n showEditor: ({ options }) =>\n options.showBaseLayer === false\n ? false\n : !(\n typeof options.baseLayerTileServer === 'undefined' ||\n options.baseLayerTileServer === ''\n ),\n editorProps: {\n values: [\n { label: _('Vector'), value: 'vector' },\n { label: _('Raster'), value: 'raster' },\n ],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: _('Map'),\n category: VizCategory.SPATIAL,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n parentKeys: ['exec'],\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes\";\nexport * from \"@splunk/themes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport * from \"@splunk/visualization-color-palettes/editors/PresetPalettes\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons\";\nexport * from \"@splunk/visualization-icons\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-icons/placeholders\";\nexport * from \"@splunk/visualization-icons/placeholders\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/configUtils\";\nexport * from \"@splunk/visualizations-shared/configUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { get, range } from 'lodash';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\n// included for backwards compatibility\nexport { enhanceOptionsSchemaWithDynamicOptions } from '@splunk/visualization-schemas';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport { enhanceConfig, getInitialPreset, generatePrecisionValues, uncollapseEditorConfig, isDynamicOption };\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n", "import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background color'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/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,EAIL,UAAM,gBAAE,KAAK;AAAA,EACb;AAAA,EACA,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIR,MAAM,4BAAAC;AAAA,EACN,iBAAiB,qBAAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA,6CAAAC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,IACJ,YAAY;AAAA,MACR,aAAa;AAAA,MACb,YAAY,CAAC,MAAM;AAAA,IACvB;AAAA,IACA,aAAa;AAAA,MACT,aAAa;AAAA,IACjB;AAAA,EACJ;AAAA,EACA,UAAU,gGAAyE;AAAA,EACnF;AAAA,EACA,eAAe,CAAC;AACpB;AAEA,IAAO,iBAAQ,cAAc,MAAM;",
|
|
6
6
|
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "config", "themes", "MapIcon", "MapPlaceholderIcon", "optionsSchema"]
|
|
7
7
|
}
|
package/Map.js
CHANGED
|
@@ -691,7 +691,8 @@ var Tooltip = ({
|
|
|
691
691
|
longitude,
|
|
692
692
|
areaId,
|
|
693
693
|
areaValue,
|
|
694
|
-
additionalFields = []
|
|
694
|
+
additionalFields = [],
|
|
695
|
+
showCoordinates = true
|
|
695
696
|
}) => /* @__PURE__ */ react_exports.createElement(
|
|
696
697
|
StyledPopover,
|
|
697
698
|
{
|
|
@@ -701,7 +702,7 @@ var Tooltip = ({
|
|
|
701
702
|
"data-test": "map-marker-tooltip",
|
|
702
703
|
defaultPlacement: "above"
|
|
703
704
|
},
|
|
704
|
-
/* @__PURE__ */ react_exports.createElement(StyledTable, null, /* @__PURE__ */ react_exports.createElement("tbody", null, areaId && areaValue && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, { "data-test": "area-id" }, areaId), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "area-value" }, areaValue)), latitude && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, null, (0, i18n_exports._)("Latitude")), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "latitude" }, convertDegToDMS(latitude, "latitude"))), longitude && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, null, (0, i18n_exports._)("Longitude")), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "longitude" }, convertDegToDMS(longitude, "longitude"))), additionalFields.filter(({ value }) => value && String(value) !== "0").map(({ name, value, color }, index) => /* @__PURE__ */ react_exports.createElement("tr", { key: String(index) }, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, { "data-test": "field-title" }, color ? /* @__PURE__ */ react_exports.createElement(StyledColorBlock, { "data-test": "field-color", color }) : null, name), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "field-value" }, value)))))
|
|
705
|
+
/* @__PURE__ */ react_exports.createElement(StyledTable, null, /* @__PURE__ */ react_exports.createElement("tbody", null, areaId && areaValue && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, { "data-test": "area-id" }, areaId), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "area-value" }, areaValue)), Boolean(showCoordinates && latitude) && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, null, (0, i18n_exports._)("Latitude")), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "latitude" }, convertDegToDMS(latitude, "latitude"))), Boolean(showCoordinates && longitude) && /* @__PURE__ */ react_exports.createElement("tr", null, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, null, (0, i18n_exports._)("Longitude")), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "longitude" }, convertDegToDMS(longitude, "longitude"))), additionalFields.filter(({ value }) => value && String(value) !== "0").map(({ name, value, color }, index) => /* @__PURE__ */ react_exports.createElement("tr", { key: String(index) }, /* @__PURE__ */ react_exports.createElement(StyledTitleColumn, { "data-test": "field-title" }, color ? /* @__PURE__ */ react_exports.createElement(StyledColorBlock, { "data-test": "field-color", color }) : null, name), /* @__PURE__ */ react_exports.createElement(StyledValueColumn, { "data-test": "field-value" }, value)))))
|
|
705
706
|
);
|
|
706
707
|
var Tooltip_default = Tooltip;
|
|
707
708
|
|
|
@@ -715,7 +716,8 @@ var MarkerWrapper = (_a) => {
|
|
|
715
716
|
additionalFields = [],
|
|
716
717
|
map,
|
|
717
718
|
isChoroplethTooltipOpen,
|
|
718
|
-
children
|
|
719
|
+
children,
|
|
720
|
+
showCoordinates = true
|
|
719
721
|
} = _b, otherProps = __objRest(_b, [
|
|
720
722
|
"longitude",
|
|
721
723
|
"latitude",
|
|
@@ -724,7 +726,8 @@ var MarkerWrapper = (_a) => {
|
|
|
724
726
|
"additionalFields",
|
|
725
727
|
"map",
|
|
726
728
|
"isChoroplethTooltipOpen",
|
|
727
|
-
"children"
|
|
729
|
+
"children",
|
|
730
|
+
"showCoordinates"
|
|
728
731
|
]);
|
|
729
732
|
const container = react_exports.useRef();
|
|
730
733
|
const marker = react_exports.useRef();
|
|
@@ -755,6 +758,8 @@ var MarkerWrapper = (_a) => {
|
|
|
755
758
|
}
|
|
756
759
|
}, [latitude, longitude, map]);
|
|
757
760
|
react_exports.useEffect(() => cleanupMarker, []);
|
|
761
|
+
const filteredAdditionalFields = additionalFields.filter(({ value }) => value && String(value) !== "0");
|
|
762
|
+
const showTooltip = showCoordinates || filteredAdditionalFields.length || areaId && areaValue;
|
|
758
763
|
return /* @__PURE__ */ react_exports.createElement("div", { style: { visibility: isChoroplethTooltip() ? "hidden" : "visible" } }, /* @__PURE__ */ react_exports.createElement(
|
|
759
764
|
"div",
|
|
760
765
|
__spreadValues({
|
|
@@ -767,7 +772,7 @@ var MarkerWrapper = (_a) => {
|
|
|
767
772
|
onBlur: closeTooltip
|
|
768
773
|
}, otherProps),
|
|
769
774
|
children
|
|
770
|
-
), /* @__PURE__ */ react_exports.createElement("div", null, /* @__PURE__ */ react_exports.createElement(
|
|
775
|
+
), /* @__PURE__ */ react_exports.createElement("div", null, showTooltip && /* @__PURE__ */ react_exports.createElement(
|
|
771
776
|
Tooltip_default,
|
|
772
777
|
{
|
|
773
778
|
open: isChoroplethTooltip() ? isChoroplethTooltipOpen : isTooltipOpen,
|
|
@@ -776,7 +781,8 @@ var MarkerWrapper = (_a) => {
|
|
|
776
781
|
longitude: isChoroplethTooltip() ? null : longitude,
|
|
777
782
|
areaId,
|
|
778
783
|
areaValue,
|
|
779
|
-
additionalFields
|
|
784
|
+
additionalFields,
|
|
785
|
+
showCoordinates
|
|
780
786
|
}
|
|
781
787
|
)));
|
|
782
788
|
};
|
|
@@ -854,7 +860,8 @@ var Bubble = react_exports.memo(
|
|
|
854
860
|
bubbleSize,
|
|
855
861
|
additionalFields = [],
|
|
856
862
|
map,
|
|
857
|
-
handleMapClick
|
|
863
|
+
handleMapClick,
|
|
864
|
+
showCoordinates
|
|
858
865
|
}) => {
|
|
859
866
|
const onBubbleClick = react_exports.useCallback(
|
|
860
867
|
(e, name, value) => {
|
|
@@ -912,7 +919,8 @@ var Bubble = react_exports.memo(
|
|
|
912
919
|
latitude,
|
|
913
920
|
additionalFields: [...bubbleSize, ...additionalFields],
|
|
914
921
|
map,
|
|
915
|
-
"data-test-type": "bubble"
|
|
922
|
+
"data-test-type": "bubble",
|
|
923
|
+
showCoordinates
|
|
916
924
|
},
|
|
917
925
|
bubble
|
|
918
926
|
);
|
|
@@ -920,7 +928,7 @@ var Bubble = react_exports.memo(
|
|
|
920
928
|
);
|
|
921
929
|
Bubble.displayName = "MapBubble";
|
|
922
930
|
var BubbleLayer = (props) => {
|
|
923
|
-
const { bubbleLayer, themeColorScheme, map, zoom, onMapClick } = props;
|
|
931
|
+
const { bubbleLayer, themeColorScheme, map, zoom, onMapClick, showCoordinates } = props;
|
|
924
932
|
bubbleLayer.seriesColors = bubbleLayer.seriesColors || DEFAULT_SERIES_COLORS;
|
|
925
933
|
bubbleLayer.bubbleSize = bubbleLayer.bubbleSize || [];
|
|
926
934
|
const bakedData = react_exports.useMemo(() => bakeBubbleData(bubbleLayer), [bubbleLayer]);
|
|
@@ -988,7 +996,8 @@ var BubbleLayer = (props) => {
|
|
|
988
996
|
bubbleSize,
|
|
989
997
|
additionalFields,
|
|
990
998
|
map,
|
|
991
|
-
handleMapClick: (e, name, value) => handleMapClick(e, name, value, i)
|
|
999
|
+
handleMapClick: (e, name, value) => handleMapClick(e, name, value, i),
|
|
1000
|
+
showCoordinates
|
|
992
1001
|
}
|
|
993
1002
|
);
|
|
994
1003
|
}));
|
|
@@ -1028,7 +1037,8 @@ var Marker2 = react_exports.memo(
|
|
|
1028
1037
|
themeColorScheme,
|
|
1029
1038
|
map,
|
|
1030
1039
|
additionalFields,
|
|
1031
|
-
handleLayerClick
|
|
1040
|
+
handleLayerClick,
|
|
1041
|
+
showCoordinates
|
|
1032
1042
|
}) => {
|
|
1033
1043
|
const icon = react_exports.useMemo(
|
|
1034
1044
|
() => /* @__PURE__ */ react_exports.createElement(MarkerIcon, { color, theme: themeColorScheme, onClick: handleLayerClick }),
|
|
@@ -1041,7 +1051,8 @@ var Marker2 = react_exports.memo(
|
|
|
1041
1051
|
longitude,
|
|
1042
1052
|
map,
|
|
1043
1053
|
additionalFields,
|
|
1044
|
-
"data-test-type": "marker"
|
|
1054
|
+
"data-test-type": "marker",
|
|
1055
|
+
showCoordinates
|
|
1045
1056
|
},
|
|
1046
1057
|
icon
|
|
1047
1058
|
);
|
|
@@ -1053,7 +1064,7 @@ var StyledMarkerWrapper2 = styled_components_default(MarkerWrapper_default)`
|
|
|
1053
1064
|
height: 28px;
|
|
1054
1065
|
cursor: pointer;
|
|
1055
1066
|
`;
|
|
1056
|
-
var generateMarkerWrapperProps = (markerLayer, onMapClick = lodash_exports.noop) => {
|
|
1067
|
+
var generateMarkerWrapperProps = (markerLayer, onMapClick = lodash_exports.noop, showCoordinates) => {
|
|
1057
1068
|
const latArray = markerLayer.latitude;
|
|
1058
1069
|
const lonArray = markerLayer.longitude;
|
|
1059
1070
|
const isStaticColor = !markerLayer.dataColors;
|
|
@@ -1086,19 +1097,29 @@ var generateMarkerWrapperProps = (markerLayer, onMapClick = lodash_exports.noop)
|
|
|
1086
1097
|
longitude: lonArray[i],
|
|
1087
1098
|
color,
|
|
1088
1099
|
additionalFields,
|
|
1089
|
-
handleLayerClick
|
|
1100
|
+
handleLayerClick,
|
|
1101
|
+
showCoordinates
|
|
1090
1102
|
});
|
|
1091
1103
|
}
|
|
1092
1104
|
return markerProps;
|
|
1093
1105
|
};
|
|
1094
1106
|
var MarkerLayer = (props) => {
|
|
1095
|
-
const { map, themeColorScheme, markerLayer, onMapClick } = props;
|
|
1107
|
+
const { map, themeColorScheme, markerLayer, onMapClick, showCoordinates = true } = props;
|
|
1096
1108
|
markerLayer.seriesColors = markerLayer.seriesColors || DEFAULT_SERIES_COLORS;
|
|
1097
|
-
const markerPropsList = react_exports.useMemo(
|
|
1098
|
-
markerLayer,
|
|
1099
|
-
onMapClick
|
|
1100
|
-
|
|
1101
|
-
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, markerPropsList.map((markerProps, i) => /* @__PURE__ */ react_exports.createElement(
|
|
1109
|
+
const markerPropsList = react_exports.useMemo(
|
|
1110
|
+
() => generateMarkerWrapperProps(markerLayer, onMapClick, showCoordinates),
|
|
1111
|
+
[markerLayer, onMapClick, showCoordinates]
|
|
1112
|
+
);
|
|
1113
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, markerPropsList.map((markerProps, i) => /* @__PURE__ */ react_exports.createElement(
|
|
1114
|
+
Marker2,
|
|
1115
|
+
__spreadProps(__spreadValues({
|
|
1116
|
+
key: String(i),
|
|
1117
|
+
themeColorScheme,
|
|
1118
|
+
map
|
|
1119
|
+
}, markerProps), {
|
|
1120
|
+
showCoordinates
|
|
1121
|
+
})
|
|
1122
|
+
)));
|
|
1102
1123
|
};
|
|
1103
1124
|
var MarkerLayer_default = MarkerLayer;
|
|
1104
1125
|
|
|
@@ -1108,7 +1129,8 @@ var ClusterLayer = ({
|
|
|
1108
1129
|
themeColorScheme,
|
|
1109
1130
|
zoom,
|
|
1110
1131
|
map,
|
|
1111
|
-
onMapClick
|
|
1132
|
+
onMapClick,
|
|
1133
|
+
showCoordinates
|
|
1112
1134
|
}) => {
|
|
1113
1135
|
var _a;
|
|
1114
1136
|
if (((_a = map == null ? void 0 : map.current) == null ? void 0 : _a.isStyleLoaded) && [clusterLayer.longitude, clusterLayer.latitude].every(Array.isArray)) {
|
|
@@ -1119,7 +1141,8 @@ var ClusterLayer = ({
|
|
|
1119
1141
|
markerLayer: clusterLayer,
|
|
1120
1142
|
themeColorScheme,
|
|
1121
1143
|
map,
|
|
1122
|
-
onMapClick
|
|
1144
|
+
onMapClick,
|
|
1145
|
+
showCoordinates
|
|
1123
1146
|
}
|
|
1124
1147
|
);
|
|
1125
1148
|
}
|
|
@@ -1131,7 +1154,8 @@ var ClusterLayer = ({
|
|
|
1131
1154
|
themeColorScheme,
|
|
1132
1155
|
map,
|
|
1133
1156
|
zoom,
|
|
1134
|
-
onMapClick
|
|
1157
|
+
onMapClick,
|
|
1158
|
+
showCoordinates
|
|
1135
1159
|
}
|
|
1136
1160
|
);
|
|
1137
1161
|
}
|
|
@@ -1522,7 +1546,8 @@ var PureMap = (props) => {
|
|
|
1522
1546
|
onMapLoad,
|
|
1523
1547
|
onMapClick,
|
|
1524
1548
|
onOptionsChange,
|
|
1525
|
-
title
|
|
1549
|
+
title,
|
|
1550
|
+
showCoordinates
|
|
1526
1551
|
} = props;
|
|
1527
1552
|
const { defaultTileConfig, customTileConfig } = (0, react_exports.useContext)(MapContext_default);
|
|
1528
1553
|
const basemapContainer = (0, react_exports.useRef)(null);
|
|
@@ -1788,7 +1813,8 @@ var PureMap = (props) => {
|
|
|
1788
1813
|
themeColorScheme,
|
|
1789
1814
|
map,
|
|
1790
1815
|
zoom: currentZoomLevel,
|
|
1791
|
-
onMapClick
|
|
1816
|
+
onMapClick,
|
|
1817
|
+
showCoordinates
|
|
1792
1818
|
}
|
|
1793
1819
|
),
|
|
1794
1820
|
isMapLoaded && layer && layer.type === visualization_schemas_exports.LAYER_TYPE.Choropleth && layer.source && /* @__PURE__ */ react_exports.createElement(
|
|
@@ -2176,6 +2202,17 @@ var editorConfig = [
|
|
|
2176
2202
|
}
|
|
2177
2203
|
}
|
|
2178
2204
|
],
|
|
2205
|
+
[
|
|
2206
|
+
{
|
|
2207
|
+
label: (0, i18n_exports._)("Show Latitude and Longitude"),
|
|
2208
|
+
option: "showCoordinates",
|
|
2209
|
+
editor: "editor.checkbox",
|
|
2210
|
+
editorProps: {
|
|
2211
|
+
labelPosition: "right",
|
|
2212
|
+
labelWidth: EDITOR_LABEL_WIDTH
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
],
|
|
2179
2216
|
[
|
|
2180
2217
|
{
|
|
2181
2218
|
label: (0, i18n_exports._)("Show zoom controls"),
|
|
@@ -2718,7 +2755,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2718
2755
|
FixSizeItem,
|
|
2719
2756
|
{
|
|
2720
2757
|
"data-test": "fix-size-item",
|
|
2721
|
-
"data-splunk-visualization-version": "27.
|
|
2758
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c",
|
|
2722
2759
|
width,
|
|
2723
2760
|
height,
|
|
2724
2761
|
backgroundColor
|
|
@@ -2784,7 +2821,7 @@ var Cover = styled_components_default.div`
|
|
|
2784
2821
|
bottom: 0;
|
|
2785
2822
|
`;
|
|
2786
2823
|
var Blocker = styled_components_default.div.attrs({
|
|
2787
|
-
"data-splunk-visualization-version": "27.
|
|
2824
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c"
|
|
2788
2825
|
})`
|
|
2789
2826
|
position: relative;
|
|
2790
2827
|
width: 100%;
|