@splunk/visualizations 28.6.0 → 28.8.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.js +2 -2
- package/Area.js.map +2 -2
- package/Bar.js +2 -2
- package/Bar.js.map +2 -2
- package/Bubble.js +2 -2
- package/Bubble.js.map +2 -2
- package/CHANGELOG.external.md +45 -50
- package/ChoroplethSvg.js +2 -2
- package/ChoroplethSvg.js.map +2 -2
- package/Column.js +2 -2
- package/Column.js.map +2 -2
- package/Ellipse.js +2 -2
- package/Ellipse.js.map +2 -2
- package/Events/PureEvents/FieldSummaryTooltip.d.ts +8 -31
- package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events/PureEvents/TimeControlsPopover.d.ts +6 -25
- package/Events/PureEvents/TimeControlsPopover.d.ts.map +1 -1
- package/Events.js +27 -101
- package/Events.js.map +2 -2
- package/FillerGauge.js +10 -5
- package/FillerGauge.js.map +2 -2
- package/Image.js +2 -2
- package/Image.js.map +2 -2
- package/Line.js +2 -2
- package/Line.js.map +2 -2
- package/LinkGraph.js +2 -2
- package/LinkGraph.js.map +2 -2
- package/Map/Map.d.ts +1 -0
- package/Map/Map.d.ts.map +1 -1
- package/Map/PureMap/BubbleLayer.d.ts +22 -4
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/ChoroplethLayer.d.ts +9 -1
- package/Map/PureMap/ChoroplethLayer.d.ts.map +1 -1
- package/Map/PureMap/ClusterLayer.d.ts +3 -1
- package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
- package/Map/PureMap/LocalChoroplethLayer.d.ts +1 -0
- package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
- package/Map/PureMap/MapContext.d.ts +13 -0
- package/Map/PureMap/MapContext.d.ts.map +1 -0
- package/Map/PureMap/MarkerLayer.d.ts +19 -2
- package/Map/PureMap/MarkerLayer.d.ts.map +1 -1
- package/Map/PureMap/MarkerWrapper.d.ts +3 -2
- package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
- package/Map/PureMap/PureMap.d.ts +1 -0
- package/Map/PureMap/PureMap.d.ts.map +1 -1
- package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
- package/Map/PureMap/Tooltip.d.ts +6 -1
- package/Map/PureMap/Tooltip.d.ts.map +1 -1
- package/Map/PureMap/keyboardConstants.d.ts +11 -0
- package/Map/PureMap/keyboardConstants.d.ts.map +1 -0
- package/Map/PureMap/useRovingTabindex.d.ts +18 -0
- package/Map/PureMap/useRovingTabindex.d.ts.map +1 -0
- package/Map.js +1317 -478
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown.config.js +1 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +24 -7
- package/Markdown.js.map +2 -2
- package/MarkerGauge.js +10 -5
- package/MarkerGauge.js.map +2 -2
- package/NetworkGraph/NetworkGraph.d.ts +2 -5
- package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +23 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js +2 -0
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +353 -40
- package/NetworkGraph.js.map +4 -4
- package/ParallelCoordinates.js +2 -2
- package/ParallelCoordinates.js.map +2 -2
- package/Pie.js +2 -2
- package/Pie.js.map +2 -2
- package/ProcessTree/ProcessTree.d.ts +3 -1
- package/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +1 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +2 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +3 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +3 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -1
- package/ProcessTree.js +101 -31
- package/ProcessTree.js.map +3 -3
- package/Punchcard.js +2 -2
- package/Punchcard.js.map +2 -2
- package/README.md +2 -0
- package/Rectangle.js +2 -2
- package/Rectangle.js.map +2 -2
- package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -1
- package/RichText/PureRichText/InnerEditor.d.ts +10 -0
- package/RichText/PureRichText/InnerEditor.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichText.d.ts +17 -0
- package/RichText/PureRichText/PureRichText.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useContentSave.d.ts +6 -0
- package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useContentSync.d.ts +13 -1
- package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +1 -16
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useTokenMap.d.ts +37 -35
- package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -1
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts +0 -4
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -1
- package/RichText/PureRichText/types.d.ts +15 -0
- package/RichText/PureRichText/types.d.ts.map +1 -1
- package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -1
- package/RichText/RichText.d.ts +2 -0
- package/RichText/RichText.d.ts.map +1 -1
- package/RichText/config.d.ts.map +1 -1
- package/RichText.config.js +14 -1
- package/RichText.config.js.map +2 -2
- package/RichText.js +733 -263
- package/RichText.js.map +4 -4
- package/Sankey.js +2 -2
- package/Sankey.js.map +2 -2
- package/Scatter.js +2 -2
- package/Scatter.js.map +2 -2
- package/SingleValue.js +368 -471
- package/SingleValue.js.map +4 -4
- package/SingleValueIcon.js +2 -2
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.js +2 -2
- package/SingleValueRadial.js.map +2 -2
- package/SparkLine/SparkLine.d.ts +57 -0
- package/SparkLine/SparkLine.d.ts.map +1 -0
- package/SparkLine/index.d.ts +1 -1
- package/SparkLine/index.d.ts.map +1 -1
- package/SparkLine.js +384 -485
- package/SparkLine.js.map +4 -4
- package/Table/PureTable.d.ts +2 -0
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts +1 -1
- package/Table/hooks.d.ts.map +1 -1
- package/Table.config.js +7 -0
- package/Table.config.js.map +2 -2
- package/Table.js +480 -500
- package/Table.js.map +4 -4
- package/Timeline/PureTimeline/PureTimeline.d.ts +6 -5
- package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/CursorPlugin.d.ts +1 -0
- package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineLegend.d.ts +10 -7
- package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineTooltip.d.ts +5 -1
- package/Timeline/PureTimeline/src/TimelineTooltip.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineUplot.d.ts +19 -2
- package/Timeline/PureTimeline/src/TimelineUplot.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/XAxisPlugin.d.ts +1 -0
- package/Timeline/PureTimeline/src/XAxisPlugin.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +8 -0
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
- package/Timeline.js +449 -211
- package/Timeline.js.map +4 -4
- package/Treemap/PureTreemap/components/PureTreemap.d.ts +42 -0
- package/Treemap/PureTreemap/components/PureTreemap.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapBreadcrumb.d.ts +10 -0
- package/Treemap/PureTreemap/components/TreemapBreadcrumb.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapChildCell.d.ts +28 -0
- package/Treemap/PureTreemap/components/TreemapChildCell.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapHeader.d.ts +19 -0
- package/Treemap/PureTreemap/components/TreemapHeader.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapHoverTarget.d.ts +17 -0
- package/Treemap/PureTreemap/components/TreemapHoverTarget.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapLegend.d.ts +20 -0
- package/Treemap/PureTreemap/components/TreemapLegend.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapNode.d.ts +5 -0
- package/Treemap/PureTreemap/components/TreemapNode.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapParentNode.d.ts +10 -0
- package/Treemap/PureTreemap/components/TreemapParentNode.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapStandaloneNode.d.ts +6 -0
- package/Treemap/PureTreemap/components/TreemapStandaloneNode.d.ts.map +1 -0
- package/Treemap/PureTreemap/components/TreemapTooltip.d.ts +17 -0
- package/Treemap/PureTreemap/components/TreemapTooltip.d.ts.map +1 -0
- package/Treemap/PureTreemap/mockdata/data.d.ts +90 -0
- package/Treemap/PureTreemap/mockdata/data.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapColorUtils.d.ts +67 -0
- package/Treemap/PureTreemap/utils/treemapColorUtils.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapDataColorUtils.d.ts +5 -0
- package/Treemap/PureTreemap/utils/treemapDataColorUtils.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapDataUtils.d.ts +14 -0
- package/Treemap/PureTreemap/utils/treemapDataUtils.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapLayout.d.ts +49 -0
- package/Treemap/PureTreemap/utils/treemapLayout.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapNodeUtils.d.ts +81 -0
- package/Treemap/PureTreemap/utils/treemapNodeUtils.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapTypes.d.ts +37 -0
- package/Treemap/PureTreemap/utils/treemapTypes.d.ts.map +1 -0
- package/Treemap/PureTreemap/utils/treemapUtils.d.ts +76 -0
- package/Treemap/PureTreemap/utils/treemapUtils.d.ts.map +1 -0
- package/Treemap/Treemap.d.ts +12 -0
- package/Treemap/Treemap.d.ts.map +1 -0
- package/Treemap/config.d.ts +4 -0
- package/Treemap/config.d.ts.map +1 -0
- package/Treemap/index.d.ts +3 -0
- package/Treemap/index.d.ts.map +1 -0
- package/Treemap.config.js +465 -0
- package/Treemap.config.js.map +7 -0
- package/Treemap.js +6233 -0
- package/Treemap.js.map +7 -0
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +1 -0
- package/common/GaugeValueMarker.js.map +2 -2
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js.map +2 -2
- package/common/docUtils.d.ts.map +1 -1
- package/common/docUtils.js +1 -8
- package/common/docUtils.js.map +2 -2
- package/common/gaugeUtils.d.ts.map +1 -1
- package/common/gaugeUtils.js +7 -3
- package/common/gaugeUtils.js.map +2 -2
- package/common/hocs/FixedSizeContainer.d.ts.map +1 -1
- package/common/hooks/useDynamicHeight.d.ts +67 -0
- package/common/hooks/useDynamicHeight.d.ts.map +1 -0
- package/common/interfaces/VizCategory.d.ts +2 -1
- package/common/interfaces/VizCategory.d.ts.map +1 -1
- package/common/utils/mapUtils.js +512 -179
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/shadowDomUtils.d.ts +2 -0
- package/common/utils/shadowDomUtils.d.ts.map +1 -0
- package/common/utils/shadowDomUtils.js +39 -0
- package/common/utils/shadowDomUtils.js.map +7 -0
- package/common/withDashboardViz.js +2 -2
- package/common/withDashboardViz.js.map +2 -2
- package/docs-llm/INDEX.md +119 -0
- package/docs-llm/area/examples-json.md +3854 -0
- package/docs-llm/area/examples-react.md +2816 -0
- package/docs-llm/area/options.md +97 -0
- package/docs-llm/area/overview.md +27 -0
- package/docs-llm/bar/examples-json.md +3380 -0
- package/docs-llm/bar/examples-react.md +2352 -0
- package/docs-llm/bar/options.md +89 -0
- package/docs-llm/bar/overview.md +25 -0
- package/docs-llm/bubble/examples-json.md +4082 -0
- package/docs-llm/bubble/examples-react.md +3977 -0
- package/docs-llm/bubble/options.md +62 -0
- package/docs-llm/bubble/overview.md +26 -0
- package/docs-llm/choropleth-svg/examples-json.md +397 -0
- package/docs-llm/choropleth-svg/examples-react.md +389 -0
- package/docs-llm/choropleth-svg/options.md +15 -0
- package/docs-llm/choropleth-svg/overview.md +23 -0
- package/docs-llm/column/examples-json.md +3898 -0
- package/docs-llm/column/examples-react.md +2653 -0
- package/docs-llm/column/options.md +94 -0
- package/docs-llm/column/overview.md +31 -0
- package/docs-llm/dsl/examples-json.md +43 -0
- package/docs-llm/dsl/examples-react.md +78 -0
- package/docs-llm/dsl/formatters/format-by-type-examples-json.md +58 -0
- package/docs-llm/dsl/formatters/format-by-type-examples-react.md +43 -0
- package/docs-llm/dsl/formatters/format-by-type.md +38 -0
- package/docs-llm/dsl/formatters/frame-examples-json.md +42 -0
- package/docs-llm/dsl/formatters/frame-examples-react.md +24 -0
- package/docs-llm/dsl/formatters/frame.md +6 -0
- package/docs-llm/dsl/formatters/gradient-examples-json.md +98 -0
- package/docs-llm/dsl/formatters/gradient-examples-react.md +44 -0
- package/docs-llm/dsl/formatters/gradient.md +23 -0
- package/docs-llm/dsl/formatters/lerp-examples-json.md +40 -0
- package/docs-llm/dsl/formatters/lerp-examples-react.md +28 -0
- package/docs-llm/dsl/formatters/lerp.md +19 -0
- package/docs-llm/dsl/formatters/match-value-examples-json.md +65 -0
- package/docs-llm/dsl/formatters/match-value-examples-react.md +37 -0
- package/docs-llm/dsl/formatters/match-value.md +13 -0
- package/docs-llm/dsl/formatters/max-contrast-examples-json.md +39 -0
- package/docs-llm/dsl/formatters/max-contrast-examples-react.md +27 -0
- package/docs-llm/dsl/formatters/max-contrast.md +9 -0
- package/docs-llm/dsl/formatters/multi-format-examples-json.md +67 -0
- package/docs-llm/dsl/formatters/multi-format-examples-react.md +49 -0
- package/docs-llm/dsl/formatters/multi-format.md +12 -0
- package/docs-llm/dsl/formatters/objects-examples-json.md +49 -0
- package/docs-llm/dsl/formatters/objects-examples-react.md +37 -0
- package/docs-llm/dsl/formatters/objects.md +3 -0
- package/docs-llm/dsl/formatters/pick-examples-json.md +59 -0
- package/docs-llm/dsl/formatters/pick-examples-react.md +30 -0
- package/docs-llm/dsl/formatters/pick.md +9 -0
- package/docs-llm/dsl/formatters/prefix-examples-json.md +29 -0
- package/docs-llm/dsl/formatters/prefix-examples-react.md +19 -0
- package/docs-llm/dsl/formatters/prefix.md +3 -0
- package/docs-llm/dsl/formatters/prepend-examples-json.md +51 -0
- package/docs-llm/dsl/formatters/prepend-examples-react.md +33 -0
- package/docs-llm/dsl/formatters/prepend.md +9 -0
- package/docs-llm/dsl/formatters/range-value-examples-json.md +48 -0
- package/docs-llm/dsl/formatters/range-value-examples-react.md +34 -0
- package/docs-llm/dsl/formatters/range-value.md +15 -0
- package/docs-llm/dsl/formatters/set-color-channel-examples-json.md +40 -0
- package/docs-llm/dsl/formatters/set-color-channel-examples-react.md +31 -0
- package/docs-llm/dsl/formatters/set-color-channel.md +9 -0
- package/docs-llm/dsl/formatters/suffix-examples-json.md +29 -0
- package/docs-llm/dsl/formatters/suffix-examples-react.md +19 -0
- package/docs-llm/dsl/formatters/suffix.md +3 -0
- package/docs-llm/dsl/formatters/type-examples-json.md +37 -0
- package/docs-llm/dsl/formatters/type-examples-react.md +20 -0
- package/docs-llm/dsl/formatters/type.md +3 -0
- package/docs-llm/dsl/overview.md +41 -0
- package/docs-llm/dsl/selectors/abs.md +7 -0
- package/docs-llm/dsl/selectors/ceil.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-average-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-average-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-average.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-count-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-count-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-count.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-examples-json.md +830 -0
- package/docs-llm/dsl/selectors/data-frame-examples-react.md +929 -0
- package/docs-llm/dsl/selectors/data-frame-get-field-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/data-frame-get-field-examples-react.md +124 -0
- package/docs-llm/dsl/selectors/data-frame-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-raw-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-max-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-max-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-max.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-min-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-min-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-min.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-percentile-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-percentile-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-percentile.md +8 -0
- package/docs-llm/dsl/selectors/data-frame-set-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-sum-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-sum-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-sum.md +7 -0
- package/docs-llm/dsl/selectors/data-frame.md +4 -0
- package/docs-llm/dsl/selectors/data-point-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-point-get-raw-value.md +4 -0
- package/docs-llm/dsl/selectors/data-point-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-point-get-value.md +5 -0
- package/docs-llm/dsl/selectors/data-point-set-value.md +4 -0
- package/docs-llm/dsl/selectors/data-point.md +5 -0
- package/docs-llm/dsl/selectors/data-series-average.md +22 -0
- package/docs-llm/dsl/selectors/data-series-count.md +14 -0
- package/docs-llm/dsl/selectors/data-series-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-series-get-raw-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-series-get-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-max.md +5 -0
- package/docs-llm/dsl/selectors/data-series-min.md +5 -0
- package/docs-llm/dsl/selectors/data-series-percentile.md +17 -0
- package/docs-llm/dsl/selectors/data-series-set-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-sum.md +24 -0
- package/docs-llm/dsl/selectors/data-series.md +4 -0
- package/docs-llm/dsl/selectors/delta.md +7 -0
- package/docs-llm/dsl/selectors/divide.md +8 -0
- package/docs-llm/dsl/selectors/first-point.md +5 -0
- package/docs-llm/dsl/selectors/floor.md +7 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range.md +10 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-json.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-react.md +87 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-names.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-types-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-types-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-types.md +9 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-json.md +137 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-react.md +135 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-json.md +157 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-react.md +155 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except.md +21 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields.md +17 -0
- package/docs-llm/dsl/selectors/frame-without-series-names.md +8 -0
- package/docs-llm/dsl/selectors/last-point.md +5 -0
- package/docs-llm/dsl/selectors/minus.md +8 -0
- package/docs-llm/dsl/selectors/multiply.md +8 -0
- package/docs-llm/dsl/selectors/plus.md +8 -0
- package/docs-llm/dsl/selectors/point-by-index.md +6 -0
- package/docs-llm/dsl/selectors/points-by-indexes.md +6 -0
- package/docs-llm/dsl/selectors/round.md +7 -0
- package/docs-llm/dsl/selectors/series-by-index-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-index-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-index.md +8 -0
- package/docs-llm/dsl/selectors/series-by-name-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-name-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-name.md +8 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-json.md +47 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types.md +10 -0
- package/docs-llm/dsl/selectors/series-by-type-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-type-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-type.md +10 -0
- package/docs-llm/dsl/selectors/series-by-types.md +6 -0
- package/docs-llm/ellipse/examples-json.md +5 -0
- package/docs-llm/ellipse/examples-react.md +5 -0
- package/docs-llm/ellipse/options.md +16 -0
- package/docs-llm/ellipse/overview.md +5 -0
- package/docs-llm/events/examples-json.md +705 -0
- package/docs-llm/events/examples-react.md +536 -0
- package/docs-llm/events/options.md +18 -0
- package/docs-llm/events/overview.md +5 -0
- package/docs-llm/filler-gauge/examples-json.md +376 -0
- package/docs-llm/filler-gauge/examples-react.md +274 -0
- package/docs-llm/filler-gauge/options.md +26 -0
- package/docs-llm/filler-gauge/overview.md +5 -0
- package/docs-llm/image/examples-json.md +39 -0
- package/docs-llm/image/examples-react.md +65 -0
- package/docs-llm/image/options.md +13 -0
- package/docs-llm/image/overview.md +5 -0
- package/docs-llm/line/examples-json.md +3724 -0
- package/docs-llm/line/examples-react.md +2683 -0
- package/docs-llm/line/options.md +95 -0
- package/docs-llm/line/overview.md +29 -0
- package/docs-llm/link-graph/examples-json.md +5 -0
- package/docs-llm/link-graph/examples-react.md +5 -0
- package/docs-llm/link-graph/options.md +26 -0
- package/docs-llm/link-graph/overview.md +16 -0
- package/docs-llm/map/examples-json.md +13973 -0
- package/docs-llm/map/examples-react.md +6154 -0
- package/docs-llm/map/options.md +22 -0
- package/docs-llm/map/overview.md +32 -0
- package/docs-llm/markdown/examples-json.md +63 -0
- package/docs-llm/markdown/examples-react.md +98 -0
- package/docs-llm/markdown/options.md +17 -0
- package/docs-llm/markdown/overview.md +5 -0
- package/docs-llm/marker-gauge/examples-json.md +436 -0
- package/docs-llm/marker-gauge/examples-react.md +367 -0
- package/docs-llm/marker-gauge/options.md +26 -0
- package/docs-llm/marker-gauge/overview.md +5 -0
- package/docs-llm/network-graph/examples-json.md +8843 -0
- package/docs-llm/network-graph/examples-react.md +7339 -0
- package/docs-llm/network-graph/options.md +50 -0
- package/docs-llm/network-graph/overview.md +28 -0
- package/docs-llm/parallel-coordinates/examples-json.md +8376 -0
- package/docs-llm/parallel-coordinates/examples-react.md +2771 -0
- package/docs-llm/parallel-coordinates/options.md +14 -0
- package/docs-llm/parallel-coordinates/overview.md +22 -0
- package/docs-llm/pie/examples-json.md +851 -0
- package/docs-llm/pie/examples-react.md +606 -0
- package/docs-llm/pie/options.md +34 -0
- package/docs-llm/pie/overview.md +23 -0
- package/docs-llm/process-tree/options.md +32 -0
- package/docs-llm/punchcard/examples-json.md +6134 -0
- package/docs-llm/punchcard/examples-react.md +4562 -0
- package/docs-llm/punchcard/options.md +33 -0
- package/docs-llm/punchcard/overview.md +5 -0
- package/docs-llm/pure-rich-text/options.md +29 -0
- package/docs-llm/rectangle/examples-json.md +5 -0
- package/docs-llm/rectangle/examples-react.md +5 -0
- package/docs-llm/rectangle/options.md +19 -0
- package/docs-llm/rectangle/overview.md +5 -0
- package/docs-llm/rich-text/examples-json.md +96 -0
- package/docs-llm/rich-text/examples-react.md +119 -0
- package/docs-llm/rich-text/options.md +29 -0
- package/docs-llm/rich-text/overview.md +5 -0
- package/docs-llm/sankey/examples-json.md +844 -0
- package/docs-llm/sankey/examples-react.md +546 -0
- package/docs-llm/sankey/options.md +19 -0
- package/docs-llm/sankey/overview.md +24 -0
- package/docs-llm/scatter/examples-json.md +4012 -0
- package/docs-llm/scatter/examples-react.md +3914 -0
- package/docs-llm/scatter/options.md +68 -0
- package/docs-llm/scatter/overview.md +25 -0
- package/docs-llm/single-value/examples-json.md +2613 -0
- package/docs-llm/single-value/examples-react.md +2296 -0
- package/docs-llm/single-value/options.md +49 -0
- package/docs-llm/single-value/overview.md +23 -0
- package/docs-llm/single-value-icon/examples-json.md +1686 -0
- package/docs-llm/single-value-icon/examples-react.md +1573 -0
- package/docs-llm/single-value-icon/options.md +43 -0
- package/docs-llm/single-value-icon/overview.md +5 -0
- package/docs-llm/single-value-radial/examples-json.md +1178 -0
- package/docs-llm/single-value-radial/examples-react.md +1028 -0
- package/docs-llm/single-value-radial/options.md +41 -0
- package/docs-llm/single-value-radial/overview.md +5 -0
- package/docs-llm/table/examples-json.md +5 -0
- package/docs-llm/table/examples-react.md +5 -0
- package/docs-llm/table/options.md +26 -0
- package/docs-llm/table/overview.md +24 -0
- package/docs-llm/timeline/examples-json.md +5 -0
- package/docs-llm/timeline/examples-react.md +5 -0
- package/docs-llm/timeline/options.md +27 -0
- package/docs-llm/timeline/overview.md +24 -0
- package/docs-llm/treemap/examples-json.md +5 -0
- package/docs-llm/treemap/examples-react.md +5 -0
- package/docs-llm/treemap/options.md +26 -0
- package/docs-llm/treemap/overview.md +27 -0
- package/package.json +33 -28
package/SingleValue.js
CHANGED
|
@@ -978,7 +978,7 @@ var defaultImport20 = __toESM(require("@splunk/ui-utils/id"));
|
|
|
978
978
|
__reExport(id_exports, require("@splunk/ui-utils/id"));
|
|
979
979
|
var id_default = "default" in defaultImport20 ? defaultImport20.default : defaultImport20;
|
|
980
980
|
|
|
981
|
-
// src/SparkLine/SparkLine.
|
|
981
|
+
// src/SparkLine/SparkLine.tsx
|
|
982
982
|
var StyledSvg = styled_components_default.svg`
|
|
983
983
|
/* For fixing IE11 shows overflow part line issue */
|
|
984
984
|
overflow: hidden;
|
|
@@ -990,233 +990,262 @@ var StyledTooltip = styled_components_default.div`
|
|
|
990
990
|
min-width: 20px;
|
|
991
991
|
`;
|
|
992
992
|
var preventDefault = (e) => e.preventDefault();
|
|
993
|
-
var
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
993
|
+
var PROP_KEYS = [
|
|
994
|
+
"acceptNull",
|
|
995
|
+
"data",
|
|
996
|
+
"elementRef",
|
|
997
|
+
"endDotCount",
|
|
998
|
+
"endDotFillColor",
|
|
999
|
+
"endDotRadius",
|
|
1000
|
+
"endDotStroke",
|
|
1001
|
+
"endDotStrokeWidth",
|
|
1002
|
+
"fillColor",
|
|
1003
|
+
"fillOpacity",
|
|
1004
|
+
"cursorStroke",
|
|
1005
|
+
"cursorStrokeWidth",
|
|
1006
|
+
"cursorStrokeLinecap",
|
|
1007
|
+
"cursorStrokeDasharray",
|
|
1008
|
+
"height",
|
|
1009
|
+
"isArea",
|
|
1010
|
+
"lineColor",
|
|
1011
|
+
"lineLength",
|
|
1012
|
+
"lineStrokeWidth",
|
|
1013
|
+
"showEndDot",
|
|
1014
|
+
"showTooltip",
|
|
1015
|
+
"yMax",
|
|
1016
|
+
"yMin",
|
|
1017
|
+
"width",
|
|
1018
|
+
"title"
|
|
1019
|
+
];
|
|
1020
|
+
var SparkLineInner = (_a) => {
|
|
1021
|
+
var _b = _a, {
|
|
1022
|
+
acceptNull = false,
|
|
1023
|
+
data = [],
|
|
1024
|
+
elementRef,
|
|
1025
|
+
endDotCount = 0,
|
|
1026
|
+
endDotFillColor = "white",
|
|
1027
|
+
endDotRadius = 0,
|
|
1028
|
+
endDotStroke = "black",
|
|
1029
|
+
endDotStrokeWidth = 0,
|
|
1030
|
+
fillColor = "#65a637",
|
|
1031
|
+
fillOpacity = ".1",
|
|
1032
|
+
cursorStroke = "#5184AF",
|
|
1033
|
+
cursorStrokeWidth = 3,
|
|
1034
|
+
cursorStrokeLinecap = "square",
|
|
1035
|
+
cursorStrokeDasharray = "1, 5",
|
|
1036
|
+
height,
|
|
1037
|
+
isArea = false,
|
|
1038
|
+
lineColor = "#65a637",
|
|
1039
|
+
lineLength,
|
|
1040
|
+
lineStrokeWidth = 1,
|
|
1041
|
+
showEndDot = false,
|
|
1042
|
+
showTooltip = true,
|
|
1043
|
+
yMax,
|
|
1044
|
+
yMin,
|
|
1045
|
+
width,
|
|
1046
|
+
title
|
|
1047
|
+
} = _b, restProps = __objRest(_b, [
|
|
1048
|
+
"acceptNull",
|
|
1049
|
+
"data",
|
|
1050
|
+
"elementRef",
|
|
1051
|
+
"endDotCount",
|
|
1052
|
+
"endDotFillColor",
|
|
1053
|
+
"endDotRadius",
|
|
1054
|
+
"endDotStroke",
|
|
1055
|
+
"endDotStrokeWidth",
|
|
1056
|
+
"fillColor",
|
|
1057
|
+
"fillOpacity",
|
|
1058
|
+
"cursorStroke",
|
|
1059
|
+
"cursorStrokeWidth",
|
|
1060
|
+
"cursorStrokeLinecap",
|
|
1061
|
+
"cursorStrokeDasharray",
|
|
1062
|
+
"height",
|
|
1063
|
+
"isArea",
|
|
1064
|
+
"lineColor",
|
|
1065
|
+
"lineLength",
|
|
1066
|
+
"lineStrokeWidth",
|
|
1067
|
+
"showEndDot",
|
|
1068
|
+
"showTooltip",
|
|
1069
|
+
"yMax",
|
|
1070
|
+
"yMin",
|
|
1071
|
+
"width",
|
|
1072
|
+
"title"
|
|
1073
|
+
]);
|
|
1074
|
+
const [anchor, setAnchor] = (0, react_exports.useState)(null);
|
|
1075
|
+
const [activeIndex, setActiveIndex] = (0, react_exports.useState)(0);
|
|
1076
|
+
const [hoveredIndex, setHoveredIndex] = (0, react_exports.useState)(null);
|
|
1077
|
+
const [componentIsFocused, setComponentIsFocused] = (0, react_exports.useState)(false);
|
|
1078
|
+
const titleId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("sparkline-title"), []);
|
|
1079
|
+
const pointRefs = (0, react_exports.useRef)([]);
|
|
1080
|
+
const containerRef = (0, react_exports.useRef)(null);
|
|
1081
|
+
const fillNull = (0, react_exports.useCallback)(() => data.map((value) => value != null ? value : 0), [data]);
|
|
1082
|
+
const getMax = (0, react_exports.useCallback)(() => {
|
|
1083
|
+
const dataMax = () => acceptNull ? (0, lodash_exports.max)(fillNull()) : (0, lodash_exports.max)(data);
|
|
1084
|
+
return yMax != null ? yMax : dataMax();
|
|
1085
|
+
}, [acceptNull, data, fillNull, yMax]);
|
|
1086
|
+
const getMin = (0, react_exports.useCallback)(() => {
|
|
1087
|
+
const dataMin = () => acceptNull ? (0, lodash_exports.min)(fillNull()) : (0, lodash_exports.min)(data);
|
|
1088
|
+
return yMin != null ? yMin : dataMin();
|
|
1089
|
+
}, [acceptNull, data, fillNull, yMin]);
|
|
1090
|
+
const getXUnit = (0, react_exports.useCallback)(
|
|
1091
|
+
(xMargin2) => {
|
|
1092
|
+
const xUnit = (width - xMargin2 * 2) / (data.length > 1 ? data.length - 1 : 1);
|
|
1093
|
+
return Math.max(0, xUnit);
|
|
1094
|
+
},
|
|
1095
|
+
[data.length, width]
|
|
1096
|
+
);
|
|
1097
|
+
const getYUnit = (0, react_exports.useCallback)(
|
|
1098
|
+
(yMargin2) => {
|
|
1099
|
+
const maxValue = getMax();
|
|
1100
|
+
const minValue = getMin();
|
|
1101
|
+
const yUnit = (height - yMargin2 * 2) / (maxValue - minValue || 2);
|
|
1102
|
+
return Math.max(0, yUnit);
|
|
1103
|
+
},
|
|
1104
|
+
[getMax, getMin, height]
|
|
1105
|
+
);
|
|
1106
|
+
const getSegmentSets = (0, react_exports.useCallback)(
|
|
1107
|
+
(segmentData, points2) => {
|
|
1108
|
+
const lines = [];
|
|
1109
|
+
const isolatedPoints = [];
|
|
1110
|
+
let currentLine = [];
|
|
1111
|
+
for (const [idx, p] of segmentData.entries()) {
|
|
1112
|
+
if (!acceptNull && (0, lodash_exports.isNull)(p)) {
|
|
1113
|
+
if (currentLine.length > 1) {
|
|
1114
|
+
lines.push(currentLine);
|
|
1115
|
+
} else if (currentLine.length === 1) {
|
|
1116
|
+
isolatedPoints.push(currentLine[0]);
|
|
1117
|
+
}
|
|
1118
|
+
currentLine = [];
|
|
1119
|
+
} else {
|
|
1120
|
+
currentLine.push(points2[idx]);
|
|
1121
|
+
}
|
|
1028
1122
|
}
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
return
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1123
|
+
if (currentLine.length > 1) {
|
|
1124
|
+
lines.push(currentLine);
|
|
1125
|
+
} else if (currentLine.length === 1) {
|
|
1126
|
+
isolatedPoints.push(currentLine[0]);
|
|
1127
|
+
}
|
|
1128
|
+
return { lines, isolatedPoints };
|
|
1129
|
+
},
|
|
1130
|
+
[acceptNull]
|
|
1131
|
+
);
|
|
1132
|
+
const dataToPoints = (0, react_exports.useCallback)(
|
|
1133
|
+
(xMargin2, yMargin2) => {
|
|
1134
|
+
const xUnit = getXUnit(xMargin2);
|
|
1135
|
+
const yUnit = getYUnit(yMargin2);
|
|
1136
|
+
const maxValue = getMax();
|
|
1137
|
+
const minValue = getMin();
|
|
1138
|
+
return data.map((val, idx) => ({
|
|
1139
|
+
x: idx * xUnit + xMargin2,
|
|
1140
|
+
y: maxValue === minValue ? yUnit + yMargin2 : (maxValue - val) * yUnit + yMargin2
|
|
1141
|
+
})).map((p) => [p.x, p.y]);
|
|
1142
|
+
},
|
|
1143
|
+
[data, getMax, getMin, getXUnit, getYUnit]
|
|
1144
|
+
);
|
|
1145
|
+
const handleFocus = (0, react_exports.useCallback)(
|
|
1146
|
+
(event) => {
|
|
1147
|
+
const { target } = event;
|
|
1148
|
+
const { pointIndex: pointIndexStr } = target.dataset || {};
|
|
1149
|
+
if (pointIndexStr !== void 0) {
|
|
1150
|
+
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
1151
|
+
if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
|
|
1152
|
+
setActiveIndex(pointIndex);
|
|
1153
|
+
setHoveredIndex(null);
|
|
1154
|
+
setComponentIsFocused(true);
|
|
1155
|
+
}
|
|
1156
|
+
} else if (pointRefs.current.length > 0) {
|
|
1157
|
+
const indexToFocus = activeIndex ? Math.min(pointRefs.current.length - 1, activeIndex) : 0;
|
|
1158
|
+
pointRefs.current[indexToFocus].focus();
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
[activeIndex, componentIsFocused, hoveredIndex]
|
|
1162
|
+
);
|
|
1163
|
+
const handleBlur = (0, react_exports.useCallback)((event) => {
|
|
1164
|
+
if (containerRef.current && !containerRef.current.contains(event.relatedTarget)) {
|
|
1165
|
+
setComponentIsFocused(false);
|
|
1049
1166
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1167
|
+
}, []);
|
|
1168
|
+
const handleKeyDown = (0, react_exports.useCallback)(
|
|
1169
|
+
(event) => {
|
|
1170
|
+
const numPoints = data.length;
|
|
1171
|
+
const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
|
|
1172
|
+
if (!allowedKeys.includes(event.key)) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
let newIndex;
|
|
1176
|
+
if (event.key === "Home") {
|
|
1053
1177
|
newIndex = 0;
|
|
1054
|
-
|
|
1055
|
-
case "End":
|
|
1178
|
+
} else if (event.key === "End") {
|
|
1056
1179
|
newIndex = numPoints - 1;
|
|
1057
|
-
|
|
1058
|
-
case "ArrowLeft":
|
|
1180
|
+
} else if (event.key === "ArrowLeft") {
|
|
1059
1181
|
newIndex = Math.max(0, activeIndex - 1);
|
|
1060
|
-
|
|
1061
|
-
case "ArrowRight":
|
|
1182
|
+
} else {
|
|
1062
1183
|
newIndex = Math.min(numPoints - 1, activeIndex + 1);
|
|
1063
|
-
break;
|
|
1064
|
-
default:
|
|
1065
|
-
return;
|
|
1066
|
-
}
|
|
1067
|
-
if (newIndex !== activeIndex) {
|
|
1068
|
-
event.preventDefault();
|
|
1069
|
-
if (this.pointRefs[newIndex]) {
|
|
1070
|
-
this.pointRefs[newIndex].focus();
|
|
1071
1184
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
1078
|
-
if (this.state.hoveredIndex !== pointIndex) {
|
|
1079
|
-
this.setState({ hoveredIndex: pointIndex });
|
|
1185
|
+
if (newIndex !== activeIndex) {
|
|
1186
|
+
event.preventDefault();
|
|
1187
|
+
if (pointRefs.current[newIndex]) {
|
|
1188
|
+
pointRefs.current[newIndex].focus();
|
|
1189
|
+
}
|
|
1080
1190
|
}
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
}
|
|
1093
|
-
getMin() {
|
|
1094
|
-
const { data, acceptNull, yMin } = this.props;
|
|
1095
|
-
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
|
|
1096
|
-
return yMin === void 0 ? dataMin() : yMin;
|
|
1097
|
-
}
|
|
1098
|
-
/**
|
|
1099
|
-
* Gets unit value of x axis.
|
|
1100
|
-
* @param {Number} xMargin - margin of x axis.
|
|
1101
|
-
* @return {Number} unit value of x axis.
|
|
1102
|
-
* @private
|
|
1103
|
-
*/
|
|
1104
|
-
getXUnit(xMargin) {
|
|
1105
|
-
const { data, width } = this.props;
|
|
1106
|
-
const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);
|
|
1107
|
-
return Math.max(0, xUnit);
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Gets unit value of y axis.
|
|
1111
|
-
* @param {String} yMargin - margin of y axis.
|
|
1112
|
-
* @return {Number} unit value of y axis.
|
|
1113
|
-
* @private
|
|
1114
|
-
*/
|
|
1115
|
-
getYUnit(yMargin) {
|
|
1116
|
-
const { height } = this.props;
|
|
1117
|
-
const maxValue = this.getMax();
|
|
1118
|
-
const minValue = this.getMin();
|
|
1119
|
-
const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);
|
|
1120
|
-
return Math.max(0, yUnit);
|
|
1121
|
-
}
|
|
1122
|
-
/**
|
|
1123
|
-
* Get a list of arrays of points for drawing lines, based on acceptNull property
|
|
1124
|
-
* @method getSegmentSets
|
|
1125
|
-
* @param {Array} data
|
|
1126
|
-
* @param {Array} points
|
|
1127
|
-
* @returns {Object} Object containing lines (arrays of points for polylines) and isolatedPoints (single points surrounded by nulls)
|
|
1128
|
-
*/
|
|
1129
|
-
getSegmentSets(data, points) {
|
|
1130
|
-
const { acceptNull } = this.props;
|
|
1131
|
-
const lines = [];
|
|
1132
|
-
const isolatedPoints = [];
|
|
1133
|
-
let currentLine = [];
|
|
1134
|
-
for (const [idx, p] of data.entries()) {
|
|
1135
|
-
if (!acceptNull && (0, lodash_exports.isNull)(p)) {
|
|
1136
|
-
if (currentLine.length > 1) {
|
|
1137
|
-
lines.push(currentLine);
|
|
1138
|
-
} else if (currentLine.length === 1) {
|
|
1139
|
-
isolatedPoints.push(currentLine[0]);
|
|
1191
|
+
},
|
|
1192
|
+
[activeIndex, data.length]
|
|
1193
|
+
);
|
|
1194
|
+
const handleMouseOver = (0, react_exports.useCallback)(
|
|
1195
|
+
(event) => {
|
|
1196
|
+
var _a2;
|
|
1197
|
+
const pointIndexStr = (_a2 = event.target.dataset) == null ? void 0 : _a2.pointIndex;
|
|
1198
|
+
if (pointIndexStr !== void 0) {
|
|
1199
|
+
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
1200
|
+
if (hoveredIndex !== pointIndex) {
|
|
1201
|
+
setHoveredIndex(pointIndex);
|
|
1140
1202
|
}
|
|
1141
|
-
currentLine = [];
|
|
1142
|
-
} else {
|
|
1143
|
-
currentLine.push(points[idx]);
|
|
1144
1203
|
}
|
|
1204
|
+
},
|
|
1205
|
+
[hoveredIndex]
|
|
1206
|
+
);
|
|
1207
|
+
const handleMouseLeave = (0, react_exports.useCallback)(() => {
|
|
1208
|
+
if (hoveredIndex !== null) {
|
|
1209
|
+
setHoveredIndex(null);
|
|
1145
1210
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
})
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
* @param {Array} points - array of points coordination.
|
|
1182
|
-
* @param {Number} xMargin - margin of x axis.
|
|
1183
|
-
* @return {Array} array of svg rect objects
|
|
1184
|
-
* @private
|
|
1185
|
-
*/
|
|
1186
|
-
renderRect(points, xMargin) {
|
|
1187
|
-
const { data, height, showTooltip } = this.props;
|
|
1188
|
-
const xUnit = this.getXUnit(xMargin);
|
|
1189
|
-
return points.map((p, i) => (
|
|
1190
|
-
/* eslint-disable react/no-array-index-key */
|
|
1191
|
-
/* @__PURE__ */ react_default.createElement(
|
|
1192
|
-
"rect",
|
|
1193
|
-
{
|
|
1194
|
-
key: `${i}_${p[0]}`,
|
|
1195
|
-
role: "graphics-symbol",
|
|
1196
|
-
"aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
|
|
1197
|
-
"data-test": `rect-${i}`,
|
|
1198
|
-
"data-point-index": i,
|
|
1199
|
-
tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
|
|
1200
|
-
ref: (el) => {
|
|
1201
|
-
this.pointRefs[i] = el;
|
|
1202
|
-
},
|
|
1203
|
-
x: Math.max(0, p[0] - xUnit / 2),
|
|
1204
|
-
y: 0,
|
|
1205
|
-
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
1206
|
-
height,
|
|
1207
|
-
style: { fillOpacity: 0 },
|
|
1208
|
-
onMouseDown: preventDefault
|
|
1209
|
-
}
|
|
1210
|
-
)
|
|
1211
|
-
));
|
|
1212
|
-
}
|
|
1213
|
-
// Renders area chart
|
|
1214
|
-
renderArea(points) {
|
|
1215
|
-
const { data, fillColor, fillOpacity, height, isArea } = this.props;
|
|
1216
|
-
if (!isArea || points.length === 0) {
|
|
1211
|
+
}, [hoveredIndex]);
|
|
1212
|
+
const handleCursorMount = (0, react_exports.useCallback)((el) => {
|
|
1213
|
+
setAnchor(el);
|
|
1214
|
+
}, []);
|
|
1215
|
+
const renderRect = (points2, xMargin2) => {
|
|
1216
|
+
const xUnit = getXUnit(xMargin2);
|
|
1217
|
+
return points2.map((p, i) => {
|
|
1218
|
+
var _a2;
|
|
1219
|
+
return (
|
|
1220
|
+
/* eslint-disable react/no-array-index-key */
|
|
1221
|
+
/* @__PURE__ */ react_default.createElement(
|
|
1222
|
+
"rect",
|
|
1223
|
+
{
|
|
1224
|
+
key: `${i}_${p[0]}`,
|
|
1225
|
+
role: "graphics-symbol",
|
|
1226
|
+
"aria-label": `Value: ${(_a2 = data[i]) != null ? _a2 : "N/A"}, point ${i + 1} of ${data.length}`,
|
|
1227
|
+
"data-test": `rect-${i}`,
|
|
1228
|
+
"data-point-index": i,
|
|
1229
|
+
tabIndex: showTooltip && activeIndex === i ? 0 : -1,
|
|
1230
|
+
ref: (el) => {
|
|
1231
|
+
pointRefs.current[i] = el;
|
|
1232
|
+
},
|
|
1233
|
+
x: Math.max(0, p[0] - xUnit / 2),
|
|
1234
|
+
y: 0,
|
|
1235
|
+
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
1236
|
+
height,
|
|
1237
|
+
style: { fillOpacity: 0 },
|
|
1238
|
+
onMouseDown: preventDefault
|
|
1239
|
+
}
|
|
1240
|
+
)
|
|
1241
|
+
);
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
const renderArea = (points2) => {
|
|
1245
|
+
if (!isArea || points2.length === 0) {
|
|
1217
1246
|
return null;
|
|
1218
1247
|
}
|
|
1219
|
-
const { lines } =
|
|
1248
|
+
const { lines } = getSegmentSets(data, points2);
|
|
1220
1249
|
const segments = lines.map(
|
|
1221
1250
|
(s) => s.concat([
|
|
1222
1251
|
[s.at(-1)[0], height],
|
|
@@ -1240,80 +1269,56 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
1240
1269
|
}
|
|
1241
1270
|
}
|
|
1242
1271
|
)));
|
|
1243
|
-
}
|
|
1244
|
-
renderCursor(
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
"
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
strokeLinecap: cursorStrokeLinecap,
|
|
1259
|
-
strokeDasharray: cursorStrokeDasharray
|
|
1260
|
-
}
|
|
1272
|
+
};
|
|
1273
|
+
const renderCursor = (currentPointX2, shouldRender) => shouldRender && /* @__PURE__ */ react_default.createElement(
|
|
1274
|
+
"line",
|
|
1275
|
+
{
|
|
1276
|
+
"data-test": "cursor",
|
|
1277
|
+
ref: handleCursorMount,
|
|
1278
|
+
x1: currentPointX2,
|
|
1279
|
+
y1: 0,
|
|
1280
|
+
x2: currentPointX2,
|
|
1281
|
+
y2: height,
|
|
1282
|
+
style: {
|
|
1283
|
+
stroke: cursorStroke,
|
|
1284
|
+
strokeWidth: cursorStrokeWidth,
|
|
1285
|
+
strokeLinecap: cursorStrokeLinecap,
|
|
1286
|
+
strokeDasharray: cursorStrokeDasharray
|
|
1261
1287
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
renderTooltip(
|
|
1265
|
-
const
|
|
1266
|
-
const displayValue = tooltipValue === null ? "-" : tooltipValue;
|
|
1288
|
+
}
|
|
1289
|
+
);
|
|
1290
|
+
const renderTooltip = (tooltipValue2, isOpen) => {
|
|
1291
|
+
const displayValue = tooltipValue2 === null ? "-" : tooltipValue2;
|
|
1267
1292
|
return /* @__PURE__ */ react_default.createElement(
|
|
1268
1293
|
Popover_default,
|
|
1269
1294
|
{
|
|
1270
1295
|
"data-test": "tooltip",
|
|
1271
1296
|
open: isOpen,
|
|
1272
1297
|
anchor,
|
|
1273
|
-
"data-test-value":
|
|
1298
|
+
"data-test-value": tooltipValue2,
|
|
1274
1299
|
appearance: "inverted",
|
|
1275
1300
|
defaultPlacement: "above",
|
|
1276
1301
|
animation: false
|
|
1277
1302
|
},
|
|
1278
1303
|
/* @__PURE__ */ react_default.createElement(StyledTooltip, null, displayValue)
|
|
1279
1304
|
);
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
"circle",
|
|
1294
|
-
{
|
|
1295
|
-
key: `end-dot${point[0]}${point[1]}`,
|
|
1296
|
-
"data-test": "end-dot",
|
|
1297
|
-
cx: point[0],
|
|
1298
|
-
cy: point[1],
|
|
1299
|
-
r: endDotRadius === 0 ? xMargin : endDotRadius,
|
|
1300
|
-
style: {
|
|
1301
|
-
fill: endDotFillColor,
|
|
1302
|
-
stroke: endDotStroke,
|
|
1303
|
-
strokeWidth: endDotStrokeWidth
|
|
1304
|
-
}
|
|
1305
|
+
};
|
|
1306
|
+
const renderEndDots = (points2, dotsToShow2, xMargin2) => /* @__PURE__ */ react_default.createElement("g", null, points2.slice(-dotsToShow2).map((point) => /* @__PURE__ */ react_default.createElement(
|
|
1307
|
+
"circle",
|
|
1308
|
+
{
|
|
1309
|
+
key: `end-dot${point[0]}${point[1]}`,
|
|
1310
|
+
"data-test": "end-dot",
|
|
1311
|
+
cx: point[0],
|
|
1312
|
+
cy: point[1],
|
|
1313
|
+
r: endDotRadius === 0 ? xMargin2 : endDotRadius,
|
|
1314
|
+
style: {
|
|
1315
|
+
fill: endDotFillColor,
|
|
1316
|
+
stroke: endDotStroke,
|
|
1317
|
+
strokeWidth: endDotStrokeWidth
|
|
1305
1318
|
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
* Renders circles for isolated points (single data points surrounded by nulls)
|
|
1310
|
-
* These would otherwise be invisible since a line requires at least 2 points
|
|
1311
|
-
* @method renderIsolatedPoints
|
|
1312
|
-
* @param {Array} isolatedPoints - Array of [x, y] coordinates for isolated points
|
|
1313
|
-
* @returns {Object} SVG Group of circles
|
|
1314
|
-
*/
|
|
1315
|
-
renderIsolatedPoints(isolatedPoints) {
|
|
1316
|
-
const { lineColor, lineStrokeWidth } = this.props;
|
|
1319
|
+
}
|
|
1320
|
+
)));
|
|
1321
|
+
const renderIsolatedPoints = (isolatedPoints) => {
|
|
1317
1322
|
if (!isolatedPoints || isolatedPoints.length === 0) {
|
|
1318
1323
|
return null;
|
|
1319
1324
|
}
|
|
@@ -1331,20 +1336,10 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
1331
1336
|
}
|
|
1332
1337
|
}
|
|
1333
1338
|
)));
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
* @param {Array} points
|
|
1339
|
-
* @returns {Object} SVG Group of polylines and isolated points
|
|
1340
|
-
*/
|
|
1341
|
-
renderPolyline(points) {
|
|
1342
|
-
const { data, lineColor, lineLength, lineStrokeWidth } = this.props;
|
|
1343
|
-
const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points.length;
|
|
1344
|
-
const { lines, isolatedPoints } = this.getSegmentSets(
|
|
1345
|
-
data.slice(-linePoints),
|
|
1346
|
-
points.slice(-linePoints)
|
|
1347
|
-
);
|
|
1339
|
+
};
|
|
1340
|
+
const renderPolyline = (points2) => {
|
|
1341
|
+
const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points2.length;
|
|
1342
|
+
const { lines, isolatedPoints } = getSegmentSets(data.slice(-linePoints), points2.slice(-linePoints));
|
|
1348
1343
|
return /* @__PURE__ */ react_default.createElement("g", { "data-test": "sparkline" }, lines.map((lineData) => /* @__PURE__ */ react_default.createElement(
|
|
1349
1344
|
"polyline",
|
|
1350
1345
|
{
|
|
@@ -1359,10 +1354,18 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
1359
1354
|
},
|
|
1360
1355
|
points: lineData.join(" ")
|
|
1361
1356
|
}
|
|
1362
|
-
)),
|
|
1363
|
-
}
|
|
1364
|
-
getInteractionState
|
|
1365
|
-
|
|
1357
|
+
)), renderIsolatedPoints(isolatedPoints));
|
|
1358
|
+
};
|
|
1359
|
+
const getInteractionState = ({
|
|
1360
|
+
interactionData,
|
|
1361
|
+
points: interactionPoints,
|
|
1362
|
+
interactionShowTooltip,
|
|
1363
|
+
interactionActiveIndex,
|
|
1364
|
+
interactionHoveredIndex,
|
|
1365
|
+
interactionComponentIsFocused
|
|
1366
|
+
}) => {
|
|
1367
|
+
var _a2;
|
|
1368
|
+
if (!interactionShowTooltip) {
|
|
1366
1369
|
return {
|
|
1367
1370
|
currentPointX: null,
|
|
1368
1371
|
tooltipValue: null,
|
|
@@ -1370,200 +1373,94 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
1370
1373
|
interactiveProps: {}
|
|
1371
1374
|
};
|
|
1372
1375
|
}
|
|
1373
|
-
const
|
|
1374
|
-
onKeyDown:
|
|
1375
|
-
onMouseOver:
|
|
1376
|
-
onMouseLeave:
|
|
1377
|
-
onFocus:
|
|
1378
|
-
onBlur:
|
|
1376
|
+
const interactiveProps2 = {
|
|
1377
|
+
onKeyDown: handleKeyDown,
|
|
1378
|
+
onMouseOver: handleMouseOver,
|
|
1379
|
+
onMouseLeave: handleMouseLeave,
|
|
1380
|
+
onFocus: handleFocus,
|
|
1381
|
+
onBlur: handleBlur
|
|
1379
1382
|
};
|
|
1380
|
-
const isHovered =
|
|
1381
|
-
const shouldDisplayInteractiveElements = (isHovered ||
|
|
1383
|
+
const isHovered = interactionHoveredIndex !== null;
|
|
1384
|
+
const shouldDisplayInteractiveElements = (isHovered || interactionComponentIsFocused) && interactionData.length > 0;
|
|
1382
1385
|
if (!shouldDisplayInteractiveElements) {
|
|
1383
1386
|
return {
|
|
1384
1387
|
currentPointX: null,
|
|
1385
1388
|
tooltipValue: null,
|
|
1386
1389
|
showCursorAndTooltip: false,
|
|
1387
|
-
interactiveProps
|
|
1390
|
+
interactiveProps: interactiveProps2
|
|
1388
1391
|
};
|
|
1389
1392
|
}
|
|
1390
|
-
const displayIndex = isHovered ?
|
|
1393
|
+
const displayIndex = isHovered ? interactionHoveredIndex : interactionActiveIndex;
|
|
1391
1394
|
const isValidIndex = displayIndex !== null && displayIndex >= 0;
|
|
1392
|
-
const withinBounds = isValidIndex && displayIndex <
|
|
1395
|
+
const withinBounds = isValidIndex && displayIndex < interactionData.length && displayIndex < interactionPoints.length;
|
|
1393
1396
|
if (!withinBounds) {
|
|
1394
1397
|
return {
|
|
1395
1398
|
currentPointX: null,
|
|
1396
1399
|
tooltipValue: null,
|
|
1397
1400
|
showCursorAndTooltip: false,
|
|
1398
|
-
interactiveProps
|
|
1401
|
+
interactiveProps: interactiveProps2
|
|
1399
1402
|
};
|
|
1400
1403
|
}
|
|
1401
|
-
const displayPointCoords =
|
|
1402
|
-
const
|
|
1403
|
-
const
|
|
1404
|
+
const displayPointCoords = interactionPoints[displayIndex];
|
|
1405
|
+
const currentPointX2 = (_a2 = displayPointCoords == null ? void 0 : displayPointCoords[0]) != null ? _a2 : null;
|
|
1406
|
+
const tooltipValue2 = interactionData[displayIndex];
|
|
1404
1407
|
return {
|
|
1405
|
-
currentPointX,
|
|
1406
|
-
tooltipValue,
|
|
1407
|
-
showCursorAndTooltip:
|
|
1408
|
-
interactiveProps
|
|
1408
|
+
currentPointX: currentPointX2,
|
|
1409
|
+
tooltipValue: tooltipValue2,
|
|
1410
|
+
showCursorAndTooltip: currentPointX2 !== null,
|
|
1411
|
+
interactiveProps: interactiveProps2
|
|
1409
1412
|
};
|
|
1413
|
+
};
|
|
1414
|
+
if (data.length === 0) {
|
|
1415
|
+
return null;
|
|
1410
1416
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1417
|
+
if (pointRefs.current.length !== data.length) {
|
|
1418
|
+
pointRefs.current.length = data.length;
|
|
1419
|
+
}
|
|
1420
|
+
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
1421
|
+
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
1422
|
+
const points = dataToPoints(xMargin, yMargin);
|
|
1423
|
+
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
1424
|
+
const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = getInteractionState({
|
|
1425
|
+
interactionData: data,
|
|
1426
|
+
points,
|
|
1427
|
+
interactionShowTooltip: showTooltip,
|
|
1428
|
+
interactionActiveIndex: activeIndex,
|
|
1429
|
+
interactionHoveredIndex: hoveredIndex,
|
|
1430
|
+
interactionComponentIsFocused: componentIsFocused
|
|
1431
|
+
});
|
|
1432
|
+
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
1433
|
+
return /* @__PURE__ */ react_default.createElement(
|
|
1434
|
+
"div",
|
|
1435
|
+
__spreadValues(__spreadValues({
|
|
1436
|
+
"data-test": "line",
|
|
1437
|
+
"data-test-type": isArea ? "area" : "line",
|
|
1438
|
+
ref: (el) => {
|
|
1439
|
+
containerRef.current = el;
|
|
1440
|
+
if (typeof elementRef === "function") {
|
|
1441
|
+
elementRef(el);
|
|
1442
|
+
} else if (elementRef && typeof elementRef === "object") {
|
|
1443
|
+
elementRef.current = el;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}, interactiveProps), (0, lodash_exports.omit)(restProps, PROP_KEYS)),
|
|
1447
|
+
/* @__PURE__ */ react_default.createElement(StyledSvg, { height, width, "aria-labelledby": titleId, "data-test": "sparkline-svg" }, /* @__PURE__ */ react_default.createElement("title", { id: titleId, "data-test": "sparkline-title" }, ariaLabel), /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? renderCursor(currentPointX, showCursorAndTooltip) : null, renderPolyline(points), renderArea(points), dotsToShow ? renderEndDots(points, dotsToShow, xMargin) : null, renderRect(points, xMargin), showTooltip ? renderTooltip(tooltipValue, showCursorAndTooltip) : null))
|
|
1448
|
+
);
|
|
1449
|
+
};
|
|
1450
|
+
var SparkLine = (_a) => {
|
|
1451
|
+
var _b = _a, { data = [] } = _b, props = __objRest(_b, ["data"]);
|
|
1452
|
+
if (true) {
|
|
1453
|
+
if (!Array.isArray(data)) {
|
|
1454
|
+
console.error("Data provided to SparkLine must be an array.");
|
|
1428
1455
|
return null;
|
|
1429
1456
|
}
|
|
1430
|
-
if (
|
|
1431
|
-
|
|
1457
|
+
if (!data.every((value) => value === null || (0, lodash_exports.isFinite)(value))) {
|
|
1458
|
+
console.error("Data provided to SparkLine must contain finite numbers or null.");
|
|
1459
|
+
return null;
|
|
1432
1460
|
}
|
|
1433
|
-
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
1434
|
-
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
1435
|
-
const points = this.dataToPoints(xMargin, yMargin);
|
|
1436
|
-
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
1437
|
-
const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = this.getInteractionState({
|
|
1438
|
-
data,
|
|
1439
|
-
points,
|
|
1440
|
-
showTooltip,
|
|
1441
|
-
activeIndex,
|
|
1442
|
-
hoveredIndex,
|
|
1443
|
-
componentIsFocused
|
|
1444
|
-
});
|
|
1445
|
-
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
1446
|
-
return /* @__PURE__ */ react_default.createElement(
|
|
1447
|
-
"div",
|
|
1448
|
-
__spreadValues(__spreadValues({
|
|
1449
|
-
"data-test": "line",
|
|
1450
|
-
"data-test-type": isArea ? "area" : "line",
|
|
1451
|
-
ref: (el) => {
|
|
1452
|
-
this.containerRef.current = el;
|
|
1453
|
-
if (typeof elementRef === "function") {
|
|
1454
|
-
elementRef(el);
|
|
1455
|
-
} else if (elementRef && typeof elementRef === "object") {
|
|
1456
|
-
elementRef.current = el;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
}, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
1460
|
-
/* @__PURE__ */ react_default.createElement(
|
|
1461
|
-
StyledSvg,
|
|
1462
|
-
{
|
|
1463
|
-
height,
|
|
1464
|
-
width,
|
|
1465
|
-
"aria-labelledby": this.titleId,
|
|
1466
|
-
"data-test": "sparkline-svg"
|
|
1467
|
-
},
|
|
1468
|
-
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
|
|
1469
|
-
/* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
|
|
1470
|
-
)
|
|
1471
|
-
);
|
|
1472
1461
|
}
|
|
1462
|
+
return /* @__PURE__ */ react_default.createElement(SparkLineInner, __spreadValues({ data }, props));
|
|
1473
1463
|
};
|
|
1474
|
-
__publicField(_SparkLine, "propTypes", {
|
|
1475
|
-
/**
|
|
1476
|
-
* If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.
|
|
1477
|
-
*/
|
|
1478
|
-
acceptNull: prop_types_default.bool,
|
|
1479
|
-
/** Array of numbers. These data numbers are converted to points and show on sparkline. */
|
|
1480
|
-
data: (props) => {
|
|
1481
|
-
if (!(0, lodash_exports.isArray)(props.data)) {
|
|
1482
|
-
return new Error("Data provided to Sparkline must be an array.");
|
|
1483
|
-
}
|
|
1484
|
-
if (props.acceptNull && !props.data.every((value) => (0, lodash_exports.isNull)(value) || (0, lodash_exports.isFinite)(value))) {
|
|
1485
|
-
return new Error("Data provided to Sparkline must be finite numbers or null.");
|
|
1486
|
-
}
|
|
1487
|
-
if (!props.acceptNull && !props.data.every((value) => (0, lodash_exports.isFinite)(value))) {
|
|
1488
|
-
return new Error("Data provided to Sparkline must be finite numbers.");
|
|
1489
|
-
}
|
|
1490
|
-
return null;
|
|
1491
|
-
},
|
|
1492
|
-
/** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */
|
|
1493
|
-
elementRef: prop_types_default.oneOfType([prop_types_default.func, prop_types_default.object]),
|
|
1494
|
-
/** 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. */
|
|
1495
|
-
endDotCount: prop_types_default.number,
|
|
1496
|
-
/** Fills color to the end dot. */
|
|
1497
|
-
endDotFillColor: prop_types_default.string,
|
|
1498
|
-
/**
|
|
1499
|
-
* Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.
|
|
1500
|
-
*/
|
|
1501
|
-
endDotRadius: prop_types_default.number,
|
|
1502
|
-
/** Sets end dot circle stroke color. */
|
|
1503
|
-
endDotStroke: prop_types_default.string,
|
|
1504
|
-
/** Sets end dot circle stroke width in pixels. */
|
|
1505
|
-
endDotStrokeWidth: prop_types_default.number,
|
|
1506
|
-
/** Fills color to area. */
|
|
1507
|
-
fillColor: prop_types_default.string,
|
|
1508
|
-
/** Fills opacity to area. Value must be in 0 ~ 1. */
|
|
1509
|
-
fillOpacity: prop_types_default.string,
|
|
1510
|
-
/** Sets cursor stroke color. */
|
|
1511
|
-
cursorStroke: prop_types_default.string,
|
|
1512
|
-
/** Sets cursor stroke width in pixels. */
|
|
1513
|
-
cursorStrokeWidth: prop_types_default.number,
|
|
1514
|
-
/** Sets cursor line cap style. */
|
|
1515
|
-
cursorStrokeLinecap: prop_types_default.oneOf(["butt", "round", "square"]),
|
|
1516
|
-
/** Sets cursor dash array style. */
|
|
1517
|
-
cursorStrokeDasharray: prop_types_default.string,
|
|
1518
|
-
/**
|
|
1519
|
-
* Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,
|
|
1520
|
-
* sparkline figures out the container height by itself.
|
|
1521
|
-
*/
|
|
1522
|
-
height: prop_types_default.number.isRequired,
|
|
1523
|
-
/** When set to `true`, sparkline shows as area. */
|
|
1524
|
-
isArea: prop_types_default.bool,
|
|
1525
|
-
/** The sparkline line color. */
|
|
1526
|
-
lineColor: prop_types_default.string,
|
|
1527
|
-
/** Allows user to draw only the last data points for the line. */
|
|
1528
|
-
lineLength: prop_types_default.number,
|
|
1529
|
-
/** The sparkline line stroke width in pixels. */
|
|
1530
|
-
lineStrokeWidth: prop_types_default.number,
|
|
1531
|
-
/** Enable to show end dot. */
|
|
1532
|
-
showEndDot: prop_types_default.bool,
|
|
1533
|
-
/** Enable to show tooltip. */
|
|
1534
|
-
showTooltip: prop_types_default.bool,
|
|
1535
|
-
/** Sets the data value range and maximum value shown on sparkline. */
|
|
1536
|
-
yMax: prop_types_default.number,
|
|
1537
|
-
/** Sets the data value range and minimum value shown on sparkline. */
|
|
1538
|
-
yMin: prop_types_default.number,
|
|
1539
|
-
/**
|
|
1540
|
-
* The width of the container.
|
|
1541
|
-
*/
|
|
1542
|
-
width: prop_types_default.number.isRequired,
|
|
1543
|
-
/** Sets the a11y title text on sparkline. */
|
|
1544
|
-
title: prop_types_default.string
|
|
1545
|
-
});
|
|
1546
|
-
__publicField(_SparkLine, "defaultProps", {
|
|
1547
|
-
acceptNull: false,
|
|
1548
|
-
data: [],
|
|
1549
|
-
showTooltip: true,
|
|
1550
|
-
endDotCount: 0,
|
|
1551
|
-
showEndDot: false,
|
|
1552
|
-
endDotRadius: 0,
|
|
1553
|
-
endDotFillColor: "white",
|
|
1554
|
-
endDotStroke: "black",
|
|
1555
|
-
endDotStrokeWidth: 0,
|
|
1556
|
-
fillColor: "#65a637",
|
|
1557
|
-
fillOpacity: ".1",
|
|
1558
|
-
cursorStroke: "#5184AF",
|
|
1559
|
-
cursorStrokeWidth: 3,
|
|
1560
|
-
cursorStrokeLinecap: "square",
|
|
1561
|
-
cursorStrokeDasharray: "1, 5",
|
|
1562
|
-
isArea: false,
|
|
1563
|
-
lineColor: "#65a637",
|
|
1564
|
-
lineStrokeWidth: 1
|
|
1565
|
-
});
|
|
1566
|
-
var SparkLine = _SparkLine;
|
|
1567
1464
|
var SparkLine_default = SparkLine;
|
|
1568
1465
|
|
|
1569
1466
|
// src/SingleValue/PureSingleValue/SingleValueSparkline.jsx
|
|
@@ -2095,7 +1992,7 @@ var SingleValue = (_a) => {
|
|
|
2095
1992
|
majorValueTitle,
|
|
2096
1993
|
trendColor,
|
|
2097
1994
|
trendText,
|
|
2098
|
-
trendTextFontSize,
|
|
1995
|
+
trendTextFontSize: trendFontSize || Math.min(contentHeight, trendTextFontSize),
|
|
2099
1996
|
showTrendIndicator: shouldShowTrend(trendDisplay),
|
|
2100
1997
|
unit,
|
|
2101
1998
|
unitPosition,
|
|
@@ -2463,7 +2360,7 @@ var Message_default = "default" in defaultImport29 ? defaultImport29.default : d
|
|
|
2463
2360
|
var isMissing = (v) => {
|
|
2464
2361
|
return v === null || v === void 0;
|
|
2465
2362
|
};
|
|
2466
|
-
var missingKeys = (
|
|
2363
|
+
var missingKeys = (keys, target) => keys.filter((k) => isMissing(target[k]));
|
|
2467
2364
|
var MissingPropsMessage = (props) => {
|
|
2468
2365
|
const {
|
|
2469
2366
|
width = SplunkVisualization_default.defaults.width,
|
|
@@ -2512,7 +2409,7 @@ var Cover = styled_components_default.div`
|
|
|
2512
2409
|
bottom: 0;
|
|
2513
2410
|
`;
|
|
2514
2411
|
var Blocker = styled_components_default.div.attrs({
|
|
2515
|
-
"data-splunk-visualization-version": "28.
|
|
2412
|
+
"data-splunk-visualization-version": "28.8.0 - 633c53372"
|
|
2516
2413
|
})`
|
|
2517
2414
|
position: relative;
|
|
2518
2415
|
width: 100%;
|
|
@@ -2602,7 +2499,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2602
2499
|
FixSizeItem,
|
|
2603
2500
|
{
|
|
2604
2501
|
"data-test": "fix-size-item",
|
|
2605
|
-
"data-splunk-visualization-version": "28.
|
|
2502
|
+
"data-splunk-visualization-version": "28.8.0 - 633c53372",
|
|
2606
2503
|
width,
|
|
2607
2504
|
height,
|
|
2608
2505
|
backgroundColor
|
|
@@ -5634,9 +5531,9 @@ var evaluatePanelOption = (panelDataSources, allOptions, optionKey, vizContext)
|
|
|
5634
5531
|
return Number.NaN;
|
|
5635
5532
|
}
|
|
5636
5533
|
};
|
|
5637
|
-
var sortTrellisKeys = (
|
|
5534
|
+
var sortTrellisKeys = (keys, trellisSortBy, trellisSortOrder, modifiedDataSourceBySplitBy, mergedOptions, vizContext) => {
|
|
5638
5535
|
if (trellisSortBy === "name") {
|
|
5639
|
-
|
|
5536
|
+
keys.sort((a, b) => {
|
|
5640
5537
|
const cmp = a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" });
|
|
5641
5538
|
return trellisSortOrder === "descending" ? -cmp : cmp;
|
|
5642
5539
|
});
|
|
@@ -5647,7 +5544,7 @@ var sortTrellisKeys = (keys2, trellisSortBy, trellisSortOrder, modifiedDataSourc
|
|
|
5647
5544
|
} else {
|
|
5648
5545
|
optionKey = mergedOptions.value !== void 0 ? "value" : "majorValue";
|
|
5649
5546
|
}
|
|
5650
|
-
|
|
5547
|
+
keys.sort((a, b) => {
|
|
5651
5548
|
const valA = evaluatePanelOption(
|
|
5652
5549
|
modifiedDataSourceBySplitBy[a],
|
|
5653
5550
|
mergedOptions,
|
|
@@ -5669,7 +5566,7 @@ var sortTrellisKeys = (keys2, trellisSortBy, trellisSortOrder, modifiedDataSourc
|
|
|
5669
5566
|
return trellisSortOrder === "descending" ? -cmp : cmp;
|
|
5670
5567
|
});
|
|
5671
5568
|
} else if (trellisSortOrder === "descending") {
|
|
5672
|
-
|
|
5569
|
+
keys.reverse();
|
|
5673
5570
|
}
|
|
5674
5571
|
};
|
|
5675
5572
|
var TrellisContainer = styled_components_default.div`
|