@splunk/visualizations 26.0.0 → 26.1.1

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.
Files changed (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/SparkLine.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"lodash\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Popover\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///./src/SparkLine/SparkLine.jsx"],"names":["StyledSvg","styled","svg","withConfig","displayName","componentId","StyledTooltip","div","SparkLine","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","_len","arguments","length","rest","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","el","setState","anchor","state","currentPointX","open","rectArea","tooltip","titleId","createDOMID","_createClass","key","value","getMax","_this2","_this$props","data","acceptNull","yMax","dataMax","max","fillNull","undefined","getMin","_this3","_this$props2","yMin","dataMin","min","getXUnit","xMargin","_this$props3","width","xUnit","Math","getYUnit","yMargin","height","maxValue","minValue","yUnit","getSegmentSets","points","lines","currentLine","forEach","p","idx","isNull","push","map","dataToPoints","val","x","y","renderRect","_this4","_this$props4","i","React","createElement","style","fillOpacity","onMouseOver","e","target","renderArea","_this$props5","fillColor","isArea","segments","s","join","fill","strokeWidth","renderCursor","_this$props6","cursorStroke","cursorStrokeWidth","cursorStrokeLinecap","cursorStrokeDasharray","ref","handleCursorMount","x1","y1","x2","y2","stroke","strokeLinecap","strokeDasharray","renderTooltip","Popover","appearance","defaultPlacement","animation","renderEndDots","dotsToShow","_this$props7","endDotFillColor","endDotRadius","endDotStroke","endDotStrokeWidth","slice","point","cx","cy","r","renderPolyline","_this$props8","lineColor","lineLength","lineStrokeWidth","linePoints","isFinite","lineData","strokeLinejoin","render","_this5","_this$props9","elementRef","showTooltip","showEndDot","endDotCount","title","_extends","onMouseOut","omit","keys","propTypes","role","id","_","Component","PropTypes","bool","isArray","Error","every","oneOfType","func","object","number","string","oneOf","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,uC;;;;;;;ACAA,kC;;;;;;;ACAA,+D;;;;;;;ACAA,kD;;;;;;;ACAA,gD;;;;;;;ACAA,mC;;;;;;;ACAA,8C;;;;;;;ACAA,2D;;;;;;;ACAA,qD;;;;;;;ACAA,kE;;;;;;;ACAA,kE;;;;;;;ACAA,4D;;;;;;;ACAA,6E;;;;;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AAC,CAAC;EACjE;EACA/D,qBAAqB,EAAEqD,iDAAS,CAACS,MAAM;EACvC;AACR;AACA;AACA;EACQzG,MAAM,EAAEgG,iDAAS,CAACQ,MAAM,CAACG,UAAU;EACnC;EACA3E,MAAM,EAAEgE,iDAAS,CAACC,IAAI;EACtB;EACAzB,SAAS,EAAEwB,iDAAS,CAACS,MAAM;EAC3B;EACAhC,UAAU,EAAEuB,iDAAS,CAACQ,MAAM;EAC5B;EACA9B,eAAe,EAAEsB,iDAAS,CAACQ,MAAM;EACjC;EACApB,UAAU,EAAEY,iDAAS,CAACC,IAAI;EAC1B;EACAd,WAAW,EAAEa,iDAAS,CAACC,IAAI;EAC3B;EACApH,IAAI,EAAEmH,iDAAS,CAACQ,MAAM;EACtB;EACAnH,IAAI,EAAE2G,iDAAS,CAACQ,MAAM;EACtB;AACR;AACA;EACQ7G,KAAK,EAAEqG,iDAAS,CAACQ,MAAM,CAACG,UAAU;EAClC;EACArB,KAAK,EAAEU,iDAAS,CAACS;AACrB,CAAC;AAAAhJ,4EAAA,CA1ECjB,SAAS,kBA4EW;EAClBoC,UAAU,EAAE,KAAK;EACjBD,IAAI,EAAE,EAAE;EACRwG,WAAW,EAAE,IAAI;EACjBE,WAAW,EAAE,CAAC;EACdD,UAAU,EAAE,KAAK;EACjBtB,YAAY,EAAE,CAAC;EACfD,eAAe,EAAE,OAAO;EACxBE,YAAY,EAAE,OAAO;EACrBC,iBAAiB,EAAE,CAAC;EACpBjC,SAAS,EAAE,SAAS;EACpBN,WAAW,EAAE,IAAI;EACjBe,YAAY,EAAE,SAAS;EACvBC,iBAAiB,EAAE,CAAC;EACpBC,mBAAmB,EAAE,QAAQ;EAC7BC,qBAAqB,EAAE,MAAM;EAC7BX,MAAM,EAAE,KAAK;EACbwC,SAAS,EAAE,SAAS;EACpBE,eAAe,EAAE;AACrB,CAAC;AA0XUlI,wEAAS,E","file":"SparkLine.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 = 95);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"lodash\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { isArray, isFinite, isNull, keys, max, min, omit } from 'lodash';\nimport styled from 'styled-components';\nimport Popover from '@splunk/react-ui/Popover';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { createDOMID } from '@splunk/ui-utils/id';\n\nconst StyledSvg = styled.svg`\n /* For fixing IE11 shows overflow part line issue */\n overflow: hidden;\n`;\n\nconst StyledTooltip = styled.div`\n padding: 3px 8px;\n font-size: 12px;\n`;\n\nclass SparkLine extends Component {\n static propTypes = {\n /**\n * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.\n */\n acceptNull: PropTypes.bool,\n /** Array of numbers. These data numbers are converted to points and show on sparkline. */\n data: props => {\n if (!isArray(props.data)) {\n return new Error('Data provided to Sparkline must be an array.');\n }\n\n if (props.acceptNull && !props.data.every(value => isNull(value) || isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers or null.');\n }\n\n if (!props.acceptNull && !props.data.every(value => isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers.');\n }\n return null;\n },\n /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */\n elementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */\n endDotCount: PropTypes.number,\n /** Fills color to the end dot. */\n endDotFillColor: PropTypes.string,\n /**\n * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.\n */\n endDotRadius: PropTypes.number,\n /** Sets end dot circle stroke color. */\n endDotStroke: PropTypes.string,\n /** Sets end dot circle stroke width in pixels. */\n endDotStrokeWidth: PropTypes.number,\n /** Fills color to area. */\n fillColor: PropTypes.string,\n /** Fills opacity to area. Value must be in 0 ~ 1. */\n fillOpacity: PropTypes.string,\n /** Sets cursor stroke color. */\n cursorStroke: PropTypes.string,\n /** Sets cursor stroke width in pixels. */\n cursorStrokeWidth: PropTypes.number,\n /** Sets cursor line cap style. */\n cursorStrokeLinecap: PropTypes.oneOf(['butt', 'round', 'square']),\n /** Sets cursor dash array style. */\n cursorStrokeDasharray: PropTypes.string,\n /**\n * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,\n * sparkline figures out the container height by itself.\n */\n height: PropTypes.number.isRequired,\n /** When set to `true`, sparkline shows as area. */\n isArea: PropTypes.bool,\n /** The sparkline line color. */\n lineColor: PropTypes.string,\n /** Allows user to draw only the last data points for the line. */\n lineLength: PropTypes.number,\n /** The sparkline line stroke width in pixels. */\n lineStrokeWidth: PropTypes.number,\n /** Enable to show end dot. */\n showEndDot: PropTypes.bool,\n /** Enable to show tooltip. */\n showTooltip: PropTypes.bool,\n /** Sets the data value range and maximum value shown on sparkline. */\n yMax: PropTypes.number,\n /** Sets the data value range and minimum value shown on sparkline. */\n yMin: PropTypes.number,\n /**\n * The width of the container.\n */\n width: PropTypes.number.isRequired,\n /** Sets the a11y title text on sparkline. */\n title: PropTypes.string,\n };\n\n static defaultProps = {\n acceptNull: false,\n data: [],\n showTooltip: true,\n endDotCount: 0,\n showEndDot: false,\n endDotRadius: 0,\n endDotFillColor: 'white',\n endDotStroke: 'black',\n endDotStrokeWidth: 0,\n fillColor: '#65a637',\n fillOpacity: '.1',\n cursorStroke: '#5184AF',\n cursorStrokeWidth: 3,\n cursorStrokeLinecap: 'square',\n cursorStrokeDasharray: '1, 5',\n isArea: false,\n lineColor: '#65a637',\n lineStrokeWidth: 1,\n };\n\n constructor(props, ...rest) {\n super(props, ...rest);\n this.state = {\n anchor: null,\n currentPointX: null,\n open: false,\n rectArea: null,\n tooltip: null,\n };\n this.titleId = createDOMID();\n }\n\n getMax() {\n const { data, acceptNull, yMax } = this.props;\n const dataMax = () => (acceptNull ? max(this.fillNull(data)) : max(data));\n return yMax !== undefined ? yMax : dataMax();\n }\n\n getMin() {\n const { data, acceptNull, yMin } = this.props;\n const dataMin = () => (acceptNull ? min(this.fillNull(data)) : min(data));\n return yMin !== undefined ? yMin : dataMin();\n }\n\n /**\n * Gets unit value of x axis.\n * @param {Number} xMargin - margin of x axis.\n * @return {Number} unit value of x axis.\n * @private\n */\n getXUnit(xMargin) {\n const { data, width } = this.props;\n // Calculate xUnit. Width substract the left margin and right margin, then divide by data length.\n const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);\n return Math.max(0, xUnit);\n }\n\n /**\n * Gets unit value of y axis.\n * @param {String} yMargin - margin of y axis.\n * @return {Number} unit value of y axis.\n * @private\n */\n getYUnit(yMargin) {\n const { height } = this.props;\n const maxValue = this.getMax();\n const minValue = this.getMin();\n\n // Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.\n // if the maxValue equals minValue, means all values in data are the same, then, we need to set the YUnit at the mid value of Height.\n // So, draws sparkline right in the mid of the container.\n const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);\n return Math.max(0, yUnit);\n }\n\n /**\n * Get a list of arrays of points for drawing lines, based on acceptNull property\n * @method getSegmentSets\n * @param {Array} data\n * @param {Array} points\n * @returns {Array} List of datapoint sets used for drawing lines\n */\n getSegmentSets(data, points) {\n const { acceptNull } = this.props;\n const lines = [];\n let currentLine = [];\n\n data.forEach((p, idx) => {\n // Found null data\n if (!acceptNull && isNull(p)) {\n // need at least 2 points to draw a segment\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n // reset for the next segment\n currentLine = [];\n } else {\n // data is good, add point data\n currentLine.push(points[idx]);\n }\n });\n\n // Add the last line\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n\n return lines;\n }\n\n handleCursorMount = el => {\n this.setState({\n anchor: el,\n });\n };\n\n /**\n * Utility for fill null value with number 0.\n * @private\n */\n fillNull() {\n const { data } = this.props;\n return data.map(value => (value === null ? 0 : value));\n }\n\n /**\n * Converts data to points in svg\n * @param {Number} xMargin - margin of x axis.\n * @param {Number} yMargin - margin of x axis.\n * @return {Array} points coordination.\n * @private\n */\n dataToPoints(xMargin, yMargin) {\n const { data } = this.props;\n const xUnit = this.getXUnit(xMargin);\n const yUnit = this.getYUnit(yMargin);\n const maxValue = this.getMax();\n const minValue = this.getMin();\n return data\n .map((val, idx) => ({\n x: idx * xUnit + xMargin,\n y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin,\n }))\n .map(p => [p.x, p.y]);\n }\n\n /**\n * Renders rect area for helping figure out which is the nearest point so that\n * render related cursor and tooltip.\n * @param {Array} points - array of points coordination.\n * @param {Number} xMargin - margin of x axis.\n * @return {Array} array of svg rect objects\n * @private\n */\n renderRect(points, xMargin) {\n const { data, height } = this.props;\n const xUnit = this.getXUnit(xMargin);\n\n return points.map((p, i) => (\n /* eslint-disable react/no-array-index-key */\n <rect // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n key={`${i}_${p[0]}`}\n data-test={`rect-${i}`}\n x={p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2}\n y={0}\n width={i === 0 && data.length !== 1 ? xUnit / 2 : xUnit}\n height={height}\n style={{ fillOpacity: 0 }}\n onMouseOver={e => {\n this.setState({\n open: data[i] !== null,\n rectArea: data[i] === null ? null : e.target,\n tooltip: data[i],\n currentPointX: p[0],\n });\n }}\n />\n /* eslint-enable react/no-array-index-key */\n ));\n }\n\n // Renders area chart\n renderArea(points) {\n const { data, fillColor, fillOpacity, height, isArea } = this.props;\n\n if (!isArea || points.length === 0) {\n return null;\n }\n\n let segments = this.getSegmentSets(data, points);\n segments = segments.map(s =>\n s.concat([\n [s[s.length - 1][0], height], // down to bottom of graph\n [s[0][0], height], // over to below first data point\n s[0], // up to first data point to close the box\n ])\n );\n\n return (\n <g data-test=\"area\">\n {segments.map(s => (\n <polyline\n key={`area${s.join('')}`}\n points={s.join(' ')}\n data-test=\"area-line\"\n style={{\n fill: fillColor,\n fillOpacity,\n strokeWidth: '0',\n }}\n />\n ))}\n </g>\n );\n }\n\n renderCursor() {\n const {\n cursorStroke,\n cursorStrokeWidth,\n cursorStrokeLinecap,\n cursorStrokeDasharray,\n height,\n } = this.props;\n\n return (\n this.state.rectArea !== null && (\n <line\n data-test=\"cursor\"\n ref={this.handleCursorMount}\n x1={this.state.currentPointX}\n y1={0}\n x2={this.state.currentPointX}\n y2={height}\n style={{\n stroke: cursorStroke,\n strokeWidth: cursorStrokeWidth,\n strokeLinecap: cursorStrokeLinecap,\n strokeDasharray: cursorStrokeDasharray,\n }}\n />\n )\n );\n }\n\n renderTooltip() {\n return (\n this.state.anchor !== null && (\n <Popover\n data-test=\"tooltip\"\n open={this.state.open}\n anchor={this.state.anchor}\n data-test-value={this.state.tooltip}\n appearance=\"inverted\"\n defaultPlacement=\"above\"\n animation={false}\n >\n <StyledTooltip>\n {this.state.anchor !== null ? this.state.tooltip : undefined}\n </StyledTooltip>\n </Popover>\n )\n );\n }\n\n /**\n * Renders one or more svg circles to highlight values on the sparkline\n * @method renderEndDots\n * @param {Array[Array[Number]]} points // x,y coordinates of values\n * @param {Number} dotsToShow // number of end dots to display\n * @param {Number} xMargin // used when calculating the dot radius\n * @returns {Object} React representation of SVG group\n * @private\n */\n renderEndDots(points, dotsToShow, xMargin) {\n const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;\n\n return (\n <g>\n {points.slice(-dotsToShow).map(point => (\n <circle\n key={`end-dot${point[0]}${point[1]}`}\n data-test=\"end-dot\"\n cx={point[0]}\n cy={point[1]}\n r={endDotRadius === 0 ? xMargin : endDotRadius}\n style={{\n fill: endDotFillColor,\n stroke: endDotStroke,\n strokeWidth: endDotStrokeWidth,\n }}\n />\n ))}\n </g>\n );\n }\n\n /**\n * Renders the line(s) above the area graph\n * @method renderPolyline\n * @param {Array} points\n * @returns {Object} SVG Group of polylines\n */\n renderPolyline(points) {\n const { data, lineColor, lineLength, lineStrokeWidth } = this.props;\n\n const linePoints = isFinite(lineLength) && lineLength > 0 ? lineLength : points.length;\n const lines = this.getSegmentSets(data.slice(-linePoints), points.slice(-linePoints));\n\n return (\n <g data-test=\"sparkline\">\n {lines.map(lineData => (\n <polyline\n key={`line${lineData.join('')}`}\n data-test=\"polyline\"\n style={{\n fill: 'none',\n stroke: lineColor,\n strokeWidth: lineStrokeWidth,\n strokeLinejoin: 'round',\n strokeLinecap: 'round',\n }}\n points={lineData.join(' ')}\n />\n ))}\n </g>\n );\n }\n\n render() {\n const {\n data,\n elementRef,\n showTooltip,\n showEndDot,\n endDotRadius,\n endDotStrokeWidth,\n endDotCount,\n height,\n isArea,\n lineStrokeWidth,\n width,\n title,\n } = this.props;\n\n if (data.length === 0) {\n return null;\n }\n\n // Calculate horizontal and vertical margin so that fit line or end dot.\n const xMargin = endDotRadius + endDotStrokeWidth / 2;\n const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);\n\n const points = this.dataToPoints(xMargin, yMargin);\n\n const dotsToShow = Math.max(showEndDot && 1, isFinite(endDotCount) && endDotCount > 0 && endDotCount);\n\n return (\n <div // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n data-test=\"line\"\n data-test-type={isArea ? 'area' : 'line'}\n onMouseOut={() => {\n this.setState({\n open: false,\n anchor: null,\n rectArea: null,\n currentPointX: null,\n });\n }}\n ref={elementRef}\n {...omit(this.props, keys(SparkLine.propTypes))}\n >\n <StyledSvg\n height={height}\n width={width}\n role=\"img\"\n aria-labelledby={this.titleId}\n data-test=\"sparkline-svg\"\n >\n <title id={this.titleId} data-test=\"sparkline-title\">\n {title || _('Source count over time sparkline trend')}\n </title>\n <g>\n {this.renderCursor()}\n {this.renderPolyline(points)}\n {this.renderArea(points)}\n {dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null}\n {showTooltip ? this.renderRect(points, xMargin) : null}\n {showTooltip ? this.renderTooltip() : null}\n </g>\n </StyledSvg>\n </div>\n );\n }\n}\n\nexport default SparkLine;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"lodash\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Popover\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///./src/SparkLine/SparkLine.jsx"],"names":["StyledSvg","styled","StyledTooltip","SparkLine","rest","anchor","el","currentPointX","open","rectArea","tooltip","createDOMID","data","acceptNull","yMax","dataMax","max","yMin","dataMin","min","width","xUnit","xMargin","Math","height","maxValue","minValue","yUnit","yMargin","lines","currentLine","isNull","points","value","x","idx","y","p","i","fillOpacity","e","fillColor","isArea","segments","s","fill","strokeWidth","cursorStroke","cursorStrokeWidth","cursorStrokeLinecap","cursorStrokeDasharray","stroke","strokeLinecap","strokeDasharray","endDotFillColor","endDotRadius","endDotStroke","endDotStrokeWidth","point","lineColor","lineLength","lineStrokeWidth","linePoints","isFinite","lineData","strokeLinejoin","elementRef","showTooltip","showEndDot","endDotCount","title","dotsToShow","omit","keys","_","Component","PropTypes","isArray","props","string"],"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,uC;;;;;;;ACAA,kC;;;;;;;ACAA,+D;;;;;;;ACAA,kD;;;;;;;ACAA,gD;;;;;;;ACAA,mC;;;;;;;ACAA,8C;;;;;;;ACAA,2D;;;;;;;ACAA,qD;;;;;;;ACAA,kE;;;;;;;ACAA,kE;;;;;;;ACAA,4D;;;;;;;ACAA,6E;;;;;;;ACAA,yE;;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iDAAS,CAxDN;;AAyDf;AACAf,iBAAe,EAAEe,iDAAS,CA1DX;;AA2Df;AACAR,YAAU,EAAEQ,iDAAS,CA5DN;;AA6Df;AACAT,aAAW,EAAES,iDAAS,CA9DP;;AA+Df;AACA9D,MAAI,EAAE8D,iDAAS,CAhEA;;AAiEf;AACA3D,MAAI,EAAE2D,iDAAS,CAlEA;;AAmEf;AACR;AACA;AACQxD,OAAK,EAAEwD,iDAAS,CAATA,OAtEQ;;AAuEf;AACAN,OAAK,EAAEM,iDAAS,CAACG;AAxEF,C;;6EADjB5E,S,kBA4EoB;AAClBU,YAAU,EADQ;AAElBD,MAAI,EAFc;AAGlBuD,aAAW,EAHO;AAIlBE,aAAW,EAJO;AAKlBD,YAAU,EALQ;AAMlBb,cAAY,EANM;AAOlBD,iBAAe,EAPG;AAQlBE,cAAY,EARM;AASlBC,mBAAiB,EATC;AAUlBhB,WAAS,EAVS;AAWlBF,aAAW,EAXO;AAYlBQ,cAAY,EAZM;AAalBC,mBAAiB,EAbC;AAclBC,qBAAmB,EAdD;AAelBC,uBAAqB,EAfH;AAgBlBR,QAAM,EAhBY;AAiBlBiB,WAAS,EAjBS;AAkBlBE,iBAAe,EAAE;AAlBC,C;;AA6Y1B,0E","file":"SparkLine.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 = 95);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"lodash\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { isArray, isFinite, isNull, keys, max, min, omit } from 'lodash';\nimport styled from 'styled-components';\nimport Popover from '@splunk/react-ui/Popover';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { createDOMID } from '@splunk/ui-utils/id';\n\nconst StyledSvg = styled.svg`\n /* For fixing IE11 shows overflow part line issue */\n overflow: hidden;\n`;\n\nconst StyledTooltip = styled.div`\n padding: 3px 8px;\n font-size: 12px;\n`;\n\nclass SparkLine extends Component {\n static propTypes = {\n /**\n * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.\n */\n acceptNull: PropTypes.bool,\n /** Array of numbers. These data numbers are converted to points and show on sparkline. */\n data: props => {\n if (!isArray(props.data)) {\n return new Error('Data provided to Sparkline must be an array.');\n }\n\n if (props.acceptNull && !props.data.every(value => isNull(value) || isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers or null.');\n }\n\n if (!props.acceptNull && !props.data.every(value => isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers.');\n }\n return null;\n },\n /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */\n elementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */\n endDotCount: PropTypes.number,\n /** Fills color to the end dot. */\n endDotFillColor: PropTypes.string,\n /**\n * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.\n */\n endDotRadius: PropTypes.number,\n /** Sets end dot circle stroke color. */\n endDotStroke: PropTypes.string,\n /** Sets end dot circle stroke width in pixels. */\n endDotStrokeWidth: PropTypes.number,\n /** Fills color to area. */\n fillColor: PropTypes.string,\n /** Fills opacity to area. Value must be in 0 ~ 1. */\n fillOpacity: PropTypes.string,\n /** Sets cursor stroke color. */\n cursorStroke: PropTypes.string,\n /** Sets cursor stroke width in pixels. */\n cursorStrokeWidth: PropTypes.number,\n /** Sets cursor line cap style. */\n cursorStrokeLinecap: PropTypes.oneOf(['butt', 'round', 'square']),\n /** Sets cursor dash array style. */\n cursorStrokeDasharray: PropTypes.string,\n /**\n * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,\n * sparkline figures out the container height by itself.\n */\n height: PropTypes.number.isRequired,\n /** When set to `true`, sparkline shows as area. */\n isArea: PropTypes.bool,\n /** The sparkline line color. */\n lineColor: PropTypes.string,\n /** Allows user to draw only the last data points for the line. */\n lineLength: PropTypes.number,\n /** The sparkline line stroke width in pixels. */\n lineStrokeWidth: PropTypes.number,\n /** Enable to show end dot. */\n showEndDot: PropTypes.bool,\n /** Enable to show tooltip. */\n showTooltip: PropTypes.bool,\n /** Sets the data value range and maximum value shown on sparkline. */\n yMax: PropTypes.number,\n /** Sets the data value range and minimum value shown on sparkline. */\n yMin: PropTypes.number,\n /**\n * The width of the container.\n */\n width: PropTypes.number.isRequired,\n /** Sets the a11y title text on sparkline. */\n title: PropTypes.string,\n };\n\n static defaultProps = {\n acceptNull: false,\n data: [],\n showTooltip: true,\n endDotCount: 0,\n showEndDot: false,\n endDotRadius: 0,\n endDotFillColor: 'white',\n endDotStroke: 'black',\n endDotStrokeWidth: 0,\n fillColor: '#65a637',\n fillOpacity: '.1',\n cursorStroke: '#5184AF',\n cursorStrokeWidth: 3,\n cursorStrokeLinecap: 'square',\n cursorStrokeDasharray: '1, 5',\n isArea: false,\n lineColor: '#65a637',\n lineStrokeWidth: 1,\n };\n\n constructor(props, ...rest) {\n super(props, ...rest);\n this.state = {\n anchor: null,\n currentPointX: null,\n open: false,\n rectArea: null,\n tooltip: null,\n };\n this.titleId = createDOMID();\n }\n\n getMax() {\n const { data, acceptNull, yMax } = this.props;\n const dataMax = () => (acceptNull ? max(this.fillNull(data)) : max(data));\n return yMax !== undefined ? yMax : dataMax();\n }\n\n getMin() {\n const { data, acceptNull, yMin } = this.props;\n const dataMin = () => (acceptNull ? min(this.fillNull(data)) : min(data));\n return yMin !== undefined ? yMin : dataMin();\n }\n\n /**\n * Gets unit value of x axis.\n * @param {Number} xMargin - margin of x axis.\n * @return {Number} unit value of x axis.\n * @private\n */\n getXUnit(xMargin) {\n const { data, width } = this.props;\n // Calculate xUnit. Width substract the left margin and right margin, then divide by data length.\n const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);\n return Math.max(0, xUnit);\n }\n\n /**\n * Gets unit value of y axis.\n * @param {String} yMargin - margin of y axis.\n * @return {Number} unit value of y axis.\n * @private\n */\n getYUnit(yMargin) {\n const { height } = this.props;\n const maxValue = this.getMax();\n const minValue = this.getMin();\n\n // Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.\n // if the maxValue equals minValue, means all values in data are the same, then, we need to set the YUnit at the mid value of Height.\n // So, draws sparkline right in the mid of the container.\n const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);\n return Math.max(0, yUnit);\n }\n\n /**\n * Get a list of arrays of points for drawing lines, based on acceptNull property\n * @method getSegmentSets\n * @param {Array} data\n * @param {Array} points\n * @returns {Array} List of datapoint sets used for drawing lines\n */\n getSegmentSets(data, points) {\n const { acceptNull } = this.props;\n const lines = [];\n let currentLine = [];\n\n data.forEach((p, idx) => {\n // Found null data\n if (!acceptNull && isNull(p)) {\n // need at least 2 points to draw a segment\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n // reset for the next segment\n currentLine = [];\n } else {\n // data is good, add point data\n currentLine.push(points[idx]);\n }\n });\n\n // Add the last line\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n\n return lines;\n }\n\n handleCursorMount = el => {\n this.setState({\n anchor: el,\n });\n };\n\n /**\n * Utility for fill null value with number 0.\n * @private\n */\n fillNull() {\n const { data } = this.props;\n return data.map(value => (value === null ? 0 : value));\n }\n\n /**\n * Converts data to points in svg\n * @param {Number} xMargin - margin of x axis.\n * @param {Number} yMargin - margin of x axis.\n * @return {Array} points coordination.\n * @private\n */\n dataToPoints(xMargin, yMargin) {\n const { data } = this.props;\n const xUnit = this.getXUnit(xMargin);\n const yUnit = this.getYUnit(yMargin);\n const maxValue = this.getMax();\n const minValue = this.getMin();\n return data\n .map((val, idx) => ({\n x: idx * xUnit + xMargin,\n y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin,\n }))\n .map(p => [p.x, p.y]);\n }\n\n /**\n * Renders rect area for helping figure out which is the nearest point so that\n * render related cursor and tooltip.\n * @param {Array} points - array of points coordination.\n * @param {Number} xMargin - margin of x axis.\n * @return {Array} array of svg rect objects\n * @private\n */\n renderRect(points, xMargin) {\n const { data, height } = this.props;\n const xUnit = this.getXUnit(xMargin);\n\n return points.map((p, i) => (\n /* eslint-disable react/no-array-index-key */\n <rect // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n key={`${i}_${p[0]}`}\n data-test={`rect-${i}`}\n x={p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2}\n y={0}\n width={i === 0 && data.length !== 1 ? xUnit / 2 : xUnit}\n height={height}\n style={{ fillOpacity: 0 }}\n onMouseOver={e => {\n this.setState({\n open: data[i] !== null,\n rectArea: data[i] === null ? null : e.target,\n tooltip: data[i],\n currentPointX: p[0],\n });\n }}\n />\n /* eslint-enable react/no-array-index-key */\n ));\n }\n\n // Renders area chart\n renderArea(points) {\n const { data, fillColor, fillOpacity, height, isArea } = this.props;\n\n if (!isArea || points.length === 0) {\n return null;\n }\n\n let segments = this.getSegmentSets(data, points);\n segments = segments.map(s =>\n s.concat([\n [s[s.length - 1][0], height], // down to bottom of graph\n [s[0][0], height], // over to below first data point\n s[0], // up to first data point to close the box\n ])\n );\n\n return (\n <g data-test=\"area\">\n {segments.map(s => (\n <polyline\n key={`area${s.join('')}`}\n points={s.join(' ')}\n data-test=\"area-line\"\n style={{\n fill: fillColor,\n fillOpacity,\n strokeWidth: '0',\n }}\n />\n ))}\n </g>\n );\n }\n\n renderCursor() {\n const {\n cursorStroke,\n cursorStrokeWidth,\n cursorStrokeLinecap,\n cursorStrokeDasharray,\n height,\n } = this.props;\n\n return (\n this.state.rectArea !== null && (\n <line\n data-test=\"cursor\"\n ref={this.handleCursorMount}\n x1={this.state.currentPointX}\n y1={0}\n x2={this.state.currentPointX}\n y2={height}\n style={{\n stroke: cursorStroke,\n strokeWidth: cursorStrokeWidth,\n strokeLinecap: cursorStrokeLinecap,\n strokeDasharray: cursorStrokeDasharray,\n }}\n />\n )\n );\n }\n\n renderTooltip() {\n return (\n this.state.anchor !== null && (\n <Popover\n data-test=\"tooltip\"\n open={this.state.open}\n anchor={this.state.anchor}\n data-test-value={this.state.tooltip}\n appearance=\"inverted\"\n defaultPlacement=\"above\"\n animation={false}\n >\n <StyledTooltip>\n {this.state.anchor !== null ? this.state.tooltip : undefined}\n </StyledTooltip>\n </Popover>\n )\n );\n }\n\n /**\n * Renders one or more svg circles to highlight values on the sparkline\n * @method renderEndDots\n * @param {Array[Array[Number]]} points // x,y coordinates of values\n * @param {Number} dotsToShow // number of end dots to display\n * @param {Number} xMargin // used when calculating the dot radius\n * @returns {Object} React representation of SVG group\n * @private\n */\n renderEndDots(points, dotsToShow, xMargin) {\n const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;\n\n return (\n <g>\n {points.slice(-dotsToShow).map(point => (\n <circle\n key={`end-dot${point[0]}${point[1]}`}\n data-test=\"end-dot\"\n cx={point[0]}\n cy={point[1]}\n r={endDotRadius === 0 ? xMargin : endDotRadius}\n style={{\n fill: endDotFillColor,\n stroke: endDotStroke,\n strokeWidth: endDotStrokeWidth,\n }}\n />\n ))}\n </g>\n );\n }\n\n /**\n * Renders the line(s) above the area graph\n * @method renderPolyline\n * @param {Array} points\n * @returns {Object} SVG Group of polylines\n */\n renderPolyline(points) {\n const { data, lineColor, lineLength, lineStrokeWidth } = this.props;\n\n const linePoints = isFinite(lineLength) && lineLength > 0 ? lineLength : points.length;\n const lines = this.getSegmentSets(data.slice(-linePoints), points.slice(-linePoints));\n\n return (\n <g data-test=\"sparkline\">\n {lines.map(lineData => (\n <polyline\n key={`line${lineData.join('')}`}\n data-test=\"polyline\"\n style={{\n fill: 'none',\n stroke: lineColor,\n strokeWidth: lineStrokeWidth,\n strokeLinejoin: 'round',\n strokeLinecap: 'round',\n }}\n points={lineData.join(' ')}\n />\n ))}\n </g>\n );\n }\n\n render() {\n const {\n data,\n elementRef,\n showTooltip,\n showEndDot,\n endDotRadius,\n endDotStrokeWidth,\n endDotCount,\n height,\n isArea,\n lineStrokeWidth,\n width,\n title,\n } = this.props;\n\n if (data.length === 0) {\n return null;\n }\n\n // Calculate horizontal and vertical margin so that fit line or end dot.\n const xMargin = endDotRadius + endDotStrokeWidth / 2;\n const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);\n\n const points = this.dataToPoints(xMargin, yMargin);\n\n const dotsToShow = Math.max(showEndDot && 1, isFinite(endDotCount) && endDotCount > 0 && endDotCount);\n\n return (\n <div // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n data-test=\"line\"\n data-test-type={isArea ? 'area' : 'line'}\n onMouseOut={() => {\n this.setState({\n open: false,\n anchor: null,\n rectArea: null,\n currentPointX: null,\n });\n }}\n ref={elementRef}\n {...omit(this.props, keys(SparkLine.propTypes))}\n >\n <StyledSvg\n height={height}\n width={width}\n role=\"img\"\n aria-labelledby={this.titleId}\n data-test=\"sparkline-svg\"\n >\n <title id={this.titleId} data-test=\"sparkline-title\">\n {title || _('Source count over time sparkline trend')}\n </title>\n <g>\n {this.renderCursor()}\n {this.renderPolyline(points)}\n {this.renderArea(points)}\n {dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null}\n {showTooltip ? this.renderRect(points, xMargin) : null}\n {showTooltip ? this.renderTooltip() : null}\n </g>\n </StyledSvg>\n </div>\n );\n }\n}\n\nexport default SparkLine;\n"],"sourceRoot":""}
package/Table.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 81);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 82);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -138,6 +138,7 @@ Object.defineProperty(exports, "__esModule", {
138
138
  });
139
139
  exports.VizBehavior = void 0;
140
140
  var VizBehavior;
141
+
141
142
  (function (VizBehavior) {
142
143
  /**
143
144
  * Dynamic Options Behavior.
@@ -157,6 +158,7 @@ var VizBehavior;
157
158
  * missing.
158
159
  * @type {string}
159
160
  */
161
+
160
162
  VizBehavior["PLACEHOLDER"] = "placeholder";
161
163
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
162
164
  VizBehavior["TRELLIS"] = "trellis";
@@ -185,24 +187,33 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
185
187
 
186
188
 
187
189
  var _toConsumableArray = __webpack_require__(1);
190
+
188
191
  var _defineProperty = __webpack_require__(7);
192
+
189
193
  var __rest = this && this.__rest || function (s, e) {
190
194
  var t = {};
195
+
191
196
  for (var p in s) {
192
197
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
193
198
  }
199
+
194
200
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
195
201
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
196
202
  }
197
203
  return t;
198
204
  };
205
+
199
206
  Object.defineProperty(exports, "__esModule", {
200
207
  value: true
201
208
  });
202
209
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
210
+
203
211
  var lodash_1 = __webpack_require__(6);
212
+
204
213
  var schemaUtils_1 = __webpack_require__(3);
214
+
205
215
  var VizBehavior_1 = __webpack_require__(2);
216
+
206
217
  var dynamicOptionsDSLType = {
207
218
  type: 'string',
208
219
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -212,20 +223,22 @@ var dynamicOptionsDSLType = {
212
223
  * @param optionsSchema a visualization's options schema
213
224
  * @returns an updated options schema that additionally allows strings starting with > for each option
214
225
  */
226
+
215
227
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
216
228
  var enhancedOptionsSchema = {};
217
229
  Object.keys(optionsSchema).forEach(function (key) {
218
230
  var _a = optionsSchema[key],
219
- title = _a.title,
220
- description = _a.description,
221
- readOnly = _a.readOnly,
222
- writeOnly = _a.writeOnly,
223
- examples = _a.examples,
224
- defaultValue = _a.default,
225
- type = _a.type,
226
- properties = _a.properties,
227
- patternProperties = _a.patternProperties,
228
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
231
+ title = _a.title,
232
+ description = _a.description,
233
+ readOnly = _a.readOnly,
234
+ writeOnly = _a.writeOnly,
235
+ examples = _a.examples,
236
+ defaultValue = _a.default,
237
+ type = _a.type,
238
+ properties = _a.properties,
239
+ patternProperties = _a.patternProperties,
240
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
241
+
229
242
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
230
243
  title: title
231
244
  }), description !== undefined && {
@@ -239,12 +252,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
239
252
  }), defaultValue !== undefined && {
240
253
  default: defaultValue
241
254
  });
255
+
242
256
  if (type === 'object') {
243
257
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
244
258
  type: type
245
259
  }), properties && {
246
260
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
247
261
  });
