@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/SparkLine.js
CHANGED
|
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
|
|
|
22
22
|
}
|
|
23
23
|
return a;
|
|
24
24
|
};
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
25
37
|
var __export = (target, all) => {
|
|
26
38
|
for (var name in all)
|
|
27
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,7 +56,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
44
56
|
mod
|
|
45
57
|
));
|
|
46
58
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
48
59
|
|
|
49
60
|
// src/SparkLine/index.ts
|
|
50
61
|
var SparkLine_exports = {};
|
|
@@ -53,70 +64,61 @@ __export(SparkLine_exports, {
|
|
|
53
64
|
});
|
|
54
65
|
module.exports = __toCommonJS(SparkLine_exports);
|
|
55
66
|
|
|
56
|
-
// esm-externals:prop-types
|
|
57
|
-
var prop_types_exports = {};
|
|
58
|
-
__export(prop_types_exports, {
|
|
59
|
-
default: () => prop_types_default
|
|
60
|
-
});
|
|
61
|
-
var defaultImport = __toESM(require("prop-types"));
|
|
62
|
-
__reExport(prop_types_exports, require("prop-types"));
|
|
63
|
-
var prop_types_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
64
|
-
|
|
65
67
|
// esm-externals:react
|
|
66
68
|
var react_exports = {};
|
|
67
69
|
__export(react_exports, {
|
|
68
70
|
default: () => react_default
|
|
69
71
|
});
|
|
70
|
-
var
|
|
72
|
+
var defaultImport = __toESM(require("react"));
|
|
71
73
|
__reExport(react_exports, require("react"));
|
|
72
|
-
var react_default = "default" in
|
|
74
|
+
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
73
75
|
|
|
74
76
|
// esm-externals:lodash
|
|
75
77
|
var lodash_exports = {};
|
|
76
78
|
__export(lodash_exports, {
|
|
77
79
|
default: () => lodash_default
|
|
78
80
|
});
|
|
79
|
-
var
|
|
81
|
+
var defaultImport2 = __toESM(require("lodash"));
|
|
80
82
|
__reExport(lodash_exports, require("lodash"));
|
|
81
|
-
var lodash_default = "default" in
|
|
83
|
+
var lodash_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
82
84
|
|
|
83
85
|
// esm-externals:styled-components
|
|
84
86
|
var styled_components_exports = {};
|
|
85
87
|
__export(styled_components_exports, {
|
|
86
88
|
default: () => styled_components_default
|
|
87
89
|
});
|
|
88
|
-
var
|
|
90
|
+
var defaultImport3 = __toESM(require("styled-components"));
|
|
89
91
|
__reExport(styled_components_exports, require("styled-components"));
|
|
90
|
-
var styled_components_default = "default" in
|
|
92
|
+
var styled_components_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
91
93
|
|
|
92
94
|
// esm-externals:@splunk/react-ui/Popover
|
|
93
95
|
var Popover_exports = {};
|
|
94
96
|
__export(Popover_exports, {
|
|
95
97
|
default: () => Popover_default
|
|
96
98
|
});
|
|
97
|
-
var
|
|
99
|
+
var defaultImport4 = __toESM(require("@splunk/react-ui/Popover"));
|
|
98
100
|
__reExport(Popover_exports, require("@splunk/react-ui/Popover"));
|
|
99
|
-
var Popover_default = "default" in
|
|
101
|
+
var Popover_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
100
102
|
|
|
101
103
|
// esm-externals:@splunk/ui-utils/i18n
|
|
102
104
|
var i18n_exports = {};
|
|
103
105
|
__export(i18n_exports, {
|
|
104
106
|
default: () => i18n_default
|
|
105
107
|
});
|
|
106
|
-
var
|
|
108
|
+
var defaultImport5 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
107
109
|
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
108
|
-
var i18n_default = "default" in
|
|
110
|
+
var i18n_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
109
111
|
|
|
110
112
|
// esm-externals:@splunk/ui-utils/id
|
|
111
113
|
var id_exports = {};
|
|
112
114
|
__export(id_exports, {
|
|
113
115
|
default: () => id_default
|
|
114
116
|
});
|
|
115
|
-
var
|
|
117
|
+
var defaultImport6 = __toESM(require("@splunk/ui-utils/id"));
|
|
116
118
|
__reExport(id_exports, require("@splunk/ui-utils/id"));
|
|
117
|
-
var id_default = "default" in
|
|
119
|
+
var id_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
118
120
|
|
|
119
|
-
// src/SparkLine/SparkLine.
|
|
121
|
+
// src/SparkLine/SparkLine.tsx
|
|
120
122
|
var StyledSvg = styled_components_default.svg`
|
|
121
123
|
/* For fixing IE11 shows overflow part line issue */
|
|
122
124
|
overflow: hidden;
|
|
@@ -128,233 +130,262 @@ var StyledTooltip = styled_components_default.div`
|
|
|
128
130
|
min-width: 20px;
|
|
129
131
|
`;
|
|
130
132
|
var preventDefault = (e) => e.preventDefault();
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
133
|
+
var PROP_KEYS = [
|
|
134
|
+
"acceptNull",
|
|
135
|
+
"data",
|
|
136
|
+
"elementRef",
|
|
137
|
+
"endDotCount",
|
|
138
|
+
"endDotFillColor",
|
|
139
|
+
"endDotRadius",
|
|
140
|
+
"endDotStroke",
|
|
141
|
+
"endDotStrokeWidth",
|
|
142
|
+
"fillColor",
|
|
143
|
+
"fillOpacity",
|
|
144
|
+
"cursorStroke",
|
|
145
|
+
"cursorStrokeWidth",
|
|
146
|
+
"cursorStrokeLinecap",
|
|
147
|
+
"cursorStrokeDasharray",
|
|
148
|
+
"height",
|
|
149
|
+
"isArea",
|
|
150
|
+
"lineColor",
|
|
151
|
+
"lineLength",
|
|
152
|
+
"lineStrokeWidth",
|
|
153
|
+
"showEndDot",
|
|
154
|
+
"showTooltip",
|
|
155
|
+
"yMax",
|
|
156
|
+
"yMin",
|
|
157
|
+
"width",
|
|
158
|
+
"title"
|
|
159
|
+
];
|
|
160
|
+
var SparkLineInner = (_a) => {
|
|
161
|
+
var _b = _a, {
|
|
162
|
+
acceptNull = false,
|
|
163
|
+
data = [],
|
|
164
|
+
elementRef,
|
|
165
|
+
endDotCount = 0,
|
|
166
|
+
endDotFillColor = "white",
|
|
167
|
+
endDotRadius = 0,
|
|
168
|
+
endDotStroke = "black",
|
|
169
|
+
endDotStrokeWidth = 0,
|
|
170
|
+
fillColor = "#65a637",
|
|
171
|
+
fillOpacity = ".1",
|
|
172
|
+
cursorStroke = "#5184AF",
|
|
173
|
+
cursorStrokeWidth = 3,
|
|
174
|
+
cursorStrokeLinecap = "square",
|
|
175
|
+
cursorStrokeDasharray = "1, 5",
|
|
176
|
+
height,
|
|
177
|
+
isArea = false,
|
|
178
|
+
lineColor = "#65a637",
|
|
179
|
+
lineLength,
|
|
180
|
+
lineStrokeWidth = 1,
|
|
181
|
+
showEndDot = false,
|
|
182
|
+
showTooltip = true,
|
|
183
|
+
yMax,
|
|
184
|
+
yMin,
|
|
185
|
+
width,
|
|
186
|
+
title
|
|
187
|
+
} = _b, restProps = __objRest(_b, [
|
|
188
|
+
"acceptNull",
|
|
189
|
+
"data",
|
|
190
|
+
"elementRef",
|
|
191
|
+
"endDotCount",
|
|
192
|
+
"endDotFillColor",
|
|
193
|
+
"endDotRadius",
|
|
194
|
+
"endDotStroke",
|
|
195
|
+
"endDotStrokeWidth",
|
|
196
|
+
"fillColor",
|
|
197
|
+
"fillOpacity",
|
|
198
|
+
"cursorStroke",
|
|
199
|
+
"cursorStrokeWidth",
|
|
200
|
+
"cursorStrokeLinecap",
|
|
201
|
+
"cursorStrokeDasharray",
|
|
202
|
+
"height",
|
|
203
|
+
"isArea",
|
|
204
|
+
"lineColor",
|
|
205
|
+
"lineLength",
|
|
206
|
+
"lineStrokeWidth",
|
|
207
|
+
"showEndDot",
|
|
208
|
+
"showTooltip",
|
|
209
|
+
"yMax",
|
|
210
|
+
"yMin",
|
|
211
|
+
"width",
|
|
212
|
+
"title"
|
|
213
|
+
]);
|
|
214
|
+
const [anchor, setAnchor] = (0, react_exports.useState)(null);
|
|
215
|
+
const [activeIndex, setActiveIndex] = (0, react_exports.useState)(0);
|
|
216
|
+
const [hoveredIndex, setHoveredIndex] = (0, react_exports.useState)(null);
|
|
217
|
+
const [componentIsFocused, setComponentIsFocused] = (0, react_exports.useState)(false);
|
|
218
|
+
const titleId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("sparkline-title"), []);
|
|
219
|
+
const pointRefs = (0, react_exports.useRef)([]);
|
|
220
|
+
const containerRef = (0, react_exports.useRef)(null);
|
|
221
|
+
const fillNull = (0, react_exports.useCallback)(() => data.map((value) => value != null ? value : 0), [data]);
|
|
222
|
+
const getMax = (0, react_exports.useCallback)(() => {
|
|
223
|
+
const dataMax = () => acceptNull ? (0, lodash_exports.max)(fillNull()) : (0, lodash_exports.max)(data);
|
|
224
|
+
return yMax != null ? yMax : dataMax();
|
|
225
|
+
}, [acceptNull, data, fillNull, yMax]);
|
|
226
|
+
const getMin = (0, react_exports.useCallback)(() => {
|
|
227
|
+
const dataMin = () => acceptNull ? (0, lodash_exports.min)(fillNull()) : (0, lodash_exports.min)(data);
|
|
228
|
+
return yMin != null ? yMin : dataMin();
|
|
229
|
+
}, [acceptNull, data, fillNull, yMin]);
|
|
230
|
+
const getXUnit = (0, react_exports.useCallback)(
|
|
231
|
+
(xMargin2) => {
|
|
232
|
+
const xUnit = (width - xMargin2 * 2) / (data.length > 1 ? data.length - 1 : 1);
|
|
233
|
+
return Math.max(0, xUnit);
|
|
234
|
+
},
|
|
235
|
+
[data.length, width]
|
|
236
|
+
);
|
|
237
|
+
const getYUnit = (0, react_exports.useCallback)(
|
|
238
|
+
(yMargin2) => {
|
|
239
|
+
const maxValue = getMax();
|
|
240
|
+
const minValue = getMin();
|
|
241
|
+
const yUnit = (height - yMargin2 * 2) / (maxValue - minValue || 2);
|
|
242
|
+
return Math.max(0, yUnit);
|
|
243
|
+
},
|
|
244
|
+
[getMax, getMin, height]
|
|
245
|
+
);
|
|
246
|
+
const getSegmentSets = (0, react_exports.useCallback)(
|
|
247
|
+
(segmentData, points2) => {
|
|
248
|
+
const lines = [];
|
|
249
|
+
const isolatedPoints = [];
|
|
250
|
+
let currentLine = [];
|
|
251
|
+
for (const [idx, p] of segmentData.entries()) {
|
|
252
|
+
if (!acceptNull && (0, lodash_exports.isNull)(p)) {
|
|
253
|
+
if (currentLine.length > 1) {
|
|
254
|
+
lines.push(currentLine);
|
|
255
|
+
} else if (currentLine.length === 1) {
|
|
256
|
+
isolatedPoints.push(currentLine[0]);
|
|
257
|
+
}
|
|
258
|
+
currentLine = [];
|
|
259
|
+
} else {
|
|
260
|
+
currentLine.push(points2[idx]);
|
|
261
|
+
}
|
|
166
262
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
263
|
+
if (currentLine.length > 1) {
|
|
264
|
+
lines.push(currentLine);
|
|
265
|
+
} else if (currentLine.length === 1) {
|
|
266
|
+
isolatedPoints.push(currentLine[0]);
|
|
267
|
+
}
|
|
268
|
+
return { lines, isolatedPoints };
|
|
269
|
+
},
|
|
270
|
+
[acceptNull]
|
|
271
|
+
);
|
|
272
|
+
const dataToPoints = (0, react_exports.useCallback)(
|
|
273
|
+
(xMargin2, yMargin2) => {
|
|
274
|
+
const xUnit = getXUnit(xMargin2);
|
|
275
|
+
const yUnit = getYUnit(yMargin2);
|
|
276
|
+
const maxValue = getMax();
|
|
277
|
+
const minValue = getMin();
|
|
278
|
+
return data.map((val, idx) => ({
|
|
279
|
+
x: idx * xUnit + xMargin2,
|
|
280
|
+
y: maxValue === minValue ? yUnit + yMargin2 : (maxValue - val) * yUnit + yMargin2
|
|
281
|
+
})).map((p) => [p.x, p.y]);
|
|
282
|
+
},
|
|
283
|
+
[data, getMax, getMin, getXUnit, getYUnit]
|
|
284
|
+
);
|
|
285
|
+
const handleFocus = (0, react_exports.useCallback)(
|
|
286
|
+
(event) => {
|
|
287
|
+
const { target } = event;
|
|
288
|
+
const { pointIndex: pointIndexStr } = target.dataset || {};
|
|
289
|
+
if (pointIndexStr !== void 0) {
|
|
290
|
+
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
291
|
+
if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
|
|
292
|
+
setActiveIndex(pointIndex);
|
|
293
|
+
setHoveredIndex(null);
|
|
294
|
+
setComponentIsFocused(true);
|
|
295
|
+
}
|
|
296
|
+
} else if (pointRefs.current.length > 0) {
|
|
297
|
+
const indexToFocus = activeIndex ? Math.min(pointRefs.current.length - 1, activeIndex) : 0;
|
|
298
|
+
pointRefs.current[indexToFocus].focus();
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
[activeIndex, componentIsFocused, hoveredIndex]
|
|
302
|
+
);
|
|
303
|
+
const handleBlur = (0, react_exports.useCallback)((event) => {
|
|
304
|
+
if (containerRef.current && !containerRef.current.contains(event.relatedTarget)) {
|
|
305
|
+
setComponentIsFocused(false);
|
|
187
306
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
307
|
+
}, []);
|
|
308
|
+
const handleKeyDown = (0, react_exports.useCallback)(
|
|
309
|
+
(event) => {
|
|
310
|
+
const numPoints = data.length;
|
|
311
|
+
const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
|
|
312
|
+
if (!allowedKeys.includes(event.key)) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
let newIndex;
|
|
316
|
+
if (event.key === "Home") {
|
|
191
317
|
newIndex = 0;
|
|
192
|
-
|
|
193
|
-
case "End":
|
|
318
|
+
} else if (event.key === "End") {
|
|
194
319
|
newIndex = numPoints - 1;
|
|
195
|
-
|
|
196
|
-
case "ArrowLeft":
|
|
320
|
+
} else if (event.key === "ArrowLeft") {
|
|
197
321
|
newIndex = Math.max(0, activeIndex - 1);
|
|
198
|
-
|
|
199
|
-
case "ArrowRight":
|
|
322
|
+
} else {
|
|
200
323
|
newIndex = Math.min(numPoints - 1, activeIndex + 1);
|
|
201
|
-
break;
|
|
202
|
-
default:
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (newIndex !== activeIndex) {
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
if (this.pointRefs[newIndex]) {
|
|
208
|
-
this.pointRefs[newIndex].focus();
|
|
209
324
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
216
|
-
if (this.state.hoveredIndex !== pointIndex) {
|
|
217
|
-
this.setState({ hoveredIndex: pointIndex });
|
|
325
|
+
if (newIndex !== activeIndex) {
|
|
326
|
+
event.preventDefault();
|
|
327
|
+
if (pointRefs.current[newIndex]) {
|
|
328
|
+
pointRefs.current[newIndex].focus();
|
|
329
|
+
}
|
|
218
330
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
getMin() {
|
|
232
|
-
const { data, acceptNull, yMin } = this.props;
|
|
233
|
-
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
|
|
234
|
-
return yMin === void 0 ? dataMin() : yMin;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Gets unit value of x axis.
|
|
238
|
-
* @param {Number} xMargin - margin of x axis.
|
|
239
|
-
* @return {Number} unit value of x axis.
|
|
240
|
-
* @private
|
|
241
|
-
*/
|
|
242
|
-
getXUnit(xMargin) {
|
|
243
|
-
const { data, width } = this.props;
|
|
244
|
-
const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);
|
|
245
|
-
return Math.max(0, xUnit);
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Gets unit value of y axis.
|
|
249
|
-
* @param {String} yMargin - margin of y axis.
|
|
250
|
-
* @return {Number} unit value of y axis.
|
|
251
|
-
* @private
|
|
252
|
-
*/
|
|
253
|
-
getYUnit(yMargin) {
|
|
254
|
-
const { height } = this.props;
|
|
255
|
-
const maxValue = this.getMax();
|
|
256
|
-
const minValue = this.getMin();
|
|
257
|
-
const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);
|
|
258
|
-
return Math.max(0, yUnit);
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Get a list of arrays of points for drawing lines, based on acceptNull property
|
|
262
|
-
* @method getSegmentSets
|
|
263
|
-
* @param {Array} data
|
|
264
|
-
* @param {Array} points
|
|
265
|
-
* @returns {Object} Object containing lines (arrays of points for polylines) and isolatedPoints (single points surrounded by nulls)
|
|
266
|
-
*/
|
|
267
|
-
getSegmentSets(data, points) {
|
|
268
|
-
const { acceptNull } = this.props;
|
|
269
|
-
const lines = [];
|
|
270
|
-
const isolatedPoints = [];
|
|
271
|
-
let currentLine = [];
|
|
272
|
-
for (const [idx, p] of data.entries()) {
|
|
273
|
-
if (!acceptNull && (0, lodash_exports.isNull)(p)) {
|
|
274
|
-
if (currentLine.length > 1) {
|
|
275
|
-
lines.push(currentLine);
|
|
276
|
-
} else if (currentLine.length === 1) {
|
|
277
|
-
isolatedPoints.push(currentLine[0]);
|
|
331
|
+
},
|
|
332
|
+
[activeIndex, data.length]
|
|
333
|
+
);
|
|
334
|
+
const handleMouseOver = (0, react_exports.useCallback)(
|
|
335
|
+
(event) => {
|
|
336
|
+
var _a2;
|
|
337
|
+
const pointIndexStr = (_a2 = event.target.dataset) == null ? void 0 : _a2.pointIndex;
|
|
338
|
+
if (pointIndexStr !== void 0) {
|
|
339
|
+
const pointIndex = Number.parseInt(pointIndexStr, 10);
|
|
340
|
+
if (hoveredIndex !== pointIndex) {
|
|
341
|
+
setHoveredIndex(pointIndex);
|
|
278
342
|
}
|
|
279
|
-
currentLine = [];
|
|
280
|
-
} else {
|
|
281
|
-
currentLine.push(points[idx]);
|
|
282
343
|
}
|
|
344
|
+
},
|
|
345
|
+
[hoveredIndex]
|
|
346
|
+
);
|
|
347
|
+
const handleMouseLeave = (0, react_exports.useCallback)(() => {
|
|
348
|
+
if (hoveredIndex !== null) {
|
|
349
|
+
setHoveredIndex(null);
|
|
283
350
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
})
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
* @param {Array} points - array of points coordination.
|
|
320
|
-
* @param {Number} xMargin - margin of x axis.
|
|
321
|
-
* @return {Array} array of svg rect objects
|
|
322
|
-
* @private
|
|
323
|
-
*/
|
|
324
|
-
renderRect(points, xMargin) {
|
|
325
|
-
const { data, height, showTooltip } = this.props;
|
|
326
|
-
const xUnit = this.getXUnit(xMargin);
|
|
327
|
-
return points.map((p, i) => (
|
|
328
|
-
/* eslint-disable react/no-array-index-key */
|
|
329
|
-
/* @__PURE__ */ react_default.createElement(
|
|
330
|
-
"rect",
|
|
331
|
-
{
|
|
332
|
-
key: `${i}_${p[0]}`,
|
|
333
|
-
role: "graphics-symbol",
|
|
334
|
-
"aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
|
|
335
|
-
"data-test": `rect-${i}`,
|
|
336
|
-
"data-point-index": i,
|
|
337
|
-
tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
|
|
338
|
-
ref: (el) => {
|
|
339
|
-
this.pointRefs[i] = el;
|
|
340
|
-
},
|
|
341
|
-
x: Math.max(0, p[0] - xUnit / 2),
|
|
342
|
-
y: 0,
|
|
343
|
-
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
344
|
-
height,
|
|
345
|
-
style: { fillOpacity: 0 },
|
|
346
|
-
onMouseDown: preventDefault
|
|
347
|
-
}
|
|
348
|
-
)
|
|
349
|
-
));
|
|
350
|
-
}
|
|
351
|
-
// Renders area chart
|
|
352
|
-
renderArea(points) {
|
|
353
|
-
const { data, fillColor, fillOpacity, height, isArea } = this.props;
|
|
354
|
-
if (!isArea || points.length === 0) {
|
|
351
|
+
}, [hoveredIndex]);
|
|
352
|
+
const handleCursorMount = (0, react_exports.useCallback)((el) => {
|
|
353
|
+
setAnchor(el);
|
|
354
|
+
}, []);
|
|
355
|
+
const renderRect = (points2, xMargin2) => {
|
|
356
|
+
const xUnit = getXUnit(xMargin2);
|
|
357
|
+
return points2.map((p, i) => {
|
|
358
|
+
var _a2;
|
|
359
|
+
return (
|
|
360
|
+
/* eslint-disable react/no-array-index-key */
|
|
361
|
+
/* @__PURE__ */ react_default.createElement(
|
|
362
|
+
"rect",
|
|
363
|
+
{
|
|
364
|
+
key: `${i}_${p[0]}`,
|
|
365
|
+
role: "graphics-symbol",
|
|
366
|
+
"aria-label": `Value: ${(_a2 = data[i]) != null ? _a2 : "N/A"}, point ${i + 1} of ${data.length}`,
|
|
367
|
+
"data-test": `rect-${i}`,
|
|
368
|
+
"data-point-index": i,
|
|
369
|
+
tabIndex: showTooltip && activeIndex === i ? 0 : -1,
|
|
370
|
+
ref: (el) => {
|
|
371
|
+
pointRefs.current[i] = el;
|
|
372
|
+
},
|
|
373
|
+
x: Math.max(0, p[0] - xUnit / 2),
|
|
374
|
+
y: 0,
|
|
375
|
+
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
376
|
+
height,
|
|
377
|
+
style: { fillOpacity: 0 },
|
|
378
|
+
onMouseDown: preventDefault
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
);
|
|
382
|
+
});
|
|
383
|
+
};
|
|
384
|
+
const renderArea = (points2) => {
|
|
385
|
+
if (!isArea || points2.length === 0) {
|
|
355
386
|
return null;
|
|
356
387
|
}
|
|
357
|
-
const { lines } =
|
|
388
|
+
const { lines } = getSegmentSets(data, points2);
|
|
358
389
|
const segments = lines.map(
|
|
359
390
|
(s) => s.concat([
|
|
360
391
|
[s.at(-1)[0], height],
|
|
@@ -378,80 +409,56 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
378
409
|
}
|
|
379
410
|
}
|
|
380
411
|
)));
|
|
381
|
-
}
|
|
382
|
-
renderCursor(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
"
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
strokeLinecap: cursorStrokeLinecap,
|
|
397
|
-
strokeDasharray: cursorStrokeDasharray
|
|
398
|
-
}
|
|
412
|
+
};
|
|
413
|
+
const renderCursor = (currentPointX2, shouldRender) => shouldRender && /* @__PURE__ */ react_default.createElement(
|
|
414
|
+
"line",
|
|
415
|
+
{
|
|
416
|
+
"data-test": "cursor",
|
|
417
|
+
ref: handleCursorMount,
|
|
418
|
+
x1: currentPointX2,
|
|
419
|
+
y1: 0,
|
|
420
|
+
x2: currentPointX2,
|
|
421
|
+
y2: height,
|
|
422
|
+
style: {
|
|
423
|
+
stroke: cursorStroke,
|
|
424
|
+
strokeWidth: cursorStrokeWidth,
|
|
425
|
+
strokeLinecap: cursorStrokeLinecap,
|
|
426
|
+
strokeDasharray: cursorStrokeDasharray
|
|
399
427
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
renderTooltip(
|
|
403
|
-
const
|
|
404
|
-
const displayValue = tooltipValue === null ? "-" : tooltipValue;
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
const renderTooltip = (tooltipValue2, isOpen) => {
|
|
431
|
+
const displayValue = tooltipValue2 === null ? "-" : tooltipValue2;
|
|
405
432
|
return /* @__PURE__ */ react_default.createElement(
|
|
406
433
|
Popover_default,
|
|
407
434
|
{
|
|
408
435
|
"data-test": "tooltip",
|
|
409
436
|
open: isOpen,
|
|
410
437
|
anchor,
|
|
411
|
-
"data-test-value":
|
|
438
|
+
"data-test-value": tooltipValue2,
|
|
412
439
|
appearance: "inverted",
|
|
413
440
|
defaultPlacement: "above",
|
|
414
441
|
animation: false
|
|
415
442
|
},
|
|
416
443
|
/* @__PURE__ */ react_default.createElement(StyledTooltip, null, displayValue)
|
|
417
444
|
);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
"circle",
|
|
432
|
-
{
|
|
433
|
-
key: `end-dot${point[0]}${point[1]}`,
|
|
434
|
-
"data-test": "end-dot",
|
|
435
|
-
cx: point[0],
|
|
436
|
-
cy: point[1],
|
|
437
|
-
r: endDotRadius === 0 ? xMargin : endDotRadius,
|
|
438
|
-
style: {
|
|
439
|
-
fill: endDotFillColor,
|
|
440
|
-
stroke: endDotStroke,
|
|
441
|
-
strokeWidth: endDotStrokeWidth
|
|
442
|
-
}
|
|
445
|
+
};
|
|
446
|
+
const renderEndDots = (points2, dotsToShow2, xMargin2) => /* @__PURE__ */ react_default.createElement("g", null, points2.slice(-dotsToShow2).map((point) => /* @__PURE__ */ react_default.createElement(
|
|
447
|
+
"circle",
|
|
448
|
+
{
|
|
449
|
+
key: `end-dot${point[0]}${point[1]}`,
|
|
450
|
+
"data-test": "end-dot",
|
|
451
|
+
cx: point[0],
|
|
452
|
+
cy: point[1],
|
|
453
|
+
r: endDotRadius === 0 ? xMargin2 : endDotRadius,
|
|
454
|
+
style: {
|
|
455
|
+
fill: endDotFillColor,
|
|
456
|
+
stroke: endDotStroke,
|
|
457
|
+
strokeWidth: endDotStrokeWidth
|
|
443
458
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
* Renders circles for isolated points (single data points surrounded by nulls)
|
|
448
|
-
* These would otherwise be invisible since a line requires at least 2 points
|
|
449
|
-
* @method renderIsolatedPoints
|
|
450
|
-
* @param {Array} isolatedPoints - Array of [x, y] coordinates for isolated points
|
|
451
|
-
* @returns {Object} SVG Group of circles
|
|
452
|
-
*/
|
|
453
|
-
renderIsolatedPoints(isolatedPoints) {
|
|
454
|
-
const { lineColor, lineStrokeWidth } = this.props;
|
|
459
|
+
}
|
|
460
|
+
)));
|
|
461
|
+
const renderIsolatedPoints = (isolatedPoints) => {
|
|
455
462
|
if (!isolatedPoints || isolatedPoints.length === 0) {
|
|
456
463
|
return null;
|
|
457
464
|
}
|
|
@@ -469,20 +476,10 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
469
476
|
}
|
|
470
477
|
}
|
|
471
478
|
)));
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
* @param {Array} points
|
|
477
|
-
* @returns {Object} SVG Group of polylines and isolated points
|
|
478
|
-
*/
|
|
479
|
-
renderPolyline(points) {
|
|
480
|
-
const { data, lineColor, lineLength, lineStrokeWidth } = this.props;
|
|
481
|
-
const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points.length;
|
|
482
|
-
const { lines, isolatedPoints } = this.getSegmentSets(
|
|
483
|
-
data.slice(-linePoints),
|
|
484
|
-
points.slice(-linePoints)
|
|
485
|
-
);
|
|
479
|
+
};
|
|
480
|
+
const renderPolyline = (points2) => {
|
|
481
|
+
const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points2.length;
|
|
482
|
+
const { lines, isolatedPoints } = getSegmentSets(data.slice(-linePoints), points2.slice(-linePoints));
|
|
486
483
|
return /* @__PURE__ */ react_default.createElement("g", { "data-test": "sparkline" }, lines.map((lineData) => /* @__PURE__ */ react_default.createElement(
|
|
487
484
|
"polyline",
|
|
488
485
|
{
|
|
@@ -497,10 +494,18 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
497
494
|
},
|
|
498
495
|
points: lineData.join(" ")
|
|
499
496
|
}
|
|
500
|
-
)),
|
|
501
|
-
}
|
|
502
|
-
getInteractionState
|
|
503
|
-
|
|
497
|
+
)), renderIsolatedPoints(isolatedPoints));
|
|
498
|
+
};
|
|
499
|
+
const getInteractionState = ({
|
|
500
|
+
interactionData,
|
|
501
|
+
points: interactionPoints,
|
|
502
|
+
interactionShowTooltip,
|
|
503
|
+
interactionActiveIndex,
|
|
504
|
+
interactionHoveredIndex,
|
|
505
|
+
interactionComponentIsFocused
|
|
506
|
+
}) => {
|
|
507
|
+
var _a2;
|
|
508
|
+
if (!interactionShowTooltip) {
|
|
504
509
|
return {
|
|
505
510
|
currentPointX: null,
|
|
506
511
|
tooltipValue: null,
|
|
@@ -508,199 +513,93 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
508
513
|
interactiveProps: {}
|
|
509
514
|
};
|
|
510
515
|
}
|
|
511
|
-
const
|
|
512
|
-
onKeyDown:
|
|
513
|
-
onMouseOver:
|
|
514
|
-
onMouseLeave:
|
|
515
|
-
onFocus:
|
|
516
|
-
onBlur:
|
|
516
|
+
const interactiveProps2 = {
|
|
517
|
+
onKeyDown: handleKeyDown,
|
|
518
|
+
onMouseOver: handleMouseOver,
|
|
519
|
+
onMouseLeave: handleMouseLeave,
|
|
520
|
+
onFocus: handleFocus,
|
|
521
|
+
onBlur: handleBlur
|
|
517
522
|
};
|
|
518
|
-
const isHovered =
|
|
519
|
-
const shouldDisplayInteractiveElements = (isHovered ||
|
|
523
|
+
const isHovered = interactionHoveredIndex !== null;
|
|
524
|
+
const shouldDisplayInteractiveElements = (isHovered || interactionComponentIsFocused) && interactionData.length > 0;
|
|
520
525
|
if (!shouldDisplayInteractiveElements) {
|
|
521
526
|
return {
|
|
522
527
|
currentPointX: null,
|
|
523
528
|
tooltipValue: null,
|
|
524
529
|
showCursorAndTooltip: false,
|
|
525
|
-
interactiveProps
|
|
530
|
+
interactiveProps: interactiveProps2
|
|
526
531
|
};
|
|
527
532
|
}
|
|
528
|
-
const displayIndex = isHovered ?
|
|
533
|
+
const displayIndex = isHovered ? interactionHoveredIndex : interactionActiveIndex;
|
|
529
534
|
const isValidIndex = displayIndex !== null && displayIndex >= 0;
|
|
530
|
-
const withinBounds = isValidIndex && displayIndex <
|
|
535
|
+
const withinBounds = isValidIndex && displayIndex < interactionData.length && displayIndex < interactionPoints.length;
|
|
531
536
|
if (!withinBounds) {
|
|
532
537
|
return {
|
|
533
538
|
currentPointX: null,
|
|
534
539
|
tooltipValue: null,
|
|
535
540
|
showCursorAndTooltip: false,
|
|
536
|
-
interactiveProps
|
|
541
|
+
interactiveProps: interactiveProps2
|
|
537
542
|
};
|
|
538
543
|
}
|
|
539
|
-
const displayPointCoords =
|
|
540
|
-
const
|
|
541
|
-
const
|
|
544
|
+
const displayPointCoords = interactionPoints[displayIndex];
|
|
545
|
+
const currentPointX2 = (_a2 = displayPointCoords == null ? void 0 : displayPointCoords[0]) != null ? _a2 : null;
|
|
546
|
+
const tooltipValue2 = interactionData[displayIndex];
|
|
542
547
|
return {
|
|
543
|
-
currentPointX,
|
|
544
|
-
tooltipValue,
|
|
545
|
-
showCursorAndTooltip:
|
|
546
|
-
interactiveProps
|
|
548
|
+
currentPointX: currentPointX2,
|
|
549
|
+
tooltipValue: tooltipValue2,
|
|
550
|
+
showCursorAndTooltip: currentPointX2 !== null,
|
|
551
|
+
interactiveProps: interactiveProps2
|
|
547
552
|
};
|
|
553
|
+
};
|
|
554
|
+
if (data.length === 0) {
|
|
555
|
+
return null;
|
|
548
556
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
557
|
+
if (pointRefs.current.length !== data.length) {
|
|
558
|
+
pointRefs.current.length = data.length;
|
|
559
|
+
}
|
|
560
|
+
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
561
|
+
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
562
|
+
const points = dataToPoints(xMargin, yMargin);
|
|
563
|
+
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
564
|
+
const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = getInteractionState({
|
|
565
|
+
interactionData: data,
|
|
566
|
+
points,
|
|
567
|
+
interactionShowTooltip: showTooltip,
|
|
568
|
+
interactionActiveIndex: activeIndex,
|
|
569
|
+
interactionHoveredIndex: hoveredIndex,
|
|
570
|
+
interactionComponentIsFocused: componentIsFocused
|
|
571
|
+
});
|
|
572
|
+
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
573
|
+
return /* @__PURE__ */ react_default.createElement(
|
|
574
|
+
"div",
|
|
575
|
+
__spreadValues(__spreadValues({
|
|
576
|
+
"data-test": "line",
|
|
577
|
+
"data-test-type": isArea ? "area" : "line",
|
|
578
|
+
ref: (el) => {
|
|
579
|
+
containerRef.current = el;
|
|
580
|
+
if (typeof elementRef === "function") {
|
|
581
|
+
elementRef(el);
|
|
582
|
+
} else if (elementRef && typeof elementRef === "object") {
|
|
583
|
+
elementRef.current = el;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}, interactiveProps), (0, lodash_exports.omit)(restProps, PROP_KEYS)),
|
|
587
|
+
/* @__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))
|
|
588
|
+
);
|
|
589
|
+
};
|
|
590
|
+
var SparkLine = (_a) => {
|
|
591
|
+
var _b = _a, { data = [] } = _b, props = __objRest(_b, ["data"]);
|
|
592
|
+
if (true) {
|
|
593
|
+
if (!Array.isArray(data)) {
|
|
594
|
+
console.error("Data provided to SparkLine must be an array.");
|
|
566
595
|
return null;
|
|
567
596
|
}
|
|
568
|
-
if (
|
|
569
|
-
|
|
597
|
+
if (!data.every((value) => value === null || (0, lodash_exports.isFinite)(value))) {
|
|
598
|
+
console.error("Data provided to SparkLine must contain finite numbers or null.");
|
|
599
|
+
return null;
|
|
570
600
|
}
|
|
571
|
-
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
572
|
-
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
573
|
-
const points = this.dataToPoints(xMargin, yMargin);
|
|
574
|
-
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
575
|
-
const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = this.getInteractionState({
|
|
576
|
-
data,
|
|
577
|
-
points,
|
|
578
|
-
showTooltip,
|
|
579
|
-
activeIndex,
|
|
580
|
-
hoveredIndex,
|
|
581
|
-
componentIsFocused
|
|
582
|
-
});
|
|
583
|
-
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
584
|
-
return /* @__PURE__ */ react_default.createElement(
|
|
585
|
-
"div",
|
|
586
|
-
__spreadValues(__spreadValues({
|
|
587
|
-
"data-test": "line",
|
|
588
|
-
"data-test-type": isArea ? "area" : "line",
|
|
589
|
-
ref: (el) => {
|
|
590
|
-
this.containerRef.current = el;
|
|
591
|
-
if (typeof elementRef === "function") {
|
|
592
|
-
elementRef(el);
|
|
593
|
-
} else if (elementRef && typeof elementRef === "object") {
|
|
594
|
-
elementRef.current = el;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
598
|
-
/* @__PURE__ */ react_default.createElement(
|
|
599
|
-
StyledSvg,
|
|
600
|
-
{
|
|
601
|
-
height,
|
|
602
|
-
width,
|
|
603
|
-
"aria-labelledby": this.titleId,
|
|
604
|
-
"data-test": "sparkline-svg"
|
|
605
|
-
},
|
|
606
|
-
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
|
|
607
|
-
/* @__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)
|
|
608
|
-
)
|
|
609
|
-
);
|
|
610
601
|
}
|
|
602
|
+
return /* @__PURE__ */ react_default.createElement(SparkLineInner, __spreadValues({ data }, props));
|
|
611
603
|
};
|
|
612
|
-
__publicField(_SparkLine, "propTypes", {
|
|
613
|
-
/**
|
|
614
|
-
* If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.
|
|
615
|
-
*/
|
|
616
|
-
acceptNull: prop_types_default.bool,
|
|
617
|
-
/** Array of numbers. These data numbers are converted to points and show on sparkline. */
|
|
618
|
-
data: (props) => {
|
|
619
|
-
if (!(0, lodash_exports.isArray)(props.data)) {
|
|
620
|
-
return new Error("Data provided to Sparkline must be an array.");
|
|
621
|
-
}
|
|
622
|
-
if (props.acceptNull && !props.data.every((value) => (0, lodash_exports.isNull)(value) || (0, lodash_exports.isFinite)(value))) {
|
|
623
|
-
return new Error("Data provided to Sparkline must be finite numbers or null.");
|
|
624
|
-
}
|
|
625
|
-
if (!props.acceptNull && !props.data.every((value) => (0, lodash_exports.isFinite)(value))) {
|
|
626
|
-
return new Error("Data provided to Sparkline must be finite numbers.");
|
|
627
|
-
}
|
|
628
|
-
return null;
|
|
629
|
-
},
|
|
630
|
-
/** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */
|
|
631
|
-
elementRef: prop_types_default.oneOfType([prop_types_default.func, prop_types_default.object]),
|
|
632
|
-
/** 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. */
|
|
633
|
-
endDotCount: prop_types_default.number,
|
|
634
|
-
/** Fills color to the end dot. */
|
|
635
|
-
endDotFillColor: prop_types_default.string,
|
|
636
|
-
/**
|
|
637
|
-
* Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.
|
|
638
|
-
*/
|
|
639
|
-
endDotRadius: prop_types_default.number,
|
|
640
|
-
/** Sets end dot circle stroke color. */
|
|
641
|
-
endDotStroke: prop_types_default.string,
|
|
642
|
-
/** Sets end dot circle stroke width in pixels. */
|
|
643
|
-
endDotStrokeWidth: prop_types_default.number,
|
|
644
|
-
/** Fills color to area. */
|
|
645
|
-
fillColor: prop_types_default.string,
|
|
646
|
-
/** Fills opacity to area. Value must be in 0 ~ 1. */
|
|
647
|
-
fillOpacity: prop_types_default.string,
|
|
648
|
-
/** Sets cursor stroke color. */
|
|
649
|
-
cursorStroke: prop_types_default.string,
|
|
650
|
-
/** Sets cursor stroke width in pixels. */
|
|
651
|
-
cursorStrokeWidth: prop_types_default.number,
|
|
652
|
-
/** Sets cursor line cap style. */
|
|
653
|
-
cursorStrokeLinecap: prop_types_default.oneOf(["butt", "round", "square"]),
|
|
654
|
-
/** Sets cursor dash array style. */
|
|
655
|
-
cursorStrokeDasharray: prop_types_default.string,
|
|
656
|
-
/**
|
|
657
|
-
* Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,
|
|
658
|
-
* sparkline figures out the container height by itself.
|
|
659
|
-
*/
|
|
660
|
-
height: prop_types_default.number.isRequired,
|
|
661
|
-
/** When set to `true`, sparkline shows as area. */
|
|
662
|
-
isArea: prop_types_default.bool,
|
|
663
|
-
/** The sparkline line color. */
|
|
664
|
-
lineColor: prop_types_default.string,
|
|
665
|
-
/** Allows user to draw only the last data points for the line. */
|
|
666
|
-
lineLength: prop_types_default.number,
|
|
667
|
-
/** The sparkline line stroke width in pixels. */
|
|
668
|
-
lineStrokeWidth: prop_types_default.number,
|
|
669
|
-
/** Enable to show end dot. */
|
|
670
|
-
showEndDot: prop_types_default.bool,
|
|
671
|
-
/** Enable to show tooltip. */
|
|
672
|
-
showTooltip: prop_types_default.bool,
|
|
673
|
-
/** Sets the data value range and maximum value shown on sparkline. */
|
|
674
|
-
yMax: prop_types_default.number,
|
|
675
|
-
/** Sets the data value range and minimum value shown on sparkline. */
|
|
676
|
-
yMin: prop_types_default.number,
|
|
677
|
-
/**
|
|
678
|
-
* The width of the container.
|
|
679
|
-
*/
|
|
680
|
-
width: prop_types_default.number.isRequired,
|
|
681
|
-
/** Sets the a11y title text on sparkline. */
|
|
682
|
-
title: prop_types_default.string
|
|
683
|
-
});
|
|
684
|
-
__publicField(_SparkLine, "defaultProps", {
|
|
685
|
-
acceptNull: false,
|
|
686
|
-
data: [],
|
|
687
|
-
showTooltip: true,
|
|
688
|
-
endDotCount: 0,
|
|
689
|
-
showEndDot: false,
|
|
690
|
-
endDotRadius: 0,
|
|
691
|
-
endDotFillColor: "white",
|
|
692
|
-
endDotStroke: "black",
|
|
693
|
-
endDotStrokeWidth: 0,
|
|
694
|
-
fillColor: "#65a637",
|
|
695
|
-
fillOpacity: ".1",
|
|
696
|
-
cursorStroke: "#5184AF",
|
|
697
|
-
cursorStrokeWidth: 3,
|
|
698
|
-
cursorStrokeLinecap: "square",
|
|
699
|
-
cursorStrokeDasharray: "1, 5",
|
|
700
|
-
isArea: false,
|
|
701
|
-
lineColor: "#65a637",
|
|
702
|
-
lineStrokeWidth: 1
|
|
703
|
-
});
|
|
704
|
-
var SparkLine = _SparkLine;
|
|
705
604
|
var SparkLine_default = SparkLine;
|
|
706
605
|
//# sourceMappingURL=SparkLine.js.map
|