@splunk/visualizations 28.7.0 → 28.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +2 -4
- package/Area.config.js.map +2 -2
- package/Area.js +245 -147
- package/Area.js.map +4 -4
- package/Bar.config.js +2 -4
- package/Bar.config.js.map +2 -2
- package/Bar.js +246 -148
- package/Bar.js.map +4 -4
- package/Bubble/Bubble.d.ts +3 -1
- package/Bubble/Bubble.d.ts.map +1 -1
- package/Bubble.js +216 -108
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +56 -0
- package/ChoroplethSvg/ChoroplethSvg.d.ts +3 -1
- package/ChoroplethSvg/ChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
- package/ChoroplethSvg.js +638 -209
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +2 -4
- package/Column.config.js.map +2 -2
- package/Column.js +246 -148
- package/Column.js.map +4 -4
- package/Ellipse/Ellipse.d.ts +3 -1
- package/Ellipse/Ellipse.d.ts.map +1 -1
- package/Ellipse.js +216 -105
- package/Ellipse.js.map +4 -4
- package/Events/Events.d.ts +5 -3
- package/Events/Events.d.ts.map +1 -1
- package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
- package/Events/PureEvents/PureEvents.d.ts +0 -1
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events.js +270 -157
- package/Events.js.map +4 -4
- package/FillerGauge.js +251 -143
- package/FillerGauge.js.map +4 -4
- package/Image/Image.d.ts +3 -1
- package/Image/Image.d.ts.map +1 -1
- package/Image.js +217 -106
- package/Image.js.map +4 -4
- package/Line.config.js +2 -4
- package/Line.config.js.map +2 -2
- package/Line.js +246 -148
- package/Line.js.map +4 -4
- package/LinkGraph/LinkGraph.d.ts +3 -1
- package/LinkGraph/LinkGraph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
- package/LinkGraph.config.js +1 -1
- package/LinkGraph.config.js.map +2 -2
- package/LinkGraph.js +802 -682
- package/LinkGraph.js.map +4 -4
- package/Map/Map.d.ts +10 -9
- package/Map/Map.d.ts.map +1 -1
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
- package/Map/PureMap/MapUtils.d.ts.map +1 -1
- package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
- package/Map/PureMap/PureMap.d.ts +8 -65
- package/Map/PureMap/PureMap.d.ts.map +1 -1
- package/Map.config.js +1 -1
- package/Map.config.js.map +2 -2
- package/Map.js +363 -313
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts +9 -1
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown/config.d.ts.map +1 -1
- package/Markdown.config.js +6 -1
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +226 -95
- package/Markdown.js.map +3 -3
- package/MarkerGauge.js +247 -137
- package/MarkerGauge.js.map +4 -4
- 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/utils/networkGraphUtils.d.ts +3 -5
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js +4 -2
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +327 -188
- package/NetworkGraph.js.map +4 -4
- package/ParallelCoordinates/ParallelCoordinates.d.ts +3 -1
- package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
- package/ParallelCoordinates.js +239 -128
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/config.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts.map +1 -1
- package/Pie.config.js +4 -2
- package/Pie.config.js.map +2 -2
- package/Pie.js +228 -125
- package/Pie.js.map +3 -3
- 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 +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +2 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +2 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +5 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -1
- package/ProcessTree.js +435 -192
- package/ProcessTree.js.map +4 -4
- package/Punchcard/Punchcard.d.ts +3 -1
- package/Punchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard.js +238 -129
- package/Punchcard.js.map +4 -4
- package/Rectangle/Rectangle.d.ts +3 -1
- package/Rectangle/Rectangle.d.ts.map +1 -1
- package/Rectangle.js +218 -116
- package/Rectangle.js.map +4 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts +1 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -1
- package/RichText/PureRichText/Editor/hooks/useConfigPanelFocus.d.ts +14 -0
- package/RichText/PureRichText/Editor/hooks/useConfigPanelFocus.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useEditorPanelSync.d.ts +15 -0
- package/RichText/PureRichText/Editor/hooks/useEditorPanelSync.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/Editor/hooks/usePortalTarget.d.ts +9 -0
- package/RichText/PureRichText/Editor/hooks/usePortalTarget.d.ts.map +1 -0
- package/RichText/PureRichText/InnerEditor.d.ts +20 -4
- package/RichText/PureRichText/InnerEditor.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichText.d.ts +21 -9
- package/RichText/PureRichText/PureRichText.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichTextContext.d.ts +3 -6
- package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -1
- package/RichText/PureRichText/RichTextStyles.d.ts +5 -4
- package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -1
- package/RichText/PureRichText/activeInstance.d.ts +6 -7
- package/RichText/PureRichText/activeInstance.d.ts.map +1 -1
- package/RichText/PureRichText/config.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 +2 -7
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts +8 -4
- 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/useFocusHandlers.d.ts +2 -4
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +3 -7
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts +2 -2
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +2 -3
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useTokenMap.d.ts +31 -40
- package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -1
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts +2 -5
- package/RichText/PureRichText/renderers/ElementRenderer.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 +21 -0
- package/RichText/PureRichText/types.d.ts.map +1 -1
- package/RichText/PureRichText/utils/slateUtils.d.ts +26 -2
- package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -1
- package/RichText/RichText.d.ts +5 -1
- package/RichText/RichText.d.ts.map +1 -1
- package/RichText/config.d.ts.map +1 -1
- package/RichText.config.js +19 -1
- package/RichText.config.js.map +2 -2
- package/RichText.js +2311 -835
- package/RichText.js.map +4 -4
- package/Sankey/PureSankey/PureSankey.d.ts +2 -0
- package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyLink.d.ts +3 -1
- package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyNode.d.ts +5 -2
- package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
- package/Sankey/Sankey.d.ts +3 -1
- package/Sankey/Sankey.d.ts.map +1 -1
- package/Sankey.js +508 -219
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +3 -5
- package/Scatter.config.js.map +2 -2
- package/Scatter.js +244 -146
- package/Scatter.js.map +4 -4
- package/SingleValue/SingleValue.d.ts.map +1 -1
- package/SingleValue.js +273 -173
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +4 -4
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
- package/SingleValueIcon.js +264 -164
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial.js +267 -167
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine/SparkLine.d.ts.map +1 -1
- package/SparkLine.js.map +2 -2
- package/Table/PureTable.d.ts +2 -0
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/Table.d.ts +2 -5
- package/Table/Table.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts.map +1 -1
- package/Table.config.js +8 -1
- package/Table.config.js.map +2 -2
- package/Table.js +374 -270
- 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/Timeline.d.ts +3 -1
- package/Timeline/Timeline.d.ts.map +1 -1
- package/Timeline.config.js +2 -2
- package/Timeline.config.js.map +2 -2
- package/Timeline.js +713 -351
- 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 +14 -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 +6349 -0
- package/Treemap.js.map +7 -0
- package/common/Charting.js +8 -10
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.d.ts.map +1 -1
- package/common/ChartingApi.js +5 -2
- package/common/ChartingApi.js.map +2 -2
- package/common/DocExampleWithVizSandbox.js +3 -3
- 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 +1 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +3 -3
- package/common/OverviewDoc.js.map +2 -2
- package/common/ThemesDoc.js.map +2 -2
- package/common/TimeSeriesChartWrapper.js +10 -9
- package/common/TimeSeriesChartWrapper.js.map +2 -2
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +12 -11
- package/common/chartingUtils.js.map +2 -2
- package/common/components/IconPlaceholder.d.ts.map +1 -1
- package/common/docUtils.d.ts.map +1 -1
- package/common/docUtils.js +16 -14
- package/common/docUtils.js.map +2 -2
- package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
- package/common/gaugeUtils.d.ts.map +1 -1
- package/common/gaugeUtils.js +11 -5
- 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/hooks/useSorting.d.ts.map +1 -1
- package/common/interfaces/VizCategory.d.ts +2 -1
- package/common/interfaces/VizCategory.d.ts.map +1 -1
- package/common/interfaces/VizEvent.d.ts +7 -0
- package/common/interfaces/VizEvent.d.ts.map +1 -1
- package/common/utils/dataUtils.d.ts.map +1 -1
- package/common/utils/dataUtils.js +6 -10
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +2 -2
- package/common/utils/featureFlagUtils.js.map +2 -2
- package/common/utils/focusUtils.js +1 -1
- package/common/utils/focusUtils.js.map +2 -2
- package/common/utils/mapUtils.d.ts.map +1 -1
- package/common/utils/mapUtils.js +14 -18
- package/common/utils/mapUtils.js.map +2 -2
- package/common/utils/singleValueUtils.js +22 -25
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/textUtils.d.ts.map +1 -1
- package/common/utils/textUtils.js +37 -23
- package/common/utils/textUtils.js.map +2 -2
- package/common/utils/trellisUtils.d.ts.map +1 -1
- package/common/utils/trellisUtils.js +18 -17
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/utils/urlUtils.js.map +2 -2
- package/common/utils/visualizationTheme.d.ts +15 -0
- package/common/utils/visualizationTheme.d.ts.map +1 -0
- package/common/utils/visualizationTheme.js +72 -0
- package/common/utils/visualizationTheme.js.map +7 -0
- package/common/withDashboardViz.d.ts +3 -1
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +216 -105
- package/common/withDashboardViz.js.map +4 -4
- package/docs-llm/INDEX.md +1 -0
- package/docs-llm/area/options.md +84 -84
- package/docs-llm/bar/options.md +77 -77
- package/docs-llm/bubble/options.md +51 -51
- package/docs-llm/choropleth-svg/options.md +5 -5
- package/docs-llm/column/options.md +82 -82
- package/docs-llm/ellipse/options.md +6 -6
- package/docs-llm/events/options.md +6 -6
- package/docs-llm/filler-gauge/options.md +16 -16
- package/docs-llm/image/options.md +3 -3
- package/docs-llm/line/options.md +82 -82
- package/docs-llm/link-graph/options.md +16 -16
- package/docs-llm/map/options.md +12 -12
- package/docs-llm/markdown/options.md +7 -7
- package/docs-llm/marker-gauge/options.md +16 -16
- package/docs-llm/network-graph/options.md +39 -39
- package/docs-llm/parallel-coordinates/options.md +4 -4
- package/docs-llm/pie/examples-json.md +195 -0
- package/docs-llm/pie/examples-react.md +123 -0
- package/docs-llm/pie/options.md +23 -23
- package/docs-llm/process-tree/options.md +23 -22
- package/docs-llm/punchcard/options.md +23 -23
- package/docs-llm/pure-rich-text/options.md +6 -5
- package/docs-llm/rectangle/options.md +9 -9
- package/docs-llm/rich-text/options.md +6 -5
- package/docs-llm/sankey/options.md +9 -9
- package/docs-llm/scatter/options.md +57 -57
- package/docs-llm/single-value/options.md +39 -39
- package/docs-llm/single-value-icon/options.md +33 -33
- package/docs-llm/single-value-radial/options.md +31 -31
- package/docs-llm/table/options.md +14 -13
- package/docs-llm/timeline/options.md +17 -17
- 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 +31 -30
package/Timeline.js
CHANGED
|
@@ -425,7 +425,7 @@ var editorConfig = [
|
|
|
425
425
|
]
|
|
426
426
|
},
|
|
427
427
|
// disable legend if dataColors is on
|
|
428
|
-
isDisabled: ({ options }) => options.dataColors
|
|
428
|
+
isDisabled: ({ options }) => Boolean(options.dataColors)
|
|
429
429
|
}
|
|
430
430
|
],
|
|
431
431
|
[
|
|
@@ -442,7 +442,7 @@ var editorConfig = [
|
|
|
442
442
|
{ label: (0, i18n_exports._)("Off"), value: "ellipsisOff" }
|
|
443
443
|
]
|
|
444
444
|
},
|
|
445
|
-
isDisabled: ({ options }) => options.dataColors,
|
|
445
|
+
isDisabled: ({ options }) => Boolean(options.dataColors),
|
|
446
446
|
showEditor: ({ options }) => options.legendDisplay && options.legendDisplay !== "off"
|
|
447
447
|
}
|
|
448
448
|
]
|
|
@@ -740,7 +740,10 @@ var useSortingParams = ({ requestParams, onRequestParamsChange }) => {
|
|
|
740
740
|
onSort = (e, { sortKey, sortDir }) => {
|
|
741
741
|
if (typeof sortKey === "string") {
|
|
742
742
|
const nextSortDir = (0, lodash_exports.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : "none";
|
|
743
|
-
onRequestParamsChange(
|
|
743
|
+
onRequestParamsChange(__spreadProps(__spreadValues({}, requestParams), {
|
|
744
|
+
offset: 0,
|
|
745
|
+
sort: { [sortKey]: nextSortDir }
|
|
746
|
+
}));
|
|
744
747
|
} else {
|
|
745
748
|
onRequestParamsChange(requestParams);
|
|
746
749
|
}
|
|
@@ -875,7 +878,7 @@ var Cover = styled_components_default.div`
|
|
|
875
878
|
bottom: 0;
|
|
876
879
|
`;
|
|
877
880
|
var Blocker = styled_components_default.div.attrs({
|
|
878
|
-
"data-splunk-visualization-version": "28.
|
|
881
|
+
"data-splunk-visualization-version": "28.9.0 - 96b03188d"
|
|
879
882
|
})`
|
|
880
883
|
position: relative;
|
|
881
884
|
width: 100%;
|
|
@@ -892,14 +895,23 @@ var withEditModeCover = (Visualization, disableEditModeCover) => {
|
|
|
892
895
|
};
|
|
893
896
|
var withEditModeCover_default = withEditModeCover;
|
|
894
897
|
|
|
898
|
+
// esm-externals:@splunk/themes
|
|
899
|
+
var themes_exports = {};
|
|
900
|
+
__export(themes_exports, {
|
|
901
|
+
default: () => themes_default
|
|
902
|
+
});
|
|
903
|
+
var defaultImport28 = __toESM(require("@splunk/themes"));
|
|
904
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
905
|
+
var themes_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
906
|
+
|
|
895
907
|
// esm-externals:@splunk/visualizations-shared/style
|
|
896
908
|
var style_exports = {};
|
|
897
909
|
__export(style_exports, {
|
|
898
910
|
default: () => style_default
|
|
899
911
|
});
|
|
900
|
-
var
|
|
912
|
+
var defaultImport29 = __toESM(require("@splunk/visualizations-shared/style"));
|
|
901
913
|
__reExport(style_exports, require("@splunk/visualizations-shared/style"));
|
|
902
|
-
var style_default = "default" in
|
|
914
|
+
var style_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
903
915
|
|
|
904
916
|
// src/common/hocs/FixedSizeContainer.tsx
|
|
905
917
|
var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
@@ -956,7 +968,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
956
968
|
FixSizeItem,
|
|
957
969
|
{
|
|
958
970
|
"data-test": "fix-size-item",
|
|
959
|
-
"data-splunk-visualization-version": "28.
|
|
971
|
+
"data-splunk-visualization-version": "28.9.0 - 96b03188d",
|
|
960
972
|
width,
|
|
961
973
|
height,
|
|
962
974
|
backgroundColor
|
|
@@ -977,6 +989,14 @@ var shouldShowIconPlaceholder = (dataSources, loading = false) => {
|
|
|
977
989
|
const noFields = fields === void 0;
|
|
978
990
|
return loading || noData || noFields;
|
|
979
991
|
};
|
|
992
|
+
var PlaceholderContainer = styled_components_default.div`
|
|
993
|
+
/* The inline token color wins when supported. Older browsers discard an
|
|
994
|
+
unsupported oklch value and retain this inherited fallback instead. */
|
|
995
|
+
color: ${(0, themes_exports.pick)({
|
|
996
|
+
dark: "#fafafa",
|
|
997
|
+
light: "#2c2c2c"
|
|
998
|
+
})};
|
|
999
|
+
`;
|
|
980
1000
|
var IconPlaceholder = (props) => {
|
|
981
1001
|
const {
|
|
982
1002
|
width = SplunkVisualization_default.defaults.width,
|
|
@@ -991,7 +1011,6 @@ var IconPlaceholder = (props) => {
|
|
|
991
1011
|
style: {
|
|
992
1012
|
left: "50%",
|
|
993
1013
|
top: "50%",
|
|
994
|
-
color: iconColor,
|
|
995
1014
|
opacity: 0.15,
|
|
996
1015
|
position: "absolute",
|
|
997
1016
|
transform: "translate(-50%, -50%)"
|
|
@@ -1001,7 +1020,14 @@ var IconPlaceholder = (props) => {
|
|
|
1001
1020
|
"data-test": "icon-placeholder"
|
|
1002
1021
|
});
|
|
1003
1022
|
}
|
|
1004
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
1023
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
1024
|
+
PlaceholderContainer,
|
|
1025
|
+
{
|
|
1026
|
+
"data-test": "icon-placeholder-container",
|
|
1027
|
+
style: { width, height, background: backgroundColor, color: iconColor }
|
|
1028
|
+
},
|
|
1029
|
+
content
|
|
1030
|
+
);
|
|
1005
1031
|
};
|
|
1006
1032
|
var IconPlaceholder_default = FixedSizeContainer_default(IconPlaceholder);
|
|
1007
1033
|
|
|
@@ -1047,9 +1073,9 @@ var numberUtils_exports = {};
|
|
|
1047
1073
|
__export(numberUtils_exports, {
|
|
1048
1074
|
default: () => numberUtils_default
|
|
1049
1075
|
});
|
|
1050
|
-
var
|
|
1076
|
+
var defaultImport30 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
|
|
1051
1077
|
__reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
|
|
1052
|
-
var numberUtils_default = "default" in
|
|
1078
|
+
var numberUtils_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
|
|
1053
1079
|
|
|
1054
1080
|
// src/common/utils/dataUtils.ts
|
|
1055
1081
|
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
@@ -1075,7 +1101,7 @@ var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices)
|
|
|
1075
1101
|
let avgY = 0;
|
|
1076
1102
|
let avgRangeStart = Math.floor((i + 1) * every) + 1;
|
|
1077
1103
|
let avgRangeEnd = Math.floor((i + 2) * every) + 1;
|
|
1078
|
-
avgRangeEnd = avgRangeEnd
|
|
1104
|
+
avgRangeEnd = Math.min(avgRangeEnd, dataLength);
|
|
1079
1105
|
const avgRangeLength = avgRangeEnd - avgRangeStart;
|
|
1080
1106
|
for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {
|
|
1081
1107
|
avgX += Number(data[avgRangeStart][0]);
|
|
@@ -1110,9 +1136,9 @@ var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices)
|
|
|
1110
1136
|
};
|
|
1111
1137
|
var strictlyCoerceYColumn = (column, options) => {
|
|
1112
1138
|
const isNullCoercionEnabled = options.nullValueDisplay === "zero";
|
|
1113
|
-
const canLooselyCoerceSomeValues = column.
|
|
1139
|
+
const canLooselyCoerceSomeValues = column.some(
|
|
1114
1140
|
(value) => (0, numberUtils_exports.startsWithNumber)(`${value}`) || isNullCoercionEnabled && value === null
|
|
1115
|
-
)
|
|
1141
|
+
);
|
|
1116
1142
|
const coercedColumn = [];
|
|
1117
1143
|
const canDownsampleColumn = !column.some((value) => {
|
|
1118
1144
|
const coercedValue = Number(value);
|
|
@@ -1131,7 +1157,7 @@ var strictlyCoerceYColumn = (column, options) => {
|
|
|
1131
1157
|
};
|
|
1132
1158
|
var strictlyCoerceXColumn = (column, fieldType) => {
|
|
1133
1159
|
if (fieldType === "number") {
|
|
1134
|
-
const coercedXColumn = column.map(
|
|
1160
|
+
const coercedXColumn = column.map(Number);
|
|
1135
1161
|
if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {
|
|
1136
1162
|
return coercedXColumn;
|
|
1137
1163
|
}
|
|
@@ -1430,16 +1456,16 @@ var FeatureFlags_exports = {};
|
|
|
1430
1456
|
__export(FeatureFlags_exports, {
|
|
1431
1457
|
default: () => FeatureFlags_default
|
|
1432
1458
|
});
|
|
1433
|
-
var
|
|
1459
|
+
var defaultImport31 = __toESM(require("@splunk/visualization-context/FeatureFlags"));
|
|
1434
1460
|
__reExport(FeatureFlags_exports, require("@splunk/visualization-context/FeatureFlags"));
|
|
1435
|
-
var FeatureFlags_default = "default" in
|
|
1461
|
+
var FeatureFlags_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
|
|
1436
1462
|
|
|
1437
1463
|
// src/common/utils/featureFlagUtils.ts
|
|
1438
1464
|
var getFeatureFlag = (context, flagName) => {
|
|
1439
|
-
if (context && Object.keys(context).
|
|
1465
|
+
if (context && Object.keys(context).includes(flagName)) {
|
|
1440
1466
|
return context[flagName];
|
|
1441
1467
|
}
|
|
1442
|
-
if (Object.keys(FeatureFlags_default).
|
|
1468
|
+
if (Object.keys(FeatureFlags_default).includes(flagName)) {
|
|
1443
1469
|
return FeatureFlags_default[flagName];
|
|
1444
1470
|
}
|
|
1445
1471
|
return false;
|
|
@@ -1450,9 +1476,9 @@ var trellisUtils_exports = {};
|
|
|
1450
1476
|
__export(trellisUtils_exports, {
|
|
1451
1477
|
default: () => trellisUtils_default
|
|
1452
1478
|
});
|
|
1453
|
-
var
|
|
1479
|
+
var defaultImport32 = __toESM(require("@splunk/visualizations-shared/trellisUtils"));
|
|
1454
1480
|
__reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisUtils"));
|
|
1455
|
-
var trellisUtils_default = "default" in
|
|
1481
|
+
var trellisUtils_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
|
|
1456
1482
|
|
|
1457
1483
|
// src/common/utils/trellisUtils.ts
|
|
1458
1484
|
var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
@@ -1469,9 +1495,9 @@ var visualization_canvas_exports = {};
|
|
|
1469
1495
|
__export(visualization_canvas_exports, {
|
|
1470
1496
|
default: () => visualization_canvas_default
|
|
1471
1497
|
});
|
|
1472
|
-
var
|
|
1498
|
+
var defaultImport33 = __toESM(require("@splunk/visualization-canvas"));
|
|
1473
1499
|
__reExport(visualization_canvas_exports, require("@splunk/visualization-canvas"));
|
|
1474
|
-
var visualization_canvas_default = "default" in
|
|
1500
|
+
var visualization_canvas_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
|
|
1475
1501
|
|
|
1476
1502
|
// src/common/components/VizStyleWrapper.jsx
|
|
1477
1503
|
var VizStyleWrapper = styled_components_default.div.attrs(({ dataTestKey }) => ({
|
|
@@ -1493,27 +1519,27 @@ var Triangle_exports = {};
|
|
|
1493
1519
|
__export(Triangle_exports, {
|
|
1494
1520
|
default: () => Triangle_default
|
|
1495
1521
|
});
|
|
1496
|
-
var
|
|
1522
|
+
var defaultImport34 = __toESM(require("@splunk/react-icons/Triangle"));
|
|
1497
1523
|
__reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
|
|
1498
|
-
var Triangle_default = "default" in
|
|
1524
|
+
var Triangle_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
|
|
1499
1525
|
|
|
1500
1526
|
// esm-externals:@splunk/visualizations-shared/propUtils
|
|
1501
1527
|
var propUtils_exports = {};
|
|
1502
1528
|
__export(propUtils_exports, {
|
|
1503
1529
|
default: () => propUtils_default
|
|
1504
1530
|
});
|
|
1505
|
-
var
|
|
1531
|
+
var defaultImport35 = __toESM(require("@splunk/visualizations-shared/propUtils"));
|
|
1506
1532
|
__reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
|
|
1507
|
-
var propUtils_default = "default" in
|
|
1533
|
+
var propUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
|
|
1508
1534
|
|
|
1509
1535
|
// esm-externals:@splunk/visualizations-shared/simpleXMLOptions
|
|
1510
1536
|
var simpleXMLOptions_exports = {};
|
|
1511
1537
|
__export(simpleXMLOptions_exports, {
|
|
1512
1538
|
default: () => simpleXMLOptions_default
|
|
1513
1539
|
});
|
|
1514
|
-
var
|
|
1540
|
+
var defaultImport36 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1515
1541
|
__reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1516
|
-
var simpleXMLOptions_default = "default" in
|
|
1542
|
+
var simpleXMLOptions_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
|
|
1517
1543
|
|
|
1518
1544
|
// src/common/chartingUtils.ts
|
|
1519
1545
|
var DEFAULT_LINE_WIDTH = 2;
|
|
@@ -1552,9 +1578,9 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
|
1552
1578
|
const xAxisIsTime = xField === "_time";
|
|
1553
1579
|
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1554
1580
|
};
|
|
1555
|
-
var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
|
|
1581
|
+
var canvasSupportedTimeSeriesCharts = /* @__PURE__ */ new Set(["splunk.line", "splunk.area"]);
|
|
1556
1582
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1557
|
-
return canvasSupportedTimeSeriesCharts.
|
|
1583
|
+
return canvasSupportedTimeSeriesCharts.has(vizConfigKey);
|
|
1558
1584
|
};
|
|
1559
1585
|
var filterChartDataFromInternalFields = (chartData) => {
|
|
1560
1586
|
const { fields, columns } = chartData;
|
|
@@ -1570,7 +1596,7 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
1570
1596
|
return { fields: filteredFields, columns: filteredColumns };
|
|
1571
1597
|
};
|
|
1572
1598
|
var convert2DArrayToNumbers = (arr) => {
|
|
1573
|
-
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
1599
|
+
return arr.map((subArray) => subArray.map((element) => Number.parseFloat(element)));
|
|
1574
1600
|
};
|
|
1575
1601
|
var parseAxisValue = (val) => {
|
|
1576
1602
|
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
@@ -1608,6 +1634,7 @@ var getLegend = (props) => {
|
|
|
1608
1634
|
return (0, visualization_canvas_exports.TopLegendFactory)(__spreadValues({
|
|
1609
1635
|
wrap: true
|
|
1610
1636
|
}, commonLegendProps));
|
|
1637
|
+
// Note: By default, use right legend
|
|
1611
1638
|
default:
|
|
1612
1639
|
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1613
1640
|
}
|
|
@@ -1740,10 +1767,10 @@ var getSeriesOverrides = (opts) => {
|
|
|
1740
1767
|
let spanGaps;
|
|
1741
1768
|
if (nullValueMode === "gaps") {
|
|
1742
1769
|
spanGaps = false;
|
|
1743
|
-
} else if (nullValueMode
|
|
1744
|
-
spanGaps = true;
|
|
1745
|
-
} else {
|
|
1770
|
+
} else if (nullValueMode == null) {
|
|
1746
1771
|
spanGaps = void 0;
|
|
1772
|
+
} else {
|
|
1773
|
+
spanGaps = true;
|
|
1747
1774
|
}
|
|
1748
1775
|
const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
|
|
1749
1776
|
const isAreaChart = type === "area";
|
|
@@ -2174,11 +2201,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2174
2201
|
y2AxisMajorUnitFromSimpleXML,
|
|
2175
2202
|
y2AxisMajorTickInterval
|
|
2176
2203
|
);
|
|
2177
|
-
const xAxisMajorTickSizeNum = xAxisMajorTickSize
|
|
2178
|
-
const yAxisMajorTickSizeNum = yAxisMajorTickSize
|
|
2179
|
-
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize
|
|
2180
|
-
const yAxisMinorTickSizeNum = yAxisMinorTickSize
|
|
2181
|
-
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize
|
|
2204
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize == null ? void 0 : Number(xAxisMajorTickSize);
|
|
2205
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize == null ? void 0 : Number(yAxisMajorTickSize);
|
|
2206
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize == null ? void 0 : Number(y2AxisMajorTickSize);
|
|
2207
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize == null ? void 0 : Number(yAxisMinorTickSize);
|
|
2208
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize == null ? void 0 : Number(y2AxisMinorTickSize);
|
|
2182
2209
|
const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
|
|
2183
2210
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
2184
2211
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
@@ -2590,6 +2617,76 @@ var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTr
|
|
|
2590
2617
|
});
|
|
2591
2618
|
return result;
|
|
2592
2619
|
};
|
|
2620
|
+
var buildAllEventCallbackProps = (events, evaluatedOptionsToUse, onEventTrigger, { supportsEvents, hasEventHandlers, mode }) => {
|
|
2621
|
+
if (!supportsEvents) return {};
|
|
2622
|
+
const defaultEvents = {};
|
|
2623
|
+
const userEvents = {};
|
|
2624
|
+
Object.entries(events || {}).forEach(([eventKey, eventConfig]) => {
|
|
2625
|
+
(eventConfig.source === "default" ? defaultEvents : userEvents)[eventKey] = eventConfig;
|
|
2626
|
+
});
|
|
2627
|
+
const userProps = hasEventHandlers && mode === "view" ? buildEventCallbackProps(userEvents, evaluatedOptionsToUse, onEventTrigger) : {};
|
|
2628
|
+
return __spreadValues(__spreadValues({}, userProps), buildEventCallbackProps(defaultEvents, evaluatedOptionsToUse, onEventTrigger));
|
|
2629
|
+
};
|
|
2630
|
+
var applyContextTimezone = (localeContext) => {
|
|
2631
|
+
if (localeContext.serializedTimezone && !moment_default.getDefaultSplunkTimezone()) {
|
|
2632
|
+
moment_default.setDefaultSplunkTimezone(localeContext.serializedTimezone);
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
var getAsyncOptionsEvaluationParams = ({
|
|
2636
|
+
visualizationID,
|
|
2637
|
+
props,
|
|
2638
|
+
optionsToEvaluate,
|
|
2639
|
+
downsampledDataSources,
|
|
2640
|
+
vizConfig,
|
|
2641
|
+
bypassCloneDeepOptionScope,
|
|
2642
|
+
lazyLoadingDataFrame
|
|
2643
|
+
}) => {
|
|
2644
|
+
return {
|
|
2645
|
+
visualizationID,
|
|
2646
|
+
props,
|
|
2647
|
+
options: __spreadValues({}, optionsToEvaluate),
|
|
2648
|
+
dataSources: downsampledDataSources,
|
|
2649
|
+
theme: vizConfig.themes,
|
|
2650
|
+
bypassCloneDeepOptionScope,
|
|
2651
|
+
lazyLoadingDataFrame
|
|
2652
|
+
};
|
|
2653
|
+
};
|
|
2654
|
+
var evaluateOptionsSync = ({
|
|
2655
|
+
optionsToEvaluate,
|
|
2656
|
+
downsampledDataSources,
|
|
2657
|
+
dataSourcesInState,
|
|
2658
|
+
dataFramesInState,
|
|
2659
|
+
setDataSourcesInState,
|
|
2660
|
+
setDataFramesInState,
|
|
2661
|
+
computeDataFrames,
|
|
2662
|
+
featureFlagContext,
|
|
2663
|
+
themeFunc
|
|
2664
|
+
}) => {
|
|
2665
|
+
let dataFrames = dataFramesInState;
|
|
2666
|
+
if (downsampledDataSources !== dataSourcesInState) {
|
|
2667
|
+
setDataSourcesInState(downsampledDataSources);
|
|
2668
|
+
dataFrames = Options_exports.Options.dataFrameFromDataSource(
|
|
2669
|
+
downsampledDataSources,
|
|
2670
|
+
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2671
|
+
);
|
|
2672
|
+
setDataFramesInState(dataFrames);
|
|
2673
|
+
}
|
|
2674
|
+
let mergedFrames = dataFrames;
|
|
2675
|
+
if (computeDataFrames && dataFrames) {
|
|
2676
|
+
const derivedFrames = computeDataFrames({
|
|
2677
|
+
dataSources: downsampledDataSources,
|
|
2678
|
+
options: optionsToEvaluate.options
|
|
2679
|
+
});
|
|
2680
|
+
mergedFrames = __spreadValues(__spreadValues({}, dataFrames), derivedFrames);
|
|
2681
|
+
}
|
|
2682
|
+
return Options_exports.Options.evaluate(
|
|
2683
|
+
optionsToEvaluate,
|
|
2684
|
+
downsampledDataSources,
|
|
2685
|
+
themeFunc,
|
|
2686
|
+
mergedFrames,
|
|
2687
|
+
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2688
|
+
);
|
|
2689
|
+
};
|
|
2593
2690
|
var withDashboardViz = (opts) => {
|
|
2594
2691
|
const {
|
|
2595
2692
|
ReactViz,
|
|
@@ -2621,11 +2718,7 @@ var withDashboardViz = (opts) => {
|
|
|
2621
2718
|
onRequestParamsChange = lodash_exports.noop
|
|
2622
2719
|
} = props;
|
|
2623
2720
|
const localeContext = react_exports.useContext(TimezoneContext_default);
|
|
2624
|
-
|
|
2625
|
-
if (!moment_default.getDefaultSplunkTimezone()) {
|
|
2626
|
-
moment_default.setDefaultSplunkTimezone(localeContext.serializedTimezone);
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2721
|
+
applyContextTimezone(localeContext);
|
|
2629
2722
|
const themeFunc = (themeVar) => {
|
|
2630
2723
|
var _a2, _b;
|
|
2631
2724
|
return (_b = (_a2 = vizConfig.themes)[themeVar]) == null ? void 0 : _b.call(_a2, props);
|
|
@@ -2653,7 +2746,12 @@ var withDashboardViz = (opts) => {
|
|
|
2653
2746
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
|
|
2654
2747
|
);
|
|
2655
2748
|
const isAcceleratedRenderOn = isAcceleratedRenderFeatureFlagOn && isTimeSeriesCanvasRenderSupported(vizConfig.key) && (options == null ? void 0 : options.acceleratedRender) === true;
|
|
2656
|
-
const
|
|
2749
|
+
const bypassCloneDeepOptionScope = Boolean(
|
|
2750
|
+
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2751
|
+
);
|
|
2752
|
+
const lazyLoadingDataFrame = Boolean(
|
|
2753
|
+
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2754
|
+
);
|
|
2657
2755
|
const optionsToEvaluate = react_exports.useMemo(() => {
|
|
2658
2756
|
var _a2;
|
|
2659
2757
|
const legendDisplay = turnOffLegendDisplayWhenTrellisIsOn(isTrellisOn, options);
|
|
@@ -2692,63 +2790,74 @@ var withDashboardViz = (opts) => {
|
|
|
2692
2790
|
threshold,
|
|
2693
2791
|
isDownsamplingEnabled
|
|
2694
2792
|
});
|
|
2695
|
-
|
|
2793
|
+
const asyncOptionsEvaluationParams = useDeepMemo(
|
|
2794
|
+
() => getAsyncOptionsEvaluationParams({
|
|
2795
|
+
visualizationID,
|
|
2796
|
+
props,
|
|
2797
|
+
optionsToEvaluate,
|
|
2798
|
+
downsampledDataSources,
|
|
2799
|
+
vizConfig,
|
|
2800
|
+
bypassCloneDeepOptionScope,
|
|
2801
|
+
lazyLoadingDataFrame
|
|
2802
|
+
}),
|
|
2803
|
+
[
|
|
2804
|
+
visualizationID,
|
|
2805
|
+
optionsToEvaluate,
|
|
2806
|
+
downsampledDataSources,
|
|
2807
|
+
vizConfig,
|
|
2808
|
+
bypassCloneDeepOptionScope,
|
|
2809
|
+
lazyLoadingDataFrame,
|
|
2810
|
+
currentThemeFamily,
|
|
2811
|
+
currentThemeColorScheme,
|
|
2812
|
+
currentThemeDensity,
|
|
2813
|
+
localeContext.serializedTimezone
|
|
2814
|
+
]
|
|
2815
|
+
);
|
|
2816
|
+
react_exports.useEffect(() => {
|
|
2817
|
+
if (!useAsyncEvaluatedOptions) {
|
|
2818
|
+
return void 0;
|
|
2819
|
+
}
|
|
2820
|
+
let ownsEvaluation = true;
|
|
2696
2821
|
try {
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
visualizationID,
|
|
2700
|
-
props,
|
|
2701
|
-
options: optionsToEvaluate,
|
|
2702
|
-
dataSources: downsampledDataSources,
|
|
2703
|
-
theme: vizConfig.themes,
|
|
2704
|
-
bypassCloneDeepOptionScope: Boolean(
|
|
2705
|
-
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2706
|
-
),
|
|
2707
|
-
lazyLoadingDataFrame: Boolean(
|
|
2708
|
-
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2709
|
-
)
|
|
2710
|
-
};
|
|
2711
|
-
async_dynamic_options_evaluator_default.evaluate(asyncDynamicOptionsEvaluatorParams).then((results) => {
|
|
2822
|
+
async_dynamic_options_evaluator_default.evaluate(asyncOptionsEvaluationParams).then((results) => {
|
|
2823
|
+
if (ownsEvaluation) {
|
|
2712
2824
|
setEvaluatedOptionsAsync(results.results);
|
|
2713
|
-
}).catch(() => {
|
|
2714
|
-
if (isMounted.current) {
|
|
2715
|
-
setUseAsyncEvaluatedOptions(false);
|
|
2716
|
-
}
|
|
2717
|
-
});
|
|
2718
|
-
} else {
|
|
2719
|
-
let dataFrames = dataFramesInState;
|
|
2720
|
-
if (downsampledDataSources !== dataSourcesInState) {
|
|
2721
|
-
setDataSourcesInState(downsampledDataSources);
|
|
2722
|
-
dataFrames = Options_exports.Options.dataFrameFromDataSource(
|
|
2723
|
-
downsampledDataSources,
|
|
2724
|
-
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2725
|
-
);
|
|
2726
|
-
setDataFramesInState(dataFrames);
|
|
2727
2825
|
}
|
|
2728
|
-
|
|
2729
|
-
if (
|
|
2730
|
-
|
|
2731
|
-
dataSources: downsampledDataSources,
|
|
2732
|
-
options: optionsToEvaluate.options
|
|
2733
|
-
});
|
|
2734
|
-
mergedFrames = __spreadValues(__spreadValues({}, dataFrames), derivedFrames);
|
|
2826
|
+
}).catch(() => {
|
|
2827
|
+
if (ownsEvaluation) {
|
|
2828
|
+
setUseAsyncEvaluatedOptions(false);
|
|
2735
2829
|
}
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2830
|
+
});
|
|
2831
|
+
} catch (e) {
|
|
2832
|
+
setUseAsyncEvaluatedOptions(false);
|
|
2833
|
+
}
|
|
2834
|
+
return () => {
|
|
2835
|
+
ownsEvaluation = false;
|
|
2836
|
+
async_dynamic_options_evaluator_default.reset(visualizationID);
|
|
2837
|
+
};
|
|
2838
|
+
}, [asyncOptionsEvaluationParams, useAsyncEvaluatedOptions, visualizationID]);
|
|
2839
|
+
evaluatedOptions = useDeepMemo(() => {
|
|
2840
|
+
try {
|
|
2841
|
+
if (useAsyncEvaluatedOptions) {
|
|
2842
|
+
return {};
|
|
2744
2843
|
}
|
|
2844
|
+
return evaluateOptionsSync({
|
|
2845
|
+
optionsToEvaluate,
|
|
2846
|
+
downsampledDataSources,
|
|
2847
|
+
dataSourcesInState,
|
|
2848
|
+
dataFramesInState,
|
|
2849
|
+
setDataSourcesInState,
|
|
2850
|
+
setDataFramesInState,
|
|
2851
|
+
computeDataFrames,
|
|
2852
|
+
featureFlagContext,
|
|
2853
|
+
themeFunc
|
|
2854
|
+
});
|
|
2745
2855
|
} catch (e) {
|
|
2746
2856
|
if (e instanceof Error) {
|
|
2747
2857
|
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
2748
2858
|
}
|
|
2749
2859
|
return {};
|
|
2750
2860
|
}
|
|
2751
|
-
return {};
|
|
2752
2861
|
}, [
|
|
2753
2862
|
currentThemeFamily,
|
|
2754
2863
|
currentThemeColorScheme,
|
|
@@ -2758,7 +2867,7 @@ var withDashboardViz = (opts) => {
|
|
|
2758
2867
|
localeContext.serializedTimezone,
|
|
2759
2868
|
useAsyncEvaluatedOptions
|
|
2760
2869
|
]);
|
|
2761
|
-
const evaluatedOptionsToUse =
|
|
2870
|
+
const evaluatedOptionsToUse = useAsyncEvaluatedOptions ? evaluatedOptionsAsync : evaluatedOptions;
|
|
2762
2871
|
let dataSourceMetadata = {};
|
|
2763
2872
|
const OptionKey = "paginateDataSourceKey";
|
|
2764
2873
|
const optsKey = (0, lodash_exports.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey];
|
|
@@ -2780,7 +2889,7 @@ var withDashboardViz = (opts) => {
|
|
|
2780
2889
|
sortParams,
|
|
2781
2890
|
paginatorParams
|
|
2782
2891
|
};
|
|
2783
|
-
if (vizConfig.supports.
|
|
2892
|
+
if (!vizConfig.supports.includes("page-and-sort" /* PAGE_AND_SORT */) && !(0, lodash_exports.has)(dataSources, paginateDataSourceKey)) {
|
|
2784
2893
|
dataSourceMetadata = {};
|
|
2785
2894
|
}
|
|
2786
2895
|
const clonedEvaluatedOptions = __spreadValues({}, evaluatedOptionsToUse);
|
|
@@ -2790,14 +2899,6 @@ var withDashboardViz = (opts) => {
|
|
|
2790
2899
|
react_exports.useEffect(() => {
|
|
2791
2900
|
onComputedProps(clonedEvaluatedOptions);
|
|
2792
2901
|
});
|
|
2793
|
-
react_exports.useEffect(() => {
|
|
2794
|
-
return () => {
|
|
2795
|
-
if (useAsyncEvaluatedOptions) {
|
|
2796
|
-
isMounted.current = false;
|
|
2797
|
-
async_dynamic_options_evaluator_default.reset(visualizationID);
|
|
2798
|
-
}
|
|
2799
|
-
};
|
|
2800
|
-
}, []);
|
|
2801
2902
|
const { requiredProps = [], supports } = vizConfig;
|
|
2802
2903
|
const missing = missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
2803
2904
|
if (missing.length > 0 && supports.includes("placeholder" /* PLACEHOLDER */) && vizConfig.key !== "splunk.singlevalue") {
|
|
@@ -2812,7 +2913,16 @@ var withDashboardViz = (opts) => {
|
|
|
2812
2913
|
}
|
|
2813
2914
|
);
|
|
2814
2915
|
}
|
|
2815
|
-
const eventCallbackProps =
|
|
2916
|
+
const eventCallbackProps = buildAllEventCallbackProps(
|
|
2917
|
+
vizConfig.events,
|
|
2918
|
+
evaluatedOptionsToUse,
|
|
2919
|
+
onEventTrigger,
|
|
2920
|
+
{
|
|
2921
|
+
supportsEvents: vizConfig.supports.includes("events" /* EVENTS */),
|
|
2922
|
+
hasEventHandlers,
|
|
2923
|
+
mode
|
|
2924
|
+
}
|
|
2925
|
+
);
|
|
2816
2926
|
const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
|
|
2817
2927
|
// Align option transformation with the actual renderer selected below.
|
|
2818
2928
|
// This prevents canvas-only option preservation from leaking into Highcharts mode.
|
|
@@ -2840,8 +2950,9 @@ var withDashboardViz = (opts) => {
|
|
|
2840
2950
|
onEventTrigger: SplunkVisualization_default.defaults.onEventTrigger
|
|
2841
2951
|
});
|
|
2842
2952
|
DashboardViz.config = vizConfig;
|
|
2843
|
-
return
|
|
2844
|
-
withPlaceholder_default(withEditModeCover_default(DashboardViz, disableEditModeCover), useIconPlaceholder)
|
|
2953
|
+
return Object.assign(
|
|
2954
|
+
(0, styled_components_exports.withTheme)(withPlaceholder_default(withEditModeCover_default(DashboardViz, disableEditModeCover), useIconPlaceholder)),
|
|
2955
|
+
{ config: vizConfig }
|
|
2845
2956
|
);
|
|
2846
2957
|
};
|
|
2847
2958
|
var withDashboardViz_default = withDashboardViz;
|
|
@@ -2851,55 +2962,60 @@ var config_exports = {};
|
|
|
2851
2962
|
__export(config_exports, {
|
|
2852
2963
|
default: () => config_default2
|
|
2853
2964
|
});
|
|
2854
|
-
var
|
|
2965
|
+
var defaultImport37 = __toESM(require("@splunk/splunk-utils/config"));
|
|
2855
2966
|
__reExport(config_exports, require("@splunk/splunk-utils/config"));
|
|
2856
|
-
var config_default2 = "default" in
|
|
2857
|
-
|
|
2858
|
-
// esm-externals:@splunk/themes
|
|
2859
|
-
var themes_exports = {};
|
|
2860
|
-
__export(themes_exports, {
|
|
2861
|
-
default: () => themes_default
|
|
2862
|
-
});
|
|
2863
|
-
var defaultImport37 = __toESM(require("@splunk/themes"));
|
|
2864
|
-
__reExport(themes_exports, require("@splunk/themes"));
|
|
2865
|
-
var themes_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
2967
|
+
var config_default2 = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
2866
2968
|
|
|
2867
2969
|
// src/common/utils/textUtils.ts
|
|
2868
2970
|
var VIZ_FONT_FAMILY = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
2971
|
+
var truncateEnd = (text, context, maxWidth, ellipsis) => {
|
|
2972
|
+
for (let i = text.length - 1; i > 0; i -= 1) {
|
|
2973
|
+
const truncatedText = text.slice(0, i) + ellipsis;
|
|
2974
|
+
if (context.measureText(truncatedText).width <= maxWidth) {
|
|
2975
|
+
return truncatedText;
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
return ellipsis;
|
|
2979
|
+
};
|
|
2980
|
+
var truncateStart = (text, context, maxWidth, ellipsis) => {
|
|
2981
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
2982
|
+
const truncatedText = ellipsis + text.slice(i);
|
|
2983
|
+
if (context.measureText(truncatedText).width <= maxWidth) {
|
|
2984
|
+
return truncatedText;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
return ellipsis;
|
|
2988
|
+
};
|
|
2989
|
+
var truncateMiddle = (text, context, maxWidth, ellipsis) => {
|
|
2990
|
+
const ellipsisWidth = context.measureText(ellipsis).width;
|
|
2991
|
+
for (let i = 0; i < text.length / 2; i += 1) {
|
|
2992
|
+
const left = text.slice(0, Math.floor(text.length / 2) - i);
|
|
2993
|
+
const right = text.slice(Math.ceil(text.length / 2) + i);
|
|
2994
|
+
const truncatedText = left + ellipsis + right;
|
|
2995
|
+
if (context.measureText(left).width + ellipsisWidth + context.measureText(right).width <= maxWidth) {
|
|
2996
|
+
return truncatedText;
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
return ellipsis;
|
|
3000
|
+
};
|
|
2869
3001
|
var truncateText = (text, maxWidth, truncationType, font = `10px ${VIZ_FONT_FAMILY}`) => {
|
|
2870
3002
|
const canvas = document.createElement("canvas");
|
|
2871
3003
|
const context = canvas.getContext("2d");
|
|
2872
3004
|
if (!context) return text;
|
|
2873
3005
|
context.font = font;
|
|
2874
3006
|
const ellipsis = "...";
|
|
2875
|
-
const ellipsisWidth = context.measureText(ellipsis).width;
|
|
2876
3007
|
const fullTextWidth = context.measureText(text).width;
|
|
2877
3008
|
if (fullTextWidth <= maxWidth) {
|
|
2878
3009
|
return text;
|
|
2879
3010
|
}
|
|
2880
3011
|
if (truncationType === "ellipsisEnd") {
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
2889
|
-
const truncatedText = ellipsis + text.slice(i);
|
|
2890
|
-
if (context.measureText(truncatedText).width <= maxWidth) {
|
|
2891
|
-
return truncatedText;
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
} else if (truncationType === "ellipsisMiddle") {
|
|
2895
|
-
for (let i = 0; i < text.length / 2; i += 1) {
|
|
2896
|
-
const left = text.slice(0, Math.floor(text.length / 2) - i);
|
|
2897
|
-
const right = text.slice(Math.ceil(text.length / 2) + i);
|
|
2898
|
-
const truncatedText = left + ellipsis + right;
|
|
2899
|
-
if (context.measureText(left).width + ellipsisWidth + context.measureText(right).width <= maxWidth) {
|
|
2900
|
-
return truncatedText;
|
|
2901
|
-
}
|
|
2902
|
-
}
|
|
3012
|
+
return truncateEnd(text, context, maxWidth, ellipsis);
|
|
3013
|
+
}
|
|
3014
|
+
if (truncationType === "ellipsisStart") {
|
|
3015
|
+
return truncateStart(text, context, maxWidth, ellipsis);
|
|
3016
|
+
}
|
|
3017
|
+
if (truncationType === "ellipsisMiddle") {
|
|
3018
|
+
return truncateMiddle(text, context, maxWidth, ellipsis);
|
|
2903
3019
|
}
|
|
2904
3020
|
return ellipsis;
|
|
2905
3021
|
};
|
|
@@ -2949,7 +3065,7 @@ function updateTimeDifferences(timeDifferences, lastValidStart, currentStart) {
|
|
|
2949
3065
|
timeDifferences.push(timeDiff);
|
|
2950
3066
|
}
|
|
2951
3067
|
}
|
|
2952
|
-
return
|
|
3068
|
+
return Number.isNaN(currentStart) ? lastValidStart : currentStart;
|
|
2953
3069
|
}
|
|
2954
3070
|
var toTimestamp = (dateStr, timezone = {}) => {
|
|
2955
3071
|
try {
|
|
@@ -3081,20 +3197,28 @@ function convertTickIntervalToMs(tickInterval) {
|
|
|
3081
3197
|
switch (tickInterval) {
|
|
3082
3198
|
case "1s":
|
|
3083
3199
|
return 1e3;
|
|
3200
|
+
// 1 second
|
|
3084
3201
|
case "1m":
|
|
3085
3202
|
return 6e4;
|
|
3203
|
+
// 1 minute
|
|
3086
3204
|
case "30m":
|
|
3087
3205
|
return 18e5;
|
|
3206
|
+
// 30 minutes
|
|
3088
3207
|
case "1h":
|
|
3089
3208
|
return 36e5;
|
|
3209
|
+
// 1 hour
|
|
3090
3210
|
case "12h":
|
|
3091
3211
|
return 432e5;
|
|
3212
|
+
// 12 hours
|
|
3092
3213
|
case "1d":
|
|
3093
3214
|
return 864e5;
|
|
3215
|
+
// 1 day
|
|
3094
3216
|
case "7d":
|
|
3095
3217
|
return 6048e5;
|
|
3218
|
+
// 1 week
|
|
3096
3219
|
case "1mo":
|
|
3097
3220
|
return 275e7;
|
|
3221
|
+
// 1 month
|
|
3098
3222
|
default:
|
|
3099
3223
|
throw new Error("Unsupported tick interval");
|
|
3100
3224
|
}
|
|
@@ -3116,6 +3240,19 @@ var tooltipLocaleTimeFormat = (displaySeconds) => {
|
|
|
3116
3240
|
year: "numeric"
|
|
3117
3241
|
}, seconds);
|
|
3118
3242
|
};
|
|
3243
|
+
var MAX_TOOLTIP_MOVE_TRANSITION_DISTANCE = 200;
|
|
3244
|
+
var isNearbyTooltipAnchor = ({
|
|
3245
|
+
anchorPoint,
|
|
3246
|
+
previousAnchorPoint
|
|
3247
|
+
}) => {
|
|
3248
|
+
if (!previousAnchorPoint) {
|
|
3249
|
+
return false;
|
|
3250
|
+
}
|
|
3251
|
+
const deltaX = anchorPoint.x - previousAnchorPoint.x;
|
|
3252
|
+
const deltaY = anchorPoint.y - previousAnchorPoint.y;
|
|
3253
|
+
const distance = Math.hypot(deltaX, deltaY);
|
|
3254
|
+
return distance > 0 && distance <= MAX_TOOLTIP_MOVE_TRANSITION_DISTANCE;
|
|
3255
|
+
};
|
|
3119
3256
|
var applyCanvasScale = (u, scaleFactor) => {
|
|
3120
3257
|
var _a;
|
|
3121
3258
|
if (!((_a = u.ctx) == null ? void 0 : _a.canvas)) {
|
|
@@ -3163,9 +3300,22 @@ var ZoomContext_default = "default" in defaultImport39 ? defaultImport39.default
|
|
|
3163
3300
|
|
|
3164
3301
|
// src/Timeline/PureTimeline/src/CursorPlugin.tsx
|
|
3165
3302
|
var FIXED_LANE_HEIGHT = 32;
|
|
3166
|
-
var MIN_BAR_WIDTH =
|
|
3167
|
-
var
|
|
3303
|
+
var MIN_BAR_WIDTH = 1;
|
|
3304
|
+
var MIN_BAR_HOVER_WIDTH = 6;
|
|
3168
3305
|
var CIRCLE_LANE_SCALE_FACTOR = 0.85;
|
|
3306
|
+
var EVENT_VERTICAL_HIT_PADDING = FIXED_LANE_HEIGHT * (1 - CIRCLE_LANE_SCALE_FACTOR) / 2;
|
|
3307
|
+
var TIMELINE_TOOLTIP_WIDTH = 300;
|
|
3308
|
+
var shouldClearOnPointerExit = (event, chartContainer) => {
|
|
3309
|
+
const { relatedTarget } = event;
|
|
3310
|
+
if (event.currentTarget !== chartContainer && relatedTarget !== null) {
|
|
3311
|
+
return false;
|
|
3312
|
+
}
|
|
3313
|
+
if (relatedTarget instanceof Node && chartContainer.contains(relatedTarget)) {
|
|
3314
|
+
return false;
|
|
3315
|
+
}
|
|
3316
|
+
const { target: eventTarget } = event;
|
|
3317
|
+
return eventTarget instanceof Node && chartContainer.contains(eventTarget);
|
|
3318
|
+
};
|
|
3169
3319
|
var CursorPlugin = (props) => {
|
|
3170
3320
|
const {
|
|
3171
3321
|
laneSeries,
|
|
@@ -3177,22 +3327,24 @@ var CursorPlugin = (props) => {
|
|
|
3177
3327
|
setHighlightedLane,
|
|
3178
3328
|
handleEventClick,
|
|
3179
3329
|
tooltipRef,
|
|
3330
|
+
scrollContainerRef,
|
|
3180
3331
|
locale,
|
|
3181
3332
|
scaleFactor
|
|
3182
3333
|
} = props;
|
|
3183
3334
|
let previousTooltipContent = null;
|
|
3335
|
+
const clearTooltip = (chart) => {
|
|
3336
|
+
clearTooltipIfVisible({
|
|
3337
|
+
chart,
|
|
3338
|
+
tooltipRef,
|
|
3339
|
+
setHighlightedLane,
|
|
3340
|
+
setHighlightedEvent,
|
|
3341
|
+
setHighlightedCategory
|
|
3342
|
+
});
|
|
3343
|
+
};
|
|
3184
3344
|
const handleMouseLeave = (u) => {
|
|
3185
3345
|
const xCursorLine = u.root.querySelector(".u-cursor-x");
|
|
3186
3346
|
xCursorLine.classList.add("u-off");
|
|
3187
|
-
|
|
3188
|
-
visible: false,
|
|
3189
|
-
overflow: false,
|
|
3190
|
-
content: "",
|
|
3191
|
-
meta: ""
|
|
3192
|
-
};
|
|
3193
|
-
setHighlightedLane(null);
|
|
3194
|
-
setHighlightedEvent(null);
|
|
3195
|
-
setHighlightedCategory(null);
|
|
3347
|
+
clearTooltip(u);
|
|
3196
3348
|
};
|
|
3197
3349
|
const handleClick2 = () => {
|
|
3198
3350
|
if (tooltipRef.current.visible) {
|
|
@@ -3206,18 +3358,44 @@ var CursorPlugin = (props) => {
|
|
|
3206
3358
|
return {
|
|
3207
3359
|
hooks: {
|
|
3208
3360
|
init: (u) => {
|
|
3361
|
+
var _a;
|
|
3209
3362
|
const chartContainer = u.root;
|
|
3210
3363
|
chartContainer.addEventListener("click", handleClick2);
|
|
3211
3364
|
const pointerExitHandler = (e) => {
|
|
3212
|
-
if (
|
|
3365
|
+
if (shouldClearOnPointerExit(e, chartContainer)) {
|
|
3213
3366
|
handleMouseLeave(u);
|
|
3214
3367
|
}
|
|
3215
3368
|
};
|
|
3369
|
+
const pointerMoveHandler = (e) => {
|
|
3370
|
+
if (!tooltipRef.current.visible || !tooltipRef.current.bounds) {
|
|
3371
|
+
return;
|
|
3372
|
+
}
|
|
3373
|
+
const rect = chartContainer.getBoundingClientRect();
|
|
3374
|
+
const dpr = globalThis.devicePixelRatio || 1;
|
|
3375
|
+
const cursorPosition = getCursorPosition({
|
|
3376
|
+
mouseEvent: e,
|
|
3377
|
+
rect,
|
|
3378
|
+
bbox: u.bbox,
|
|
3379
|
+
scaleFactor,
|
|
3380
|
+
dpr
|
|
3381
|
+
});
|
|
3382
|
+
if (!isCursorWithinBounds({ cursorPosition, bounds: tooltipRef.current.bounds })) {
|
|
3383
|
+
clearTooltip(u);
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3386
|
+
const scrollContainer = (_a = scrollContainerRef == null ? void 0 : scrollContainerRef.current) != null ? _a : chartContainer.closest('[data-test="timeline-chart-scroll-area"]');
|
|
3387
|
+
const scrollHandler = () => {
|
|
3388
|
+
clearTooltip(u);
|
|
3389
|
+
};
|
|
3216
3390
|
chartContainer.addEventListener("pointerleave", pointerExitHandler);
|
|
3391
|
+
document.addEventListener("pointermove", pointerMoveHandler, true);
|
|
3217
3392
|
document.addEventListener("pointerout", pointerExitHandler, true);
|
|
3393
|
+
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", scrollHandler);
|
|
3218
3394
|
return () => {
|
|
3219
3395
|
chartContainer.removeEventListener("pointerleave", pointerExitHandler);
|
|
3396
|
+
document.removeEventListener("pointermove", pointerMoveHandler, true);
|
|
3220
3397
|
document.removeEventListener("pointerout", pointerExitHandler, true);
|
|
3398
|
+
scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", scrollHandler);
|
|
3221
3399
|
chartContainer.removeEventListener("click", handleClick2);
|
|
3222
3400
|
};
|
|
3223
3401
|
},
|
|
@@ -3225,12 +3403,11 @@ var CursorPlugin = (props) => {
|
|
|
3225
3403
|
const mouseEvent = u.cursor.event;
|
|
3226
3404
|
const xCursorLine = u.root.querySelector(".u-cursor-x");
|
|
3227
3405
|
if (!mouseEvent) {
|
|
3228
|
-
tooltipRef.current.visible = false;
|
|
3229
3406
|
toggleCursorLine(xCursorLine, true);
|
|
3230
3407
|
return;
|
|
3231
3408
|
}
|
|
3232
3409
|
const rect = u.root.getBoundingClientRect();
|
|
3233
|
-
const dpr =
|
|
3410
|
+
const dpr = globalThis.devicePixelRatio || 1;
|
|
3234
3411
|
const cursorPosition = getCursorPosition({
|
|
3235
3412
|
mouseEvent,
|
|
3236
3413
|
rect,
|
|
@@ -3241,13 +3418,7 @@ var CursorPlugin = (props) => {
|
|
|
3241
3418
|
u.cursor.left = cursorPosition.x;
|
|
3242
3419
|
u.cursor.top = cursorPosition.y;
|
|
3243
3420
|
if (updateCursorLine(xCursorLine, cursorPosition, u, dpr)) {
|
|
3244
|
-
|
|
3245
|
-
chart: u,
|
|
3246
|
-
tooltipRef,
|
|
3247
|
-
setHighlightedLane,
|
|
3248
|
-
setHighlightedEvent,
|
|
3249
|
-
setHighlightedCategory
|
|
3250
|
-
});
|
|
3421
|
+
clearTooltip(u);
|
|
3251
3422
|
return;
|
|
3252
3423
|
}
|
|
3253
3424
|
const tooltipState = getTooltipState({
|
|
@@ -3261,13 +3432,7 @@ var CursorPlugin = (props) => {
|
|
|
3261
3432
|
chart: u
|
|
3262
3433
|
});
|
|
3263
3434
|
if (!tooltipState) {
|
|
3264
|
-
|
|
3265
|
-
chart: u,
|
|
3266
|
-
tooltipRef,
|
|
3267
|
-
setHighlightedLane,
|
|
3268
|
-
setHighlightedEvent,
|
|
3269
|
-
setHighlightedCategory
|
|
3270
|
-
});
|
|
3435
|
+
clearTooltip(u);
|
|
3271
3436
|
return;
|
|
3272
3437
|
}
|
|
3273
3438
|
applyTooltipState({
|
|
@@ -3353,12 +3518,15 @@ function getTooltipState({
|
|
|
3353
3518
|
if (!lane) {
|
|
3354
3519
|
return null;
|
|
3355
3520
|
}
|
|
3356
|
-
const tooltip =
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3521
|
+
const tooltip = {
|
|
3522
|
+
x: hit.anchorX,
|
|
3523
|
+
y: hit.anchorY,
|
|
3524
|
+
eventWidth: hit.eventWidth,
|
|
3525
|
+
eventHeight: hit.eventHeight,
|
|
3526
|
+
eventAnchorOffsetX: hit.eventAnchorOffsetX,
|
|
3527
|
+
bounds: hit.bounds,
|
|
3528
|
+
overflow: hit.anchorX + hit.eventWidth + TIMELINE_TOOLTIP_WIDTH / 2 > chart.bbox.width / dpr
|
|
3529
|
+
};
|
|
3362
3530
|
const displaySeconds = durationPerTick < 6e4 && hit.event.duration !== 0;
|
|
3363
3531
|
const content = buildTooltipContent({ lane, event: hit.event, locale, displaySeconds });
|
|
3364
3532
|
const meta = buildTooltipMeta(hit.event);
|
|
@@ -3392,6 +3560,7 @@ function findEventHit({
|
|
|
3392
3560
|
widthPerTick,
|
|
3393
3561
|
xScaleMin
|
|
3394
3562
|
}) {
|
|
3563
|
+
const candidates = [];
|
|
3395
3564
|
for (let i = events.length - 1; i >= 0; i -= 1) {
|
|
3396
3565
|
const event = events[i];
|
|
3397
3566
|
const metrics = getEventMetrics({
|
|
@@ -3402,56 +3571,97 @@ function findEventHit({
|
|
|
3402
3571
|
xScaleMin
|
|
3403
3572
|
});
|
|
3404
3573
|
if (metrics && hitTestEvent({ metrics, cursorPosition })) {
|
|
3405
|
-
|
|
3406
|
-
event,
|
|
3407
|
-
tooltipX: metrics.tooltipX,
|
|
3408
|
-
tooltipY: metrics.tooltipY
|
|
3409
|
-
};
|
|
3574
|
+
candidates.push({ event, metrics });
|
|
3410
3575
|
}
|
|
3411
3576
|
}
|
|
3412
|
-
|
|
3577
|
+
if (candidates.length === 0) {
|
|
3578
|
+
return null;
|
|
3579
|
+
}
|
|
3580
|
+
const minWidthCandidates = candidates.filter(({ metrics }) => metrics.isMinWidthBar);
|
|
3581
|
+
const hit = minWidthCandidates.length ? getClosestMinWidthHit({ candidates: minWidthCandidates, cursorPosition }) : candidates[0];
|
|
3582
|
+
return {
|
|
3583
|
+
event: hit.event,
|
|
3584
|
+
anchorX: hit.metrics.anchorX,
|
|
3585
|
+
anchorY: hit.metrics.anchorY,
|
|
3586
|
+
eventWidth: hit.metrics.eventWidth,
|
|
3587
|
+
eventHeight: hit.metrics.eventHeight,
|
|
3588
|
+
eventAnchorOffsetX: hit.metrics.eventAnchorOffsetX,
|
|
3589
|
+
bounds: {
|
|
3590
|
+
xMin: hit.metrics.hitMin,
|
|
3591
|
+
xMax: hit.metrics.hitMax,
|
|
3592
|
+
yMin: hit.metrics.hitYMin,
|
|
3593
|
+
yMax: hit.metrics.hitYMax
|
|
3594
|
+
}
|
|
3595
|
+
};
|
|
3596
|
+
}
|
|
3597
|
+
function getClosestMinWidthHit({ candidates, cursorPosition }) {
|
|
3598
|
+
return candidates.reduce((closest, candidate) => {
|
|
3599
|
+
const closestDistance = Math.abs(cursorPosition.x - closest.metrics.anchorX);
|
|
3600
|
+
const candidateDistance = Math.abs(cursorPosition.x - candidate.metrics.anchorX);
|
|
3601
|
+
return candidateDistance < closestDistance ? candidate : closest;
|
|
3602
|
+
}, candidates[0]);
|
|
3413
3603
|
}
|
|
3414
3604
|
function getEventMetrics({ event, cursorSeriesIndex, durationPerTick, widthPerTick, xScaleMin }) {
|
|
3415
3605
|
const xStartFraction = (event.start - xScaleMin) / durationPerTick;
|
|
3416
3606
|
const xStartBase = xStartFraction * widthPerTick;
|
|
3417
3607
|
const xStart = cursorSeriesIndex - 1 === 0 ? xStartBase + 2 : xStartBase;
|
|
3418
|
-
|
|
3419
|
-
|
|
3608
|
+
const laneTop = (cursorSeriesIndex - 1) * FIXED_LANE_HEIGHT;
|
|
3609
|
+
const laneCenterY = laneTop + FIXED_LANE_HEIGHT / 2;
|
|
3610
|
+
const eventHeight = FIXED_LANE_HEIGHT * CIRCLE_LANE_SCALE_FACTOR;
|
|
3611
|
+
const eventTop = laneCenterY - eventHeight / 2;
|
|
3612
|
+
const eventBottom = eventTop + eventHeight;
|
|
3613
|
+
const hitYMin = eventTop - EVENT_VERTICAL_HIT_PADDING;
|
|
3614
|
+
const hitYMax = eventBottom + EVENT_VERTICAL_HIT_PADDING;
|
|
3615
|
+
if (event.duration === null || event.duration === 0) {
|
|
3616
|
+
const circleRadius = eventHeight / 2;
|
|
3617
|
+
const circleLeft = xStart - circleRadius;
|
|
3420
3618
|
return {
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3619
|
+
anchorX: circleLeft,
|
|
3620
|
+
anchorY: eventTop,
|
|
3621
|
+
eventWidth: eventHeight,
|
|
3622
|
+
eventHeight,
|
|
3623
|
+
eventAnchorOffsetX: circleRadius,
|
|
3624
|
+
hitMin: circleLeft,
|
|
3625
|
+
hitMax: xStart + circleRadius,
|
|
3626
|
+
hitYMin,
|
|
3627
|
+
hitYMax
|
|
3425
3628
|
};
|
|
3426
3629
|
}
|
|
3427
3630
|
const durationWidth = event.duration / durationPerTick * widthPerTick;
|
|
3428
3631
|
const barWidth = Math.max(durationWidth, MIN_BAR_WIDTH);
|
|
3632
|
+
const isMinWidthBar = barWidth <= MIN_BAR_WIDTH;
|
|
3633
|
+
const hitXMin = isMinWidthBar ? xStart - MIN_BAR_HOVER_WIDTH / 2 : xStart;
|
|
3634
|
+
const hitXMax = isMinWidthBar ? xStart + MIN_BAR_HOVER_WIDTH / 2 : xStart + barWidth;
|
|
3429
3635
|
return {
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3636
|
+
anchorX: xStart,
|
|
3637
|
+
anchorY: eventTop,
|
|
3638
|
+
eventWidth: barWidth,
|
|
3639
|
+
eventHeight,
|
|
3640
|
+
eventAnchorOffsetX: 0,
|
|
3641
|
+
hitMin: hitXMin,
|
|
3642
|
+
hitMax: hitXMax,
|
|
3643
|
+
hitYMin,
|
|
3644
|
+
hitYMax,
|
|
3645
|
+
isMinWidthBar
|
|
3434
3646
|
};
|
|
3435
3647
|
}
|
|
3436
3648
|
function hitTestEvent({ metrics, cursorPosition }) {
|
|
3437
|
-
|
|
3438
|
-
|
|
3649
|
+
return isCursorWithinBounds({
|
|
3650
|
+
cursorPosition,
|
|
3651
|
+
bounds: {
|
|
3652
|
+
xMin: metrics.hitMin,
|
|
3653
|
+
xMax: metrics.hitMax,
|
|
3654
|
+
yMin: metrics.hitYMin,
|
|
3655
|
+
yMax: metrics.hitYMax
|
|
3656
|
+
}
|
|
3657
|
+
});
|
|
3439
3658
|
}
|
|
3440
|
-
function
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
overflow = true;
|
|
3447
|
-
adjustedY -= FIXED_LANE_HEIGHT / 2;
|
|
3448
|
-
adjustedX -= event.duration === 0 ? FIXED_LANE_HEIGHT : MIN_BAR_WIDTH;
|
|
3449
|
-
}
|
|
3450
|
-
return {
|
|
3451
|
-
x: adjustedX,
|
|
3452
|
-
y: adjustedY,
|
|
3453
|
-
overflow
|
|
3454
|
-
};
|
|
3659
|
+
function isCursorWithinBounds({
|
|
3660
|
+
cursorPosition,
|
|
3661
|
+
bounds
|
|
3662
|
+
}) {
|
|
3663
|
+
const { x, y } = cursorPosition;
|
|
3664
|
+
return x >= bounds.xMin && x <= bounds.xMax && y >= bounds.yMin && y <= bounds.yMax;
|
|
3455
3665
|
}
|
|
3456
3666
|
function buildTooltipContent({ lane, event, locale, displaySeconds }) {
|
|
3457
3667
|
const startTime = new Date(event.start).toLocaleTimeString(
|
|
@@ -3485,6 +3695,10 @@ function applyTooltipState({
|
|
|
3485
3695
|
visible: true,
|
|
3486
3696
|
x: tooltipState.tooltip.x,
|
|
3487
3697
|
y: tooltipState.tooltip.y,
|
|
3698
|
+
eventWidth: tooltipState.tooltip.eventWidth,
|
|
3699
|
+
eventHeight: tooltipState.tooltip.eventHeight,
|
|
3700
|
+
eventAnchorOffsetX: tooltipState.tooltip.eventAnchorOffsetX,
|
|
3701
|
+
bounds: tooltipState.tooltip.bounds,
|
|
3488
3702
|
overflow: tooltipState.tooltip.overflow,
|
|
3489
3703
|
content: tooltipState.content,
|
|
3490
3704
|
meta: tooltipState.meta
|
|
@@ -3504,12 +3718,9 @@ function clearTooltipIfVisible({
|
|
|
3504
3718
|
return;
|
|
3505
3719
|
}
|
|
3506
3720
|
chart.root.style.cursor = "default";
|
|
3507
|
-
tooltipRef.current = {
|
|
3508
|
-
visible: false
|
|
3509
|
-
|
|
3510
|
-
content: "",
|
|
3511
|
-
meta: ""
|
|
3512
|
-
};
|
|
3721
|
+
tooltipRef.current = __spreadProps(__spreadValues({}, tooltipRef.current), {
|
|
3722
|
+
visible: false
|
|
3723
|
+
});
|
|
3513
3724
|
setHighlightedLane(null);
|
|
3514
3725
|
setHighlightedEvent(null);
|
|
3515
3726
|
setHighlightedCategory(null);
|
|
@@ -3620,7 +3831,7 @@ var TimelinePlugin = ({
|
|
|
3620
3831
|
var TimelinePlugin_default = TimelinePlugin;
|
|
3621
3832
|
|
|
3622
3833
|
// src/Timeline/PureTimeline/src/XAxisPlugin.tsx
|
|
3623
|
-
var X_AXIS_HEIGHT =
|
|
3834
|
+
var X_AXIS_HEIGHT = 50;
|
|
3624
3835
|
var XAxisPlugin = ({
|
|
3625
3836
|
durationPerTick = 0,
|
|
3626
3837
|
numTicks = 0,
|
|
@@ -3660,7 +3871,6 @@ var XAxisPlugin = ({
|
|
|
3660
3871
|
draw: (u) => {
|
|
3661
3872
|
const { ctx } = u;
|
|
3662
3873
|
const scaleMin = u.scales.x.min;
|
|
3663
|
-
const maxLabelWidth = 50;
|
|
3664
3874
|
const ticks = [scaleMin];
|
|
3665
3875
|
for (let i = 1; i <= numTicks; i += 1) {
|
|
3666
3876
|
ticks.push(scaleMin + i * durationPerTick);
|
|
@@ -3716,7 +3926,9 @@ var XAxisPlugin = ({
|
|
|
3716
3926
|
} else {
|
|
3717
3927
|
xTickPosition = i * (u.width / numTicks);
|
|
3718
3928
|
}
|
|
3719
|
-
|
|
3929
|
+
const label = labels[i];
|
|
3930
|
+
const labelPixelWidth = label ? Math.max(...label.map((line) => ctx.measureText(line).width)) : 0;
|
|
3931
|
+
if (xTickPosition + labelPixelWidth > u.width) {
|
|
3720
3932
|
return;
|
|
3721
3933
|
}
|
|
3722
3934
|
const yLabelPosition = xAxisY + tickHeight + labelOffset;
|
|
@@ -3726,7 +3938,6 @@ var XAxisPlugin = ({
|
|
|
3726
3938
|
ctx.strokeStyle = "rgba(144, 144, 144, 0.5)";
|
|
3727
3939
|
ctx.lineWidth = i === 0 ? 1 : 0.5;
|
|
3728
3940
|
ctx.stroke();
|
|
3729
|
-
const label = labels[i];
|
|
3730
3941
|
if (label) {
|
|
3731
3942
|
label.forEach((line, idx) => {
|
|
3732
3943
|
ctx.fillText(line, xTickPosition, yLabelPosition + idx * lineHeight);
|
|
@@ -3802,12 +4013,14 @@ var TimelineYAxis = ({
|
|
|
3802
4013
|
laneTextColor = theme.contentColorActive;
|
|
3803
4014
|
}
|
|
3804
4015
|
}
|
|
4016
|
+
const laneText = lane.toString();
|
|
3805
4017
|
const truncatedText = truncateText(
|
|
3806
|
-
|
|
4018
|
+
laneText,
|
|
3807
4019
|
yAxisLabelWidth - lanePadding,
|
|
3808
4020
|
"ellipsisMiddle",
|
|
3809
4021
|
`14px ${VIZ_FONT_FAMILY}`
|
|
3810
4022
|
);
|
|
4023
|
+
const isTruncated = truncatedText !== laneText;
|
|
3811
4024
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3812
4025
|
YAxisLane,
|
|
3813
4026
|
{
|
|
@@ -3818,6 +4031,7 @@ var TimelineYAxis = ({
|
|
|
3818
4031
|
isEven: (lanes.length - index - 1) % 2 === 0,
|
|
3819
4032
|
backgroundColor,
|
|
3820
4033
|
clickable: !!handleLaneClick,
|
|
4034
|
+
title: isTruncated ? laneText : void 0,
|
|
3821
4035
|
onClick: () => {
|
|
3822
4036
|
handleLaneClick == null ? void 0 : handleLaneClick(lane);
|
|
3823
4037
|
}
|
|
@@ -3834,35 +4048,48 @@ TimelineYAxis.propTypes = {
|
|
|
3834
4048
|
var TimelineYAxis_default = TimelineYAxis;
|
|
3835
4049
|
|
|
3836
4050
|
// src/Timeline/PureTimeline/src/TimelineLegend.tsx
|
|
3837
|
-
var LEGEND_WIDTH =
|
|
4051
|
+
var LEGEND_WIDTH = 79;
|
|
4052
|
+
var SCROLLBAR_GUTTER_WIDTH = 16;
|
|
3838
4053
|
var LEGEND_TEXT_WIDTH = 55;
|
|
4054
|
+
var BOTTOM_LEGEND_MIN_HEIGHT = 34;
|
|
3839
4055
|
var LegendContainer = styled_components_default.div`
|
|
3840
4056
|
display: flex;
|
|
3841
|
-
justify-content: center;
|
|
4057
|
+
justify-content: ${({ legendDisplay, hasVerticalOverflow }) => legendDisplay === "right" && hasVerticalOverflow ? "flex-start" : "center"};
|
|
3842
4058
|
flex-direction: ${({ legendDisplay }) => legendDisplay === "bottom" ? "row" : "column"};
|
|
3843
4059
|
align-items: flex-start;
|
|
3844
4060
|
background-color: ${({ backgroundColor }) => backgroundColor};
|
|
3845
4061
|
color: #fafafa;
|
|
3846
4062
|
font-size: 10px;
|
|
3847
|
-
|
|
4063
|
+
flex-shrink: 0;
|
|
4064
|
+
box-sizing: border-box;
|
|
4065
|
+
padding-right: ${({ scrollbarGutterWidth }) => scrollbarGutterWidth}px;
|
|
4066
|
+
${({ legendDisplay, height, maxHeight, yAxisLabelWidth }) => legendDisplay === "right" ? `
|
|
3848
4067
|
width: ${LEGEND_WIDTH}px;
|
|
3849
|
-
height: ${height}px;
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
margin-
|
|
4068
|
+
min-height: ${Math.min(height, maxHeight)}px;
|
|
4069
|
+
max-height: ${maxHeight}px;
|
|
4070
|
+
align-self: flex-start;
|
|
4071
|
+
margin-left: 9px;
|
|
3853
4072
|
overflow-x: hidden;
|
|
4073
|
+
overflow-y: auto;
|
|
3854
4074
|
` : `
|
|
3855
4075
|
flex-wrap: wrap;
|
|
3856
|
-
|
|
3857
|
-
|
|
4076
|
+
align-content: flex-start;
|
|
4077
|
+
min-height: ${BOTTOM_LEGEND_MIN_HEIGHT}px;
|
|
4078
|
+
max-height: ${maxHeight}px;
|
|
4079
|
+
overflow-y: auto;
|
|
4080
|
+
width: calc(100% - ${yAxisLabelWidth}px);
|
|
3858
4081
|
margin-left: ${yAxisLabelWidth}px;
|
|
3859
|
-
padding-
|
|
4082
|
+
padding-top: 8px;
|
|
4083
|
+
padding-bottom: 0;
|
|
3860
4084
|
`}
|
|
3861
4085
|
`;
|
|
3862
4086
|
var LegendItem = styled_components_default.div`
|
|
3863
4087
|
display: flex;
|
|
3864
4088
|
align-items: ${({ legendTruncation }) => legendTruncation === "ellipsisOff" ? "flex-start" : "center"};
|
|
3865
|
-
margin: ${({ legendDisplay }) => legendDisplay === "bottom" ? "
|
|
4089
|
+
margin: ${({ legendDisplay }) => legendDisplay === "bottom" ? "4px 20px 4px 0px" : "4px"};
|
|
4090
|
+
max-width: 100%;
|
|
4091
|
+
min-width: 0;
|
|
4092
|
+
box-sizing: border-box;
|
|
3866
4093
|
cursor: pointer;
|
|
3867
4094
|
opacity: ${({ isHighlighted }) => isHighlighted ? 1 : 0.5};
|
|
3868
4095
|
transition: opacity 0.2s ease;
|
|
@@ -3889,19 +4116,43 @@ var LegendText = styled_components_default.div`
|
|
|
3889
4116
|
`}
|
|
3890
4117
|
font-size: 10px;
|
|
3891
4118
|
color: ${themes_exports.variables.contentColorActive};
|
|
4119
|
+
max-width: 100%;
|
|
4120
|
+
min-width: 0;
|
|
3892
4121
|
`;
|
|
3893
4122
|
var TimelineLegend = ({
|
|
3894
4123
|
backgroundColor,
|
|
3895
4124
|
categoryColors,
|
|
3896
4125
|
highlightedCategory = null,
|
|
3897
4126
|
setHighlightedCategory,
|
|
3898
|
-
height,
|
|
3899
|
-
width,
|
|
3900
4127
|
handleLegendClick: handleLegendClick2,
|
|
3901
4128
|
legendDisplay = "right",
|
|
3902
4129
|
legendTruncation = "ellipsisEnd",
|
|
4130
|
+
height = 0,
|
|
4131
|
+
maxHeight = height,
|
|
3903
4132
|
yAxisLabelWidth = 0
|
|
3904
4133
|
}) => {
|
|
4134
|
+
const containerRef = react_exports.useRef(null);
|
|
4135
|
+
const [scrollbarGutter, setScrollbarGutter] = react_exports.useState({
|
|
4136
|
+
reservedWidth: 0,
|
|
4137
|
+
paddingRight: 0,
|
|
4138
|
+
hasVerticalOverflow: false
|
|
4139
|
+
});
|
|
4140
|
+
const categoryColorEntries = Array.from(categoryColors.entries());
|
|
4141
|
+
const legendTextWidth = Math.max(0, LEGEND_TEXT_WIDTH - scrollbarGutter.reservedWidth);
|
|
4142
|
+
react_exports.useEffect(() => {
|
|
4143
|
+
const el = containerRef.current;
|
|
4144
|
+
if (!el) return;
|
|
4145
|
+
const hasVerticalOverflow = el.scrollHeight > el.clientHeight;
|
|
4146
|
+
const measuredScrollbarWidth = hasVerticalOverflow ? Math.max(0, el.offsetWidth - el.clientWidth) : 0;
|
|
4147
|
+
const nextGutter = hasVerticalOverflow ? {
|
|
4148
|
+
reservedWidth: Math.max(SCROLLBAR_GUTTER_WIDTH, measuredScrollbarWidth),
|
|
4149
|
+
paddingRight: Math.max(0, SCROLLBAR_GUTTER_WIDTH - measuredScrollbarWidth),
|
|
4150
|
+
hasVerticalOverflow
|
|
4151
|
+
} : { reservedWidth: 0, paddingRight: 0, hasVerticalOverflow };
|
|
4152
|
+
setScrollbarGutter(
|
|
4153
|
+
(current) => current.reservedWidth === nextGutter.reservedWidth && current.paddingRight === nextGutter.paddingRight && current.hasVerticalOverflow === nextGutter.hasVerticalOverflow ? current : nextGutter
|
|
4154
|
+
);
|
|
4155
|
+
}, [categoryColors, height, legendDisplay, legendTruncation, maxHeight]);
|
|
3905
4156
|
const handleMouseEnter = (category) => {
|
|
3906
4157
|
setHighlightedCategory == null ? void 0 : setHighlightedCategory(category);
|
|
3907
4158
|
};
|
|
@@ -3911,31 +4162,36 @@ var TimelineLegend = ({
|
|
|
3911
4162
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3912
4163
|
LegendContainer,
|
|
3913
4164
|
{
|
|
4165
|
+
ref: containerRef,
|
|
3914
4166
|
"data-test": "legend-container",
|
|
3915
4167
|
"data-test-position-value": legendDisplay,
|
|
3916
4168
|
"data-test-truncation-value": legendTruncation,
|
|
3917
4169
|
legendDisplay,
|
|
3918
4170
|
backgroundColor,
|
|
4171
|
+
yAxisLabelWidth,
|
|
3919
4172
|
height,
|
|
3920
|
-
|
|
3921
|
-
|
|
4173
|
+
maxHeight,
|
|
4174
|
+
scrollbarGutterWidth: scrollbarGutter.paddingRight,
|
|
4175
|
+
hasVerticalOverflow: scrollbarGutter.hasVerticalOverflow
|
|
3922
4176
|
},
|
|
3923
|
-
|
|
4177
|
+
categoryColorEntries.map(([category, color]) => {
|
|
3924
4178
|
const isHighlighted = !highlightedCategory || highlightedCategory === category;
|
|
3925
|
-
const truncatedText = legendTruncation === "ellipsisOff" || legendDisplay === "bottom" ? category : truncateText(category,
|
|
4179
|
+
const truncatedText = legendTruncation === "ellipsisOff" || legendDisplay === "bottom" ? category : truncateText(category, legendTextWidth, legendTruncation);
|
|
4180
|
+
const canTruncate = legendTruncation !== "ellipsisOff";
|
|
3926
4181
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3927
4182
|
LegendItem,
|
|
3928
4183
|
{
|
|
3929
4184
|
"data-test": "legend-item",
|
|
3930
4185
|
key: category,
|
|
3931
|
-
color,
|
|
3932
4186
|
isHighlighted,
|
|
3933
4187
|
legendDisplay,
|
|
3934
4188
|
legendTruncation,
|
|
4189
|
+
title: canTruncate ? category : void 0,
|
|
4190
|
+
"aria-label": category,
|
|
3935
4191
|
onMouseEnter: () => handleMouseEnter(category),
|
|
3936
4192
|
onMouseLeave: handleMouseLeave,
|
|
3937
4193
|
onClick: () => {
|
|
3938
|
-
handleLegendClick2(category);
|
|
4194
|
+
handleLegendClick2 == null ? void 0 : handleLegendClick2(category);
|
|
3939
4195
|
}
|
|
3940
4196
|
},
|
|
3941
4197
|
/* @__PURE__ */ react_exports.createElement(
|
|
@@ -3955,104 +4211,133 @@ var TimelineLegend = ({
|
|
|
3955
4211
|
};
|
|
3956
4212
|
TimelineLegend.propTypes = {
|
|
3957
4213
|
backgroundColor: prop_types_exports.string.isRequired,
|
|
3958
|
-
height: prop_types_exports.number
|
|
3959
|
-
legendDisplay: prop_types_exports.oneOf(["right", "bottom"]),
|
|
4214
|
+
height: prop_types_exports.number,
|
|
4215
|
+
legendDisplay: prop_types_exports.oneOf(["right", "bottom", "off"]),
|
|
3960
4216
|
legendTruncation: prop_types_exports.oneOf(["ellipsisEnd", "ellipsisMiddle", "ellipsisStart", "ellipsisOff"]),
|
|
3961
4217
|
categoryColors: prop_types_exports.any,
|
|
3962
4218
|
highlightedCategory: prop_types_exports.string,
|
|
3963
|
-
setHighlightedCategory: prop_types_exports.func
|
|
4219
|
+
setHighlightedCategory: prop_types_exports.func,
|
|
4220
|
+
maxHeight: prop_types_exports.number
|
|
3964
4221
|
};
|
|
3965
4222
|
var TimelineLegend_default = TimelineLegend;
|
|
3966
4223
|
|
|
3967
|
-
// esm-externals:@splunk/
|
|
3968
|
-
var
|
|
3969
|
-
__export(
|
|
3970
|
-
default: () =>
|
|
4224
|
+
// esm-externals:@splunk/react-ui/Popover
|
|
4225
|
+
var Popover_exports = {};
|
|
4226
|
+
__export(Popover_exports, {
|
|
4227
|
+
default: () => Popover_default
|
|
3971
4228
|
});
|
|
3972
|
-
var defaultImport40 = __toESM(require("@splunk/
|
|
3973
|
-
__reExport(
|
|
3974
|
-
var
|
|
4229
|
+
var defaultImport40 = __toESM(require("@splunk/react-ui/Popover"));
|
|
4230
|
+
__reExport(Popover_exports, require("@splunk/react-ui/Popover"));
|
|
4231
|
+
var Popover_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
|
|
3975
4232
|
|
|
3976
4233
|
// src/Timeline/PureTimeline/src/TimelineTooltip.tsx
|
|
3977
|
-
var
|
|
4234
|
+
var TOOLTIP_ANCHOR_GAP = 4;
|
|
4235
|
+
var TOOLTIP_MOVE_TRANSITION = "transform 0.1s ease-out, left 0.1s ease-out, top 0.1s ease-out";
|
|
4236
|
+
var VirtualAnchor = styled_components_default.div`
|
|
3978
4237
|
position: absolute;
|
|
3979
|
-
background-color: ${({ backgroundColor }) => `${backgroundColor}`};
|
|
3980
|
-
box-shadow: ${themes_exports.variables.overlayShadow};
|
|
3981
|
-
padding: 12px 16px;
|
|
3982
|
-
border-radius: 3px;
|
|
3983
4238
|
pointer-events: none;
|
|
3984
|
-
|
|
3985
|
-
|
|
4239
|
+
width: ${({ width }) => `${width}px`};
|
|
4240
|
+
height: ${({ height }) => `${height}px`};
|
|
3986
4241
|
left: ${({ x }) => `${x}px`};
|
|
3987
|
-
top: ${({ y
|
|
3988
|
-
transform: ${({ chartOverflow }) => chartOverflow ? "translate(-100%, -50%);" : "translate(-55%, 0);"}
|
|
3989
|
-
transition: left 0.1s ease-out, top 0.1s ease-out;
|
|
3990
|
-
z-index: 1000;
|
|
3991
|
-
|
|
3992
|
-
::after {
|
|
3993
|
-
content: '';
|
|
3994
|
-
position: absolute;
|
|
3995
|
-
${({ chartOverflow, backgroundColor }) => chartOverflow ? `
|
|
3996
|
-
top: 50%;
|
|
3997
|
-
left: 100%;
|
|
3998
|
-
transform: translateY(-50%);
|
|
3999
|
-
border-width: 5px;
|
|
4000
|
-
border-style: solid;
|
|
4001
|
-
border-bottom-color: transparent;
|
|
4002
|
-
border-top-color: transparent;
|
|
4003
|
-
border-right-color: transparent;
|
|
4004
|
-
border-left-color: ${backgroundColor};
|
|
4005
|
-
` : `
|
|
4006
|
-
bottom: 100%;
|
|
4007
|
-
left: 50%;
|
|
4008
|
-
transform: translateX(-50%);
|
|
4009
|
-
border-width: 5px;
|
|
4010
|
-
border-style: solid;
|
|
4011
|
-
border-bottom-color: ${backgroundColor};
|
|
4012
|
-
border-top-color: transparent;
|
|
4013
|
-
border-right-color: transparent;
|
|
4014
|
-
border-left-color: transparent;
|
|
4015
|
-
`}
|
|
4016
|
-
}
|
|
4017
|
-
`;
|
|
4018
|
-
var TooltipLabel = styled_components_default.div`
|
|
4019
|
-
color: ${themes_exports.variables.contentColorDefault};
|
|
4242
|
+
top: ${({ y }) => `${y}px`};
|
|
4020
4243
|
`;
|
|
4021
|
-
var
|
|
4022
|
-
|
|
4244
|
+
var TooltipContainer = styled_components_default.div`
|
|
4245
|
+
padding: 12px 16px;
|
|
4023
4246
|
`;
|
|
4024
|
-
var
|
|
4025
|
-
|
|
4026
|
-
flex-direction: row;
|
|
4027
|
-
justify-content: space-between;
|
|
4028
|
-
align-items: center;
|
|
4029
|
-
gap: 16px;
|
|
4247
|
+
var TooltipTable = styled_components_default.table`
|
|
4248
|
+
border-collapse: collapse;
|
|
4030
4249
|
font-weight: 400;
|
|
4031
4250
|
font-size: 12px;
|
|
4032
4251
|
line-height: 16px;
|
|
4252
|
+
max-width: 280px;
|
|
4033
4253
|
`;
|
|
4034
|
-
var
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4254
|
+
var TooltipLabel = styled_components_default.td`
|
|
4255
|
+
color: ${themes_exports.variables.contentColorDefault};
|
|
4256
|
+
overflow-wrap: normal;
|
|
4257
|
+
word-break: normal;
|
|
4258
|
+
white-space: normal;
|
|
4259
|
+
vertical-align: top;
|
|
4260
|
+
padding-right: 16px;
|
|
4261
|
+
padding-bottom: 2px;
|
|
4262
|
+
min-width: 8ch;
|
|
4263
|
+
max-width: 18ch;
|
|
4264
|
+
`;
|
|
4265
|
+
var TooltipValue = styled_components_default.td`
|
|
4266
|
+
color: ${themes_exports.variables.contentColorActive};
|
|
4267
|
+
overflow-wrap: anywhere;
|
|
4268
|
+
word-break: normal;
|
|
4269
|
+
white-space: normal;
|
|
4270
|
+
vertical-align: top;
|
|
4271
|
+
text-align: right;
|
|
4272
|
+
padding-bottom: 2px;
|
|
4273
|
+
`;
|
|
4274
|
+
var POPOVER_STYLE = { pointerEvents: "none" };
|
|
4275
|
+
var TimelineTooltip = ({
|
|
4276
|
+
visible,
|
|
4277
|
+
content,
|
|
4278
|
+
x,
|
|
4279
|
+
y,
|
|
4280
|
+
eventWidth = 0,
|
|
4281
|
+
eventHeight = 0,
|
|
4282
|
+
eventAnchorOffsetX = 0,
|
|
4283
|
+
overflow,
|
|
4284
|
+
scaleFactor = 1
|
|
4285
|
+
}) => {
|
|
4286
|
+
const [anchorEl, setAnchorEl] = react_default.useState(null);
|
|
4287
|
+
const preferredPlacement = overflow ? "left" : "below";
|
|
4288
|
+
const previousAnchorRef = react_default.useRef(null);
|
|
4289
|
+
const anchorX = x - TOOLTIP_ANCHOR_GAP;
|
|
4290
|
+
const anchorY = y - TOOLTIP_ANCHOR_GAP;
|
|
4291
|
+
const anchorWidth = eventWidth + TOOLTIP_ANCHOR_GAP * 2;
|
|
4292
|
+
const anchorHeight = eventHeight + TOOLTIP_ANCHOR_GAP * 2;
|
|
4293
|
+
const pointTo = overflow ? void 0 : { x: (eventAnchorOffsetX + TOOLTIP_ANCHOR_GAP) * scaleFactor };
|
|
4294
|
+
const tooltipRows = Object.entries(content).filter(([, value]) => value !== void 0 && value !== null);
|
|
4295
|
+
const open = visible && anchorEl !== null;
|
|
4296
|
+
const previousAnchor = previousAnchorRef.current;
|
|
4297
|
+
const shouldTransitionTooltipMove = open ? isNearbyTooltipAnchor({
|
|
4298
|
+
anchorPoint: { x: anchorX, y: anchorY },
|
|
4299
|
+
previousAnchorPoint: previousAnchor
|
|
4300
|
+
}) : false;
|
|
4301
|
+
react_default.useEffect(() => {
|
|
4302
|
+
if (!open) {
|
|
4303
|
+
return;
|
|
4304
|
+
}
|
|
4305
|
+
previousAnchorRef.current = { x: anchorX, y: anchorY };
|
|
4306
|
+
}, [anchorX, anchorY, open]);
|
|
4307
|
+
const applyOuterPopoverStyles = react_default.useCallback(
|
|
4308
|
+
(element) => {
|
|
4309
|
+
if (!element) return;
|
|
4310
|
+
const { style } = element;
|
|
4311
|
+
style.pointerEvents = "none";
|
|
4312
|
+
style.minWidth = "0";
|
|
4313
|
+
style.transition = shouldTransitionTooltipMove ? TOOLTIP_MOVE_TRANSITION : "none";
|
|
4314
|
+
},
|
|
4315
|
+
[shouldTransitionTooltipMove]
|
|
4316
|
+
);
|
|
4317
|
+
return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
|
|
4318
|
+
VirtualAnchor,
|
|
4319
|
+
{
|
|
4320
|
+
ref: setAnchorEl,
|
|
4321
|
+
x: anchorX,
|
|
4322
|
+
y: anchorY,
|
|
4323
|
+
width: anchorWidth,
|
|
4324
|
+
height: anchorHeight,
|
|
4325
|
+
"data-test": "timeline-tooltip-anchor"
|
|
4326
|
+
}
|
|
4327
|
+
), /* @__PURE__ */ react_default.createElement(
|
|
4328
|
+
Popover_default,
|
|
4044
4329
|
{
|
|
4045
4330
|
"data-test": "timeline-tooltip",
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4331
|
+
open,
|
|
4332
|
+
anchor: anchorEl,
|
|
4333
|
+
defaultPlacement: preferredPlacement,
|
|
4334
|
+
outerRef: applyOuterPopoverStyles,
|
|
4335
|
+
pointTo,
|
|
4336
|
+
repositionMode: "flip",
|
|
4337
|
+
style: POPOVER_STYLE
|
|
4051
4338
|
},
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
)
|
|
4055
|
-
);
|
|
4339
|
+
/* @__PURE__ */ react_default.createElement(TooltipContainer, null, /* @__PURE__ */ react_default.createElement(TooltipTable, null, /* @__PURE__ */ react_default.createElement("tbody", null, tooltipRows.map(([key, value]) => /* @__PURE__ */ react_default.createElement("tr", { key }, /* @__PURE__ */ react_default.createElement(TooltipLabel, null, key.charAt(0).toUpperCase() + key.slice(1)), /* @__PURE__ */ react_default.createElement(TooltipValue, null, value))))))
|
|
4340
|
+
));
|
|
4056
4341
|
};
|
|
4057
4342
|
var TimelineTooltip_default = TimelineTooltip;
|
|
4058
4343
|
|
|
@@ -4066,18 +4351,66 @@ __reExport(uPlot_min_exports, require("uplot/dist/uPlot.min.css"));
|
|
|
4066
4351
|
var uPlot_min_default = "default" in defaultImport41 ? defaultImport41.default : defaultImport41;
|
|
4067
4352
|
|
|
4068
4353
|
// src/Timeline/PureTimeline/src/TimelineUplot.tsx
|
|
4354
|
+
var TIMELINE_CONTAINER_PADDING = 10;
|
|
4355
|
+
var BOTTOM_LEGEND_SCROLLBAR_GAP = 8;
|
|
4356
|
+
var LANE_HEIGHT = 32;
|
|
4357
|
+
var SCROLLBAR_GUTTER_WIDTH2 = 24;
|
|
4358
|
+
var RIGHT_LEGEND_FOOTPRINT = 88;
|
|
4359
|
+
var getTimelineLayout = ({
|
|
4360
|
+
width,
|
|
4361
|
+
height,
|
|
4362
|
+
yAxisLabelWidth,
|
|
4363
|
+
laneCount,
|
|
4364
|
+
showLegend = false,
|
|
4365
|
+
legendDisplay
|
|
4366
|
+
}) => {
|
|
4367
|
+
const laneBandHeight = LANE_HEIGHT * laneCount;
|
|
4368
|
+
const chartHeight = laneBandHeight + X_AXIS_HEIGHT;
|
|
4369
|
+
const visibleTimelineHeight = Math.max(0, height - TIMELINE_CONTAINER_PADDING * 2);
|
|
4370
|
+
const bottomLegendReservedHeight = showLegend && legendDisplay === "bottom" ? BOTTOM_LEGEND_SCROLLBAR_GAP + BOTTOM_LEGEND_MIN_HEIGHT : 0;
|
|
4371
|
+
const reserveScrollbarGutter = chartHeight > Math.max(0, visibleTimelineHeight - bottomLegendReservedHeight);
|
|
4372
|
+
const legendWidth = showLegend && legendDisplay === "right" ? RIGHT_LEGEND_FOOTPRINT : 0;
|
|
4373
|
+
const chartWidth = Math.max(
|
|
4374
|
+
1,
|
|
4375
|
+
width - yAxisLabelWidth - legendWidth - TIMELINE_CONTAINER_PADDING * 2 - (reserveScrollbarGutter ? SCROLLBAR_GUTTER_WIDTH2 : 0)
|
|
4376
|
+
);
|
|
4377
|
+
const legendMaxHeight = legendDisplay === "bottom" ? Math.max(
|
|
4378
|
+
BOTTOM_LEGEND_MIN_HEIGHT,
|
|
4379
|
+
visibleTimelineHeight - BOTTOM_LEGEND_SCROLLBAR_GAP - chartHeight
|
|
4380
|
+
) : visibleTimelineHeight;
|
|
4381
|
+
return {
|
|
4382
|
+
laneBandHeight,
|
|
4383
|
+
chartHeight,
|
|
4384
|
+
chartWidth,
|
|
4385
|
+
reserveScrollbarGutter,
|
|
4386
|
+
legendMaxHeight
|
|
4387
|
+
};
|
|
4388
|
+
};
|
|
4069
4389
|
var TimelineUplotContainer = styled_components_default.div`
|
|
4070
4390
|
display: flex;
|
|
4071
4391
|
flex-direction: ${({ legendDisplay }) => legendDisplay === "bottom" ? "column" : "row"};
|
|
4072
4392
|
width: 100%;
|
|
4073
4393
|
height: 100%;
|
|
4074
|
-
padding:
|
|
4075
|
-
overflow
|
|
4394
|
+
padding: ${TIMELINE_CONTAINER_PADDING}px ${TIMELINE_CONTAINER_PADDING}px;
|
|
4395
|
+
overflow: visible;
|
|
4396
|
+
box-sizing: border-box;
|
|
4397
|
+
position: relative;
|
|
4398
|
+
${({ legendDisplay }) => legendDisplay === "bottom" ? `gap: ${BOTTOM_LEGEND_SCROLLBAR_GAP}px;` : ""}
|
|
4399
|
+
`;
|
|
4400
|
+
var TimelineChartScrollArea = styled_components_default.div`
|
|
4401
|
+
flex: ${({ hasBottomLegend }) => hasBottomLegend ? "0 0 auto" : "1 1 auto"};
|
|
4402
|
+
max-height: ${({ hasBottomLegend }) => hasBottomLegend ? `calc(100% - ${BOTTOM_LEGEND_SCROLLBAR_GAP + BOTTOM_LEGEND_MIN_HEIGHT}px)` : "none"};
|
|
4403
|
+
min-height: 0;
|
|
4404
|
+
min-width: 0;
|
|
4405
|
+
overflow-y: auto;
|
|
4076
4406
|
overflow-x: hidden;
|
|
4407
|
+
box-sizing: border-box;
|
|
4408
|
+
padding-right: ${({ reserveScrollbarGutter }) => reserveScrollbarGutter ? SCROLLBAR_GUTTER_WIDTH2 : 0}px;
|
|
4077
4409
|
`;
|
|
4078
4410
|
var TimelineUplotWrapper = styled_components_default.div`
|
|
4079
4411
|
width: ${({ width }) => `${width}px`};
|
|
4080
4412
|
position: relative;
|
|
4413
|
+
overflow: visible;
|
|
4081
4414
|
`;
|
|
4082
4415
|
var TimelineChartContainer = styled_components_default.div`
|
|
4083
4416
|
display: flex;
|
|
@@ -4087,6 +4420,7 @@ var TimelineChartContainer = styled_components_default.div`
|
|
|
4087
4420
|
var TimelineUplot = ({
|
|
4088
4421
|
backgroundColor,
|
|
4089
4422
|
width,
|
|
4423
|
+
height,
|
|
4090
4424
|
yAxisLabelWidth,
|
|
4091
4425
|
laneSeries,
|
|
4092
4426
|
lanes,
|
|
@@ -4106,30 +4440,36 @@ var TimelineUplot = ({
|
|
|
4106
4440
|
const [isFontLoaded, setIsFontLoaded] = react_exports.useState(false);
|
|
4107
4441
|
const theme = (0, themes_exports.useSplunkTheme)();
|
|
4108
4442
|
const zoom = (0, ZoomContext_exports.useZoomContext)();
|
|
4109
|
-
const fullscreenEl = typeof document
|
|
4443
|
+
const fullscreenEl = typeof document === "undefined" ? null : document.fullscreenElement;
|
|
4110
4444
|
const scaleFactor = fullscreenEl && fullscreenEl.tagName !== "BODY" ? 1 : zoom || 1;
|
|
4111
4445
|
const { version: dprVersion } = (0, visualization_canvas_exports.useDevicePixelRatio)();
|
|
4446
|
+
const scrollContainerRef = react_exports.useRef(null);
|
|
4112
4447
|
const tooltipRef = react_exports.useRef({
|
|
4113
4448
|
visible: false,
|
|
4114
4449
|
x: 0,
|
|
4115
4450
|
y: 0,
|
|
4451
|
+
eventAnchorOffsetX: 0,
|
|
4452
|
+
bounds: null,
|
|
4116
4453
|
overflow: false,
|
|
4117
4454
|
content: {},
|
|
4118
4455
|
meta: {}
|
|
4119
4456
|
});
|
|
4120
|
-
const
|
|
4121
|
-
const
|
|
4122
|
-
const
|
|
4123
|
-
const
|
|
4124
|
-
const
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4457
|
+
const eventStarts = laneSeries.flatMap((lane) => lane.map((dp) => dp.start));
|
|
4458
|
+
const eventEnds = laneSeries.flatMap((lane) => lane.map((dp) => dp.end));
|
|
4459
|
+
const xMin = eventStarts.length ? Math.min(...eventStarts) : 0;
|
|
4460
|
+
const xMax = eventEnds.length ? Math.max(...eventEnds) : 1;
|
|
4461
|
+
const { laneBandHeight, chartHeight, chartWidth, reserveScrollbarGutter, legendMaxHeight } = getTimelineLayout({
|
|
4462
|
+
width,
|
|
4463
|
+
height,
|
|
4464
|
+
yAxisLabelWidth,
|
|
4465
|
+
laneCount: lanes.length,
|
|
4466
|
+
showLegend,
|
|
4467
|
+
legendDisplay
|
|
4468
|
+
});
|
|
4129
4469
|
const granularityMultiplier = convertTickIntervalToMs(tickInterval);
|
|
4130
4470
|
const totalRange = xMax + granularityMultiplier - xMin;
|
|
4131
4471
|
const totalNumberOfTicks = totalRange / granularityMultiplier;
|
|
4132
|
-
const maxNumOfTicks = calculateMaxNumberOfTicks(chartWidth, 50, 10);
|
|
4472
|
+
const maxNumOfTicks = Math.max(1, calculateMaxNumberOfTicks(chartWidth, 50, 10));
|
|
4133
4473
|
const unitsPerTick = Math.ceil(totalNumberOfTicks / maxNumOfTicks);
|
|
4134
4474
|
const numTicks = totalNumberOfTicks / unitsPerTick;
|
|
4135
4475
|
const durationPerTick = granularityMultiplier * unitsPerTick;
|
|
@@ -4193,6 +4533,7 @@ var TimelineUplot = ({
|
|
|
4193
4533
|
setHighlightedLane,
|
|
4194
4534
|
handleEventClick,
|
|
4195
4535
|
tooltipRef,
|
|
4536
|
+
scrollContainerRef,
|
|
4196
4537
|
locale,
|
|
4197
4538
|
scaleFactor
|
|
4198
4539
|
})
|
|
@@ -4221,32 +4562,42 @@ var TimelineUplot = ({
|
|
|
4221
4562
|
setHighlightedLane,
|
|
4222
4563
|
handleEventClick,
|
|
4223
4564
|
tooltipRef,
|
|
4565
|
+
scrollContainerRef,
|
|
4224
4566
|
theme
|
|
4225
4567
|
]
|
|
4226
4568
|
);
|
|
4227
|
-
return /* @__PURE__ */ react_exports.createElement(TimelineUplotContainer, { legendDisplay, "data-test": "timeline-uplot-container" }, /* @__PURE__ */ react_exports.createElement(
|
|
4228
|
-
|
|
4569
|
+
return /* @__PURE__ */ react_exports.createElement(TimelineUplotContainer, { legendDisplay, "data-test": "timeline-uplot-container" }, /* @__PURE__ */ react_exports.createElement(
|
|
4570
|
+
TimelineChartScrollArea,
|
|
4229
4571
|
{
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4572
|
+
ref: scrollContainerRef,
|
|
4573
|
+
"data-test": "timeline-chart-scroll-area",
|
|
4574
|
+
hasBottomLegend: showLegend && legendDisplay === "bottom",
|
|
4575
|
+
reserveScrollbarGutter
|
|
4576
|
+
},
|
|
4577
|
+
/* @__PURE__ */ react_exports.createElement(TimelineChartContainer, { "data-test": "timeline-chart-container" }, /* @__PURE__ */ react_exports.createElement(
|
|
4578
|
+
TimelineYAxis_default,
|
|
4579
|
+
{
|
|
4580
|
+
height: chartHeight,
|
|
4581
|
+
laneHeight: LANE_HEIGHT,
|
|
4582
|
+
lanes,
|
|
4583
|
+
yAxisLabelWidth,
|
|
4584
|
+
backgroundColor,
|
|
4585
|
+
highlightedLane,
|
|
4586
|
+
handleLaneClick
|
|
4587
|
+
}
|
|
4588
|
+
), /* @__PURE__ */ react_exports.createElement(TimelineUplotWrapper, { width: chartWidth }, /* @__PURE__ */ react_exports.createElement(
|
|
4589
|
+
uplot_react_default,
|
|
4590
|
+
{
|
|
4591
|
+
key: `timeline-${dprVersion}-${scaleFactor}`,
|
|
4592
|
+
options: opts,
|
|
4593
|
+
data: [[xMin], ...lanes.map(() => [])]
|
|
4594
|
+
}
|
|
4595
|
+
), /* @__PURE__ */ react_exports.createElement(TimelineTooltip_default, __spreadProps(__spreadValues({}, tooltipRef.current), { scaleFactor }))))
|
|
4596
|
+
), showLegend && /* @__PURE__ */ react_exports.createElement(
|
|
4246
4597
|
TimelineLegend_default,
|
|
4247
4598
|
{
|
|
4248
|
-
height:
|
|
4249
|
-
|
|
4599
|
+
height: laneBandHeight,
|
|
4600
|
+
maxHeight: legendMaxHeight,
|
|
4250
4601
|
yAxisLabelWidth,
|
|
4251
4602
|
backgroundColor,
|
|
4252
4603
|
legendDisplay,
|
|
@@ -4296,6 +4647,15 @@ var PureTimeline = (_a) => {
|
|
|
4296
4647
|
const showLegend = (!dataColors || (dataColors == null ? void 0 : dataColors.length) === 0) && (category == null ? void 0 : category.length) > 0 && (legendDisplay === "right" || legendDisplay === "bottom");
|
|
4297
4648
|
const timezone = react_exports.useContext(TimezoneContext_default);
|
|
4298
4649
|
const theme = (0, themes_exports.useSplunkTheme)();
|
|
4650
|
+
const [containerSize, setContainerSize] = react_exports.useState({
|
|
4651
|
+
width: typeof width === "number" ? width : 0,
|
|
4652
|
+
height: typeof height === "number" ? height : 0
|
|
4653
|
+
});
|
|
4654
|
+
const handleResize = react_exports.useCallback((nextWidth, nextHeight) => {
|
|
4655
|
+
setContainerSize(
|
|
4656
|
+
(current) => current.width === nextWidth && current.height === nextHeight ? current : { width: nextWidth, height: nextHeight }
|
|
4657
|
+
);
|
|
4658
|
+
}, []);
|
|
4299
4659
|
const { laneSeries, lanes, categoricalColors, tickInterval, hasInvalidData } = mapDataToTimeline({
|
|
4300
4660
|
resultLimit,
|
|
4301
4661
|
x,
|
|
@@ -4370,11 +4730,13 @@ var PureTimeline = (_a) => {
|
|
|
4370
4730
|
height,
|
|
4371
4731
|
"data-test-data-colors": JSON.stringify(dataColors)
|
|
4372
4732
|
},
|
|
4733
|
+
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: handleResize }),
|
|
4373
4734
|
/* @__PURE__ */ react_exports.createElement(
|
|
4374
4735
|
TimelineUplot_default,
|
|
4375
4736
|
{
|
|
4376
4737
|
backgroundColor: backgroundColor || theme.backgroundColorPage,
|
|
4377
|
-
width,
|
|
4738
|
+
width: containerSize.width,
|
|
4739
|
+
height: containerSize.height,
|
|
4378
4740
|
lanes,
|
|
4379
4741
|
laneSeries,
|
|
4380
4742
|
yAxisLabelWidth,
|
|
@@ -4397,8 +4759,8 @@ PureTimeline.propTypes = {
|
|
|
4397
4759
|
duration: prop_types_exports.arrayOf(prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number])),
|
|
4398
4760
|
category: prop_types_exports.arrayOf(prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number])),
|
|
4399
4761
|
backgroundColor: prop_types_exports.string,
|
|
4400
|
-
width: prop_types_exports.number,
|
|
4401
|
-
height: prop_types_exports.number,
|
|
4762
|
+
width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
4763
|
+
height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
4402
4764
|
xField: prop_types_exports.string,
|
|
4403
4765
|
yField: prop_types_exports.string,
|
|
4404
4766
|
durationField: prop_types_exports.string,
|
|
@@ -4536,7 +4898,7 @@ var computeVizProps = (_a) => {
|
|
|
4536
4898
|
};
|
|
4537
4899
|
function convertToNumbers(arr) {
|
|
4538
4900
|
return arr.map((item) => {
|
|
4539
|
-
return (0, types_exports.isNumber)(item) ? parseFloat(item) : 0;
|
|
4901
|
+
return (0, types_exports.isNumber)(item) ? Number.parseFloat(item) : 0;
|
|
4540
4902
|
});
|
|
4541
4903
|
}
|
|
4542
4904
|
function normalizeSeriesColors(seriesColors) {
|