262
+
248
263
  if (patternProperties) {
249
264
  var enhancedPatternProperties = {};
250
265
  Object.keys(patternProperties).forEach(function (opt) {
@@ -262,6 +277,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
262
277
  });
263
278
  return enhancedOptionsSchema;
264
279
  }
280
+
265
281
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
266
282
  /**
267
283
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -270,11 +286,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
270
286
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
271
287
  * and containing `open: false` for all editor panels in editorConfig
272
288
  */
289
+
273
290
  function enhanceConfig(vizConfig) {
274
291
  var enhancedConfig = Object.assign({}, vizConfig);
292
+
275
293
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
276
294
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
277
295
  }
296
+
278
297
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
279
298
  return Object.assign(Object.assign({}, config), {
280
299
  open: config.open || false
@@ -282,6 +301,7 @@ function enhanceConfig(vizConfig) {
282
301
  });
283
302
  return enhancedConfig;
284
303
  }
304
+
285
305
  exports.enhanceConfig = enhanceConfig;
286
306
  /**
287
307
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -289,6 +309,7 @@ exports.enhanceConfig = enhanceConfig;
289
309
  * @param vizConfig a Visualization Config
290
310
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
291
311
  */
312
+
292
313
  function uncollapseEditorConfig(vizConfig) {
293
314
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
294
315
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -298,13 +319,16 @@ function uncollapseEditorConfig(vizConfig) {
298
319
  });
