@splunk/visualizations 26.4.0 → 27.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/Area.config.js +1262 -1600
- package/Area.config.js.map +7 -1
- package/Area.js +3002 -4920
- package/Area.js.map +7 -1
- package/Bar.config.js +1247 -1574
- package/Bar.config.js.map +7 -1
- package/Bar.js +2924 -4836
- package/Bar.js.map +7 -1
- package/Bubble.config.js +896 -1213
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2520 -4476
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2004 -3810
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1208 -1541
- package/Column.config.js.map +7 -1
- package/Column.js +2933 -4879
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1651 -3341
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2615 -4649
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2137 -4578
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1395 -3048
- package/Image.js.map +7 -1
- package/Line.config.js +1278 -1625
- package/Line.config.js.map +7 -1
- package/Line.js +2957 -4919
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5243 -6190
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +12 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3369 -5676
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1645 -3216
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2189 -4535
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2023 -4720
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +1998 -3982
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2709 -5042
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1638 -3262
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2737 -4909
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +876 -1194
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2532 -4470
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +819 -1251
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4203 -7413
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +781 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3350 -6285
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +708 -1119
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3808 -6965
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/Table.config.js +565 -887
- package/Table.config.js.map +7 -1
- package/Table.js +3277 -5386
- package/Table.js.map +7 -1
- package/common/Charting.js +484 -1462
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +347 -912
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +462 -1010
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +237 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1168 -2438
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +52 -43
package/common/ThemesDoc.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
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 \"styled-components\"","webpack:///external \"@splunk/visualization-themes/variables\"","webpack:///external \"@splunk/react-ui/Heading\"","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 \"@babel/runtime/helpers/slicedToArray\"","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,iCAAi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MAEE,UAAU,CAdyB,EActB;;;AACf,WACI,wBACI;AACI,SAAG,EADP;AAEI,iBAAW,EAAE;AAAA,eAAMb,2BAA2B,CAAjC,MAAiC,CAAjC;AAFjB;AAGI,gBAAU,EAAE;AAAA,eAAMA,2BAA2B,CAAjC,EAAiC,CAAjC;AAAA;AAHhB,oBAKI;AACI,iBAAW,EAAEe,MAAM,KAAKhB;AAD5B,iBALJ,MAKI,EALJ,EAQKa,qBAAqB,iBAClB;AAAS,aAAO,EAAC;AAAjB,MATR,eAWI;AAAM,WAAK,EAAX;AAAoB,UAAI,EAAEJ;AAA1B,MAXJ,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 = 96);\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(\"styled-components\");","module.exports = require(\"@splunk/visualization-themes/variables\");","module.exports = require(\"@splunk/react-ui/Heading\");","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(\"@babel/runtime/helpers/slicedToArray\");","/* 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
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/common/ThemesDoc.jsx", "esm-externals:react", "esm-externals:prop-types", "esm-externals:@splunk/react-ui/Heading", "esm-externals:styled-components", "esm-externals:lodash/omit", "esm-externals:lodash/cloneDeep", "esm-externals:@splunk/react-ui/ColumnLayout", "esm-externals:@splunk/react-ui/Select", "esm-externals:@splunk/react-ui/Message", "esm-externals:@splunk/react-ui/Tooltip", "esm-externals:@splunk/themes/SplunkThemeProvider", "esm-externals:@splunk/visualizations-shared/colorUtils", "esm-externals:@splunk/visualization-themes/variables"],
|
|
4
|
+
"sourcesContent": ["/* 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", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"prop-types\";\nexport * from \"prop-types\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/Heading\";\nexport * from \"@splunk/react-ui/Heading\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"styled-components\";\nexport * from \"styled-components\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash/omit\";\nexport * from \"lodash/omit\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash/cloneDeep\";\nexport * from \"lodash/cloneDeep\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/ColumnLayout\";\nexport * from \"@splunk/react-ui/ColumnLayout\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/Select\";\nexport * from \"@splunk/react-ui/Select\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/Message\";\nexport * from \"@splunk/react-ui/Message\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/Tooltip\";\nexport * from \"@splunk/react-ui/Tooltip\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/SplunkThemeProvider\";\nexport * from \"@splunk/themes/SplunkThemeProvider\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/colorUtils\";\nexport * from \"@splunk/visualizations-shared/colorUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-themes/variables\";\nexport * from \"@splunk/visualization-themes/variables\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,+BAAc;AACd,IAAO,qBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,4BAAc;AACd,IAAO,kBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,sCAAc;AACd,IAAO,4BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,8BAAc;AACd,IAAO,oBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,iCAAc;AACd,IAAO,uBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;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AA,IAC/C,SAAS,GAAG;AAAA,IAAC;AACb,WACI,CAAC,UACG;AAAA,MAAC;AAAA;AAAA,QACG,KAAK;AAAA,QACL,aAAa,MAAM,4BAA4B,MAAM;AAAA,QACrD,YAAY,MAAM,4BAA4B,EAAE;AAAA;AAAA,MAEhD;AAAA,QAAC;AAAA;AAAA,UACG,aAAa,WAAW;AAAA;AAAA,QAC1B,GAAG,MAAM;AAAA,MAAG;AAAA,MACb,yBACG,4CAAC,mBAAQ,SAAQ,qEAAoE;AAAA,MAEzF,4CAAC,QAAK,OAAM,SAAQ,MAAM,YAAY;AAAA,IAC1C;AAAA,EAGZ,CAAC,CACL,CACJ,CACJ;AAER;AAEA,UAAU,YAAY;AAAA,EAClB,QAAQ,mBAAE,OAAO;AAAA;AAAA,EACjB,qBAAqB,mBAAE,KAAK;AAChC;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport"]
|
|
7
|
+
}
|
package/common/chartingUtils.js
CHANGED
|
@@ -1,314 +1,155 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
46
|
-
/******/ }
|
|
47
|
-
/******/ };
|
|
48
|
-
/******/
|
|
49
|
-
/******/ // define __esModule on exports
|
|
50
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
51
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
52
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
53
|
-
/******/ }
|
|
54
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
55
|
-
/******/ };
|
|
56
|
-
/******/
|
|
57
|
-
/******/ // create a fake namespace object
|
|
58
|
-
/******/ // mode & 1: value is a module id, require it
|
|
59
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
-
/******/ // mode & 4: return value when already ns object
|
|
61
|
-
/******/ // mode & 8|1: behave like require
|
|
62
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
-
/******/ if(mode & 8) return value;
|
|
65
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
-
/******/ var ns = Object.create(null);
|
|
67
|
-
/******/ __webpack_require__.r(ns);
|
|
68
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
-
/******/ return ns;
|
|
71
|
-
/******/ };
|
|
72
|
-
/******/
|
|
73
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
-
/******/ __webpack_require__.n = function(module) {
|
|
75
|
-
/******/ var getter = module && module.__esModule ?
|
|
76
|
-
/******/ function getDefault() { return module['default']; } :
|
|
77
|
-
/******/ function getModuleExports() { return module; };
|
|
78
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
-
/******/ return getter;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // __webpack_public_path__
|
|
86
|
-
/******/ __webpack_require__.p = "";
|
|
87
|
-
/******/
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s = 97);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ({
|
|
94
|
-
|
|
95
|
-
/***/ 22:
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
|
|
102
|
-
/***/ 3:
|
|
103
|
-
/***/ (function(module, exports) {
|
|
104
|
-
|
|
105
|
-
module.exports = require("lodash");
|
|
106
|
-
|
|
107
|
-
/***/ }),
|
|
108
|
-
|
|
109
|
-
/***/ 97:
|
|
110
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
111
|
-
|
|
112
|
-
"use strict";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var _toConsumableArray = __webpack_require__(22);
|
|
116
|
-
|
|
117
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
118
|
-
var t = {};
|
|
119
|
-
|
|
120
|
-
for (var p in s) {
|
|
121
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
125
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
126
45
|
}
|
|
127
|
-
return
|
|
46
|
+
return to;
|
|
128
47
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
48
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/common/chartingUtils.ts
|
|
60
|
+
var chartingUtils_exports = {};
|
|
61
|
+
__export(chartingUtils_exports, {
|
|
62
|
+
constructFieldsAndColumns: () => constructFieldsAndColumns,
|
|
63
|
+
convertOverlayFields: () => convertOverlayFields,
|
|
64
|
+
convertY2AxisOptions: () => convertY2AxisOptions,
|
|
65
|
+
getAnnotations: () => getAnnotations,
|
|
66
|
+
isMultiSeriesData: () => isMultiSeriesData,
|
|
67
|
+
mapToValues: () => mapToValues,
|
|
68
|
+
shouldEnableSearchZoom: () => shouldEnableSearchZoom,
|
|
69
|
+
toArrayForSeries: () => toArrayForSeries,
|
|
70
|
+
truncateData: () => truncateData
|
|
132
71
|
});
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var lodash_1 = __webpack_require__(3);
|
|
136
|
-
/**
|
|
137
|
-
* Get formatted annotations
|
|
138
|
-
* @method getAnnotations
|
|
139
|
-
* @param {Object} options
|
|
140
|
-
* @param {Array} options.annotationX
|
|
141
|
-
* @param {Array} options.annotationColor
|
|
142
|
-
* @param {Array} options.annotationLabel
|
|
143
|
-
* @returns {Array}
|
|
144
|
-
*/
|
|
145
|
-
|
|
72
|
+
module.exports = __toCommonJS(chartingUtils_exports);
|
|
146
73
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* @method truncateData
|
|
164
|
-
* @param {Object} dataSet - dataSources.primary.data
|
|
165
|
-
* @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']
|
|
166
|
-
* @returns {Object}
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
var truncateData = function truncateData(dataSet, truncationLimit) {
|
|
74
|
+
// esm-externals:lodash
|
|
75
|
+
var lodash_exports = {};
|
|
76
|
+
__export(lodash_exports, {
|
|
77
|
+
default: () => lodash_default
|
|
78
|
+
});
|
|
79
|
+
var defaultImport = __toESM(require("lodash"));
|
|
80
|
+
__reExport(lodash_exports, require("lodash"));
|
|
81
|
+
var lodash_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
82
|
+
|
|
83
|
+
// src/common/chartingUtils.ts
|
|
84
|
+
var getAnnotations = ({ annotationX, annotationColor, annotationLabel }) => annotationX && annotationX.length ? annotationX.map((timestamp, i) => ({
|
|
85
|
+
color: annotationColor && annotationColor[i],
|
|
86
|
+
label: annotationLabel && annotationLabel[i],
|
|
87
|
+
time: timestamp
|
|
88
|
+
})) : [];
|
|
89
|
+
var truncateData = (dataSet, truncationLimit) => {
|
|
170
90
|
if (!dataSet) {
|
|
171
91
|
return null;
|
|
172
92
|
}
|
|
173
|
-
|
|
174
|
-
var limit = parseInt(truncationLimit, 10);
|
|
175
|
-
|
|
93
|
+
const limit = parseInt(truncationLimit, 10);
|
|
176
94
|
if (!limit || limit <= 0) {
|
|
177
95
|
return dataSet;
|
|
178
96
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
});
|
|
97
|
+
const truncatedData = __spreadValues({}, dataSet);
|
|
98
|
+
truncatedData.columns = truncatedData.columns.map(
|
|
99
|
+
(columnData) => columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData
|
|
100
|
+
);
|
|
184
101
|
return truncatedData;
|
|
185
102
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
var mapToValues = function mapToValues(optionValuesSCMapping) {
|
|
196
|
-
return function (options) {
|
|
197
|
-
var convertedOptions = Object.assign({}, options);
|
|
198
|
-
Object.keys(optionValuesSCMapping).forEach(function (key) {
|
|
199
|
-
if ((0, lodash_1.has)(options, key)) {
|
|
200
|
-
var updatedValue = optionValuesSCMapping[key][options[key]];
|
|
201
|
-
|
|
202
|
-
if (!(0, lodash_1.isUndefined)(updatedValue)) {
|
|
203
|
-
convertedOptions[key] = updatedValue;
|
|
204
|
-
}
|
|
103
|
+
var mapToValues = (optionValuesSCMapping) => (options) => {
|
|
104
|
+
const convertedOptions = __spreadValues({}, options);
|
|
105
|
+
Object.keys(optionValuesSCMapping).forEach((key) => {
|
|
106
|
+
if ((0, lodash_exports.has)(options, key)) {
|
|
107
|
+
const updatedValue = optionValuesSCMapping[key][options[key]];
|
|
108
|
+
if (!(0, lodash_exports.isUndefined)(updatedValue)) {
|
|
109
|
+
convertedOptions[key] = updatedValue;
|
|
205
110
|
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return convertedOptions;
|
|
209
114
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
var convertY2AxisOptions = function convertY2AxisOptions(_a) {
|
|
220
|
-
var y2Fields = _a.y2Fields,
|
|
221
|
-
originalOptions = __rest(_a, ["y2Fields"]);
|
|
222
|
-
|
|
223
|
-
var convertedOptions = Object.assign({}, originalOptions);
|
|
224
|
-
|
|
115
|
+
var convertY2AxisOptions = (_a) => {
|
|
116
|
+
var _b = _a, {
|
|
117
|
+
y2Fields
|
|
118
|
+
} = _b, originalOptions = __objRest(_b, [
|
|
119
|
+
"y2Fields"
|
|
120
|
+
]);
|
|
121
|
+
const convertedOptions = __spreadValues({}, originalOptions);
|
|
225
122
|
if (y2Fields) {
|
|
226
|
-
convertedOptions[
|
|
227
|
-
convertedOptions[
|
|
228
|
-
return name;
|
|
229
|
-
}).join(',') : y2Fields;
|
|
123
|
+
convertedOptions["axisY2.enabled"] = true;
|
|
124
|
+
convertedOptions["axisY2.fields"] = (0, lodash_exports.isArray)(y2Fields) ? y2Fields.filter((name) => name).join(",") : y2Fields;
|
|
230
125
|
}
|
|
231
|
-
|
|
232
126
|
return convertedOptions;
|
|
233
127
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
* Helper method to format value for overlayFields
|
|
238
|
-
* @method convertOverlayFields
|
|
239
|
-
* @param {Object} originalOptions
|
|
240
|
-
* @returns {Object}
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
var convertOverlayFields = function convertOverlayFields(originalOptions) {
|
|
244
|
-
var convertedOptions = Object.assign({}, originalOptions);
|
|
245
|
-
var overlayFields = originalOptions.overlayFields;
|
|
246
|
-
|
|
128
|
+
var convertOverlayFields = (originalOptions) => {
|
|
129
|
+
const convertedOptions = __spreadValues({}, originalOptions);
|
|
130
|
+
const { overlayFields } = originalOptions;
|
|
247
131
|
if (overlayFields) {
|
|
248
|
-
convertedOptions.overlayFields = Array.isArray(overlayFields) ? overlayFields.filter(
|
|
249
|
-
return field;
|
|
250
|
-
}).map(function (field) {
|
|
251
|
-
return field.trim();
|
|
252
|
-
}).join(',') : overlayFields;
|
|
132
|
+
convertedOptions.overlayFields = Array.isArray(overlayFields) ? overlayFields.filter((field) => field).map((field) => field.trim()).join(",") : overlayFields;
|
|
253
133
|
}
|
|
254
|
-
|
|
255
134
|
return convertedOptions;
|
|
256
135
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* checks whether data is multi series data and returns value as array
|
|
272
|
-
* @param {array} data array
|
|
273
|
-
* @param {*} value to return as array
|
|
274
|
-
* @return {array}
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
|
-
var toArrayForSeries = function toArrayForSeries(data, value) {
|
|
278
|
-
return (0, exports.isMultiSeriesData)(data) ? value : [value];
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
exports.toArrayForSeries = toArrayForSeries;
|
|
282
|
-
|
|
283
|
-
var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
284
|
-
var _ref2$x = _ref2.x,
|
|
285
|
-
x = _ref2$x === void 0 ? [] : _ref2$x,
|
|
286
|
-
_ref2$y = _ref2.y,
|
|
287
|
-
y = _ref2$y === void 0 ? [] : _ref2$y,
|
|
288
|
-
xField = _ref2.xField,
|
|
289
|
-
yFields = _ref2.yFields,
|
|
290
|
-
y2 = _ref2.y2,
|
|
291
|
-
y2Fields = _ref2.y2Fields;
|
|
292
|
-
var columns = [x.map(String)].concat(_toConsumableArray((0, exports.toArrayForSeries)(y, y).map(function (series) {
|
|
293
|
-
return series.map(String);
|
|
294
|
-
})));
|
|
295
|
-
var yFieldsArray = (0, exports.toArrayForSeries)(y, yFields);
|
|
296
|
-
var fields = [{
|
|
297
|
-
name: xField
|
|
298
|
-
}].concat(_toConsumableArray(yFieldsArray.map(function (field) {
|
|
299
|
-
return {
|
|
300
|
-
name: field
|
|
301
|
-
};
|
|
302
|
-
}))); // splunk-charting requires y2 to be part of columns
|
|
303
|
-
// when y & y2 options are configured with different (mutually exclusive) series
|
|
304
|
-
// y2 columns need to be added to columns
|
|
305
|
-
|
|
136
|
+
var isMultiSeriesData = (data) => Array.isArray(data) && Array.isArray(data[0]);
|
|
137
|
+
var toArrayForSeries = (data, value) => isMultiSeriesData(data) ? value : [value];
|
|
138
|
+
var constructFieldsAndColumns = ({
|
|
139
|
+
x = [],
|
|
140
|
+
y = [],
|
|
141
|
+
xField,
|
|
142
|
+
yFields,
|
|
143
|
+
y2,
|
|
144
|
+
y2Fields
|
|
145
|
+
}) => {
|
|
146
|
+
const columns = [x.map(String), ...toArrayForSeries(y, y).map((series) => series.map(String))];
|
|
147
|
+
const yFieldsArray = toArrayForSeries(y, yFields);
|
|
148
|
+
const fields = [{ name: xField }, ...yFieldsArray.map((field) => ({ name: field }))];
|
|
306
149
|
if (y2Fields) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
});
|
|
311
|
-
y2FieldsArray.forEach(function (y2Field, index) {
|
|
150
|
+
const y2FieldsArray = toArrayForSeries(y2, y2Fields);
|
|
151
|
+
const y2AsArray = toArrayForSeries(y2, y2).map((series) => series == null ? void 0 : series.map(String));
|
|
152
|
+
y2FieldsArray.forEach((y2Field, index) => {
|
|
312
153
|
if (yFieldsArray.indexOf(y2Field) === -1 && y2AsArray[index]) {
|
|
313
154
|
fields.push({
|
|
314
155
|
name: y2Field
|
|
@@ -317,32 +158,19 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
|
317
158
|
}
|
|
318
159
|
});
|
|
319
160
|
}
|
|
320
|
-
|
|
321
161
|
return {
|
|
322
|
-
columns
|
|
323
|
-
fields
|
|
162
|
+
columns,
|
|
163
|
+
fields
|
|
324
164
|
};
|
|
325
165
|
};
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return (_a = eventHandler.options.events) === null || _a === void 0 ? void 0 : _a.includes('range.select');
|
|
336
|
-
}); // Check if xField is _time. This is how splunk-charting distinguishes a time chart from categorical.
|
|
337
|
-
// Note: search zoom will be buggy if the x axis uses timestamp values but is not _time
|
|
338
|
-
|
|
339
|
-
var xAxisIsTime = xField === '_time';
|
|
166
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
167
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
168
|
+
(eventHandler) => {
|
|
169
|
+
var _a;
|
|
170
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
const xAxisIsTime = xField === "_time";
|
|
340
174
|
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
341
175
|
};
|
|
342
|
-
|
|
343
|
-
exports.shouldEnableSearchZoom = shouldEnableSearchZoom;
|
|
344
|
-
|
|
345
|
-
/***/ })
|
|
346
|
-
|
|
347
|
-
/******/ });
|
|
348
|
-
//# sourceMappingURL=chartingUtils.js.map
|
|
176
|
+
//# sourceMappingURL=chartingUtils.js.map
|