@splunk/visualizations 24.4.0 → 24.5.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/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Choropleth_Svg_Choropleth_Svg_Placeholder_If_No_Svg_And_No_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Color_purple.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_extraLarge.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_empty_columns_and_fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_invalid_label_data_specified.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_invalid_value_data_specified.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_missing_column.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_Time_Type_Series_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_Time_Type_Series_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Cell_Types.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_fixed.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Time_Zone_Time_Formatting.png +0 -0
- package/Area.js +246 -218
- package/Area.js.map +1 -1
- package/Bar.js +238 -210
- package/Bar.js.map +1 -1
- package/Bubble.js +231 -203
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.js +230 -197
- package/ChoroplethSvg.js.map +1 -1
- package/Column.js +238 -210
- package/Column.js.map +1 -1
- package/Ellipse.js +203 -170
- package/Ellipse.js.map +1 -1
- package/FillerGauge.js +222 -189
- package/FillerGauge.js.map +1 -1
- package/Image.js +199 -164
- package/Image.js.map +1 -1
- package/Line.js +239 -211
- package/Line.js.map +1 -1
- package/LinkGraph.js +264 -223
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +39 -25
- package/Map.config.js.map +1 -1
- package/Map.js +469 -327
- package/Map.js.map +1 -1
- package/Markdown.config.js +29 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +513 -267
- package/Markdown.js.map +1 -1
- package/MarkerGauge.js +941 -906
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.js +230 -196
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.js +309 -249
- package/Pie.js.map +1 -1
- package/Punchcard.js +263 -229
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +217 -182
- package/Rectangle.js.map +1 -1
- package/Sankey.js +269 -230
- package/Sankey.js.map +1 -1
- package/Scatter.js +314 -286
- package/Scatter.js.map +1 -1
- package/SingleValue.js +398 -363
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +25 -25
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.js +2821 -2653
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.js +359 -324
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +2 -1
- package/Table.config.js.map +1 -1
- package/Table.js +623 -347
- package/Table.js.map +1 -1
- package/common/Charting.js +21 -21
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +2 -2
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +18 -18
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +10 -10
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +10 -10
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +217 -174
- package/common/OptionsDoc.js.map +1 -1
- package/common/SplunkVisualization.js +4 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/ThemesDoc.js +26 -26
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +3 -3
- package/common/chartingUtils.js.map +1 -1
- package/common/gaugeUtils.js +2 -2
- package/common/shapeUtils.js +2 -2
- package/common/withDashboardViz.js +80 -48
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +13 -11
package/common/ThemesDoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@splunk/react-ui/ColumnLayout\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"styled-components\"","webpack:///external \"@splunk/visualization-themes/variables\"","webpack:///external \"@splunk/react-ui/Select\"","webpack:///external \"lodash/omit\"","webpack:///external \"lodash/cloneDeep\"","webpack:///external \"@splunk/react-ui/Message\"","webpack:///external \"@splunk/react-ui/Tooltip\"","webpack:///external \"@splunk/themes/SplunkThemeProvider\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///./src/common/ThemesDoc.jsx"],"names":["ThemeVar","styled","ThemeVarName","props","PairContainer","PairTitle","ColorPreview","Pair","title","text","isColor","T","string","themeFamilyMapping","enterprise","colorScheme","dark","light","prisma","themeIdToVariant","enterpriseLightComfortable","density","family","label","enterpriseLightCompact","enterpriseDarkComfortable","enterpriseDarkCompact","prismaLightComfortable","prismaLightCompact","prismaDarkComfortable","prismaDarkCompact","ThemesDoc","renderVisualization","themeVars","useState","highlightedThemeVariable","setHighlightedThemeVariable","selectedTheme","setSelectedTheme","previewTheme","cloneDeep","marginTop","value","padding","themeValue","theme","splunkThemeV1","omit","isFromSharedVariables","isJSON","JSON","varKey","themes","isRequired"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kC;;;;;;;ACAA,uC;;;;;;;ACAA,0D;;;;;;;ACAA,0D;;;;;;;ACAA,qE;;;;;;;ACAA,iE;;;;;;;ACAA,8C;;;;;;;ACAA,mE;;;;;;;ACAA,oD;;;;;;;ACAA,wC;;;;;;;ACAA,6C;;;;;;;ACAA,qD;;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,CAFR;AAhDpB,GAiCiB,CAFL,CAfJ,CAfJ,CADJ;AAVJ;;AAkFAb,SAAS,CAATA,YAAsB;AAClBqB,QAAM,EAAEzC,iDAAC,CAADA,OADU;AACW;AAC7BqB,qBAAmB,EAAErB,iDAAC,CAADA,KAAO0C;AAFV,CAAtBtB;AAKA,0E","file":"ThemesDoc.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 66);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"styled-components\");","module.exports = require(\"@splunk/visualization-themes/variables\");","module.exports = require(\"@splunk/react-ui/Select\");","module.exports = require(\"lodash/omit\");","module.exports = require(\"lodash/cloneDeep\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes/SplunkThemeProvider\");","module.exports = require(\"@splunk/react-ui/Heading\");","/* eslint-disable react/no-multi-comp */\nimport React, { useState } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport styled from 'styled-components';\nimport omit from 'lodash/omit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport Select from '@splunk/react-ui/Select';\nimport Message from '@splunk/react-ui/Message';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport * as sharedThemeVariables from '@splunk/visualization-themes/variables';\n\nconst ThemeVar = styled.div`\n margin-top: 20px;\n cursor: pointer;\n`;\nconst ThemeVarName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n display: inline-block;\n padding-right: 5px;\n font-weight: ${props => (props.highlighted ? 'bold' : 'normal')};\n`;\nconst PairContainer = styled.div`\n margin-left: 40px;\n margin-top: 10px;\n`;\nconst PairTitle = styled.span`\n display: inline-block;\n color: #8293a7;\n width: 80px;\n`;\nconst ColorPreview = styled.div`\n width: 20px;\n height: 20px;\n background: ${props => props.color};\n display: inline-block;\n vertical-align: bottom;\n margin-right: 5px;\n border: 1px solid rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n`;\n\nconst Pair = ({ title, text }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {isColor(text) && <ColorPreview color={text} />}\n <samp>{text}</samp>\n </PairContainer>\n);\nPair.propTypes = {\n title: T.string,\n text: T.string,\n};\n\nconst themeFamilyMapping = {\n enterprise: {\n colorScheme: {\n dark: 'enterpriseDark',\n light: 'enterprise',\n },\n },\n prisma: {\n colorScheme: {\n dark: 'scp',\n light: 'enterprise',\n },\n },\n};\n\nconst themeIdToVariant = {\n enterpriseLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Light Comfortable',\n },\n enterpriseLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Light Compact',\n },\n enterpriseDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Dark Comfortable',\n },\n enterpriseDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Dark Compact',\n },\n prismaLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Light Comfortable',\n },\n prismaLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Light Compact',\n },\n prismaDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Dark Comfortable',\n },\n prismaDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Dark Compact',\n },\n};\n\nconst ThemesDoc = props => {\n const { renderVisualization, themes: themeVars } = props;\n const [highlightedThemeVariable, setHighlightedThemeVariable] = useState('');\n const [selectedTheme, setSelectedTheme] = useState(themeIdToVariant.enterpriseLightComfortable);\n const previewTheme = cloneDeep(themeVars);\n // if the highlighted theme variable is a color, color it red\n // TODO(fkurniawan): fix red highlighting. this broke ~v20.7.0, and approach needs to be modified again owing to SUI upgrade\n if (isColor(themeVars[highlightedThemeVariable])) {\n previewTheme[highlightedThemeVariable] = () => 'red';\n }\n return (\n <ColumnLayout style={{ marginTop: -20 }}>\n <ColumnLayout.Row>\n <ColumnLayout.Column span={12}>\n <Heading level={4}>Theme</Heading>\n <Select value={selectedTheme} onChange={(e, { value }) => setSelectedTheme(value)}>\n {Object.keys(themeIdToVariant).map(themeId => (\n <Select.Option\n key={themeId}\n label={themeIdToVariant[themeId].label}\n value={themeIdToVariant[themeId]}\n />\n ))}\n </Select>\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n <ColumnLayout.Row>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={4}>\n <Heading level={4}>Preview</Heading>\n <SplunkThemeProvider\n family={selectedTheme.family}\n colorScheme={selectedTheme.colorScheme}\n density={selectedTheme.density}\n >\n {renderVisualization()}\n </SplunkThemeProvider>\n <Message type=\"info\">\n This preview may differ from the visualization's default look and feel. <br />\n It exists to show areas affected by theme variables.\n </Message>\n </ColumnLayout.Column>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={8}>\n <Heading level={4}>Variables</Heading>\n {Object.keys(previewTheme).map(varKey => {\n const themeValue = previewTheme[varKey]({\n theme: { splunkThemeV1: omit(selectedTheme, ['label']) },\n });\n // if a theme variable is in @splunk/visualization-themes and it has the same value\n // we assume we used the shared variable.\n const isFromSharedVariables =\n sharedThemeVariables?.[\n themeFamilyMapping?.[selectedTheme.family]?.[selectedTheme.colorScheme]\n ]?.[varKey] === themeValue;\n // for now we only show simple theme values (nested theme objects shouldn't have been introduced in the first place)\n let isJSON;\n try {\n isJSON = typeof JSON.parse(themeValue) === 'object';\n } catch (e) {} // eslint-disable-line no-empty\n return (\n !isJSON && (\n <ThemeVar\n key={varKey}\n onMouseOver={() => setHighlightedThemeVariable(varKey)}\n onMouseOut={() => setHighlightedThemeVariable('')}\n >\n <ThemeVarName\n highlighted={varKey === highlightedThemeVariable}\n >{`${varKey}`}</ThemeVarName>\n {isFromSharedVariables && (\n <Tooltip content=\"This is a shared theme variable from @splunk/visualization-themes\" />\n )}\n <Pair title=\"Value\" text={themeValue} />\n </ThemeVar>\n )\n );\n })}\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n </ColumnLayout>\n );\n};\n\nThemesDoc.propTypes = {\n themes: T.object.isRequired, // @TODO: replace with themes object from viz config when we add docs/descs to theme vars\n renderVisualization: T.func.isRequired,\n};\n\nexport default ThemesDoc;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@splunk/react-ui/ColumnLayout\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"styled-components\"","webpack:///external \"@splunk/visualization-themes/variables\"","webpack:///external \"@splunk/react-ui/Select\"","webpack:///external \"lodash/omit\"","webpack:///external \"lodash/cloneDeep\"","webpack:///external \"@splunk/react-ui/Message\"","webpack:///external \"@splunk/react-ui/Tooltip\"","webpack:///external \"@splunk/themes/SplunkThemeProvider\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///./src/common/ThemesDoc.jsx","webpack:///external \"@babel/runtime/helpers/typeof\""],"names":["ThemeVar","styled","ThemeVarName","props","PairContainer","PairTitle","ColorPreview","Pair","title","text","isColor","T","string","themeFamilyMapping","enterprise","colorScheme","dark","light","prisma","themeIdToVariant","enterpriseLightComfortable","density","family","label","enterpriseLightCompact","enterpriseDarkComfortable","enterpriseDarkCompact","prismaLightComfortable","prismaLightCompact","prismaDarkComfortable","prismaDarkCompact","ThemesDoc","renderVisualization","themeVars","useState","highlightedThemeVariable","setHighlightedThemeVariable","selectedTheme","setSelectedTheme","previewTheme","cloneDeep","marginTop","value","padding","themeValue","theme","splunkThemeV1","omit","isFromSharedVariables","isJSON","JSON","varKey","themes","isRequired"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kC;;;;;;;ACAA,uC;;;;;;;ACAA,0D;;;;;;;ACAA,qE;;;;;;;ACAA,iE;;;;;;;ACAA,8C;;;;;;;ACAA,mE;;;;;;;ACAA,oD;;;;;;;ACAA,wC;;;;;;;ACAA,6C;;;;;;;ACAA,qD;;;;;;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R;AAhDpB,GAiCiB,CAFL,CAfJ,CAfJ,CADJ;AAVJ;;AAkFAb,SAAS,CAATA,YAAsB;AAClBqB,QAAM,EAAEzC,iDAAC,CAADA,OADU;AACW;AAC7BqB,qBAAmB,EAAErB,iDAAC,CAADA,KAAO0C;AAFV,CAAtBtB;AAKA,0E;;;;;;;ACnNA,0D","file":"ThemesDoc.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 66);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"styled-components\");","module.exports = require(\"@splunk/visualization-themes/variables\");","module.exports = require(\"@splunk/react-ui/Select\");","module.exports = require(\"lodash/omit\");","module.exports = require(\"lodash/cloneDeep\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes/SplunkThemeProvider\");","module.exports = require(\"@splunk/react-ui/Heading\");","/* eslint-disable react/no-multi-comp */\nimport React, { useState } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport styled from 'styled-components';\nimport omit from 'lodash/omit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport Select from '@splunk/react-ui/Select';\nimport Message from '@splunk/react-ui/Message';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport * as sharedThemeVariables from '@splunk/visualization-themes/variables';\n\nconst ThemeVar = styled.div`\n margin-top: 20px;\n cursor: pointer;\n`;\nconst ThemeVarName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n display: inline-block;\n padding-right: 5px;\n font-weight: ${props => (props.highlighted ? 'bold' : 'normal')};\n`;\nconst PairContainer = styled.div`\n margin-left: 40px;\n margin-top: 10px;\n`;\nconst PairTitle = styled.span`\n display: inline-block;\n color: #8293a7;\n width: 80px;\n`;\nconst ColorPreview = styled.div`\n width: 20px;\n height: 20px;\n background: ${props => props.color};\n display: inline-block;\n vertical-align: bottom;\n margin-right: 5px;\n border: 1px solid rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n`;\n\nconst Pair = ({ title, text }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {isColor(text) && <ColorPreview color={text} />}\n <samp>{text}</samp>\n </PairContainer>\n);\nPair.propTypes = {\n title: T.string,\n text: T.string,\n};\n\nconst themeFamilyMapping = {\n enterprise: {\n colorScheme: {\n dark: 'enterpriseDark',\n light: 'enterprise',\n },\n },\n prisma: {\n colorScheme: {\n dark: 'scp',\n light: 'enterprise',\n },\n },\n};\n\nconst themeIdToVariant = {\n enterpriseLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Light Comfortable',\n },\n enterpriseLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Light Compact',\n },\n enterpriseDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Dark Comfortable',\n },\n enterpriseDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Dark Compact',\n },\n prismaLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Light Comfortable',\n },\n prismaLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Light Compact',\n },\n prismaDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Dark Comfortable',\n },\n prismaDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Dark Compact',\n },\n};\n\nconst ThemesDoc = props => {\n const { renderVisualization, themes: themeVars } = props;\n const [highlightedThemeVariable, setHighlightedThemeVariable] = useState('');\n const [selectedTheme, setSelectedTheme] = useState(themeIdToVariant.enterpriseLightComfortable);\n const previewTheme = cloneDeep(themeVars);\n // if the highlighted theme variable is a color, color it red\n // TODO(fkurniawan): fix red highlighting. this broke ~v20.7.0, and approach needs to be modified again owing to SUI upgrade\n if (isColor(themeVars[highlightedThemeVariable])) {\n previewTheme[highlightedThemeVariable] = () => 'red';\n }\n return (\n <ColumnLayout style={{ marginTop: -20 }}>\n <ColumnLayout.Row>\n <ColumnLayout.Column span={12}>\n <Heading level={4}>Theme</Heading>\n <Select value={selectedTheme} onChange={(e, { value }) => setSelectedTheme(value)}>\n {Object.keys(themeIdToVariant).map(themeId => (\n <Select.Option\n key={themeId}\n label={themeIdToVariant[themeId].label}\n value={themeIdToVariant[themeId]}\n />\n ))}\n </Select>\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n <ColumnLayout.Row>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={4}>\n <Heading level={4}>Preview</Heading>\n <SplunkThemeProvider\n family={selectedTheme.family}\n colorScheme={selectedTheme.colorScheme}\n density={selectedTheme.density}\n >\n {renderVisualization()}\n </SplunkThemeProvider>\n <Message type=\"info\">\n This preview may differ from the visualization's default look and feel. <br />\n It exists to show areas affected by theme variables.\n </Message>\n </ColumnLayout.Column>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={8}>\n <Heading level={4}>Variables</Heading>\n {Object.keys(previewTheme).map(varKey => {\n const themeValue = previewTheme[varKey]({\n theme: { splunkThemeV1: omit(selectedTheme, ['label']) },\n });\n // if a theme variable is in @splunk/visualization-themes and it has the same value\n // we assume we used the shared variable.\n const isFromSharedVariables =\n sharedThemeVariables?.[\n themeFamilyMapping?.[selectedTheme.family]?.[selectedTheme.colorScheme]\n ]?.[varKey] === themeValue;\n // for now we only show simple theme values (nested theme objects shouldn't have been introduced in the first place)\n let isJSON;\n try {\n isJSON = typeof JSON.parse(themeValue) === 'object';\n } catch (e) {} // eslint-disable-line no-empty\n return (\n !isJSON && (\n <ThemeVar\n key={varKey}\n onMouseOver={() => setHighlightedThemeVariable(varKey)}\n onMouseOut={() => setHighlightedThemeVariable('')}\n >\n <ThemeVarName\n highlighted={varKey === highlightedThemeVariable}\n >{`${varKey}`}</ThemeVarName>\n {isFromSharedVariables && (\n <Tooltip content=\"This is a shared theme variable from @splunk/visualization-themes\" />\n )}\n <Pair title=\"Value\" text={themeValue} />\n </ThemeVar>\n )\n );\n })}\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n </ColumnLayout>\n );\n};\n\nThemesDoc.propTypes = {\n themes: T.object.isRequired, // @TODO: replace with themes object from viz config when we add docs/descs to theme vars\n renderVisualization: T.func.isRequired,\n};\n\nexport default ThemesDoc;\n","module.exports = require(\"@babel/runtime/helpers/typeof\");"],"sourceRoot":""}
|
package/common/chartingUtils.js
CHANGED
|
@@ -92,7 +92,7 @@ module.exports =
|
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 26:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
98
|
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
@@ -112,7 +112,7 @@ module.exports = require("lodash");
|
|
|
112
112
|
"use strict";
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
var _toConsumableArray = __webpack_require__(
|
|
115
|
+
var _toConsumableArray = __webpack_require__(26);
|
|
116
116
|
|
|
117
117
|
var __rest = this && this.__rest || function (s, e) {
|
|
118
118
|
var t = {};
|
|
@@ -179,7 +179,7 @@ var truncateData = function truncateData(dataSet, truncationLimit) {
|
|
|
179
179
|
|
|
180
180
|
var truncatedData = Object.assign({}, dataSet);
|
|
181
181
|
truncatedData.columns = truncatedData.columns.map(function (columnData) {
|
|
182
|
-
return columnData.slice(0, limit);
|
|
182
|
+
return columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData;
|
|
183
183
|
});
|
|
184
184
|
return truncatedData;
|
|
185
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/chartingUtils.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,qE;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAOA;;;;;;;;AAQG;;;AACI,IAAM,cAAc,GAAG,SAAjB,cAAiB;AAAA,MAAG,WAAH,QAAG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CAAtB;AACA,QAAM,SAAS,GAAG,yBAAiB,EAAjB,EAAqB,EAArB,EAAyB,GAAzB,CAA6B,gBAAM;AAAA,aAAI,MAAM,SAAN,UAAM,WAAN,GAAM,MAAN,SAAM,CAAE,GAAR,CAAY,MAAZ,CAAJ;AAAA,KAAnC,CAAlB;AACA,iBAAa,CAAC,OAAd,CAAsB,UAAC,OAAD,EAAU,KAAV,EAAmB;AACrC,UAAI,YAAY,CAAC,OAAb,CAAqB,OAArB,MAAkC,CAAC,CAAnC,IAAwC,SAAS,CAAC,KAAD,CAArD,EAA8D;AAC1D,cAAM,CAAC,IAAP,CAAY;AACR,cAAI,EAAE;AADE,SAAZ;AAGA,eAAO,CAAC,IAAR,CAAa,SAAS,CAAC,KAAD,CAAtB;AACH;AACJ,KAPD;AAQH;;AACD,SAAO;AACH,WAAO,EAAP,OADG;AAEH,UAAM,EAAN;AAFG,GAAP;AAIH,CA9BM;;AAAM,oCAAyB,yBAAzB,C","file":"chartingUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 67);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","import { has, isArray, isUndefined } from 'lodash';\nimport type { JsonColumnData } from './interfaces/DataSource';\n\ninterface ChartOptions {\n [key: string]: any;\n}\n\n/**\n * Get formatted annotations\n * @method getAnnotations\n * @param {Object} options\n * @param {Array} options.annotationX\n * @param {Array} options.annotationColor\n * @param {Array} options.annotationLabel\n * @returns {Array}\n */\nexport const getAnnotations = ({ annotationX, annotationColor, annotationLabel }) =>\n annotationX && annotationX.length\n ? annotationX.map((timestamp, i) => ({\n color: annotationColor && annotationColor[i],\n label: annotationLabel && annotationLabel[i],\n time: timestamp,\n }))\n : [];\n\n/**\n * Truncate the result set to given limit\n * @method truncateData\n * @param {Object} dataSet - dataSources.primary.data\n * @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']\n * @returns {Object}\n */\nexport const truncateData = (dataSet, truncationLimit): Record<string, any[]> => {\n if (!dataSet) {\n return null;\n }\n\n const limit = parseInt(truncationLimit, 10);\n if (!limit || limit <= 0) {\n return dataSet;\n }\n\n const truncatedData: Record<string, Array<string[] | number[]>> = { ...dataSet };\n truncatedData.columns = truncatedData.columns.map(columnData => columnData.slice(0, limit));\n return truncatedData;\n};\n\n/**\n * Helper method to update the option values into the values that SC accepts\n * @method mapToValues\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToValues = (optionValuesSCMapping: Record<string, any>) => options => {\n const convertedOptions: Record<string, any> = { ...options };\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(options, key)) {\n const updatedValue = optionValuesSCMapping[key][options[key]];\n if (!isUndefined(updatedValue)) {\n convertedOptions[key] = updatedValue;\n }\n }\n });\n return convertedOptions;\n};\n\ninterface y2AxisOptions extends ChartOptions {\n y2Fields?: string | string[];\n}\n\n/**\n * Helper method to process options related to y2Fields\n * @method convertY2AxisOptions\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertY2AxisOptions = ({\n y2Fields,\n ...originalOptions\n}: y2AxisOptions): Record<string, any> => {\n const convertedOptions: Record<string, any> = {\n ...originalOptions,\n };\n if (y2Fields) {\n convertedOptions['axisY2.enabled'] = true;\n convertedOptions['axisY2.fields'] = isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n return convertedOptions;\n};\n\n/**\n * Helper method to format value for overlayFields\n * @method convertOverlayFields\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertOverlayFields = (originalOptions: ChartOptions): ChartOptions => {\n const convertedOptions: ChartOptions = {\n ...originalOptions,\n };\n const { overlayFields } = originalOptions;\n if (overlayFields) {\n convertedOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n return convertedOptions;\n};\n\n/**\n * checks whether data is multi series data\n * @param {array} data array\n * @return {Boolean}\n */\nexport const isMultiSeriesData = (data: string[] | string[][]): boolean =>\n Array.isArray(data) && Array.isArray(data[0]);\n/**\n * checks whether data is multi series data and returns value as array\n * @param {array} data array\n * @param {*} value to return as array\n * @return {array}\n */\nexport const toArrayForSeries = (data, value): any[] => (isMultiSeriesData(data) ? value : [value]);\n\ninterface ConstructFieldsAndColumnsParams {\n x: string[];\n y: string[] | string[][];\n xField: string;\n yFields: string | string[];\n y2?: string[] | string[][];\n y2Fields?: string | string[];\n}\nexport const constructFieldsAndColumns = ({\n x = [],\n y = [],\n xField,\n yFields,\n y2,\n y2Fields,\n}: ConstructFieldsAndColumnsParams): JsonColumnData => {\n const columns = [x.map(String), ...toArrayForSeries(y, y).map(series => series.map(String))];\n const yFieldsArray = toArrayForSeries(y, yFields);\n const fields = [{ name: xField }, ...yFieldsArray.map(field => ({ name: field }))];\n // splunk-charting requires y2 to be part of columns\n // when y & y2 options are configured with different (mutually exclusive) series\n // y2 columns need to be added to columns\n if (y2Fields) {\n const y2FieldsArray = toArrayForSeries(y2, y2Fields);\n const y2AsArray = toArrayForSeries(y2, y2).map(series => series?.map(String));\n y2FieldsArray.forEach((y2Field, index) => {\n if (yFieldsArray.indexOf(y2Field) === -1 && y2AsArray[index]) {\n fields.push({\n name: y2Field,\n });\n columns.push(y2AsArray[index]);\n }\n });\n }\n return {\n columns,\n fields,\n };\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/chartingUtils.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,qE;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAOA;;;;;;;;AAQG;;;AACI,IAAM,cAAc,GAAG,SAAjB,cAAiB;AAAA,MAAG,WAAH,QAAG,WAAH;AAAA,MAAgB,eAAhB,QAAgB,eAAhB;AAAA,MAAiC,eAAjC,QAAiC,eAAjC;AAAA,SAC1B,WAAW,IAAI,WAAW,CAAC,MAA3B,GACM,WAAW,CAAC,GAAZ,CAAgB,UAAC,SAAD,EAAY,CAAZ;AAAA,WAAmB;AAC/B,WAAK,EAAE,eAAe,IAAI,eAAe,CAAC,CAAD,CADV;AAE/B,WAAK,EAAE,eAAe,IAAI,eAAe,CAAC,CAAD,CAFV;AAG/B,UAAI,EAAE;AAHyB,KAAnB;AAAA,GAAhB,CADN,GAMM,EAPoB;AAAA,CAAvB;;AAAM,yBAAc,cAAd;AASb;;;;;;AAMG;;AACI,IAAM,YAAY,GAAG,SAAf,YAAe,CAAC,OAAD,EAAU,eAAV,EAAoD;AAC5E,MAAI,C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AO,CAAC,IAAR,CAAa,SAAS,CAAC,KAAD,CAAtB;AACH;AACJ,KAPD;AAQH;;AACD,SAAO;AACH,WAAO,EAAP,OADG;AAEH,UAAM,EAAN;AAFG,GAAP;AAIH,CA9BM;;AAAM,oCAAyB,yBAAzB,C","file":"chartingUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 67);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","import { has, isArray, isUndefined } from 'lodash';\nimport type { JsonColumnData } from './interfaces/DataSource';\n\ninterface ChartOptions {\n [key: string]: any;\n}\n\n/**\n * Get formatted annotations\n * @method getAnnotations\n * @param {Object} options\n * @param {Array} options.annotationX\n * @param {Array} options.annotationColor\n * @param {Array} options.annotationLabel\n * @returns {Array}\n */\nexport const getAnnotations = ({ annotationX, annotationColor, annotationLabel }) =>\n annotationX && annotationX.length\n ? annotationX.map((timestamp, i) => ({\n color: annotationColor && annotationColor[i],\n label: annotationLabel && annotationLabel[i],\n time: timestamp,\n }))\n : [];\n\n/**\n * Truncate the result set to given limit\n * @method truncateData\n * @param {Object} dataSet - dataSources.primary.data\n * @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']\n * @returns {Object}\n */\nexport const truncateData = (dataSet, truncationLimit): Record<string, any[]> => {\n if (!dataSet) {\n return null;\n }\n\n const limit = parseInt(truncationLimit, 10);\n if (!limit || limit <= 0) {\n return dataSet;\n }\n\n const truncatedData: Record<string, Array<string[] | number[]>> = { ...dataSet };\n truncatedData.columns = truncatedData.columns.map(columnData =>\n columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData\n );\n return truncatedData;\n};\n\n/**\n * Helper method to update the option values into the values that SC accepts\n * @method mapToValues\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToValues = (optionValuesSCMapping: Record<string, any>) => options => {\n const convertedOptions: Record<string, any> = { ...options };\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(options, key)) {\n const updatedValue = optionValuesSCMapping[key][options[key]];\n if (!isUndefined(updatedValue)) {\n convertedOptions[key] = updatedValue;\n }\n }\n });\n return convertedOptions;\n};\n\ninterface y2AxisOptions extends ChartOptions {\n y2Fields?: string | string[];\n}\n\n/**\n * Helper method to process options related to y2Fields\n * @method convertY2AxisOptions\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertY2AxisOptions = ({\n y2Fields,\n ...originalOptions\n}: y2AxisOptions): Record<string, any> => {\n const convertedOptions: Record<string, any> = {\n ...originalOptions,\n };\n if (y2Fields) {\n convertedOptions['axisY2.enabled'] = true;\n convertedOptions['axisY2.fields'] = isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n return convertedOptions;\n};\n\n/**\n * Helper method to format value for overlayFields\n * @method convertOverlayFields\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertOverlayFields = (originalOptions: ChartOptions): ChartOptions => {\n const convertedOptions: ChartOptions = {\n ...originalOptions,\n };\n const { overlayFields } = originalOptions;\n if (overlayFields) {\n convertedOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n return convertedOptions;\n};\n\n/**\n * checks whether data is multi series data\n * @param {array} data array\n * @return {Boolean}\n */\nexport const isMultiSeriesData = (data: string[] | string[][]): boolean =>\n Array.isArray(data) && Array.isArray(data[0]);\n/**\n * checks whether data is multi series data and returns value as array\n * @param {array} data array\n * @param {*} value to return as array\n * @return {array}\n */\nexport const toArrayForSeries = (data, value): any[] => (isMultiSeriesData(data) ? value : [value]);\n\ninterface ConstructFieldsAndColumnsParams {\n x: string[];\n y: string[] | string[][];\n xField: string;\n yFields: string | string[];\n y2?: string[] | string[][];\n y2Fields?: string | string[];\n}\nexport const constructFieldsAndColumns = ({\n x = [],\n y = [],\n xField,\n yFields,\n y2,\n y2Fields,\n}: ConstructFieldsAndColumnsParams): JsonColumnData => {\n const columns = [x.map(String), ...toArrayForSeries(y, y).map(series => series.map(String))];\n const yFieldsArray = toArrayForSeries(y, yFields);\n const fields = [{ name: xField }, ...yFieldsArray.map(field => ({ name: field }))];\n // splunk-charting requires y2 to be part of columns\n // when y & y2 options are configured with different (mutually exclusive) series\n // y2 columns need to be added to columns\n if (y2Fields) {\n const y2FieldsArray = toArrayForSeries(y2, y2Fields);\n const y2AsArray = toArrayForSeries(y2, y2).map(series => series?.map(String));\n y2FieldsArray.forEach((y2Field, index) => {\n if (yFieldsArray.indexOf(y2Field) === -1 && y2AsArray[index]) {\n fields.push({\n name: y2Field,\n });\n columns.push(y2AsArray[index]);\n }\n });\n }\n return {\n columns,\n fields,\n };\n};\n"],"sourceRoot":""}
|
package/common/gaugeUtils.js
CHANGED
|
@@ -92,7 +92,7 @@ module.exports =
|
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 26:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
98
|
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
@@ -119,7 +119,7 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
119
119
|
"use strict";
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
var _toConsumableArray = __webpack_require__(
|
|
122
|
+
var _toConsumableArray = __webpack_require__(26);
|
|
123
123
|
|
|
124
124
|
Object.defineProperty(exports, "__esModule", {
|
|
125
125
|
value: true
|
package/common/shapeUtils.js
CHANGED
|
@@ -99,7 +99,7 @@ module.exports = require("styled-components");
|
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 27:
|
|
103
103
|
/***/ (function(module, exports) {
|
|
104
104
|
|
|
105
105
|
module.exports = require("@splunk/themes/variables");
|
|
@@ -130,7 +130,7 @@ var styled_components_1 = __webpack_require__(2);
|
|
|
130
130
|
|
|
131
131
|
var pick_1 = __webpack_require__(73);
|
|
132
132
|
|
|
133
|
-
var variables_1 = __webpack_require__(
|
|
133
|
+
var variables_1 = __webpack_require__(27);
|
|
134
134
|
|
|
135
135
|
var propUtils_1 = __webpack_require__(74); // map for new options names to old option names
|
|
136
136
|
|
|
@@ -140,21 +140,21 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
140
140
|
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
141
141
|
|
|
142
142
|
/***/ }),
|
|
143
|
-
/* 9
|
|
144
|
-
/* 10 */,
|
|
145
|
-
/* 11 */
|
|
143
|
+
/* 9 */
|
|
146
144
|
/***/ (function(module, exports) {
|
|
147
145
|
|
|
148
146
|
module.exports = require("@babel/runtime/helpers/typeof");
|
|
149
147
|
|
|
150
148
|
/***/ }),
|
|
151
|
-
/*
|
|
149
|
+
/* 10 */,
|
|
150
|
+
/* 11 */,
|
|
151
|
+
/* 12 */,
|
|
152
|
+
/* 13 */
|
|
152
153
|
/***/ (function(module, exports) {
|
|
153
154
|
|
|
154
155
|
module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
155
156
|
|
|
156
157
|
/***/ }),
|
|
157
|
-
/* 13 */,
|
|
158
158
|
/* 14 */,
|
|
159
159
|
/* 15 */,
|
|
160
160
|
/* 16 */,
|
|
@@ -206,11 +206,17 @@ var VizBehavior;
|
|
|
206
206
|
/* 21 */
|
|
207
207
|
/***/ (function(module, exports) {
|
|
208
208
|
|
|
209
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
210
|
+
|
|
211
|
+
/***/ }),
|
|
212
|
+
/* 22 */
|
|
213
|
+
/***/ (function(module, exports) {
|
|
214
|
+
|
|
209
215
|
module.exports = require("@splunk/visualizations-shared/style");
|
|
210
216
|
|
|
211
217
|
/***/ }),
|
|
212
|
-
/*
|
|
213
|
-
/*
|
|
218
|
+
/* 23 */,
|
|
219
|
+
/* 24 */
|
|
214
220
|
/***/ (function(module, exports, __webpack_require__) {
|
|
215
221
|
|
|
216
222
|
"use strict";
|
|
@@ -228,7 +234,7 @@ var T = __webpack_require__(1);
|
|
|
228
234
|
|
|
229
235
|
var lodash_1 = __webpack_require__(3);
|
|
230
236
|
|
|
231
|
-
var VizActionHandler_1 = __webpack_require__(
|
|
237
|
+
var VizActionHandler_1 = __webpack_require__(25); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
232
238
|
|
|
233
239
|
|
|
234
240
|
exports.INITIAL_WIDTH = 250;
|
|
@@ -361,7 +367,7 @@ SplunkVisualization.defaultProps = {
|
|
|
361
367
|
exports.default = SplunkVisualization;
|
|
362
368
|
|
|
363
369
|
/***/ }),
|
|
364
|
-
/*
|
|
370
|
+
/* 25 */
|
|
365
371
|
/***/ (function(module, exports, __webpack_require__) {
|
|
366
372
|
|
|
367
373
|
"use strict";
|
|
@@ -398,20 +404,20 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
398
404
|
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
399
405
|
|
|
400
406
|
/***/ }),
|
|
401
|
-
/*
|
|
402
|
-
/*
|
|
407
|
+
/* 26 */,
|
|
408
|
+
/* 27 */
|
|
403
409
|
/***/ (function(module, exports) {
|
|
404
410
|
|
|
405
411
|
module.exports = require("@splunk/themes/variables");
|
|
406
412
|
|
|
407
413
|
/***/ }),
|
|
408
|
-
/*
|
|
414
|
+
/* 28 */
|
|
409
415
|
/***/ (function(module, exports, __webpack_require__) {
|
|
410
416
|
|
|
411
417
|
"use strict";
|
|
412
418
|
|
|
413
419
|
|
|
414
|
-
var _typeof = __webpack_require__(
|
|
420
|
+
var _typeof = __webpack_require__(9);
|
|
415
421
|
|
|
416
422
|
Object.defineProperty(exports, "__esModule", {
|
|
417
423
|
value: true
|
|
@@ -533,10 +539,10 @@ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(s
|
|
|
533
539
|
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
534
540
|
|
|
535
541
|
/***/ }),
|
|
536
|
-
/* 28 */,
|
|
537
542
|
/* 29 */,
|
|
538
543
|
/* 30 */,
|
|
539
|
-
/* 31
|
|
544
|
+
/* 31 */,
|
|
545
|
+
/* 32 */
|
|
540
546
|
/***/ (function(module, exports, __webpack_require__) {
|
|
541
547
|
|
|
542
548
|
"use strict";
|
|
@@ -550,11 +556,11 @@ var React = __webpack_require__(0);
|
|
|
550
556
|
|
|
551
557
|
var styled_components_1 = __webpack_require__(2);
|
|
552
558
|
|
|
553
|
-
var SizeAwareWrapper_1 = __webpack_require__(
|
|
559
|
+
var SizeAwareWrapper_1 = __webpack_require__(86);
|
|
554
560
|
|
|
555
|
-
var style_1 = __webpack_require__(
|
|
561
|
+
var style_1 = __webpack_require__(22);
|
|
556
562
|
|
|
557
|
-
var colorUtils_1 = __webpack_require__(
|
|
563
|
+
var colorUtils_1 = __webpack_require__(13);
|
|
558
564
|
|
|
559
565
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
560
566
|
var width = _ref.width;
|
|
@@ -611,7 +617,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
611
617
|
|
|
612
618
|
return React.createElement(FixSizeItem, {
|
|
613
619
|
"data-test": "fix-size-item",
|
|
614
|
-
"data-splunk-visualization-version": "24.
|
|
620
|
+
"data-splunk-visualization-version": "24.5.0 - b75bfbe79",
|
|
615
621
|
width: width,
|
|
616
622
|
height: height,
|
|
617
623
|
backgroundColor: backgroundColor
|
|
@@ -632,7 +638,6 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
632
638
|
exports.default = withFixedSizeContainer;
|
|
633
639
|
|
|
634
640
|
/***/ }),
|
|
635
|
-
/* 32 */,
|
|
636
641
|
/* 33 */,
|
|
637
642
|
/* 34 */,
|
|
638
643
|
/* 35 */,
|
|
@@ -695,27 +700,31 @@ var Options_1 = __webpack_require__(77);
|
|
|
695
700
|
|
|
696
701
|
var SanitizeProps_1 = __webpack_require__(78);
|
|
697
702
|
|
|
703
|
+
var TimezoneContext_1 = __webpack_require__(21);
|
|
704
|
+
|
|
705
|
+
var moment_1 = __webpack_require__(79);
|
|
706
|
+
|
|
698
707
|
var styled_components_1 = __webpack_require__(2);
|
|
699
708
|
|
|
700
|
-
var SplunkVisualization_1 = __webpack_require__(
|
|
709
|
+
var SplunkVisualization_1 = __webpack_require__(24);
|
|
701
710
|
|
|
702
711
|
var VizBehavior_1 = __webpack_require__(19);
|
|
703
712
|
|
|
704
|
-
var getSorting_1 = __webpack_require__(
|
|
713
|
+
var getSorting_1 = __webpack_require__(80);
|
|
705
714
|
|
|
706
|
-
var getPagination_1 = __webpack_require__(
|
|
715
|
+
var getPagination_1 = __webpack_require__(82);
|
|
707
716
|
|
|
708
|
-
var useDeepMemo_1 = __webpack_require__(
|
|
717
|
+
var useDeepMemo_1 = __webpack_require__(83);
|
|
709
718
|
|
|
710
|
-
var JSONSchemaUtils_1 = __webpack_require__(
|
|
719
|
+
var JSONSchemaUtils_1 = __webpack_require__(84);
|
|
711
720
|
|
|
712
|
-
var MissingPropsMessage_1 = __webpack_require__(
|
|
721
|
+
var MissingPropsMessage_1 = __webpack_require__(85);
|
|
713
722
|
|
|
714
|
-
var withEditModeCover_1 = __webpack_require__(
|
|
723
|
+
var withEditModeCover_1 = __webpack_require__(87);
|
|
715
724
|
|
|
716
|
-
var withPlaceholder_1 = __webpack_require__(
|
|
725
|
+
var withPlaceholder_1 = __webpack_require__(88);
|
|
717
726
|
|
|
718
|
-
var hocUtils_1 = __webpack_require__(
|
|
727
|
+
var hocUtils_1 = __webpack_require__(28);
|
|
719
728
|
/**
|
|
720
729
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
721
730
|
* @param {DashboardVizOpts} opts
|
|
@@ -748,6 +757,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
748
757
|
theme = props.theme,
|
|
749
758
|
onRequestParamsChange = props.onRequestParamsChange;
|
|
750
759
|
|
|
760
|
+
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
761
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
762
|
+
|
|
763
|
+
if (serializedTimezone) {
|
|
764
|
+
/*
|
|
765
|
+
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
766
|
+
This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
|
|
767
|
+
will use it.
|
|
768
|
+
@TODO(pwied):
|
|
769
|
+
- remove when we moved away from @splunk/moment
|
|
770
|
+
- provide timezone context to dynamic option evaluation phase
|
|
771
|
+
*/
|
|
772
|
+
if (!moment_1.default.getDefaultSplunkTimezone()) {
|
|
773
|
+
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
751
777
|
var themeFunc = function themeFunc(themeVar) {
|
|
752
778
|
var _a, _b;
|
|
753
779
|
|
|
@@ -776,7 +802,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
776
802
|
console.error("unexpected error evaluating options: + ".concat(e.message));
|
|
777
803
|
return {};
|
|
778
804
|
}
|
|
779
|
-
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources]); // useEffect hook needs to be initialized before any early returns
|
|
805
|
+
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
|
|
780
806
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
781
807
|
|
|
782
808
|
React.useEffect(function () {
|
|
@@ -918,6 +944,12 @@ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
|
918
944
|
|
|
919
945
|
/***/ }),
|
|
920
946
|
/* 79 */
|
|
947
|
+
/***/ (function(module, exports) {
|
|
948
|
+
|
|
949
|
+
module.exports = require("@splunk/moment");
|
|
950
|
+
|
|
951
|
+
/***/ }),
|
|
952
|
+
/* 80 */
|
|
921
953
|
/***/ (function(module, exports, __webpack_require__) {
|
|
922
954
|
|
|
923
955
|
"use strict";
|
|
@@ -934,7 +966,7 @@ var T = __webpack_require__(1);
|
|
|
934
966
|
|
|
935
967
|
var lodash_1 = __webpack_require__(3);
|
|
936
968
|
|
|
937
|
-
var DataSource_1 = __webpack_require__(
|
|
969
|
+
var DataSource_1 = __webpack_require__(81);
|
|
938
970
|
|
|
939
971
|
exports.SortParamsPropTypes = T.shape({
|
|
940
972
|
currentSortKey: T.string,
|
|
@@ -987,7 +1019,7 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
987
1019
|
exports.getSortingParams = getSortingParams;
|
|
988
1020
|
|
|
989
1021
|
/***/ }),
|
|
990
|
-
/*
|
|
1022
|
+
/* 81 */
|
|
991
1023
|
/***/ (function(module, exports, __webpack_require__) {
|
|
992
1024
|
|
|
993
1025
|
"use strict";
|
|
@@ -1000,7 +1032,7 @@ exports.validSortDirs = void 0;
|
|
|
1000
1032
|
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1001
1033
|
|
|
1002
1034
|
/***/ }),
|
|
1003
|
-
/*
|
|
1035
|
+
/* 82 */
|
|
1004
1036
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1005
1037
|
|
|
1006
1038
|
"use strict";
|
|
@@ -1064,7 +1096,7 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1064
1096
|
exports.getPaginationParams = getPaginationParams;
|
|
1065
1097
|
|
|
1066
1098
|
/***/ }),
|
|
1067
|
-
/*
|
|
1099
|
+
/* 83 */
|
|
1068
1100
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1069
1101
|
|
|
1070
1102
|
"use strict";
|
|
@@ -1109,7 +1141,7 @@ var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
|
1109
1141
|
exports.useDeepMemo = useDeepMemo;
|
|
1110
1142
|
|
|
1111
1143
|
/***/ }),
|
|
1112
|
-
/*
|
|
1144
|
+
/* 84 */
|
|
1113
1145
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1114
1146
|
|
|
1115
1147
|
"use strict";
|
|
@@ -1142,7 +1174,7 @@ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
|
|
|
1142
1174
|
exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
|
|
1143
1175
|
|
|
1144
1176
|
/***/ }),
|
|
1145
|
-
/*
|
|
1177
|
+
/* 85 */
|
|
1146
1178
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1147
1179
|
|
|
1148
1180
|
"use strict";
|
|
@@ -1161,7 +1193,7 @@ var i18n_1 = __webpack_require__(7);
|
|
|
1161
1193
|
|
|
1162
1194
|
var Message_1 = __webpack_require__(18);
|
|
1163
1195
|
|
|
1164
|
-
var FixedSizeContainer_1 = __webpack_require__(
|
|
1196
|
+
var FixedSizeContainer_1 = __webpack_require__(32);
|
|
1165
1197
|
/**
|
|
1166
1198
|
* @method isMissing
|
|
1167
1199
|
* @param {any} v
|
|
@@ -1222,13 +1254,13 @@ exports.MissingPropsMessage.defaultProps = {
|
|
|
1222
1254
|
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
1223
1255
|
|
|
1224
1256
|
/***/ }),
|
|
1225
|
-
/*
|
|
1257
|
+
/* 86 */
|
|
1226
1258
|
/***/ (function(module, exports) {
|
|
1227
1259
|
|
|
1228
1260
|
module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
1229
1261
|
|
|
1230
1262
|
/***/ }),
|
|
1231
|
-
/*
|
|
1263
|
+
/* 87 */
|
|
1232
1264
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1233
1265
|
|
|
1234
1266
|
"use strict";
|
|
@@ -1242,14 +1274,14 @@ var React = __webpack_require__(0);
|
|
|
1242
1274
|
|
|
1243
1275
|
var styled_components_1 = __webpack_require__(2);
|
|
1244
1276
|
|
|
1245
|
-
var hocUtils_1 = __webpack_require__(
|
|
1277
|
+
var hocUtils_1 = __webpack_require__(28);
|
|
1246
1278
|
|
|
1247
1279
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1248
1280
|
displayName: "withEditModeCover__Cover",
|
|
1249
1281
|
componentId: "sc-1gsbnxb-0"
|
|
1250
1282
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1251
1283
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1252
|
-
'data-splunk-visualization-version': "24.
|
|
1284
|
+
'data-splunk-visualization-version': "24.5.0 - b75bfbe79"
|
|
1253
1285
|
}).withConfig({
|
|
1254
1286
|
displayName: "withEditModeCover__Blocker",
|
|
1255
1287
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1280,7 +1312,7 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1280
1312
|
exports.default = withEditModeCover;
|
|
1281
1313
|
|
|
1282
1314
|
/***/ }),
|
|
1283
|
-
/*
|
|
1315
|
+
/* 88 */
|
|
1284
1316
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1285
1317
|
|
|
1286
1318
|
"use strict";
|
|
@@ -1292,15 +1324,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1292
1324
|
|
|
1293
1325
|
var React = __webpack_require__(0);
|
|
1294
1326
|
|
|
1295
|
-
var colorUtils_1 = __webpack_require__(
|
|
1327
|
+
var colorUtils_1 = __webpack_require__(13);
|
|
1296
1328
|
|
|
1297
|
-
var variables_1 = __webpack_require__(
|
|
1329
|
+
var variables_1 = __webpack_require__(27);
|
|
1298
1330
|
|
|
1299
|
-
var IconPlaceholder_1 = __webpack_require__(
|
|
1331
|
+
var IconPlaceholder_1 = __webpack_require__(89);
|
|
1300
1332
|
|
|
1301
1333
|
var VizBehavior_1 = __webpack_require__(19);
|
|
1302
1334
|
|
|
1303
|
-
var hocUtils_1 = __webpack_require__(
|
|
1335
|
+
var hocUtils_1 = __webpack_require__(28);
|
|
1304
1336
|
|
|
1305
1337
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1306
1338
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
@@ -1344,7 +1376,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1344
1376
|
exports.default = withPlaceholder;
|
|
1345
1377
|
|
|
1346
1378
|
/***/ }),
|
|
1347
|
-
/*
|
|
1379
|
+
/* 89 */
|
|
1348
1380
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1349
1381
|
|
|
1350
1382
|
"use strict";
|
|
@@ -1365,7 +1397,7 @@ var i18n_1 = __webpack_require__(7);
|
|
|
1365
1397
|
|
|
1366
1398
|
var Message_1 = __webpack_require__(18);
|
|
1367
1399
|
|
|
1368
|
-
var FixedSizeContainer_1 = __webpack_require__(
|
|
1400
|
+
var FixedSizeContainer_1 = __webpack_require__(32);
|
|
1369
1401
|
/**
|
|
1370
1402
|
* @method shouldShowIconPlaceholder
|
|
1371
1403
|
* @param {object} dataSources
|