@splunk/visualization-migrations 27.4.0 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/index.ts", "esm-externals:@splunk/visualization-schemas", "esm-externals:@splunk/visualization-encoding/utils/parserUtils", "src/encoding/encoding.ts", "src/visualizations/splunk-charting.ts", "src/visualizations/area.ts", "src/visualizations/bar.ts", "src/visualizations/bubble.ts", "esm-externals:@splunk/visualization-encoding/utils/dsl", "src/utils/migrationUtils.ts", "src/visualizations/choroplethSvg.ts", "src/visualizations/column.ts", "src/visualizations/ellipse.ts", "src/utils/gauges.ts", "src/visualizations/fillergauge.ts", "src/visualizations/line.ts", "src/visualizations/image.ts", "src/visualizations/markdown.ts", "src/visualizations/markergauge.ts", "src/visualizations/pie.ts", "src/visualizations/scatter.ts", "src/visualizations/rectangle.ts", "src/utils/singlevalue.ts", "src/visualizations/singlevalue.ts", "src/visualizations/singlevalueicon.ts", "src/visualizations/singlevalueradial.ts", "esm-externals:lodash", "esm-externals:@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides", "src/visualizations/table.ts", "src/visualizations/text.ts", "src/visualizations/punchcard.ts", "src/visualizations/choropleth.ts", "src/migrate.ts"],
4
- "sourcesContent": ["export * from './migrate';\nexport * from './encoding';\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-encoding/utils/parserUtils\";\nexport * from \"@splunk/visualization-encoding/utils/parserUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import {\n parseNameBasedFieldReference,\n parseIndexBasedFieldReference,\n} from '@splunk/visualization-encoding/utils/parserUtils';\n\n// index based references are defined by <dataSource>[<index>]\n// this regex matches <text with numbers>[<anything>]\n// the \"[\" \"]\" part makes it an index based reference\nconst indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n// name based references are defined by <dataSource>.<columnName>\n// the \".\" access makes it a name based reference\nconst nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n\ninterface AdvancedEncodingConfig {\n field: string;\n format?: Record<string, unknown>;\n}\ntype EncodingConfig = string | string[] | AdvancedEncodingConfig;\n\nexport type { EncodingConfig };\n\ninterface DynamicOptionsChunk {\n options: Record<string, unknown>;\n context: Record<string, unknown>;\n}\nconst isIndexBasedReference = ref => indexBasedRegx.test(ref);\nconst isNameBasedReference = ref => nameBasedRegx.test(ref);\n\ntype formatterFromEncodingType = {\n contextConfig: Record<string, unknown> | unknown;\n contextKey: string;\n dsl: string;\n};\n\nconst convertFormatterToDSL = (\n fieldReference: AdvancedEncodingConfig,\n key: string,\n translatedValue: string\n): formatterFromEncodingType | void => {\n switch (fieldReference?.format?.type) {\n case 'gradient':\n return {\n contextConfig: {\n ...(Array.isArray(fieldReference.format?.ranges) && {\n stops: [...fieldReference.format.ranges],\n }),\n ...(Array.isArray(fieldReference.format?.values) && {\n colors: [...fieldReference.format.values],\n }),\n },\n contextKey: `${key}GradientContext`,\n dsl: `${translatedValue} | gradient(${key}GradientContext)`,\n };\n case 'rangevalue': {\n const contextKey = `${key}RangeValueContext`;\n return {\n contextConfig: fieldReference.format?.ranges || [],\n contextKey,\n dsl: `${translatedValue} | rangeValue(${contextKey})`,\n };\n }\n case 'matchvalue': {\n const defaultValue = fieldReference.format?.defaultValue;\n const matchValueContextKey = `${key}MatchValueContext`;\n return {\n contextConfig: fieldReference.format?.matches || [],\n contextKey: matchValueContextKey,\n dsl: `${translatedValue} | matchValue(${matchValueContextKey}${\n defaultValue !== null && defaultValue !== undefined\n ? `, ${typeof defaultValue === 'string' ? `\"${defaultValue}\"` : defaultValue}`\n : ''\n })`,\n };\n }\n default:\n break;\n }\n return null;\n};\n\n/**\n * Translates encoding data selections in array format\n *\n * Note:\n * 'frameBySeriesIndexes' only supports positive indexes\n *\n * Examples:\n * 1. all index based selection\n * ['primary[0]', 'primary[1]'] => '> primary | frameBySeriesIndexes(0,1)'\n *\n * 2. all name based selection\n * ['primary.foo', 'primary.bar'] => '> primary | frameBySeriesNames(\"foo\",\"bar\")'\n *\n * 3. index or name based selections\n * ['primary.foo', 'primary[1]'] => '> primary | frameBySeriesNamesOrIndexes(\"foo\",1)'\n */\nconst translateArrayFormatDataReference = (encodingDataReference: string[]): string => {\n if (encodingDataReference.length === 0) {\n return null;\n }\n const allIndexBased = encodingDataReference.every(isIndexBasedReference);\n const allNameBased = encodingDataReference.every(isNameBasedReference);\n\n if (allIndexBased) {\n const { dataSourceName } = parseIndexBasedFieldReference(encodingDataReference[0]);\n const indexesStr = encodingDataReference\n .map(ref => parseIndexBasedFieldReference(ref)?.fieldIndex)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesIndexes(${indexesStr})`;\n }\n if (allNameBased) {\n const { dataSourceName } = parseNameBasedFieldReference(encodingDataReference[0]);\n const namesStr = encodingDataReference\n .map(ref => `\"${parseNameBasedFieldReference(ref)?.fieldName}\"`)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNames(${namesStr})`;\n }\n // it's a mix of name and index based references\n // get the first ref to extract the dataSource\n const firstEntry = encodingDataReference[0];\n const { dataSourceName } = isIndexBasedReference(firstEntry)\n ? parseIndexBasedFieldReference(firstEntry)\n : parseNameBasedFieldReference(firstEntry);\n const paramStr = encodingDataReference\n .map(ref => {\n return isIndexBasedReference(ref)\n ? parseIndexBasedFieldReference(ref)?.fieldIndex\n : `\"${parseNameBasedFieldReference(ref)?.fieldName}\"`;\n })\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNamesOrIndexes(${paramStr})`;\n};\n\n/**\n * Translates an encoding data selection string to a dynamic options data selection\n *\n * Index based column selection\n * 'primary[0]' => '> primary | seriesByIndex(0)'\n *\n * Index range based column selection\n * 'primary[1:]' => '> primary | frameBySeriesIndexRange(1)'\n * 'primary[0:3]' => '> primary | frameBySeriesIndexRange(0,2)'\n *\n * Name based column selection\n * 'primary.foo' => '> primary | seriesByName(\"foo\")'\n *\n * Encoding references\n * 'encoding.x' => '> x'\n */\nconst translateDataReference = (encodingDataReference: string): string => {\n if (encodingDataReference.indexOf('encoding.') === 0) {\n return `> ${encodingDataReference.replace('encoding.', '')}`;\n }\n const isIndexBasedRef = isIndexBasedReference(encodingDataReference);\n const isNameBasedRef = isNameBasedReference(encodingDataReference);\n\n if (!isIndexBasedRef && !isNameBasedRef) {\n console.warn('Unable to parse the encoding. Please verify the encoding format is correct');\n return null;\n }\n\n if (isNameBasedRef) {\n const { dataSourceName, fieldName, columnIndex } = parseNameBasedFieldReference(\n encodingDataReference\n );\n let returnString = `> ${dataSourceName} | seriesByName(\"${fieldName}\")`;\n if (columnIndex) {\n returnString += ` | pointByIndex(${columnIndex})`;\n }\n return returnString;\n }\n if (isIndexBasedRef) {\n const {\n dataSourceName,\n fieldIndex,\n columnIndex,\n isFieldIndexRange,\n fromFieldIndex,\n toFieldIndex,\n } = parseIndexBasedFieldReference(encodingDataReference);\n if (isFieldIndexRange) {\n let dslToIndexString;\n if (toFieldIndex === -1) {\n dslToIndexString = '';\n } else {\n // adjust index, DSL is using default slice behavior whereas encoding behaved differently\n dslToIndexString = `,${toFieldIndex + 1}`;\n }\n return `> ${dataSourceName} | frameBySeriesIndexRange(${fromFieldIndex}${dslToIndexString})`;\n }\n let returnString = `> ${dataSourceName} | seriesByIndex(${fieldIndex})`;\n if (columnIndex) {\n returnString += ` | pointByIndex(${columnIndex})`;\n }\n return returnString;\n }\n return null;\n};\n/**\n * An encoding configuration can come in various different forms:\n *\n * 1. Simple data selection (either index or name based)\n * {\n * x: 'primary[0]',\n * y: 'primary.count'\n * }\n *\n * 2. Multi column selection in array format\n * {\n * x: 'primary[0]',\n * \t y: ['primary.count', 'primary.count2']\n * }\n *\n * 3. Advanced Encoding Configuration (for data selection and formatting)\n * {\n * x: {\n * \t field: 'primary[0]',\n * \t },\n * y: {\n * \t field: 'primary[1]',\n * format: {},\n * }\n * }\n */\nconst encodingToDynamicOptionsDSL = (encoding: Record<string, EncodingConfig>): DynamicOptionsChunk => {\n const dynamicOptions: DynamicOptionsChunk = {\n options: {},\n context: {},\n };\n const translatedOptions = {};\n const encodingObj = encoding ?? {};\n Object.keys(encodingObj).forEach(key => {\n const fieldReference = encoding[key];\n let fieldReferenceStr = fieldReference as string;\n if (typeof fieldReference === 'object' && !Array.isArray(fieldReference)) {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n let translatedValue;\n // field reference is either in form of array or string\n if (Array.isArray(fieldReference)) {\n translatedValue = translateArrayFormatDataReference(fieldReference);\n } else {\n translatedValue = translateDataReference(fieldReferenceStr);\n }\n\n // omit if translated value is not set\n if (translatedValue) {\n translatedOptions[key] = translatedValue;\n const convertedFormatterObject = convertFormatterToDSL(\n fieldReference as AdvancedEncodingConfig,\n key,\n translatedValue\n );\n\n if (convertedFormatterObject) {\n translatedOptions[key] = convertedFormatterObject.dsl;\n dynamicOptions.context[convertedFormatterObject.contextKey] =\n convertedFormatterObject.contextConfig;\n }\n }\n });\n dynamicOptions.options = translatedOptions;\n return dynamicOptions;\n};\n\nexport { encodingToDynamicOptionsDSL };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\n\n/**\n * map of splunk charting based @splunk/dashboard-visualization option names\n * to updated @splunk/visualization option names\n */\nconst optionRenames = {\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisLabelVisibility',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorUnit': 'xAxisMajorTickInterval',\n 'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisLabelsX.integerUnits': 'showRoundedXAxisLabels',\n 'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisLabelsX.axisVisibility': 'xAxisLineVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisLineVisibility',\n 'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',\n 'gridLinesX.showMajorLines': 'showXMajorGridLines',\n 'gridLinesY.showMajorLines': 'showYMajorGridLines',\n 'gridLinesX.showMinorLines': 'showXMinorGridLines',\n 'gridLinesY.showMinorLines': 'showYMinorGridLines',\n 'gridLinesY2.showMajorLines': 'showY2MajorGridLines',\n 'gridLinesY2.showMinorLines': 'showY2MinorGridLines',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.includeZero': 'showXAxisWithZero',\n 'axisY.includeZero': 'showYAxisWithZero',\n 'axisY2.includeZero': 'showY2AxisWithZero',\n 'axisLabelsX.extendsAxisRange': 'showXAxisExtendedRange',\n 'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',\n 'layout.splitSeries': 'showSplitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',\n 'axisY2.enabled': 'showOverlayY2Axis',\n 'axisY2.fields': 'y2Fields',\n 'chart.overlayFields': 'overlayFields',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendTruncation',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendDisplay',\n 'chart.nullValueMode': 'nullValueDisplay',\n 'chart.showDataLabels': 'dataValuesDisplay',\n fieldColors: 'seriesColorsByField',\n 'chart.resultTruncationLimit': 'resultLimit',\n 'chart.stackMode': 'stackMode',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.sliceCollapsingLabel': 'collapseLabel',\n 'chart.sliceCollapsingThreshold': 'collapseThreshold',\n hasDonutHole: 'showDonutHole',\n // area specific mapped options\n areaFillOpacity: 'areaOpacity',\n 'chart.showLines': 'showLines',\n // bubble specific mapped options\n 'chart.bubbleMinimumSize': 'bubbleSizeMin',\n 'chart.bubbleMaximumSize': 'bubbleSizeMax',\n 'chart.bubbleSizeBy': 'bubbleSizeMethod',\n // line specific mapped options\n fieldDashStyles: 'lineDashStylesByField',\n 'chart.showMarkers': 'markerDisplay',\n // scatter-specific options\n 'chart.markerSize': 'markerSize',\n};\n\nconst visibilityEnumReplacements = {\n visible: 'show',\n collapsed: 'hide',\n};\nconst modeEnumReplacements = {\n none: 'off',\n};\nconst abbreviationEnumReplacements = {\n none: 'auto',\n};\n/**\n * for some options the valid values changed.\n * this maps enum values that need to be changed\n */\nconst enumReplacements = {\n xAxisTitleVisibility: visibilityEnumReplacements,\n yAxisTitleVisibility: visibilityEnumReplacements,\n y2AxisTitleVisibility: visibilityEnumReplacements,\n xAxisAbbreviation: modeEnumReplacements,\n yAxisAbbreviation: abbreviationEnumReplacements,\n y2AxisAbbreviation: abbreviationEnumReplacements,\n dataValuesDisplay: modeEnumReplacements,\n legendDisplay: modeEnumReplacements,\n legendTruncation: {\n ellipsisNone: 'ellipsisOff',\n },\n stackMode: {\n default: 'auto',\n },\n};\n\n// splits a string with multiple fields separated by comma\n// returns the same value if it's already an array\nconst splitValue = (oldValue: string | string[]) =>\n Array.isArray(oldValue) ? oldValue : oldValue.split(',');\n\n/**\n * converts stringified objects into plain objects\n *\n * @param {string | Object} oldValue stringified object to parse\n * @returns {Object}\n */\nconst parseObjects = (oldValue: string | Record<string, unknown>): Record<string, unknown> => {\n if (typeof oldValue === 'object' && !Array.isArray(oldValue)) {\n return oldValue;\n }\n let nuValue = {};\n try {\n nuValue = JSON.parse(oldValue as string);\n } catch (e) {\n /* noop */\n }\n return nuValue;\n};\n\n/**\n * some option values require special processing\n * (e.g. if the type of the updated option changed)\n * \"legendLabels\": \"test,test2\" => \"legendLabels\": [\"test\", \"test2\"]\n */\nconst otherValueReplacements = {\n y2Fields: splitValue,\n overlayFields: splitValue,\n legendLabels: splitValue,\n seriesColorsByField: parseObjects,\n lineDashStylesByField: parseObjects,\n /**\n * the original markerDisplay was only exposed as `chart.showMarkers`\n * setting chart.showMarkers to true is the equivalent of `markerDisplay: 'outlined'`\n */\n markerDisplay: (oldValue: boolean) => {\n if (oldValue === false) return 'off';\n if (oldValue === true) return 'outlined';\n return oldValue;\n },\n};\n\n/**\n * migrateChartingOptions\n * - renames option keys\n * - checks if enum values have changed for new options, replaces it\n * - checks if other replacements are necessary and applies them\n * @param {object} options dashboard-viz charting options\n * @returns {object} migratedOptions viz charting options\n */\nconst migrateChartingOptions = (options: Record<string, unknown>): Record<string, unknown> => {\n const migratedOptions = {};\n Object.keys(options).forEach(key => {\n const value = options[key];\n const updatedKey = optionRenames[key] ?? key;\n let updatedValue = enumReplacements?.[updatedKey]?.[value] ?? value;\n if (otherValueReplacements[updatedKey]) {\n updatedValue = otherValueReplacements[updatedKey](updatedValue);\n }\n migratedOptions[updatedKey] = updatedValue;\n });\n return migratedOptions;\n};\n\n/**\n * helper that encapsulates shared migration logic across most charting-based viz\n * @param {Object} defaultChanges - map consisting of default value changes from viz.* to splunk.*\n * @param {Object} validOptions - the list of options that the new splunk.* viz supports\n * @param {VisualizationDefinition} vizDefinition - the viz definition to migrate\n * @param {String} vizType - the value of splunk.*\n */\nconst migrateBaseChartingVizDefinition = ({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType,\n}: {\n defaultChanges: Record<string, unknown>;\n validOptions: Record<string, unknown>;\n vizDefinition: VisualizationDefinition;\n vizType: string;\n}) => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: vizType,\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...defaultChanges,\n ...migrateChartingOptions(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateBaseChartingVizDefinition, migrateChartingOptions, otherValueReplacements };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { areaOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkArea = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.area',\n });\n\nexport { migrateVizToSplunkArea };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { barOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkBar = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bar',\n });\n\nexport { migrateVizToSplunkBar };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { bubbleOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkBubble = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bubble',\n });\n\nexport { migrateVizToSplunkBubble };\n", "\nimport * as defaultImport from \"@splunk/visualization-encoding/utils/dsl\";\nexport * from \"@splunk/visualization-encoding/utils/dsl\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { getDataSelectorsFromDSL } from '@splunk/visualization-encoding/utils/dsl';\n\n/**\n * Removes invalid keys in the options\n * @param currentOptions - Current visualization options\n * @param validOptions - Valid visualization option keys\n * @returns void\n */\nexport const removeInvalidOptions = (\n currentOptions: Record<string, unknown>,\n validOptions?: Record<string, unknown> | null\n): void => {\n if (!currentOptions || !validOptions) {\n return;\n }\n const copiedCurrOptions = currentOptions;\n Object.keys(copiedCurrOptions).forEach(key => {\n if (!(key in validOptions)) {\n delete copiedCurrOptions[key];\n }\n });\n};\n\n/**\n * Renames viz options by looking up their migration mapping\n * @param oldOptions - Current visualization options\n * @param optionRenames - Mapping of old options in viz.X to their migrated counterparts in splunk.X\n * @returns updatedOptions\n */\nexport const renameVizOptions = (\n oldOptions: Record<string, unknown>,\n optionRenames?: Record<string, string> | null\n): Record<string, unknown> => {\n const updatedOptions = {};\n\n if (!oldOptions) return {};\n if (!optionRenames) return oldOptions;\n\n Object.entries(oldOptions).forEach(([oldOptName, val]) => {\n const optionName = optionRenames[oldOptName] ?? oldOptName;\n updatedOptions[optionName] = val;\n });\n\n return updatedOptions;\n};\n\n/**\n * Appends appropriate series selector to DSL string to add viz-specific implicit logic\n * @param valueOption - the value of an option\n * @param selector - the selector to append\n * @returns string | void\n */\nexport const preserveDataSelectionForValueOption = (\n valueOption: unknown,\n selector: string\n): string | void => {\n if (valueOption) {\n // if the last data selector starts with seriesBy, append appropriate selector to it\n const dataSelectors = typeof valueOption === 'string' ? getDataSelectorsFromDSL(valueOption) : [];\n const lastDataSelector = dataSelectors[dataSelectors.length - 1];\n if (lastDataSelector.includes('seriesByIndex') || lastDataSelector.includes('seriesByName')) {\n return `${valueOption} | ${selector}`;\n }\n }\n\n return null;\n};\n\n/**\n * For all data options, calls preserveDataSelectionForValueOption with relevant selector and\n * updates dataOptions object\n * @param dataOptions - an object reflecting all data options\n * @param selector - the selector to append\n * @returns void\n */\nexport const addsDataSelectorToOptions = (\n dataOptions: Record<string, unknown>,\n selector: string\n): Record<string, unknown> => {\n const updatedDataOptions = {};\n\n Object.keys(dataOptions).forEach(key => {\n const statement = dataOptions[key] as string;\n const updatedDSL = preserveDataSelectionForValueOption(statement, selector);\n if (updatedDSL) {\n updatedDataOptions[key] = updatedDSL;\n } else {\n updatedDataOptions[key] = statement;\n }\n });\n\n return updatedDataOptions;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { choroplethSvgOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nconst optionRenames = {\n featureId: 'areaIds',\n value: 'areaValues',\n fill: 'areaColors',\n};\n\n// old default encoding configurations should be retained in migrated configuration\nconst defaultOptionChanges = {\n areaIds: '> primary | seriesByIndex(0)',\n areaValues: '> primary | seriesByIndex(1)',\n areaColors: '> primary | seriesByIndex(1) | gradient(fillGradientContext)',\n};\n\nconst defaultContextChanges = {\n fillGradientContext: {\n colors: ['#7EEFDA', '#6484F6', '#C093F9', '#293873'],\n },\n};\n\nexport const migrateVizToSplunkChoroplethSvg = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.choropleth.svg',\n options: {},\n context: {},\n };\n\n // add migrated option names and values\n const migratedOptions = { ...options };\n Object.keys(dataOptions).forEach(key => {\n const updatedKey = optionRenames[key] ?? key;\n migratedOptions[updatedKey] = dataOptions[key];\n });\n\n // update migrated options and context\n migratedDefinition.options = {\n ...defaultOptionChanges,\n ...migratedOptions,\n };\n\n migratedDefinition.context = encoding.fill ? dataContext : defaultContextChanges;\n\n // remove invalid options\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n return migratedDefinition;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { columnOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkColumn = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.column',\n });\n\nexport { migrateVizToSplunkColumn };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { ellipseOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions, addsDataSelectorToOptions } from '../utils/migrationUtils';\n\nconst optionsToRename = {\n fill: 'fillColor',\n stroke: 'strokeColor',\n strokeDasharray: 'strokeDashStyle',\n};\n\nexport const migrateVizToSplunkEllipse = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.ellipse',\n options,\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // To simulate the implicit logic in the shape parser that Ellipse utilizes, append\n // the lastPoint() DataSeries selector.\n const updatedDataOptions = addsDataSelectorToOptions(dataOptions, 'lastPoint()');\n\n migratedDefinition.options = { ...options, ...updatedDataOptions };\n\n // perform any option renaming\n migratedDefinition.options = renameVizOptions(migratedDefinition.options, optionsToRename);\n\n // remove invalid options from new definition\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n", "/**\n * Helper to convert old label and value options into consolidated labelDisplay and valueDisplay\n * If the `showOption` is explicitly false, then we return 'off'\n * If the `showOption` is undefined (which corresponds to a default of `true`), we return nothing to avoid conflating the viz definition (since this corresponds to `number` in the new display)\n * @param {Boolean} showOption - either one of `showLabel` or `showValue` in the old gauges\n * @param {Boolean} percentageOption - either one of `usePercentageRange` or `usePercentageValue` in the old gauges\n * @returns {String}\n */\nexport const consolidateDisplayOption = (showOption: boolean, percentageOption: boolean): string | void => {\n if (showOption === false) {\n return 'off';\n }\n if (percentageOption === true) {\n return 'percentage';\n }\n if (showOption === true) {\n return 'number';\n }\n // if showOption is undefined and percentageOption is false, we don't need to return an explicit value (since 'number' is passed in implicitly)\n return null;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { fillerGaugeOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { consolidateDisplayOption } from '../utils/gauges';\nimport {\n preserveDataSelectionForValueOption,\n removeInvalidOptions,\n renameVizOptions,\n} from '../utils/migrationUtils';\n\nconst optionRenames = {\n majorUnit: 'majorTickInterval',\n};\n\nconst previousRangeValueConfig = [\n { to: 10, value: '#5fbcff' },\n { from: 10, to: 30, value: '#4beba8' },\n { from: 30, to: 50, value: '#f4df7a' },\n { from: 50, to: 70, value: '#fc9850' },\n { from: 70, to: 100, value: '#ff7152' },\n];\n\nconst defaultChanges = {\n gaugeColor: '> value | rangeValue(gaugeColorRangeValueContext)',\n value: '> primary | seriesByIndex(0) | lastPoint()',\n};\n\nexport const migrateVizToSplunkFillerGauge = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.fillergauge',\n context: {},\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { options: encodingOptions, context: gaugeColorContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // if a viz.fillergauge receives an entire column for `value` (e.g. primary[0]), it will select the last value of the column\n // this contrasts with viz.markergauge (which takes the first point of the column)\n // this is due to differing behavior in the FillerGaugeParser, which explicitly retrieves the last point in a received array\n // https://cd.splunkdev.com/devplat/vision/-/blob/main/packages/visualization-encoding-parsers/src/FillerGaugeParser.js#L79\n const originalGaugeValue = encodingOptions.value;\n if (typeof originalGaugeValue === 'string') {\n encodingOptions.value =\n preserveDataSelectionForValueOption(originalGaugeValue, 'lastPoint()') ?? originalGaugeValue;\n }\n if (encodingOptions?.gaugeColor) {\n migratedVisualization.context = gaugeColorContext;\n } else {\n // preserve the default context if no gaugeColor encoding was configured\n migratedVisualization.context = {\n gaugeColorRangeValueContext: previousRangeValueConfig,\n };\n }\n\n const { showLabels, usePercentageRange, showValue, usePercentageValue } = options;\n const labelDisplay = consolidateDisplayOption(showLabels as boolean, usePercentageRange as boolean);\n const valueDisplay = consolidateDisplayOption(showValue as boolean, usePercentageValue as boolean);\n\n migratedVisualization.options = {\n ...defaultChanges,\n ...renamedOptions,\n ...encodingOptions,\n ...(typeof labelDisplay === 'string' && { labelDisplay }),\n ...(typeof valueDisplay === 'string' && { valueDisplay }),\n };\n\n // remove invalid options using the optionsSchema for splunk.fillergauge as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { lineOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\n// except for markerDisplay which migrates to the new default 'off'\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkLine = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.line',\n });\n\nexport { migrateVizToSplunkLine };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { imageOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nexport const migrateVizToSplunkImage = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = { options, ...otherDefinitionParts, type: 'splunk.image', context: {} };\n\n // remove invalid options using the optionsSchema for splunk.image as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markdownOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nexport const migrateVizToSplunkMarkdown = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = { options, ...otherDefinitionParts, type: 'splunk.markdown', context: {} };\n\n // remove invalid options using the optionsSchema for splunk.markdown as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markerGaugeOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n preserveDataSelectionForValueOption,\n removeInvalidOptions,\n renameVizOptions,\n} from '../utils/migrationUtils';\nimport { consolidateDisplayOption } from '../utils/gauges';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n gaugeRanges: [\n { from: 90, to: 100, value: '#CB3B43' },\n { from: 50, to: 90, value: '#F4DF7A' },\n { from: 0, to: 50, value: '#4BEBA8' },\n ],\n value: '> primary | seriesByIndex(0) | lastPoint()',\n};\n\nconst optionRenames = {\n majorUnit: 'majorTickInterval',\n ranges: 'gaugeRanges',\n};\n\nexport const migrateVizToSplunkMarkerGauge = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.markergauge',\n context: {},\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { options: dataOptions } = encodingToDynamicOptionsDSL(encoding as Record<string, EncodingConfig>);\n // viz.markergauge has behavior where if a column without a specific point (e.g. primary[1]) is selected,\n // the markerGauge will only display the first point of the column\n // the following logic accounts for this and appends firstPoint() to the DSL statement\n const originalGaugeValue = dataOptions.value;\n if (typeof originalGaugeValue === 'string') {\n dataOptions.value =\n preserveDataSelectionForValueOption(originalGaugeValue, 'firstPoint()') ?? originalGaugeValue;\n }\n\n const { showLabels, usePercentageRange, showValue, usePercentageValue } = renamedOptions;\n const labelDisplay = consolidateDisplayOption(showLabels as boolean, usePercentageRange as boolean);\n const valueDisplay = consolidateDisplayOption(showValue as boolean, usePercentageValue as boolean);\n\n migratedVisualization.options = {\n ...defaultChanges,\n ...renamedOptions,\n ...dataOptions,\n ...(typeof labelDisplay === 'string' && { labelDisplay }),\n ...(typeof valueDisplay === 'string' && { valueDisplay }),\n };\n\n // remove invalid options using the optionsSchema for splunk.markergauge as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { pieOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions, otherValueReplacements } from './splunk-charting';\n\nconst migratePieChartLabelAndPercent = (options: Record<string, unknown>): Record<string, string> => {\n // if neither chart.showLabels or chart.showPercent is specified in viz.pie,\n // splunk.pie use the default labelDisplay value\n if (!('chart.showLabels' in options) && !('chart.showPercent' in options)) {\n return {};\n }\n\n // if only chart.showPercent is specified in viz.pie\n if (!('chart.showLabels' in options) && 'chart.showPercent' in options) {\n return { labelDisplay: options['chart.showPercent'] ? 'valuesAndPercentage' : 'values' };\n }\n\n // if only chart.showLabels is specified in viz.pie\n if ('chart.showLabels' in options && !('chart.showPercent' in options)) {\n return { labelDisplay: options['chart.showLabels'] ? 'values' : 'off' };\n }\n\n // if both chart.showLabels and chart.showPercent are specified in viz.pie\n const labelOption = {\n labelDisplay: 'values',\n };\n if (options['chart.showLabels'] && options['chart.showPercent']) {\n labelOption.labelDisplay = 'valuesAndPercentage';\n }\n if (!options['chart.showLabels']) {\n labelOption.labelDisplay = 'off';\n }\n\n return labelOption;\n};\n\n// retain the pie position when converting viz.pie to splunk.pie - SCP-48658\nconst migrateDonutChart = (options: Record<string, unknown>): Record<string, string> => {\n if (options.hasDonutHole) {\n if (options['legend.placement'] === 'none') {\n return { labelDisplay: 'off' };\n }\n return { labelDisplay: 'values' };\n }\n return {};\n};\n\nconst migrateFieldColors = (options: Record<string, any>): Record<string, any> => {\n if ('fieldColors' in options) {\n return {\n seriesColorsByField: otherValueReplacements.seriesColorsByField(options.fieldColors),\n };\n }\n return {};\n};\n\nconst migrateVizToSplunkPie = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.pie',\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...migratePieChartLabelAndPercent(options),\n ...migrateChartingOptions(options),\n ...migrateFieldColors(options),\n ...migrateDonutChart(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkPie };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { scatterOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkScatter = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.scatter',\n });\n\nexport { migrateVizToSplunkScatter };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { rectangleOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions, addsDataSelectorToOptions } from '../utils/migrationUtils';\n\nconst optionsToRename = {\n fill: 'fillColor',\n stroke: 'strokeColor',\n strokeDasharray: 'strokeDashStyle',\n strokeLinejoin: 'strokeJoinStyle',\n};\n\nconst migrateVizToSplunkRectangle = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.rectangle',\n options: {},\n context: {},\n };\n\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // To simulate the implicit logic in the shape parser that Rectangle utilizes, append\n // the lastPoint() DataSeries selector.\n const updatedDataOptions = addsDataSelectorToOptions(dataOptions, 'lastPoint()');\n\n migratedDefinition.options = { ...options, ...updatedDataOptions };\n\n // perform option rename\n migratedDefinition.options = renameVizOptions(migratedDefinition.options, optionsToRename);\n\n // remove invalid options, validOptions is taken from the config.optionsSchema\n removeInvalidOptions(migratedDefinition.options, validOptions);\n migratedDefinition.context = dataContext;\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkRectangle };\n", "/**\n * Helper function to consolidate `trendDisplayMode` - percent/absolute\n * and `showTrendIndicator` - true/false into `trendDisplay` - off/percent/absolute for Single Value Variations\n * 1. if `showTrendIndicator` is explicitly false, `trendDisplay` is off\n * 2. if `showTrendIndicator` is undefined (defaults to true), return `trendDisplayMode` value if present\n * 3. if `showTrendIndicator` is explicitly true, return 'absolute'\n * 4. if both the old options are undefined, return nothing as their defaults (true and `absolute`)\n * correspond to `trendDisplay` default - absolute\n */\nexport const consolidateTrendDisplay = (\n trendDisplayMode: string,\n showTrendIndicator: boolean\n): string | void => {\n if (showTrendIndicator === false) {\n return 'off';\n }\n if (['absolute', 'percent'].includes(trendDisplayMode)) {\n return trendDisplayMode;\n }\n if (showTrendIndicator === true) {\n return 'absolute';\n }\n return null;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\n// old default configurations should be retained in migrated configuration\nconst defaultsToRetain = {\n showSparklineAreaGraph: false,\n sparklineValues: '> primary | seriesByTypes(\"number\", \"string\")',\n};\n\nconst optionRenames = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n sparklineAreaGraph: 'showSparklineAreaGraph',\n sparklineFillColor: 'sparklineAreaColor',\n sparklineAcceptNullData: 'shouldSparklineAcceptNullData',\n deltaFontSize: 'trendFontSize',\n};\n\n/**\n * Helper function to consolidate `sparklinePosition` - before/after/below\n * and `showSparkline` - true/false into `sparklineDisplay` - off/before/after/below\n * 1. if `showSparkline` is explicitly false, `sparklineDisplay` is off\n * 2. if `showSparkline` is undefined (defaults to true), return `sparklinePosition` value if present\n * 3. if `showSparkline` is explicitly true, return 'below'\n * 4. if both the old options are undefined, return nothing as their defaults (true and `below`)\n * correspond to `sparklineDisplay` default - below\n */\nconst consolidateSparklineDisplay = (sparklinePosition: string, showSparkline: boolean): string | void => {\n if (showSparkline === false) {\n return 'off';\n }\n if (['before', 'after', 'below'].includes(sparklinePosition)) {\n return sparklinePosition;\n }\n if (showSparkline === true) {\n return 'below';\n }\n return null;\n};\n\nexport const migrateVizToSplunkSingleValue = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalue',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDataOptions = {\n /**\n * in splunk.singlevalue, since we have the defaults\n * trendValue: '> sparklineValues|delta(-2)'\n * majorValue: '> sparklineValues|lastPoint()'\n * computing sparklineValues DSL from trend encoding should be sufficient\n */\n ...(dataOptions?.trend && { sparklineValues: dataOptions.trend }),\n ...(dataOptions?.majorColor && {\n majorColor:\n preserveDataSelectionForValueOption(dataOptions.majorColor as string, 'lastPoint()') ??\n dataOptions.majorColor,\n }),\n ...(dataOptions?.deltaColor && {\n trendColor:\n preserveDataSelectionForValueOption(dataOptions.deltaColor as string, 'lastPoint()') ??\n dataOptions.deltaColor,\n }),\n ...(dataOptions?.fill && {\n backgroundColor:\n preserveDataSelectionForValueOption(dataOptions.fill as string, 'lastPoint()') ??\n dataOptions.fill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { trendDisplayMode, showTrendIndicator, showSparkline, sparklinePosition } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n const sparklineDisplay = consolidateSparklineDisplay(\n sparklinePosition as string,\n showSparkline as boolean\n );\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n ...(typeof sparklineDisplay === 'string' && { sparklineDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalue as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueIconOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\nconst defaultsToRetain = {\n majorValue: '> primary | seriesByIndex(0) | lastPoint()',\n trendValue: '> primary | seriesByIndex(0) | delta(-2)',\n};\n\nconst optionsToRename = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n deltaColor: 'trendColor',\n color: 'iconColor',\n};\n\nexport const migrateVizToSplunkSingleValueIcon = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalueicon',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDataOptions = {\n ...(dataOptions?.trend && {\n majorValue:\n preserveDataSelectionForValueOption(dataOptions.trend as string, 'lastPoint()') ??\n dataOptions.trend,\n trendValue:\n preserveDataSelectionForValueOption(dataOptions.trend as string, 'delta(-2)') ??\n dataOptions.trend,\n }),\n ...(dataOptions?.fill && {\n backgroundColor:\n preserveDataSelectionForValueOption(dataOptions.fill as string, 'lastPoint()') ??\n dataOptions.fill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionsToRename);\n\n const { trendDisplayMode, showTrendIndicator } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalueicon as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueRadialOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\n// old default configurations should be retained in migrated configuration\nconst defaultsToRetain = {\n majorValue: '> primary | seriesByIndex(0) | lastPoint()',\n trendValue: '> primary | seriesByIndex(0) | delta(-2)',\n};\n\nconst optionRenames = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n};\n\nexport const migrateVizToSplunkSingleValueRadial = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalueradial',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n const { trend: originalTrend, fill: originalFill } = dataOptions;\n\n const migratedDataOptions = {\n ...(originalTrend && {\n majorValue: preserveDataSelectionForValueOption(originalTrend, 'lastPoint()') ?? originalTrend,\n trendValue: preserveDataSelectionForValueOption(originalTrend, 'delta(-2)') ?? originalTrend,\n }),\n ...(originalFill && {\n backgroundColor: preserveDataSelectionForValueOption(originalFill, 'lastPoint()') ?? originalFill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { trendDisplayMode, showTrendIndicator } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalueradial as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides\";\nexport * from \"@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { isEmpty, set } from 'lodash';\nimport type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { tableOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { deepMergeWithArrayPrimitiveOverrides } from '@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { renameVizOptions } from '../utils/migrationUtils';\n\ninterface CellFormatting {\n numberPrecision?: number;\n unit?: string;\n unitPosition?: string;\n useThousandSeparators?: boolean;\n}\n\ninterface VizTableFormattingOpts {\n headerTextColor?: string;\n headerBackgroundColor?: string;\n numberPrecision?: number;\n rowBackgroundColorEven?: string;\n rowBackgroundColorOdd?: string;\n rowTextColorOdd?: string;\n rowTextColorEven?: string;\n unit?: string;\n unitPosition?: string;\n useThousandSeparators?: boolean;\n}\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n count: 20,\n};\n\nconst optionRenames = {\n rowNumbers: 'showRowNumbers',\n};\n\nconst migrateHeaderVisibility = (oldHeaderVisibility: boolean): string => {\n if (oldHeaderVisibility === undefined) {\n // headerVisibility: 'inline' is the default in splunk.table\n // this corresponds to `showHeader: true`, which is the default in viz.table\n return undefined;\n }\n return oldHeaderVisibility ? 'inline' : 'none';\n};\n\ninterface Colors {\n oddColor?: string;\n evenColor?: string;\n}\n\n/**\n * Helper to migrate alternating color options (text and background) to their corresponding DSL and context configs\n */\nconst migrateAlternatingColors = (\n colors: Colors,\n optionToConvert: string,\n contextConfigName: string\n): {\n contextConfigName?: string;\n context?: string[];\n dsl?: string;\n} => {\n // default alternating themed color values as defined in table config\n const themedAlternatingColors = {\n rowBackgroundColors: {\n even: '> themes.rowBackgroundColorEven',\n odd: '> themes.rowBackgroundColorOdd',\n },\n rowColors: {\n even: '> themes.inverseTextColor',\n odd: '> themes.textColor',\n },\n };\n const colorsContext: string[] = [];\n const { oddColor, evenColor } = colors;\n if (oddColor && evenColor) {\n colorsContext.push(...[oddColor, evenColor]);\n } else if (oddColor) {\n colorsContext.push(...[oddColor, themedAlternatingColors[optionToConvert].even]);\n } else if (evenColor) {\n colorsContext.push(...[themedAlternatingColors[optionToConvert].odd, evenColor]);\n }\n\n if (colorsContext.length) {\n return {\n contextConfigName,\n context: colorsContext,\n dsl: `> table | pick(${contextConfigName})`,\n };\n }\n\n return {};\n};\n\n/**\n * Intermediate helper to translate column-specific formatting in viz.table to their DSL equivalents\n * viz.table defines column-specific formatting via entries specified in options.fields.<columnName>\n *\n * This requires moving numberPrecision, useThousandSeparators, unitPosition, and other formatting options to the config\n * The resultant config is used as the argument for formatByType\n */\nconst migrateToColumnFormat = (\n fieldsOption: Record<string, CellFormatting>\n): {\n columnFormat: Record<string, unknown>;\n columnFormatContext: Record<string, unknown>;\n} => {\n const columnFormat: Record<string, unknown> = {};\n const columnFormatContext: Record<string, unknown> = {};\n\n if (!fieldsOption) {\n return {\n columnFormat,\n columnFormatContext,\n };\n }\n\n Object.entries(fieldsOption).forEach(([column, formatting]) => {\n // need to prepend `formatted` in case the column has leading digits, which the nearley parser cannot account for\n const contextEntry = `formatted${column}Config`;\n columnFormatContext[contextEntry] = {};\n columnFormat[column] = {\n data: `> table | seriesByName(\"${column}\") | formatByType(${contextEntry})`,\n };\n\n // all columnFormatting options are optional; if they are not present in the original config, tableFormat should take precedence\n const { unit, unitPosition, numberPrecision, useThousandSeparators } = formatting;\n if (typeof unitPosition === 'string') {\n set(columnFormatContext, [contextEntry, 'number', 'unitPosition'], unitPosition);\n set(columnFormatContext, [contextEntry, 'string', 'unitPosition'], unitPosition);\n }\n if (typeof unit === 'string' || typeof unit === 'number') {\n set(columnFormatContext, [contextEntry, 'number', 'unit'], unit);\n set(columnFormatContext, [contextEntry, 'string', 'unit'], unit);\n }\n if (numberPrecision != null) {\n set(columnFormatContext, [contextEntry, 'number', 'precision'], numberPrecision);\n }\n if (useThousandSeparators != null) {\n set(columnFormatContext, [contextEntry, 'number', 'thousandSeparated'], useThousandSeparators);\n }\n });\n\n return {\n columnFormat,\n columnFormatContext,\n };\n};\n\n/**\n * Intermediate helper to translate table-wide formatting and coloring in viz.table to their DSL equivalents\n *\n * This requires moving numberPrecision, useThousandSeparators, unitPosition, and other formatting/coloring options to the config\n * The resultant formatting and coloring config is used as the argument for the formatByType() and pick() DSL formatters respectively\n */\nconst migrateToTableFormat = (\n oldOptions: VizTableFormattingOpts = {}\n): {\n tableFormat: Record<string, unknown>;\n tableFormatContext: Record<string, unknown>;\n} => {\n const tableFormat: Record<string, unknown> = {};\n const tableFormatContext: Record<string, unknown> = {\n formattedConfig: {},\n };\n\n const {\n unit,\n unitPosition: oldUnitPosition,\n numberPrecision: oldNumberPrecision,\n useThousandSeparators: oldUseThousandSeparators,\n } = oldOptions;\n const unitPosition = typeof oldUnitPosition === 'string' ? oldUnitPosition : 'after';\n const numberPrecision = typeof oldNumberPrecision === 'number' ? oldNumberPrecision : 0;\n const useThousandSeparators =\n typeof oldUseThousandSeparators === 'boolean' ? oldUseThousandSeparators : false;\n\n set(tableFormatContext, ['formattedConfig', 'number', 'precision'], numberPrecision);\n set(tableFormatContext, ['formattedConfig', 'number', 'thousandSeparated'], useThousandSeparators);\n set(tableFormatContext, ['formattedConfig', 'number', 'unitPosition'], unitPosition);\n set(tableFormatContext, ['formattedConfig', 'string', 'unitPosition'], unitPosition);\n if (typeof unit === 'string' || typeof unit === 'number') {\n set(tableFormatContext, ['formattedConfig', 'number', 'unit'], unit);\n set(tableFormatContext, ['formattedConfig', 'string', 'unit'], unit);\n }\n\n tableFormat.data = `> table | formatByType(formattedConfig)`;\n\n const {\n rowBackgroundColorEven,\n rowBackgroundColorOdd,\n rowTextColorOdd,\n rowTextColorEven,\n headerTextColor,\n headerBackgroundColor,\n } = oldOptions;\n\n const { context: rowColorsContext, dsl: rowColorsDSL } = migrateAlternatingColors(\n { oddColor: rowTextColorOdd, evenColor: rowTextColorEven },\n 'rowColors',\n 'rowColorsConfig'\n );\n if (rowColorsContext && rowColorsDSL) {\n tableFormatContext.rowColorsConfig = rowColorsContext;\n tableFormat.rowColors = rowColorsDSL;\n }\n\n const { context: rowBackgroundColorsContext, dsl: rowBackgroundColorsDSL } = migrateAlternatingColors(\n { oddColor: rowBackgroundColorOdd, evenColor: rowBackgroundColorEven },\n 'rowBackgroundColors',\n 'rowBackgroundColorsConfig'\n );\n if (rowBackgroundColorsContext && rowBackgroundColorsDSL) {\n tableFormat.rowBackgroundColors = rowBackgroundColorsDSL;\n tableFormatContext.rowBackgroundColorsConfig = rowBackgroundColorsContext;\n }\n if (headerTextColor) {\n tableFormat.headerColor = headerTextColor;\n }\n if (headerBackgroundColor) {\n tableFormat.headerBackgroundColor = headerBackgroundColor;\n }\n\n return {\n tableFormat,\n tableFormatContext,\n };\n};\n\nconst migrateVizToSplunkTable = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.table',\n options: {},\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n const headerVisibility = migrateHeaderVisibility(renamedOptions.showHeader as boolean);\n const { tableFormat, tableFormatContext } = migrateToTableFormat(renamedOptions);\n const { columnFormat, columnFormatContext } = migrateToColumnFormat(\n renamedOptions.fields as Record<string, CellFormatting>\n );\n const migratedDataOptions = {\n ...(dataOptions?.columns && { table: dataOptions.columns }),\n };\n const formattingOptions = {\n ...(!isEmpty(columnFormat) && { columnFormat }),\n ...(typeof headerVisibility === 'string' && { headerVisibility }),\n tableFormat,\n };\n const migratedOptions = deepMergeWithArrayPrimitiveOverrides(\n {},\n defaultChanges,\n formattingOptions,\n migratedDataOptions,\n renamedOptions\n );\n\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n\n migratedDefinition.context = {\n ...dataContext,\n // columnFormat is optional, but tableFormat is required all cases to preserve some viz.table behavior\n ...(!isEmpty(columnFormatContext) && { ...columnFormatContext }),\n ...tableFormatContext,\n };\n migratedDefinition.options = migratedOptions;\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkTable };\n", "import * as _ from 'lodash';\nimport type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markdownOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { renameVizOptions, removeInvalidOptions } from '../utils/migrationUtils';\n\ntype FontWeight = 'normal' | 'bold' | 'light';\n\nconst optionsToRename = {\n textColor: 'fontColor',\n content: 'markdown',\n};\n\nconst convertTextContentToMarkDown = (fontWeight: FontWeight, fontSize: number, textContent = ''): string => {\n if (!_.isNumber(fontSize)) {\n return textContent;\n }\n if (textContent.trim().length === 0) {\n return textContent;\n }\n // Remove any trailing newline chars from the content\n let markdownContent = textContent.replace(/\\n*$/, '');\n // Handle text conversion to marker tags based on fontSize and fontWeight\n const regex = /\\n/g; // regex to match /n with global scope across the string\n\n // Convert to paragraph in markdown, if fontSize < 20,\n // If text has fontWeight set to 'bold', add bold tag (**{markdown}**)\n if (fontWeight === 'bold') {\n // Here direct regex replace doesnt work, as we need to remove the\n // extra trailing space if any exist before appending **{markdown}** to the text\n const contentStrings = markdownContent.split('\\n');\n const stringsTrimmed = contentStrings.map(str =>\n str && str.trim().length ? `**${str.trim()}**` : ''\n );\n // Remove all blank entries from the end of the trimmed string array,\n // to avoid `\\` to get rendered, which happens if following line after `\\\\n` is empty)\n let idx = stringsTrimmed.length - 1;\n while (idx >= 0 && stringsTrimmed[idx].length === 0) {\n stringsTrimmed.pop();\n idx -= 1;\n }\n return stringsTrimmed.join('\\\\\\n');\n }\n // If fontWeight is not bold, replace '\\n' with '\\\\n` using regex\n markdownContent = markdownContent.replace(regex, '\\\\\\n');\n return markdownContent;\n};\n\nexport const convertFontSize = (fontSize: number): { fontSize: string; customFontSize?: number } => {\n if (!_.isNumber(fontSize)) {\n return { fontSize: 'default' };\n }\n return { fontSize: 'custom', customFontSize: fontSize };\n};\n\nexport const migrateVizTextToSplunkMarkdown = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const {\n fontSize = 24,\n fontWeight = 'normal',\n fontFamily = 'Splunk Platform Sans',\n rotation = 0,\n } = options;\n const migratedVisualization = { options, ...otherDefinitionParts, type: 'splunk.markdown', context: {} };\n\n // perform any option renames\n migratedVisualization.options = renameVizOptions(migratedVisualization.options, optionsToRename);\n const migratedVizOptions = migratedVisualization.options;\n\n // convert text content to respective markdown\n migratedVizOptions.markdown = convertTextContentToMarkDown(\n fontWeight as FontWeight,\n fontSize as number,\n migratedVizOptions.markdown as string\n );\n // convert text fontSize to markdown fontSize\n const { fontSize: fontSizeValue, customFontSize } = convertFontSize(fontSize as number);\n migratedVizOptions.fontSize = fontSizeValue;\n migratedVizOptions.customFontSize = customFontSize;\n migratedVizOptions.fontFamily = fontFamily;\n migratedVizOptions.rotation = rotation;\n\n // remove invalid options using the optionsSchema for splunk.markdown as reference\n removeInvalidOptions(migratedVizOptions, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { punchcardOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions } from '../utils/migrationUtils';\n\nconst defaultContext = {\n bubbleColorConfig: {\n colors: ['rgba(123,86,219,0.4)', 'rgba(123,86,219,1)'],\n },\n};\n\nconst optionsToRename = {\n showBubbleLabels: 'bubbleLabelDisplay',\n bubbleScale: 'bubbleSizeMethod',\n isBubbleSizeDynamic: 'showDynamicBubbleSize',\n maxBubbleRadius: 'bubbleRadiusMax',\n minBubbleRadius: 'bubbleRadiusMin',\n maxBubbleSize: 'bubbleSizeMax',\n minBubbleSize: 'bubbleSizeMin',\n showLegend: 'legendDisplay',\n useDefaultSort: 'showDefaultSort',\n};\n\nconst consolidateLegendDisplay = (vizOptions: Record<string, unknown>): void => {\n if (!vizOptions) {\n return;\n }\n const options = vizOptions;\n if (options.legendDisplay) {\n options.legendDisplay = 'right';\n } else if (options.legendDisplay === false) {\n options.legendDisplay = 'off'; // legenddisplay set explicitly to false\n }\n};\n\nconst consolidateBubbleLabelDisplay = (vizOptions: Record<string, unknown>): void => {\n if (!vizOptions) {\n return;\n }\n const options = vizOptions;\n if (options.bubbleLabelDisplay === 'none') {\n options.bubbleLabelDisplay = 'off';\n }\n};\n\n// Updates the first color of the bubbleColorConfig with the minBubbleColorIntensity\nconst convertGradientConfig = (\n minBubbleColorIntensity: number,\n defaultBubbleColorConfig: Record<string, unknown>\n): Record<string, unknown> => {\n if (\n !defaultBubbleColorConfig ||\n !defaultBubbleColorConfig.colors ||\n !defaultBubbleColorConfig.colors[0] ||\n typeof minBubbleColorIntensity !== 'number'\n ) {\n return null;\n }\n const firstColor = defaultBubbleColorConfig.colors[0] as string;\n const firstColorUpdated = `${firstColor.substring(\n 0,\n firstColor.lastIndexOf(',')\n )},${minBubbleColorIntensity})`;\n const colors = [...(defaultBubbleColorConfig.colors as Array<string>)];\n colors[0] = firstColorUpdated;\n const bubbleColorConfigUpdated = { ...defaultBubbleColorConfig, colors };\n return bubbleColorConfigUpdated;\n};\n\nconst convertColorModeOption = (visualizationDefinition: VisualizationDefinition): void => {\n const visualizationDef = visualizationDefinition;\n if (!visualizationDef || !visualizationDef.options) {\n return;\n }\n\n // Rename the colorMode option from 'sequential' to 'dynamic' if specified\n if (visualizationDef.options.colorMode === 'sequential') {\n visualizationDef.options.colorMode = 'dynamic';\n }\n\n // If no colorMode was specified the default in viz.punchcard used to be 'categorical'.\n // But in splunk.punchcard default is 'dynamic', we need to preserve the original default.\n // Set colorMode to 'categorical' if no colorMode was specified in viz\n if (!visualizationDef.options.colorMode) {\n visualizationDef.options.colorMode = 'categorical';\n }\n\n const { minBubbleColorIntensity } = visualizationDef.options;\n // If there is no category option set or if the colorMode is not categorical, then the colorMode will to 'dynamic'\n // In both cases we need to update the gradient config bubbleColorConfig with the minBubbleColorIntensity for first color\n if (\n (!visualizationDef.options.category || visualizationDef.options.colorMode !== 'categorical') &&\n minBubbleColorIntensity &&\n typeof minBubbleColorIntensity === 'number'\n ) {\n const bubbleColorConfig = convertGradientConfig(\n minBubbleColorIntensity,\n defaultContext.bubbleColorConfig\n );\n if (bubbleColorConfig) {\n visualizationDef.context = { ...visualizationDef.context, bubbleColorConfig };\n }\n }\n};\n\nexport const migrateVizToSplunkPunchcard = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = { options, ...otherDefinitionParts, type: 'splunk.punchcard', context: {} };\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n // perform any option renames\n const renamedOptions = renameVizOptions(migratedVisualization.options, optionsToRename);\n\n consolidateLegendDisplay(renamedOptions);\n consolidateBubbleLabelDisplay(renamedOptions);\n\n migratedVisualization.options = {\n ...renamedOptions,\n ...dataOptions,\n };\n migratedVisualization.context = dataContext;\n\n convertColorModeOption(migratedVisualization);\n // remove invalid options using the optionsSchema for splunk.punchcard as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { mapOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { removeInvalidOptions, renameVizOptions } from '../utils/migrationUtils';\n\nconst optionRenames = {\n fillColor: 'choroplethEmptyAreaColor',\n strokeColor: 'choroplethStrokeColor',\n featureId: 'areaIds',\n fill: 'dataColors',\n value: 'areaValues',\n};\n\nconst defaultContextChanges = {\n fillGradientContext: {\n colors: '> themes.defaultGradientMigrationConfig',\n },\n};\n\nexport const defaultStrokeColor = '#689C8D';\nexport const defaultEmptyAreaColor = '#EAEFF2';\n\nexport const migrateVizToSplunkMapChoropleth = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.map',\n options: {},\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const dynamicOptions = renameVizOptions(dataOptions, optionRenames);\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n if (!('dataColors' in dynamicOptions)) {\n Object.assign(dynamicOptions, {\n dataColors: '> areaValues | gradient(fillGradientContext)',\n });\n }\n\n let { choroplethEmptyAreaColor, choroplethStrokeColor } = renamedOptions;\n const { source } = renamedOptions;\n\n const layerOptions = ['choroplethEmptyAreaColor', 'choroplethStrokeColor', 'source'];\n\n const renamedOptionsFiltered = Object.keys(renamedOptions)\n .filter(key => !layerOptions.includes(key))\n .reduce((obj, key) => {\n /* eslint-disable-next-line no-param-reassign */\n obj[key] = renamedOptions[key];\n return obj;\n }, {});\n\n /* migrate default strokeColor in viz.geojson to either the backgroundColor if configured and non-transparent or defaultBackgroundColor in splunk.map */\n if (choroplethStrokeColor === defaultStrokeColor && choroplethEmptyAreaColor !== 'transparent') {\n if ('backgroundColor' in renamedOptionsFiltered) {\n /* eslint-disable-next-line dot-notation */\n if (renamedOptionsFiltered['backgroundColor'] !== 'transparent') {\n /* eslint-disable-next-line dot-notation */\n choroplethStrokeColor = renamedOptionsFiltered['backgroundColor'];\n } else {\n choroplethStrokeColor = '> themes.defaultBackgroundColor';\n }\n } else {\n choroplethStrokeColor = '> themes.defaultBackgroundColor';\n }\n }\n\n if (choroplethEmptyAreaColor === defaultEmptyAreaColor) {\n choroplethEmptyAreaColor = '> themes.defaultChoroplethEmptyAreaColor';\n }\n\n // update migrated options and context\n migratedDefinition.options = {\n ...renamedOptionsFiltered,\n layers: [\n {\n type: 'choropleth',\n source,\n ...dynamicOptions,\n choroplethEmptyAreaColor,\n choroplethStrokeColor,\n choroplethOpacity: 1.0,\n },\n ],\n showScale: false,\n showBaseLayer: false,\n showZoomControls: false,\n };\n\n if (vizDefinition.type === 'viz.geojson.us') {\n migratedDefinition.options.center = [39.83, -97];\n migratedDefinition.options.zoom = 3;\n } else {\n migratedDefinition.options.center = [46.56, 10.35];\n migratedDefinition.options.zoom = 0;\n }\n\n migratedDefinition.context = encoding.fill ? dataContext : defaultContextChanges;\n\n if (\n JSON.stringify(dataContext) ===\n JSON.stringify({\n fillGradientContext: {},\n })\n ) {\n Object.assign(migratedDefinition, {\n context: defaultContextChanges,\n });\n }\n\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n return migratedDefinition;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport {\n migrateVizToSplunkArea,\n migrateVizToSplunkBar,\n migrateVizToSplunkBubble,\n migrateVizToSplunkChoroplethSvg,\n migrateVizToSplunkColumn,\n migrateVizToSplunkFillerGauge,\n migrateVizToSplunkLine,\n migrateVizToSplunkImage,\n migrateVizToSplunkMarkdown,\n migrateVizToSplunkMarkerGauge,\n migrateVizToSplunkPie,\n migrateVizToSplunkRectangle,\n migrateVizToSplunkSingleValue,\n migrateVizToSplunkSingleValueIcon,\n migrateVizToSplunkSingleValueRadial,\n migrateVizToSplunkScatter,\n migrateVizToSplunkTable,\n migrateVizTextToSplunkMarkdown,\n migrateVizToSplunkEllipse,\n migrateVizToSplunkPunchcard,\n migrateVizToSplunkMapChoropleth,\n} from './visualizations';\n\nconst supportedMigrations = {\n 'viz.area': {\n 'splunk.area': migrateVizToSplunkArea,\n },\n 'viz.bar': {\n 'splunk.bar': migrateVizToSplunkBar,\n },\n 'viz.bubble': {\n 'splunk.bubble': migrateVizToSplunkBubble,\n },\n 'viz.column': {\n 'splunk.column': migrateVizToSplunkColumn,\n },\n 'viz.choropleth.svg': {\n 'splunk.choropleth.svg': migrateVizToSplunkChoroplethSvg,\n },\n 'viz.geojson.us': {\n 'splunk.map': migrateVizToSplunkMapChoropleth,\n },\n 'viz.geojson.world': {\n 'splunk.map': migrateVizToSplunkMapChoropleth,\n },\n 'viz.ellipse': {\n 'splunk.ellipse': migrateVizToSplunkEllipse,\n },\n 'viz.fillergauge': {\n 'splunk.fillergauge': migrateVizToSplunkFillerGauge,\n },\n 'viz.line': {\n 'splunk.line': migrateVizToSplunkLine,\n },\n 'viz.img': {\n 'splunk.image': migrateVizToSplunkImage,\n },\n 'viz.markdown': {\n 'splunk.markdown': migrateVizToSplunkMarkdown,\n },\n 'viz.markergauge': {\n 'splunk.markergauge': migrateVizToSplunkMarkerGauge,\n },\n 'viz.pie': {\n 'splunk.pie': migrateVizToSplunkPie,\n },\n 'viz.rectangle': {\n 'splunk.rectangle': migrateVizToSplunkRectangle,\n },\n 'viz.singlevalue': {\n 'splunk.singlevalue': migrateVizToSplunkSingleValue,\n },\n 'viz.singlevalueicon': {\n 'splunk.singlevalueicon': migrateVizToSplunkSingleValueIcon,\n },\n 'viz.singlevalueradial': {\n 'splunk.singlevalueradial': migrateVizToSplunkSingleValueRadial,\n },\n 'viz.scatter': {\n 'splunk.scatter': migrateVizToSplunkScatter,\n },\n 'viz.table': {\n 'splunk.table': migrateVizToSplunkTable,\n },\n 'viz.text': {\n 'splunk.markdown': migrateVizTextToSplunkMarkdown,\n },\n 'viz.punchcard': {\n 'splunk.punchcard': migrateVizToSplunkPunchcard,\n },\n};\n\nconst inferToType = (typeFromDefinition: string): string => {\n if (typeFromDefinition === 'viz.img') {\n return 'splunk.image';\n }\n if (typeFromDefinition === 'viz.text') {\n return 'splunk.markdown';\n }\n\n if (typeFromDefinition === 'viz.geojson.us' || typeFromDefinition === 'viz.geojson.world') {\n return 'splunk.map';\n }\n return typeFromDefinition.replace(/^viz\\./, 'splunk.');\n};\n\ninterface MigrationParams {\n definition: VisualizationDefinition;\n toType?: string;\n}\n\nconst migrate = ({ definition, toType: toTypeFromParams }: MigrationParams): VisualizationDefinition => {\n const toType = toTypeFromParams ?? inferToType(definition.type);\n if (!supportedMigrations?.[definition?.type]?.[toType]) {\n throw new Error('Migration currently not supported');\n }\n return supportedMigrations[definition.type][toType](definition);\n};\n\ninterface CanMigrateParams {\n fromType: string;\n toType: string;\n}\n\nconst canMigrate = ({ fromType, toType }: CanMigrateParams): boolean => {\n if (supportedMigrations?.[fromType]?.[toType]) {\n return true;\n }\n return false;\n};\n\nexport { migrate, canMigrate, inferToType };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,gCAAc;AACd,IAAO,sBAAS,aAAaA,iBAA8B,yBAAUA;;;ACKrE,IAAM,iBAAiB;AAGvB,IAAM,gBAAgB;AActB,IAAM,wBAAwB,SAAO,eAAe,KAAK,GAAG;AAC5D,IAAM,uBAAuB,SAAO,cAAc,KAAK,GAAG;AAQ1D,IAAM,wBAAwB,CAC1B,gBACA,KACA,oBACmC;AAtCvC;AAuCI,WAAQ,sDAAgB,WAAhB,mBAAwB,MAAM;AAAA,IAClC,KAAK;AACD,aAAO;AAAA,QACH,eAAe,kCACP,MAAM,SAAQ,oBAAe,WAAf,mBAAuB,MAAM,KAAK;AAAA,UAChD,OAAO,CAAC,GAAG,eAAe,OAAO,MAAM;AAAA,QAC3C,IACI,MAAM,SAAQ,oBAAe,WAAf,mBAAuB,MAAM,KAAK;AAAA,UAChD,QAAQ,CAAC,GAAG,eAAe,OAAO,MAAM;AAAA,QAC5C;AAAA,QAEJ,YAAY,GAAG,GAAG;AAAA,QAClB,KAAK,GAAG,eAAe,eAAe,GAAG;AAAA,MAC7C;AAAA,IACJ,KAAK,cAAc;AACf,YAAM,aAAa,GAAG,GAAG;AACzB,aAAO;AAAA,QACH,iB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';\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-encoding/utils/parserUtils\";\nexport * from \"@splunk/visualization-encoding/utils/parserUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import {\n parseNameBasedFieldReference,\n parseIndexBasedFieldReference,\n} from '@splunk/visualization-encoding/utils/parserUtils';\n\n// index based references are defined by <dataSource>[<index>]\n// this regex matches <text with numbers>[<anything>]\n// the \"[\" \"]\" part makes it an index based reference\nconst indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n// name based references are defined by <dataSource>.<columnName>\n// the \".\" access makes it a name based reference\nconst nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n\ninterface AdvancedEncodingConfig {\n field: string;\n format?: Record<string, unknown>;\n}\ntype EncodingConfig = string | string[] | AdvancedEncodingConfig;\n\nexport type { EncodingConfig };\n\ninterface DynamicOptionsChunk {\n options: Record<string, unknown>;\n context: Record<string, unknown>;\n}\nconst isIndexBasedReference = ref => indexBasedRegx.test(ref);\nconst isNameBasedReference = ref => nameBasedRegx.test(ref);\n\ntype formatterFromEncodingType = {\n contextConfig: Record<string, unknown> | unknown;\n contextKey: string;\n dsl: string;\n};\n\nconst convertFormatterToDSL = (\n fieldReference: AdvancedEncodingConfig,\n key: string,\n translatedValue: string\n): formatterFromEncodingType | void => {\n switch (fieldReference?.format?.type) {\n case 'gradient':\n return {\n contextConfig: {\n ...(Array.isArray(fieldReference.format?.ranges) && {\n stops: [...fieldReference.format.ranges],\n }),\n ...(Array.isArray(fieldReference.format?.values) && {\n colors: [...fieldReference.format.values],\n }),\n },\n contextKey: `${key}GradientContext`,\n dsl: `${translatedValue} | gradient(${key}GradientContext)`,\n };\n case 'rangevalue': {\n const contextKey = `${key}RangeValueContext`;\n return {\n contextConfig: fieldReference.format?.ranges || [],\n contextKey,\n dsl: `${translatedValue} | rangeValue(${contextKey})`,\n };\n }\n case 'matchvalue': {\n const defaultValue = fieldReference.format?.defaultValue;\n const matchValueContextKey = `${key}MatchValueContext`;\n return {\n contextConfig: fieldReference.format?.matches || [],\n contextKey: matchValueContextKey,\n dsl: `${translatedValue} | matchValue(${matchValueContextKey}${\n defaultValue !== null && defaultValue !== undefined\n ? `, ${typeof defaultValue === 'string' ? `\"${defaultValue}\"` : defaultValue}`\n : ''\n })`,\n };\n }\n default:\n break;\n }\n return null;\n};\n\n/**\n * Translates encoding data selections in array format\n *\n * Note:\n * 'frameBySeriesIndexes' only supports positive indexes\n *\n * Examples:\n * 1. all index based selection\n * ['primary[0]', 'primary[1]'] => '> primary | frameBySeriesIndexes(0,1)'\n *\n * 2. all name based selection\n * ['primary.foo', 'primary.bar'] => '> primary | frameBySeriesNames(\"foo\",\"bar\")'\n *\n * 3. index or name based selections\n * ['primary.foo', 'primary[1]'] => '> primary | frameBySeriesNamesOrIndexes(\"foo\",1)'\n */\nconst translateArrayFormatDataReference = (encodingDataReference: string[]): string => {\n if (encodingDataReference.length === 0) {\n return null;\n }\n const allIndexBased = encodingDataReference.every(isIndexBasedReference);\n const allNameBased = encodingDataReference.every(isNameBasedReference);\n\n if (allIndexBased) {\n const { dataSourceName } = parseIndexBasedFieldReference(encodingDataReference[0]);\n const indexesStr = encodingDataReference\n .map(ref => parseIndexBasedFieldReference(ref)?.fieldIndex)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesIndexes(${indexesStr})`;\n }\n if (allNameBased) {\n const { dataSourceName } = parseNameBasedFieldReference(encodingDataReference[0]);\n const namesStr = encodingDataReference\n .map(ref => `\"${parseNameBasedFieldReference(ref)?.fieldName}\"`)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNames(${namesStr})`;\n }\n // it's a mix of name and index based references\n // get the first ref to extract the dataSource\n const firstEntry = encodingDataReference[0];\n const { dataSourceName } = isIndexBasedReference(firstEntry)\n ? parseIndexBasedFieldReference(firstEntry)\n : parseNameBasedFieldReference(firstEntry);\n const paramStr = encodingDataReference\n .map(ref => {\n return isIndexBasedReference(ref)\n ? parseIndexBasedFieldReference(ref)?.fieldIndex\n : `\"${parseNameBasedFieldReference(ref)?.fieldName}\"`;\n })\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNamesOrIndexes(${paramStr})`;\n};\n\n/**\n * Translates an encoding data selection string to a dynamic options data selection\n *\n * Index based column selection\n * 'primary[0]' => '> primary | seriesByIndex(0)'\n *\n * Index range based column selection\n * 'primary[1:]' => '> primary | frameBySeriesIndexRange(1)'\n * 'primary[0:3]' => '> primary | frameBySeriesIndexRange(0,2)'\n *\n * Name based column selection\n * 'primary.foo' => '> primary | seriesByName(\"foo\")'\n *\n * Encoding references\n * 'encoding.x' => '> x'\n */\nconst translateDataReference = (encodingDataReference: string): string => {\n if (encodingDataReference.indexOf('encoding.') === 0) {\n return `> ${encodingDataReference.replace('encoding.', '')}`;\n }\n const isIndexBasedRef = isIndexBasedReference(encodingDataReference);\n const isNameBasedRef = isNameBasedReference(encodingDataReference);\n\n if (!isIndexBasedRef && !isNameBasedRef) {\n // eslint-disable-next-line no-console\n console.warn('Unable to parse the encoding. Please verify the encoding format is correct');\n return null;\n }\n\n if (isNameBasedRef) {\n const { dataSourceName, fieldName, columnIndex } =\n parseNameBasedFieldReference(encodingDataReference);\n let returnString = `> ${dataSourceName} | seriesByName(\"${fieldName}\")`;\n if (columnIndex) {\n returnString += ` | pointByIndex(${columnIndex})`;\n }\n return returnString;\n }\n if (isIndexBasedRef) {\n const { dataSourceName, fieldIndex, columnIndex, isFieldIndexRange, fromFieldIndex, toFieldIndex } =\n parseIndexBasedFieldReference(encodingDataReference);\n if (isFieldIndexRange) {\n let dslToIndexString;\n if (toFieldIndex === -1) {\n dslToIndexString = '';\n } else {\n // adjust index, DSL is using default slice behavior whereas encoding behaved differently\n dslToIndexString = `,${toFieldIndex + 1}`;\n }\n return `> ${dataSourceName} | frameBySeriesIndexRange(${fromFieldIndex}${dslToIndexString})`;\n }\n let returnString = `> ${dataSourceName} | seriesByIndex(${fieldIndex})`;\n if (columnIndex) {\n returnString += ` | pointByIndex(${columnIndex})`;\n }\n return returnString;\n }\n return null;\n};\n/**\n * An encoding configuration can come in various different forms:\n *\n * 1. Simple data selection (either index or name based)\n * {\n * x: 'primary[0]',\n * y: 'primary.count'\n * }\n *\n * 2. Multi column selection in array format\n * {\n * x: 'primary[0]',\n * \t y: ['primary.count', 'primary.count2']\n * }\n *\n * 3. Advanced Encoding Configuration (for data selection and formatting)\n * {\n * x: {\n * \t field: 'primary[0]',\n * \t },\n * y: {\n * \t field: 'primary[1]',\n * format: {},\n * }\n * }\n */\nconst encodingToDynamicOptionsDSL = (encoding: Record<string, EncodingConfig>): DynamicOptionsChunk => {\n const dynamicOptions: DynamicOptionsChunk = {\n options: {},\n context: {},\n };\n const translatedOptions = {};\n const encodingObj = encoding ?? {};\n Object.keys(encodingObj).forEach(key => {\n const fieldReference = encoding[key];\n let fieldReferenceStr = fieldReference as string;\n if (typeof fieldReference === 'object' && !Array.isArray(fieldReference)) {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n let translatedValue;\n // field reference is either in form of array or string\n if (Array.isArray(fieldReference)) {\n translatedValue = translateArrayFormatDataReference(fieldReference);\n } else {\n translatedValue = translateDataReference(fieldReferenceStr);\n }\n\n // omit if translated value is not set\n if (translatedValue) {\n translatedOptions[key] = translatedValue;\n const convertedFormatterObject = convertFormatterToDSL(\n fieldReference as AdvancedEncodingConfig,\n key,\n translatedValue\n );\n\n if (convertedFormatterObject) {\n translatedOptions[key] = convertedFormatterObject.dsl;\n dynamicOptions.context[convertedFormatterObject.contextKey] =\n convertedFormatterObject.contextConfig;\n }\n }\n });\n dynamicOptions.options = translatedOptions;\n return dynamicOptions;\n};\n\nexport { encodingToDynamicOptionsDSL };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\n\n/**\n * map of splunk charting based @splunk/dashboard-visualization option names\n * to updated @splunk/visualization option names\n */\nconst optionRenames = {\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisLabelVisibility',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorUnit': 'xAxisMajorTickInterval',\n 'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisLabelsX.integerUnits': 'showRoundedXAxisLabels',\n 'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisLabelsX.axisVisibility': 'xAxisLineVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisLineVisibility',\n 'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',\n 'gridLinesX.showMajorLines': 'showXMajorGridLines',\n 'gridLinesY.showMajorLines': 'showYMajorGridLines',\n 'gridLinesX.showMinorLines': 'showXMinorGridLines',\n 'gridLinesY.showMinorLines': 'showYMinorGridLines',\n 'gridLinesY2.showMajorLines': 'showY2MajorGridLines',\n 'gridLinesY2.showMinorLines': 'showY2MinorGridLines',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.includeZero': 'showXAxisWithZero',\n 'axisY.includeZero': 'showYAxisWithZero',\n 'axisY2.includeZero': 'showY2AxisWithZero',\n 'axisLabelsX.extendsAxisRange': 'showXAxisExtendedRange',\n 'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',\n 'layout.splitSeries': 'showSplitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',\n 'axisY2.enabled': 'showOverlayY2Axis',\n 'axisY2.fields': 'y2Fields',\n 'chart.overlayFields': 'overlayFields',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendTruncation',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendDisplay',\n 'chart.nullValueMode': 'nullValueDisplay',\n 'chart.showDataLabels': 'dataValuesDisplay',\n fieldColors: 'seriesColorsByField',\n 'chart.resultTruncationLimit': 'resultLimit',\n 'chart.stackMode': 'stackMode',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.sliceCollapsingLabel': 'collapseLabel',\n 'chart.sliceCollapsingThreshold': 'collapseThreshold',\n hasDonutHole: 'showDonutHole',\n // area specific mapped options\n areaFillOpacity: 'areaOpacity',\n 'chart.showLines': 'showLines',\n // bubble specific mapped options\n 'chart.bubbleMinimumSize': 'bubbleSizeMin',\n 'chart.bubbleMaximumSize': 'bubbleSizeMax',\n 'chart.bubbleSizeBy': 'bubbleSizeMethod',\n // line specific mapped options\n fieldDashStyles: 'lineDashStylesByField',\n 'chart.showMarkers': 'markerDisplay',\n // scatter-specific options\n 'chart.markerSize': 'markerSize',\n};\n\nconst visibilityEnumReplacements = {\n visible: 'show',\n collapsed: 'hide',\n};\nconst modeEnumReplacements = {\n none: 'off',\n};\nconst abbreviationEnumReplacements = {\n none: 'auto',\n};\n/**\n * for some options the valid values changed.\n * this maps enum values that need to be changed\n */\nconst enumReplacements = {\n xAxisTitleVisibility: visibilityEnumReplacements,\n yAxisTitleVisibility: visibilityEnumReplacements,\n y2AxisTitleVisibility: visibilityEnumReplacements,\n xAxisAbbreviation: modeEnumReplacements,\n yAxisAbbreviation: abbreviationEnumReplacements,\n y2AxisAbbreviation: abbreviationEnumReplacements,\n dataValuesDisplay: modeEnumReplacements,\n legendDisplay: modeEnumReplacements,\n legendTruncation: {\n ellipsisNone: 'ellipsisOff',\n },\n stackMode: {\n default: 'auto',\n },\n};\n\n// splits a string with multiple fields separated by comma\n// returns the same value if it's already an array\nconst splitValue = (oldValue: string | string[]) =>\n Array.isArray(oldValue) ? oldValue : oldValue.split(',');\n\n/**\n * converts stringified objects into plain objects\n *\n * @param {string | Object} oldValue stringified object to parse\n * @returns {Object}\n */\nconst parseObjects = (oldValue: string | Record<string, unknown>): Record<string, unknown> => {\n if (typeof oldValue === 'object' && !Array.isArray(oldValue)) {\n return oldValue;\n }\n let nuValue = {};\n try {\n nuValue = JSON.parse(oldValue as string);\n } catch (e) {\n /* noop */\n }\n return nuValue;\n};\n\n/**\n * some option values require special processing\n * (e.g. if the type of the updated option changed)\n * \"legendLabels\": \"test,test2\" => \"legendLabels\": [\"test\", \"test2\"]\n */\nconst otherValueReplacements = {\n y2Fields: splitValue,\n overlayFields: splitValue,\n legendLabels: splitValue,\n seriesColorsByField: parseObjects,\n lineDashStylesByField: parseObjects,\n /**\n * the original markerDisplay was only exposed as `chart.showMarkers`\n * setting chart.showMarkers to true is the equivalent of `markerDisplay: 'outlined'`\n */\n markerDisplay: (oldValue: boolean) => {\n if (oldValue === false) return 'off';\n if (oldValue === true) return 'outlined';\n return oldValue;\n },\n};\n\n/**\n * migrateChartingOptions\n * - renames option keys\n * - checks if enum values have changed for new options, replaces it\n * - checks if other replacements are necessary and applies them\n * @param {object} options dashboard-viz charting options\n * @returns {object} migratedOptions viz charting options\n */\nconst migrateChartingOptions = (options: Record<string, unknown>): Record<string, unknown> => {\n const migratedOptions = {};\n Object.keys(options).forEach(key => {\n const value = options[key];\n const updatedKey = optionRenames[key] ?? key;\n let updatedValue = enumReplacements?.[updatedKey]?.[value] ?? value;\n if (otherValueReplacements[updatedKey]) {\n updatedValue = otherValueReplacements[updatedKey](updatedValue);\n }\n migratedOptions[updatedKey] = updatedValue;\n });\n return migratedOptions;\n};\n\n/**\n * helper that encapsulates shared migration logic across most charting-based viz\n * @param {Object} defaultChanges - map consisting of default value changes from viz.* to splunk.*\n * @param {Object} validOptions - the list of options that the new splunk.* viz supports\n * @param {VisualizationDefinition} vizDefinition - the viz definition to migrate\n * @param {String} vizType - the value of splunk.*\n */\nconst migrateBaseChartingVizDefinition = ({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType,\n}: {\n defaultChanges: Record<string, unknown>;\n validOptions: Record<string, unknown>;\n vizDefinition: VisualizationDefinition;\n vizType: string;\n}) => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: vizType,\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...defaultChanges,\n ...migrateChartingOptions(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateBaseChartingVizDefinition, migrateChartingOptions, otherValueReplacements };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { areaOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkArea = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.area',\n });\n\nexport { migrateVizToSplunkArea };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { barOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkBar = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bar',\n });\n\nexport { migrateVizToSplunkBar };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { bubbleOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkBubble = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bubble',\n });\n\nexport { migrateVizToSplunkBubble };\n", "\nimport * as defaultImport from \"@splunk/visualization-encoding/utils/dsl\";\nexport * from \"@splunk/visualization-encoding/utils/dsl\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { getDataSelectorsFromDSL } from '@splunk/visualization-encoding/utils/dsl';\n\n/**\n * Removes invalid keys in the options\n * @param currentOptions - Current visualization options\n * @param validOptions - Valid visualization option keys\n * @returns void\n */\nexport const removeInvalidOptions = (\n currentOptions: Record<string, unknown>,\n validOptions?: Record<string, unknown> | null\n): void => {\n if (!currentOptions || !validOptions) {\n return;\n }\n const copiedCurrOptions = currentOptions;\n Object.keys(copiedCurrOptions).forEach(key => {\n if (!(key in validOptions)) {\n delete copiedCurrOptions[key];\n }\n });\n};\n\n/**\n * Renames viz options by looking up their migration mapping\n * @param oldOptions - Current visualization options\n * @param optionRenames - Mapping of old options in viz.X to their migrated counterparts in splunk.X\n * @returns updatedOptions\n */\nexport const renameVizOptions = (\n oldOptions: Record<string, unknown>,\n optionRenames?: Record<string, string> | null\n): Record<string, unknown> => {\n const updatedOptions = {};\n\n if (!oldOptions) return {};\n if (!optionRenames) return oldOptions;\n\n Object.entries(oldOptions).forEach(([oldOptName, val]) => {\n const optionName = optionRenames[oldOptName] ?? oldOptName;\n updatedOptions[optionName] = val;\n });\n\n return updatedOptions;\n};\n\n/**\n * Appends appropriate series selector to DSL string to add viz-specific implicit logic\n * @param valueOption - the value of an option\n * @param selector - the selector to append\n * @returns string | void\n */\nexport const preserveDataSelectionForValueOption = (\n valueOption: unknown,\n selector: string\n): string | void => {\n if (valueOption) {\n // if the last data selector starts with seriesBy, append appropriate selector to it\n const dataSelectors = typeof valueOption === 'string' ? getDataSelectorsFromDSL(valueOption) : [];\n const lastDataSelector = dataSelectors[dataSelectors.length - 1];\n if (lastDataSelector.includes('seriesByIndex') || lastDataSelector.includes('seriesByName')) {\n return `${valueOption} | ${selector}`;\n }\n }\n\n return null;\n};\n\n/**\n * For all data options, calls preserveDataSelectionForValueOption with relevant selector and\n * updates dataOptions object\n * @param dataOptions - an object reflecting all data options\n * @param selector - the selector to append\n * @returns void\n */\nexport const addsDataSelectorToOptions = (\n dataOptions: Record<string, unknown>,\n selector: string\n): Record<string, unknown> => {\n const updatedDataOptions = {};\n\n Object.keys(dataOptions).forEach(key => {\n const statement = dataOptions[key] as string;\n const updatedDSL = preserveDataSelectionForValueOption(statement, selector);\n if (updatedDSL) {\n updatedDataOptions[key] = updatedDSL;\n } else {\n updatedDataOptions[key] = statement;\n }\n });\n\n return updatedDataOptions;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { choroplethSvgOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nconst optionRenames = {\n featureId: 'areaIds',\n value: 'areaValues',\n fill: 'areaColors',\n};\n\n// old default encoding configurations should be retained in migrated configuration\nconst defaultOptionChanges = {\n areaIds: '> primary | seriesByIndex(0)',\n areaValues: '> primary | seriesByIndex(1)',\n areaColors: '> primary | seriesByIndex(1) | gradient(fillGradientContext)',\n};\n\nconst defaultContextChanges = {\n fillGradientContext: {\n colors: ['#7EEFDA', '#6484F6', '#C093F9', '#293873'],\n },\n};\n\nexport const migrateVizToSplunkChoroplethSvg = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.choropleth.svg',\n options: {},\n context: {},\n };\n\n // add migrated option names and values\n const migratedOptions = { ...options };\n Object.keys(dataOptions).forEach(key => {\n const updatedKey = optionRenames[key] ?? key;\n migratedOptions[updatedKey] = dataOptions[key];\n });\n\n // update migrated options and context\n migratedDefinition.options = {\n ...defaultOptionChanges,\n ...migratedOptions,\n };\n\n migratedDefinition.context = encoding.fill ? dataContext : defaultContextChanges;\n\n // remove invalid options\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n return migratedDefinition;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { columnOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkColumn = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.column',\n });\n\nexport { migrateVizToSplunkColumn };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { ellipseOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions, addsDataSelectorToOptions } from '../utils/migrationUtils';\n\nconst optionsToRename = {\n fill: 'fillColor',\n stroke: 'strokeColor',\n strokeDasharray: 'strokeDashStyle',\n};\n\nexport const migrateVizToSplunkEllipse = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.ellipse',\n options,\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // To simulate the implicit logic in the shape parser that Ellipse utilizes, append\n // the lastPoint() DataSeries selector.\n const updatedDataOptions = addsDataSelectorToOptions(dataOptions, 'lastPoint()');\n\n migratedDefinition.options = { ...options, ...updatedDataOptions };\n\n // perform any option renaming\n migratedDefinition.options = renameVizOptions(migratedDefinition.options, optionsToRename);\n\n // remove invalid options from new definition\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n", "/**\n * Helper to convert old label and value options into consolidated labelDisplay and valueDisplay\n * If the `showOption` is explicitly false, then we return 'off'\n * If the `showOption` is undefined (which corresponds to a default of `true`), we return nothing to avoid conflating the viz definition (since this corresponds to `number` in the new display)\n * @param {Boolean} showOption - either one of `showLabel` or `showValue` in the old gauges\n * @param {Boolean} percentageOption - either one of `usePercentageRange` or `usePercentageValue` in the old gauges\n * @returns {String}\n */\nexport const consolidateDisplayOption = (showOption: boolean, percentageOption: boolean): string | void => {\n if (showOption === false) {\n return 'off';\n }\n if (percentageOption === true) {\n return 'percentage';\n }\n if (showOption === true) {\n return 'number';\n }\n // if showOption is undefined and percentageOption is false, we don't need to return an explicit value (since 'number' is passed in implicitly)\n return null;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { fillerGaugeOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { consolidateDisplayOption } from '../utils/gauges';\nimport {\n preserveDataSelectionForValueOption,\n removeInvalidOptions,\n renameVizOptions,\n} from '../utils/migrationUtils';\n\nconst optionRenames = {\n majorUnit: 'majorTickInterval',\n};\n\nconst previousRangeValueConfig = [\n { to: 10, value: '#5fbcff' },\n { from: 10, to: 30, value: '#4beba8' },\n { from: 30, to: 50, value: '#f4df7a' },\n { from: 50, to: 70, value: '#fc9850' },\n { from: 70, to: 100, value: '#ff7152' },\n];\n\nconst defaultChanges = {\n gaugeColor: '> value | rangeValue(gaugeColorRangeValueContext)',\n value: '> primary | seriesByIndex(0) | lastPoint()',\n};\n\nexport const migrateVizToSplunkFillerGauge = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.fillergauge',\n context: {},\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { options: encodingOptions, context: gaugeColorContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // if a viz.fillergauge receives an entire column for `value` (e.g. primary[0]), it will select the last value of the column\n // this contrasts with viz.markergauge (which takes the first point of the column)\n // this is due to differing behavior in the FillerGaugeParser, which explicitly retrieves the last point in a received array\n // https://cd.splunkdev.com/devplat/vision/-/blob/main/packages/visualization-encoding-parsers/src/FillerGaugeParser.js#L79\n const originalGaugeValue = encodingOptions.value;\n if (typeof originalGaugeValue === 'string') {\n encodingOptions.value =\n preserveDataSelectionForValueOption(originalGaugeValue, 'lastPoint()') ?? originalGaugeValue;\n }\n if (encodingOptions?.gaugeColor) {\n migratedVisualization.context = gaugeColorContext;\n } else {\n // preserve the default context if no gaugeColor encoding was configured\n migratedVisualization.context = {\n gaugeColorRangeValueContext: previousRangeValueConfig,\n };\n }\n\n const { showLabels, usePercentageRange, showValue, usePercentageValue } = options;\n const labelDisplay = consolidateDisplayOption(showLabels as boolean, usePercentageRange as boolean);\n const valueDisplay = consolidateDisplayOption(showValue as boolean, usePercentageValue as boolean);\n\n migratedVisualization.options = {\n ...defaultChanges,\n ...renamedOptions,\n ...encodingOptions,\n ...(typeof labelDisplay === 'string' && { labelDisplay }),\n ...(typeof valueDisplay === 'string' && { valueDisplay }),\n };\n\n // remove invalid options using the optionsSchema for splunk.fillergauge as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { lineOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\n// except for markerDisplay which migrates to the new default 'off'\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkLine = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.line',\n });\n\nexport { migrateVizToSplunkLine };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { imageOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nexport const migrateVizToSplunkImage = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.image',\n context: {},\n };\n\n // remove invalid options using the optionsSchema for splunk.image as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markdownOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { removeInvalidOptions } from '../utils/migrationUtils';\n\nexport const migrateVizToSplunkMarkdown = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.markdown',\n context: {},\n };\n\n // remove invalid options using the optionsSchema for splunk.markdown as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markerGaugeOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n preserveDataSelectionForValueOption,\n removeInvalidOptions,\n renameVizOptions,\n} from '../utils/migrationUtils';\nimport { consolidateDisplayOption } from '../utils/gauges';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n gaugeRanges: [\n { from: 90, to: 100, value: '#CB3B43' },\n { from: 50, to: 90, value: '#F4DF7A' },\n { from: 0, to: 50, value: '#4BEBA8' },\n ],\n value: '> primary | seriesByIndex(0) | lastPoint()',\n};\n\nconst optionRenames = {\n majorUnit: 'majorTickInterval',\n ranges: 'gaugeRanges',\n};\n\nexport const migrateVizToSplunkMarkerGauge = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.markergauge',\n context: {},\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { options: dataOptions } = encodingToDynamicOptionsDSL(encoding as Record<string, EncodingConfig>);\n // viz.markergauge has behavior where if a column without a specific point (e.g. primary[1]) is selected,\n // the markerGauge will only display the first point of the column\n // the following logic accounts for this and appends firstPoint() to the DSL statement\n const originalGaugeValue = dataOptions.value;\n if (typeof originalGaugeValue === 'string') {\n dataOptions.value =\n preserveDataSelectionForValueOption(originalGaugeValue, 'firstPoint()') ?? originalGaugeValue;\n }\n\n const { showLabels, usePercentageRange, showValue, usePercentageValue } = renamedOptions;\n const labelDisplay = consolidateDisplayOption(showLabels as boolean, usePercentageRange as boolean);\n const valueDisplay = consolidateDisplayOption(showValue as boolean, usePercentageValue as boolean);\n\n migratedVisualization.options = {\n ...defaultChanges,\n ...renamedOptions,\n ...dataOptions,\n ...(typeof labelDisplay === 'string' && { labelDisplay }),\n ...(typeof valueDisplay === 'string' && { valueDisplay }),\n };\n\n // remove invalid options using the optionsSchema for splunk.markergauge as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { pieOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions, otherValueReplacements } from './splunk-charting';\n\nconst migratePieChartLabelAndPercent = (options: Record<string, unknown>): Record<string, string> => {\n // if neither chart.showLabels or chart.showPercent is specified in viz.pie,\n // splunk.pie use the default labelDisplay value\n if (!('chart.showLabels' in options) && !('chart.showPercent' in options)) {\n return {};\n }\n\n // if only chart.showPercent is specified in viz.pie\n if (!('chart.showLabels' in options) && 'chart.showPercent' in options) {\n return {\n labelDisplay: options['chart.showPercent'] ? 'valuesAndPercentage' : 'values',\n };\n }\n\n // if only chart.showLabels is specified in viz.pie\n if ('chart.showLabels' in options && !('chart.showPercent' in options)) {\n return { labelDisplay: options['chart.showLabels'] ? 'values' : 'off' };\n }\n\n // if both chart.showLabels and chart.showPercent are specified in viz.pie\n const labelOption = {\n labelDisplay: 'values',\n };\n if (options['chart.showLabels'] && options['chart.showPercent']) {\n labelOption.labelDisplay = 'valuesAndPercentage';\n }\n if (!options['chart.showLabels']) {\n labelOption.labelDisplay = 'off';\n }\n\n return labelOption;\n};\n\n// retain the pie position when converting viz.pie to splunk.pie - SCP-48658\nconst migrateDonutChart = (options: Record<string, unknown>): Record<string, string> => {\n if (options.hasDonutHole) {\n if (options['legend.placement'] === 'none') {\n return { labelDisplay: 'off' };\n }\n return { labelDisplay: 'values' };\n }\n return {};\n};\n\nconst migrateFieldColors = (options: Record<string, any>): Record<string, any> => {\n if ('fieldColors' in options) {\n return {\n seriesColorsByField: otherValueReplacements.seriesColorsByField(options.fieldColors),\n };\n }\n return {};\n};\n\nconst migrateVizToSplunkPie = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.pie',\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...migratePieChartLabelAndPercent(options),\n ...migrateChartingOptions(options),\n ...migrateFieldColors(options),\n ...migrateDonutChart(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkPie };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { scatterOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkScatter = (vizDefinition: VisualizationDefinition): VisualizationDefinition =>\n migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.scatter',\n });\n\nexport { migrateVizToSplunkScatter };\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { rectangleOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions, addsDataSelectorToOptions } from '../utils/migrationUtils';\n\nconst optionsToRename = {\n fill: 'fillColor',\n stroke: 'strokeColor',\n strokeDasharray: 'strokeDashStyle',\n strokeLinejoin: 'strokeJoinStyle',\n};\n\nconst migrateVizToSplunkRectangle = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.rectangle',\n options: {},\n context: {},\n };\n\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n // To simulate the implicit logic in the shape parser that Rectangle utilizes, append\n // the lastPoint() DataSeries selector.\n const updatedDataOptions = addsDataSelectorToOptions(dataOptions, 'lastPoint()');\n\n migratedDefinition.options = { ...options, ...updatedDataOptions };\n\n // perform option rename\n migratedDefinition.options = renameVizOptions(migratedDefinition.options, optionsToRename);\n\n // remove invalid options, validOptions is taken from the config.optionsSchema\n removeInvalidOptions(migratedDefinition.options, validOptions);\n migratedDefinition.context = dataContext;\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkRectangle };\n", "/**\n * Helper function to consolidate `trendDisplayMode` - percent/absolute\n * and `showTrendIndicator` - true/false into `trendDisplay` - off/percent/absolute for Single Value Variations\n * 1. if `showTrendIndicator` is explicitly false, `trendDisplay` is off\n * 2. if `showTrendIndicator` is undefined (defaults to true), return `trendDisplayMode` value if present\n * 3. if `showTrendIndicator` is explicitly true, return 'absolute'\n * 4. if both the old options are undefined, return nothing as their defaults (true and `absolute`)\n * correspond to `trendDisplay` default - absolute\n */\nexport const consolidateTrendDisplay = (\n trendDisplayMode: string,\n showTrendIndicator: boolean\n): string | void => {\n if (showTrendIndicator === false) {\n return 'off';\n }\n if (['absolute', 'percent'].includes(trendDisplayMode)) {\n return trendDisplayMode;\n }\n if (showTrendIndicator === true) {\n return 'absolute';\n }\n return null;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\n// old default configurations should be retained in migrated configuration\nconst defaultsToRetain = {\n showSparklineAreaGraph: false,\n sparklineValues: '> primary | seriesByTypes(\"number\", \"string\")',\n};\n\nconst optionRenames = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n sparklineAreaGraph: 'showSparklineAreaGraph',\n sparklineFillColor: 'sparklineAreaColor',\n sparklineAcceptNullData: 'shouldSparklineAcceptNullData',\n deltaFontSize: 'trendFontSize',\n};\n\n/**\n * Helper function to consolidate `sparklinePosition` - before/after/below\n * and `showSparkline` - true/false into `sparklineDisplay` - off/before/after/below\n * 1. if `showSparkline` is explicitly false, `sparklineDisplay` is off\n * 2. if `showSparkline` is undefined (defaults to true), return `sparklinePosition` value if present\n * 3. if `showSparkline` is explicitly true, return 'below'\n * 4. if both the old options are undefined, return nothing as their defaults (true and `below`)\n * correspond to `sparklineDisplay` default - below\n */\nconst consolidateSparklineDisplay = (sparklinePosition: string, showSparkline: boolean): string | void => {\n if (showSparkline === false) {\n return 'off';\n }\n if (['before', 'after', 'below'].includes(sparklinePosition)) {\n return sparklinePosition;\n }\n if (showSparkline === true) {\n return 'below';\n }\n return null;\n};\n\nexport const migrateVizToSplunkSingleValue = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalue',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDataOptions = {\n /**\n * in splunk.singlevalue, since we have the defaults\n * trendValue: '> sparklineValues|delta(-2)'\n * majorValue: '> sparklineValues|lastPoint()'\n * computing sparklineValues DSL from trend encoding should be sufficient\n */\n ...(dataOptions?.trend && { sparklineValues: dataOptions.trend }),\n ...(dataOptions?.majorColor && {\n majorColor:\n preserveDataSelectionForValueOption(dataOptions.majorColor as string, 'lastPoint()') ??\n dataOptions.majorColor,\n }),\n ...(dataOptions?.deltaColor && {\n trendColor:\n preserveDataSelectionForValueOption(dataOptions.deltaColor as string, 'lastPoint()') ??\n dataOptions.deltaColor,\n }),\n ...(dataOptions?.fill && {\n backgroundColor:\n preserveDataSelectionForValueOption(dataOptions.fill as string, 'lastPoint()') ??\n dataOptions.fill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { trendDisplayMode, showTrendIndicator, showSparkline, sparklinePosition } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n const sparklineDisplay = consolidateSparklineDisplay(\n sparklinePosition as string,\n showSparkline as boolean\n );\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n ...(typeof sparklineDisplay === 'string' && { sparklineDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalue as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueIconOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport type { EncodingConfig } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\nconst defaultsToRetain = {\n majorValue: '> primary | seriesByIndex(0) | lastPoint()',\n trendValue: '> primary | seriesByIndex(0) | delta(-2)',\n};\n\nconst optionsToRename = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n deltaColor: 'trendColor',\n color: 'iconColor',\n};\n\nexport const migrateVizToSplunkSingleValueIcon = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalueicon',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedDataOptions = {\n ...(dataOptions?.trend && {\n majorValue:\n preserveDataSelectionForValueOption(dataOptions.trend as string, 'lastPoint()') ??\n dataOptions.trend,\n trendValue:\n preserveDataSelectionForValueOption(dataOptions.trend as string, 'delta(-2)') ??\n dataOptions.trend,\n }),\n ...(dataOptions?.fill && {\n backgroundColor:\n preserveDataSelectionForValueOption(dataOptions.fill as string, 'lastPoint()') ??\n dataOptions.fill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionsToRename);\n\n const { trendDisplayMode, showTrendIndicator } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalueicon as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { singleValueRadialOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport {\n removeInvalidOptions,\n renameVizOptions,\n preserveDataSelectionForValueOption,\n} from '../utils/migrationUtils';\nimport { consolidateTrendDisplay } from '../utils/singlevalue';\n\n// old default configurations should be retained in migrated configuration\nconst defaultsToRetain = {\n majorValue: '> primary | seriesByIndex(0) | lastPoint()',\n trendValue: '> primary | seriesByIndex(0) | delta(-2)',\n};\n\nconst optionRenames = {\n useTrendUnits: 'shouldAbbreviateTrendValue',\n useThousandSeparators: 'shouldUseThousandSeparators',\n};\n\nexport const migrateVizToSplunkSingleValueRadial = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n ...otherDefinitionParts,\n type: 'splunk.singlevalueradial',\n context: {},\n options: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n const { trend: originalTrend, fill: originalFill } = dataOptions;\n\n const migratedDataOptions = {\n ...(originalTrend && {\n majorValue: preserveDataSelectionForValueOption(originalTrend, 'lastPoint()') ?? originalTrend,\n trendValue: preserveDataSelectionForValueOption(originalTrend, 'delta(-2)') ?? originalTrend,\n }),\n ...(originalFill && {\n backgroundColor: preserveDataSelectionForValueOption(originalFill, 'lastPoint()') ?? originalFill,\n }),\n };\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n const { trendDisplayMode, showTrendIndicator } = renamedOptions;\n\n const trendDisplay = consolidateTrendDisplay(trendDisplayMode as string, showTrendIndicator as boolean);\n\n migratedVisualization.options = {\n ...defaultsToRetain,\n ...renamedOptions,\n ...migratedDataOptions, // fill encoding takes precedence over explicit static backgroundColor\n ...(typeof trendDisplay === 'string' && { trendDisplay }),\n };\n\n migratedVisualization.context = dataContext;\n\n // remove invalid (and deprecated) options using the optionsSchema for splunk.singlevalueradial as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n\n return migratedVisualization;\n};\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides\";\nexport * from \"@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { isEmpty, set } from 'lodash';\nimport type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { tableOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { deepMergeWithArrayPrimitiveOverrides } from '@splunk/visualization-encoding/utils/deepMergeWithArrayPrimitiveOverrides';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { renameVizOptions } from '../utils/migrationUtils';\n\ninterface CellFormatting {\n numberPrecision?: number;\n unit?: string;\n unitPosition?: string;\n useThousandSeparators?: boolean;\n}\n\ninterface VizTableFormattingOpts {\n headerTextColor?: string;\n headerBackgroundColor?: string;\n numberPrecision?: number;\n rowBackgroundColorEven?: string;\n rowBackgroundColorOdd?: string;\n rowTextColorOdd?: string;\n rowTextColorEven?: string;\n unit?: string;\n unitPosition?: string;\n useThousandSeparators?: boolean;\n}\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n count: 20,\n};\n\nconst optionRenames = {\n rowNumbers: 'showRowNumbers',\n};\n\nconst migrateHeaderVisibility = (oldHeaderVisibility: boolean): string => {\n if (oldHeaderVisibility === undefined) {\n // headerVisibility: 'inline' is the default in splunk.table\n // this corresponds to `showHeader: true`, which is the default in viz.table\n return undefined;\n }\n return oldHeaderVisibility ? 'inline' : 'none';\n};\n\ninterface Colors {\n oddColor?: string;\n evenColor?: string;\n}\n\n/**\n * Helper to migrate alternating color options (text and background) to their corresponding DSL and context configs\n */\nconst migrateAlternatingColors = (\n colors: Colors,\n optionToConvert: string,\n contextConfigName: string\n): {\n contextConfigName?: string;\n context?: string[];\n dsl?: string;\n} => {\n // default alternating themed color values as defined in table config\n const themedAlternatingColors = {\n rowBackgroundColors: {\n even: '> themes.rowBackgroundColorEven',\n odd: '> themes.rowBackgroundColorOdd',\n },\n rowColors: {\n even: '> themes.inverseTextColor',\n odd: '> themes.textColor',\n },\n };\n const colorsContext: string[] = [];\n const { oddColor, evenColor } = colors;\n if (oddColor && evenColor) {\n colorsContext.push(...[oddColor, evenColor]);\n } else if (oddColor) {\n colorsContext.push(...[oddColor, themedAlternatingColors[optionToConvert].even]);\n } else if (evenColor) {\n colorsContext.push(...[themedAlternatingColors[optionToConvert].odd, evenColor]);\n }\n\n if (colorsContext.length) {\n return {\n contextConfigName,\n context: colorsContext,\n dsl: `> table | pick(${contextConfigName})`,\n };\n }\n\n return {};\n};\n\n/**\n * Intermediate helper to translate column-specific formatting in viz.table to their DSL equivalents\n * viz.table defines column-specific formatting via entries specified in options.fields.<columnName>\n *\n * This requires moving numberPrecision, useThousandSeparators, unitPosition, and other formatting options to the config\n * The resultant config is used as the argument for formatByType\n */\nconst migrateToColumnFormat = (\n fieldsOption: Record<string, CellFormatting>\n): {\n columnFormat: Record<string, unknown>;\n columnFormatContext: Record<string, unknown>;\n} => {\n const columnFormat: Record<string, unknown> = {};\n const columnFormatContext: Record<string, unknown> = {};\n\n if (!fieldsOption) {\n return {\n columnFormat,\n columnFormatContext,\n };\n }\n\n Object.entries(fieldsOption).forEach(([column, formatting]) => {\n // need to prepend `formatted` in case the column has leading digits, which the nearley parser cannot account for\n const contextEntry = `formatted${column}Config`;\n columnFormatContext[contextEntry] = {};\n columnFormat[column] = {\n data: `> table | seriesByName(\"${column}\") | formatByType(${contextEntry})`,\n };\n\n // all columnFormatting options are optional; if they are not present in the original config, tableFormat should take precedence\n const { unit, unitPosition, numberPrecision, useThousandSeparators } = formatting;\n if (typeof unitPosition === 'string') {\n set(columnFormatContext, [contextEntry, 'number', 'unitPosition'], unitPosition);\n set(columnFormatContext, [contextEntry, 'string', 'unitPosition'], unitPosition);\n }\n if (typeof unit === 'string' || typeof unit === 'number') {\n set(columnFormatContext, [contextEntry, 'number', 'unit'], unit);\n set(columnFormatContext, [contextEntry, 'string', 'unit'], unit);\n }\n if (numberPrecision != null) {\n set(columnFormatContext, [contextEntry, 'number', 'precision'], numberPrecision);\n }\n if (useThousandSeparators != null) {\n set(columnFormatContext, [contextEntry, 'number', 'thousandSeparated'], useThousandSeparators);\n }\n });\n\n return {\n columnFormat,\n columnFormatContext,\n };\n};\n\n/**\n * Intermediate helper to translate table-wide formatting and coloring in viz.table to their DSL equivalents\n *\n * This requires moving numberPrecision, useThousandSeparators, unitPosition, and other formatting/coloring options to the config\n * The resultant formatting and coloring config is used as the argument for the formatByType() and pick() DSL formatters respectively\n */\nconst migrateToTableFormat = (\n oldOptions: VizTableFormattingOpts = {}\n): {\n tableFormat: Record<string, unknown>;\n tableFormatContext: Record<string, unknown>;\n} => {\n const tableFormat: Record<string, unknown> = {};\n const tableFormatContext: Record<string, unknown> = {\n formattedConfig: {},\n };\n\n const {\n unit,\n unitPosition: oldUnitPosition,\n numberPrecision: oldNumberPrecision,\n useThousandSeparators: oldUseThousandSeparators,\n } = oldOptions;\n const unitPosition = typeof oldUnitPosition === 'string' ? oldUnitPosition : 'after';\n const numberPrecision = typeof oldNumberPrecision === 'number' ? oldNumberPrecision : 0;\n const useThousandSeparators =\n typeof oldUseThousandSeparators === 'boolean' ? oldUseThousandSeparators : false;\n\n set(tableFormatContext, ['formattedConfig', 'number', 'precision'], numberPrecision);\n set(tableFormatContext, ['formattedConfig', 'number', 'thousandSeparated'], useThousandSeparators);\n set(tableFormatContext, ['formattedConfig', 'number', 'unitPosition'], unitPosition);\n set(tableFormatContext, ['formattedConfig', 'string', 'unitPosition'], unitPosition);\n if (typeof unit === 'string' || typeof unit === 'number') {\n set(tableFormatContext, ['formattedConfig', 'number', 'unit'], unit);\n set(tableFormatContext, ['formattedConfig', 'string', 'unit'], unit);\n }\n\n tableFormat.data = `> table | formatByType(formattedConfig)`;\n\n const {\n rowBackgroundColorEven,\n rowBackgroundColorOdd,\n rowTextColorOdd,\n rowTextColorEven,\n headerTextColor,\n headerBackgroundColor,\n } = oldOptions;\n\n const { context: rowColorsContext, dsl: rowColorsDSL } = migrateAlternatingColors(\n { oddColor: rowTextColorOdd, evenColor: rowTextColorEven },\n 'rowColors',\n 'rowColorsConfig'\n );\n if (rowColorsContext && rowColorsDSL) {\n tableFormatContext.rowColorsConfig = rowColorsContext;\n tableFormat.rowColors = rowColorsDSL;\n }\n\n const { context: rowBackgroundColorsContext, dsl: rowBackgroundColorsDSL } = migrateAlternatingColors(\n {\n oddColor: rowBackgroundColorOdd,\n evenColor: rowBackgroundColorEven,\n },\n 'rowBackgroundColors',\n 'rowBackgroundColorsConfig'\n );\n if (rowBackgroundColorsContext && rowBackgroundColorsDSL) {\n tableFormat.rowBackgroundColors = rowBackgroundColorsDSL;\n tableFormatContext.rowBackgroundColorsConfig = rowBackgroundColorsContext;\n }\n if (headerTextColor) {\n tableFormat.headerColor = headerTextColor;\n }\n if (headerBackgroundColor) {\n tableFormat.headerBackgroundColor = headerBackgroundColor;\n }\n\n return {\n tableFormat,\n tableFormatContext,\n };\n};\n\nconst migrateVizToSplunkTable = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.table',\n options: {},\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const renamedOptions = renameVizOptions(options, optionRenames);\n const headerVisibility = migrateHeaderVisibility(renamedOptions.showHeader as boolean);\n const { tableFormat, tableFormatContext } = migrateToTableFormat(renamedOptions);\n const { columnFormat, columnFormatContext } = migrateToColumnFormat(\n renamedOptions.fields as Record<string, CellFormatting>\n );\n const migratedDataOptions = {\n ...(dataOptions?.columns && { table: dataOptions.columns }),\n };\n const formattingOptions = {\n ...(!isEmpty(columnFormat) && { columnFormat }),\n ...(typeof headerVisibility === 'string' && { headerVisibility }),\n tableFormat,\n };\n const migratedOptions = deepMergeWithArrayPrimitiveOverrides(\n {},\n defaultChanges,\n formattingOptions,\n migratedDataOptions,\n renamedOptions\n );\n\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n\n migratedDefinition.context = {\n ...dataContext,\n // columnFormat is optional, but tableFormat is required all cases to preserve some viz.table behavior\n ...(!isEmpty(columnFormatContext) && { ...columnFormatContext }),\n ...tableFormatContext,\n };\n migratedDefinition.options = migratedOptions;\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkTable };\n", "import * as _ from 'lodash';\nimport type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { markdownOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport { renameVizOptions, removeInvalidOptions } from '../utils/migrationUtils';\n\ntype FontWeight = 'normal' | 'bold' | 'light';\n\nconst optionsToRename = {\n textColor: 'fontColor',\n content: 'markdown',\n};\n\nconst convertTextContentToMarkDown = (fontWeight: FontWeight, fontSize: number, textContent = ''): string => {\n if (!_.isNumber(fontSize)) {\n return textContent;\n }\n if (textContent.trim().length === 0) {\n return textContent;\n }\n // Remove any trailing newline chars from the content\n let markdownContent = textContent.replace(/\\n*$/, '');\n // Handle text conversion to marker tags based on fontSize and fontWeight\n const regex = /\\n/g; // regex to match /n with global scope across the string\n\n // Convert to paragraph in markdown, if fontSize < 20,\n // If text has fontWeight set to 'bold', add bold tag (**{markdown}**)\n if (fontWeight === 'bold') {\n // Here direct regex replace doesnt work, as we need to remove the\n // extra trailing space if any exist before appending **{markdown}** to the text\n const contentStrings = markdownContent.split('\\n');\n const stringsTrimmed = contentStrings.map(str =>\n str && str.trim().length ? `**${str.trim()}**` : ''\n );\n // Remove all blank entries from the end of the trimmed string array,\n // to avoid `\\` to get rendered, which happens if following line after `\\\\n` is empty)\n let idx = stringsTrimmed.length - 1;\n while (idx >= 0 && stringsTrimmed[idx].length === 0) {\n stringsTrimmed.pop();\n idx -= 1;\n }\n return stringsTrimmed.join('\\\\\\n');\n }\n // If fontWeight is not bold, replace '\\n' with '\\\\n` using regex\n markdownContent = markdownContent.replace(regex, '\\\\\\n');\n return markdownContent;\n};\n\nexport const convertFontSize = (fontSize: number): { fontSize: string; customFontSize?: number } => {\n if (!_.isNumber(fontSize)) {\n return { fontSize: 'default' };\n }\n return { fontSize: 'custom', customFontSize: fontSize };\n};\n\nexport const migrateVizTextToSplunkMarkdown = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, ...otherDefinitionParts } = vizDefinition;\n const {\n fontSize = 24,\n fontWeight = 'normal',\n fontFamily = 'Splunk Platform Sans',\n rotation = 0,\n } = options;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.markdown',\n context: {},\n };\n\n // perform any option renames\n migratedVisualization.options = renameVizOptions(migratedVisualization.options, optionsToRename);\n const migratedVizOptions = migratedVisualization.options;\n\n // convert text content to respective markdown\n migratedVizOptions.markdown = convertTextContentToMarkDown(\n fontWeight as FontWeight,\n fontSize as number,\n migratedVizOptions.markdown as string\n );\n // convert text fontSize to markdown fontSize\n const { fontSize: fontSizeValue, customFontSize } = convertFontSize(fontSize as number);\n migratedVizOptions.fontSize = fontSizeValue;\n migratedVizOptions.customFontSize = customFontSize;\n migratedVizOptions.fontFamily = fontFamily;\n migratedVizOptions.rotation = rotation;\n\n // remove invalid options using the optionsSchema for splunk.markdown as reference\n removeInvalidOptions(migratedVizOptions, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { punchcardOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { renameVizOptions, removeInvalidOptions } from '../utils/migrationUtils';\n\nconst defaultContext = {\n bubbleColorConfig: {\n colors: ['rgba(123,86,219,0.4)', 'rgba(123,86,219,1)'],\n },\n};\n\nconst optionsToRename = {\n showBubbleLabels: 'bubbleLabelDisplay',\n bubbleScale: 'bubbleSizeMethod',\n isBubbleSizeDynamic: 'showDynamicBubbleSize',\n maxBubbleRadius: 'bubbleRadiusMax',\n minBubbleRadius: 'bubbleRadiusMin',\n maxBubbleSize: 'bubbleSizeMax',\n minBubbleSize: 'bubbleSizeMin',\n showLegend: 'legendDisplay',\n useDefaultSort: 'showDefaultSort',\n};\n\nconst consolidateLegendDisplay = (vizOptions: Record<string, unknown>): void => {\n if (!vizOptions) {\n return;\n }\n const options = vizOptions;\n if (options.legendDisplay) {\n options.legendDisplay = 'right';\n } else if (options.legendDisplay === false) {\n options.legendDisplay = 'off'; // legenddisplay set explicitly to false\n }\n};\n\nconst consolidateBubbleLabelDisplay = (vizOptions: Record<string, unknown>): void => {\n if (!vizOptions) {\n return;\n }\n const options = vizOptions;\n if (options.bubbleLabelDisplay === 'none') {\n options.bubbleLabelDisplay = 'off';\n }\n};\n\n// Updates the first color of the bubbleColorConfig with the minBubbleColorIntensity\nconst convertGradientConfig = (\n minBubbleColorIntensity: number,\n defaultBubbleColorConfig: Record<string, unknown>\n): Record<string, unknown> => {\n if (\n !defaultBubbleColorConfig ||\n !defaultBubbleColorConfig.colors ||\n !defaultBubbleColorConfig.colors[0] ||\n typeof minBubbleColorIntensity !== 'number'\n ) {\n return null;\n }\n const firstColor = defaultBubbleColorConfig.colors[0] as string;\n const firstColorUpdated = `${firstColor.substring(\n 0,\n firstColor.lastIndexOf(',')\n )},${minBubbleColorIntensity})`;\n const colors = [...(defaultBubbleColorConfig.colors as Array<string>)];\n colors[0] = firstColorUpdated;\n const bubbleColorConfigUpdated = { ...defaultBubbleColorConfig, colors };\n return bubbleColorConfigUpdated;\n};\n\nconst convertColorModeOption = (visualizationDefinition: VisualizationDefinition): void => {\n const visualizationDef = visualizationDefinition;\n if (!visualizationDef || !visualizationDef.options) {\n return;\n }\n\n // Rename the colorMode option from 'sequential' to 'dynamic' if specified\n if (visualizationDef.options.colorMode === 'sequential') {\n visualizationDef.options.colorMode = 'dynamic';\n }\n\n // If no colorMode was specified the default in viz.punchcard used to be 'categorical'.\n // But in splunk.punchcard default is 'dynamic', we need to preserve the original default.\n // Set colorMode to 'categorical' if no colorMode was specified in viz\n if (!visualizationDef.options.colorMode) {\n visualizationDef.options.colorMode = 'categorical';\n }\n\n const { minBubbleColorIntensity } = visualizationDef.options;\n // If there is no category option set or if the colorMode is not categorical, then the colorMode will to 'dynamic'\n // In both cases we need to update the gradient config bubbleColorConfig with the minBubbleColorIntensity for first color\n if (\n (!visualizationDef.options.category || visualizationDef.options.colorMode !== 'categorical') &&\n minBubbleColorIntensity &&\n typeof minBubbleColorIntensity === 'number'\n ) {\n const bubbleColorConfig = convertGradientConfig(\n minBubbleColorIntensity,\n defaultContext.bubbleColorConfig\n );\n if (bubbleColorConfig) {\n visualizationDef.context = {\n ...visualizationDef.context,\n bubbleColorConfig,\n };\n }\n }\n};\n\nexport const migrateVizToSplunkPunchcard = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { options = {}, encoding = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedVisualization = {\n options,\n ...otherDefinitionParts,\n type: 'splunk.punchcard',\n context: {},\n };\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n // perform any option renames\n const renamedOptions = renameVizOptions(migratedVisualization.options, optionsToRename);\n\n consolidateLegendDisplay(renamedOptions);\n consolidateBubbleLabelDisplay(renamedOptions);\n\n migratedVisualization.options = {\n ...renamedOptions,\n ...dataOptions,\n };\n migratedVisualization.context = dataContext;\n\n convertColorModeOption(migratedVisualization);\n // remove invalid options using the optionsSchema for splunk.punchcard as reference\n removeInvalidOptions(migratedVisualization.options, validOptions);\n return migratedVisualization;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { mapOptionsSchema as validOptions } from '@splunk/visualization-schemas';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { removeInvalidOptions, renameVizOptions } from '../utils/migrationUtils';\n\nconst optionRenames = {\n fillColor: 'choroplethEmptyAreaColor',\n strokeColor: 'choroplethStrokeColor',\n featureId: 'areaIds',\n fill: 'dataColors',\n value: 'areaValues',\n};\n\nconst defaultContextChanges = {\n fillGradientContext: {\n colors: '> themes.defaultGradientMigrationConfig',\n },\n};\n\nexport const defaultStrokeColor = '#689C8D';\nexport const defaultEmptyAreaColor = '#EAEFF2';\n\nexport const migrateVizToSplunkMapChoropleth = (\n vizDefinition: VisualizationDefinition\n): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.map',\n options: {},\n context: {},\n };\n\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const dynamicOptions = renameVizOptions(dataOptions, optionRenames);\n const renamedOptions = renameVizOptions(options, optionRenames);\n\n if (!('dataColors' in dynamicOptions)) {\n Object.assign(dynamicOptions, {\n dataColors: '> areaValues | gradient(fillGradientContext)',\n });\n }\n\n let { choroplethEmptyAreaColor, choroplethStrokeColor } = renamedOptions;\n const { source } = renamedOptions;\n\n const layerOptions = ['choroplethEmptyAreaColor', 'choroplethStrokeColor', 'source'];\n\n const renamedOptionsFiltered = Object.keys(renamedOptions)\n .filter(key => !layerOptions.includes(key))\n .reduce((obj, key) => {\n /* eslint-disable-next-line no-param-reassign */\n obj[key] = renamedOptions[key];\n return obj;\n }, {});\n\n /* migrate default strokeColor in viz.geojson to either the backgroundColor if configured and non-transparent or defaultBackgroundColor in splunk.map */\n if (choroplethStrokeColor === defaultStrokeColor && choroplethEmptyAreaColor !== 'transparent') {\n if ('backgroundColor' in renamedOptionsFiltered) {\n /* eslint-disable-next-line dot-notation */\n if (renamedOptionsFiltered['backgroundColor'] !== 'transparent') {\n /* eslint-disable-next-line dot-notation */\n choroplethStrokeColor = renamedOptionsFiltered.backgroundColor;\n } else {\n choroplethStrokeColor = '> themes.defaultBackgroundColor';\n }\n } else {\n choroplethStrokeColor = '> themes.defaultBackgroundColor';\n }\n }\n\n if (choroplethEmptyAreaColor === defaultEmptyAreaColor) {\n choroplethEmptyAreaColor = '> themes.defaultChoroplethEmptyAreaColor';\n }\n\n // update migrated options and context\n migratedDefinition.options = {\n ...renamedOptionsFiltered,\n layers: [\n {\n type: 'choropleth',\n source,\n ...dynamicOptions,\n choroplethEmptyAreaColor,\n choroplethStrokeColor,\n choroplethOpacity: 1.0,\n },\n ],\n showScale: false,\n showBaseLayer: false,\n showZoomControls: false,\n };\n\n if (vizDefinition.type === 'viz.geojson.us') {\n migratedDefinition.options.center = [39.83, -97];\n migratedDefinition.options.zoom = 3;\n } else {\n migratedDefinition.options.center = [46.56, 10.35];\n migratedDefinition.options.zoom = 0;\n }\n\n migratedDefinition.context = encoding.fill ? dataContext : defaultContextChanges;\n\n if (\n JSON.stringify(dataContext) ===\n JSON.stringify({\n fillGradientContext: {},\n })\n ) {\n Object.assign(migratedDefinition, {\n context: defaultContextChanges,\n });\n }\n\n removeInvalidOptions(migratedDefinition.options, validOptions);\n\n return migratedDefinition;\n};\n", "import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport {\n migrateVizToSplunkArea,\n migrateVizToSplunkBar,\n migrateVizToSplunkBubble,\n migrateVizToSplunkChoroplethSvg,\n migrateVizToSplunkColumn,\n migrateVizToSplunkFillerGauge,\n migrateVizToSplunkLine,\n migrateVizToSplunkImage,\n migrateVizToSplunkMarkdown,\n migrateVizToSplunkMarkerGauge,\n migrateVizToSplunkPie,\n migrateVizToSplunkRectangle,\n migrateVizToSplunkSingleValue,\n migrateVizToSplunkSingleValueIcon,\n migrateVizToSplunkSingleValueRadial,\n migrateVizToSplunkScatter,\n migrateVizToSplunkTable,\n migrateVizTextToSplunkMarkdown,\n migrateVizToSplunkEllipse,\n migrateVizToSplunkPunchcard,\n migrateVizToSplunkMapChoropleth,\n} from './visualizations';\n\nconst supportedMigrations = {\n 'viz.area': {\n 'splunk.area': migrateVizToSplunkArea,\n },\n 'viz.bar': {\n 'splunk.bar': migrateVizToSplunkBar,\n },\n 'viz.bubble': {\n 'splunk.bubble': migrateVizToSplunkBubble,\n },\n 'viz.column': {\n 'splunk.column': migrateVizToSplunkColumn,\n },\n 'viz.choropleth.svg': {\n 'splunk.choropleth.svg': migrateVizToSplunkChoroplethSvg,\n },\n 'viz.geojson.us': {\n 'splunk.map': migrateVizToSplunkMapChoropleth,\n },\n 'viz.geojson.world': {\n 'splunk.map': migrateVizToSplunkMapChoropleth,\n },\n 'viz.ellipse': {\n 'splunk.ellipse': migrateVizToSplunkEllipse,\n },\n 'viz.fillergauge': {\n 'splunk.fillergauge': migrateVizToSplunkFillerGauge,\n },\n 'viz.line': {\n 'splunk.line': migrateVizToSplunkLine,\n },\n 'viz.img': {\n 'splunk.image': migrateVizToSplunkImage,\n },\n 'viz.markdown': {\n 'splunk.markdown': migrateVizToSplunkMarkdown,\n },\n 'viz.markergauge': {\n 'splunk.markergauge': migrateVizToSplunkMarkerGauge,\n },\n 'viz.pie': {\n 'splunk.pie': migrateVizToSplunkPie,\n },\n 'viz.rectangle': {\n 'splunk.rectangle': migrateVizToSplunkRectangle,\n },\n 'viz.singlevalue': {\n 'splunk.singlevalue': migrateVizToSplunkSingleValue,\n },\n 'viz.singlevalueicon': {\n 'splunk.singlevalueicon': migrateVizToSplunkSingleValueIcon,\n },\n 'viz.singlevalueradial': {\n 'splunk.singlevalueradial': migrateVizToSplunkSingleValueRadial,\n },\n 'viz.scatter': {\n 'splunk.scatter': migrateVizToSplunkScatter,\n },\n 'viz.table': {\n 'splunk.table': migrateVizToSplunkTable,\n },\n 'viz.text': {\n 'splunk.markdown': migrateVizTextToSplunkMarkdown,\n },\n 'viz.punchcard': {\n 'splunk.punchcard': migrateVizToSplunkPunchcard,\n },\n};\n\nconst inferToType = (typeFromDefinition: string): string => {\n if (typeFromDefinition === 'viz.img') {\n return 'splunk.image';\n }\n if (typeFromDefinition === 'viz.text') {\n return 'splunk.markdown';\n }\n\n if (typeFromDefinition === 'viz.geojson.us' || typeFromDefinition === 'viz.geojson.world') {\n return 'splunk.map';\n }\n return typeFromDefinition.replace(/^viz\\./, 'splunk.');\n};\n\ninterface MigrationParams {\n definition: VisualizationDefinition;\n toType?: string;\n}\n\nconst migrate = ({ definition, toType: toTypeFromParams }: MigrationParams): VisualizationDefinition => {\n const toType = toTypeFromParams ?? inferToType(definition.type);\n if (!supportedMigrations?.[definition?.type]?.[toType]) {\n throw new Error('Migration currently not supported');\n }\n return supportedMigrations[definition.type][toType](definition);\n};\n\ninterface CanMigrateParams {\n fromType: string;\n toType: string;\n}\n\nconst canMigrate = ({ fromType, toType }: CanMigrateParams): boolean => {\n if (supportedMigrations?.[fromType]?.[toType]) {\n return true;\n }\n return false;\n};\n\nexport { migrate, canMigrate, inferToType };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,gCAAc;AACd,IAAO,sBAAS,aAAaA,iBAA8B,yBAAUA;;;ACKrE,IAAM,iBAAiB;AAGvB,IAAM,gBAAgB;AActB,IAAM,wBAAwB,SAAO,eAAe,KAAK,GAAG;AAC5D,IAAM,uBAAuB,SAAO,cAAc,KAAK,GAAG;AAQ1D,IAAM,wBAAwB,CAC1B,gBACA,KACA,oBACmC;AAtCvC;AAuCI,WAAQ,sDAAgB,WAAhB,mBAAwB,MAAM;AAAA,IAClC,KAAK;A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X;AACA,SAAO,mBAAmB,QAAQ,UAAU,SAAS;AACzD;AAOA,IAAM,UAAU,CAAC,EAAE,YAAY,QAAQ,iBAAiB,MAAgD;AAjHxG;AAkHI,QAAM,SAAS,8CAAoB,YAAY,WAAW,IAAI;AAC9D,MAAI,GAAC,gEAAsB,yCAAY,UAAlC,mBAA0C,UAAS;AACpD,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACvD;AACA,SAAO,oBAAoB,WAAW,IAAI,EAAE,MAAM,EAAE,UAAU;AAClE;AAOA,IAAM,aAAa,CAAC,EAAE,UAAU,OAAO,MAAiC;AA9HxE;AA+HI,OAAI,gEAAsB,cAAtB,mBAAkC,SAAS;AAC3C,WAAO;AAAA,EACX;AACA,SAAO;AACX;",
6
6
  "names": ["defaultImport", "dataSourceName", "defaultChanges", "validOptions", "validOptions", "defaultChanges", "validOptions", "defaultChanges", "validOptions", "defaultImport", "validOptions", "optionRenames", "optionRenames", "_a", "validOptions", "defaultChanges", "validOptions", "validOptions", "optionRenames", "defaultChanges", "validOptions", "defaultChanges", "validOptions", "validOptions", "validOptions", "defaultChanges", "optionRenames", "validOptions", "validOptions", "defaultChanges", "validOptions", "optionsToRename", "validOptions", "optionRenames", "validOptions", "defaultsToRetain", "optionsToRename", "validOptions", "defaultsToRetain", "optionRenames", "validOptions", "defaultImport", "defaultImport", "defaultChanges", "optionRenames", "validOptions", "optionsToRename", "validOptions", "optionsToRename", "validOptions", "optionRenames", "defaultContextChanges", "validOptions"]
7
7
  }