299
320
  return editorPanelUncollapsedConfig;
300
321
  }
322
+
301
323
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
324
+
302
325
  function isDynamicOption(option) {
303
326
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
304
327
  }
305
- exports.isDynamicOption = isDynamicOption;
306
- // private helpers to improve readability of getInitialPreset
328
+
329
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
307
330
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
331
+
308
332
  /**
309
333
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
310
334
  * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
@@ -313,6 +337,7 @@ exports.isDynamicOption = isDynamicOption;
313
337
  *
314
338
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
315
339
  */
340
+
316
341
  function hasCompatibleContexts(vizContext, presetContext) {
317
342
  var presetContextKeys = Object.keys(presetContext);
318
343
  return presetContextKeys.every(function (contextKey) {
@@ -322,6 +347,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
322
347
  /**
323
348
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
324
349
  */
350
+
351
+
325
352
  function hasCompatibleOptions(vizOptions, presetOptions) {
326
353
  var presetOptionKeys = Object.keys(presetOptions);
327
354
  return presetOptionKeys.every(function (optionKey) {
@@ -336,18 +363,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
336
363
  * @param {Object} vizOptions - the current vizOptions definition
337
364
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
338
365
  */
366
+
367
+
339
368
  function getInitialPreset(vizContext, vizOptions, presets) {
340
369
  return presets.find(function (preset) {
341
370
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
342
371
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
343
372
  var presetContextKeys = Object.keys(presetContext);
344
- var presetOptionKeys = Object.keys(presetOptions);
345
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
373
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
346
374
  // if not, then the preset is invalid in config.ts
375
+
347
376
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
348
377
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
349
378
  });
350
379
  }
380
+
351
381
  exports.getInitialPreset = getInitialPreset;
352
382
  /**
353
383
  * generates number precision values for a Select editor
@@ -355,6 +385,7 @@ exports.getInitialPreset = getInitialPreset;
355
385
  * @param {Number} numPrecisionValues - number of integer precision values to generate
356
386
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
357
387
  */
388
+
358
389
  function generatePrecisionValues(numPrecisionValues) {
359
390
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
360
391
  return {
@@ -363,6 +394,7 @@ function generatePrecisionValues(numPrecisionValues) {
363
394
  };
364
395
  });
365
396
  }
397
+
366
398
  exports.generatePrecisionValues = generatePrecisionValues;
367
399
  /**
368
400
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -372,12 +404,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
372
404
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
373
405
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
374
406
  */
407
+
375
408
  var insertLayout = function insertLayout(layout, index) {
376
409
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
377
410
  layoutItems[_key - 2] = arguments[_key];
378
411
  }
412
+
379
413
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
380
414
  };
415
+
381
416
  exports.insertLayout = insertLayout;
382
417
 
383
418
  /***/ }),
@@ -407,6 +442,7 @@ Object.defineProperty(exports, "__esModule", {
407
442
  });
408
443
  exports.VizCategory = void 0;
409
444
  var VizCategory;
445
+
410
446
  (function (VizCategory) {
411
447
  VizCategory["SINGLE_VALUE"] = "Single Value";
412
448
  VizCategory["TRENDS"] = "Trends";
@@ -424,28 +460,42 @@ var VizCategory;
424
460
 
425
461
  /***/ }),
426
462
 
427
- /***/ 81:
463
+ /***/ 82:
428
464
  /***/ (function(module, exports, __webpack_require__) {
429
465
 
430
466
  "use strict";
431
467
 
432
468
 
433
469
  var _toConsumableArray = __webpack_require__(1);
470
+
434
471
  Object.defineProperty(exports, "__esModule", {
435
472
  value: true
436
473
  });
474
+
437
475
  var i18n_1 = __webpack_require__(0);
476
+
438
477
  var lodash_1 = __webpack_require__(6);
478
+
439
479
  var schemaUtils_1 = __webpack_require__(3);
480
+
440
481
  var colorConstants_1 = __webpack_require__(26);
482
+
441
483
  var visualization_icons_1 = __webpack_require__(12);
484
+
442
485
  var placeholders_1 = __webpack_require__(11);
486
+
443
487
  var variables_1 = __webpack_require__(10);
488
+
444
489
  var pick_1 = __webpack_require__(9);
490
+
445
491
  var configUtils_1 = __webpack_require__(4);
492
+
446
493
  var VizBehavior_1 = __webpack_require__(2);
447
- var consts_1 = __webpack_require__(82);
494
+
495
+ var consts_1 = __webpack_require__(83);
496
+
448
497
  var VizCategory_1 = __webpack_require__(8);
498
+
449
499
  var dataContract = {
450
500
  requiredDataSources: [{
451
501
  name: 'primary',
@@ -922,8 +972,8 @@ var themes = {
922
972
  enterprise: {
923
973
  dark: variables_1.default.contentColorInverted(props),
924
974
  light: variables_1.default.white(props) // equal to textColor in enterpriseDark
925
- },
926
975
 
976
+ },
927
977
  prisma: variables_1.default.contentColorInverted(props)
928
978
  })(props);
929
979
  }
@@ -1090,7 +1140,7 @@ var editorConfig = [{
1090
1140
  },
1091
1141
  value: function value(_ref) {
1092
1142
  var context = _ref.context,
1093
- options = _ref.options;
1143
+ options = _ref.options;
1094
1144
  return {
1095
1145
  context: context,
1096
1146
  columnFormat: options.columnFormat,
@@ -1104,16 +1154,19 @@ var editorConfig = [{
1104
1154
  /**
1105
1155
  * visualization configuration
1106
1156
  */
1157
+
1107
1158
  var config = {
1108
1159
  /**
1109
1160
  * unique viz key
1110
1161
  */
1111
1162
  key: 'splunk.table',
1163
+
1112
1164
  /**
1113
1165
  * viz name
1114
1166
  */
1115
1167
  name: (0, i18n_1._)('Table'),
1116
1168
  category: VizCategory_1.VizCategory.TABLE,
1169
+
1117
1170
  /**
1118
1171
  * viz icon
1119
1172
  */
@@ -1136,7 +1189,7 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
1136
1189
 
1137
1190
  /***/ }),
1138
1191
 
1139
- /***/ 82:
1192
+ /***/ 83:
1140
1193
  /***/ (function(module, exports, __webpack_require__) {
1141
1194
 
1142
1195
  "use strict";