@splunk/visualizations 28.5.2 → 28.6.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/Area.d.ts.map +1 -1
- package/Area/areaUtils.d.ts +1 -1
- package/Area/areaUtils.d.ts.map +1 -1
- package/Area/config.d.ts.map +1 -1
- package/Area.config.js +93 -25
- package/Area.config.js.map +3 -3
- package/Area.js +708 -319
- package/Area.js.map +4 -4
- package/Bar/Bar.d.ts.map +1 -1
- package/Bar.config.js +81 -24
- package/Bar.config.js.map +3 -3
- package/Bar.js +528 -297
- package/Bar.js.map +4 -4
- package/Bubble.config.js +80 -23
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +375 -208
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +75 -8
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts +1 -0
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts +12 -25
- package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts +11 -4
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
- package/ChoroplethSvg.js +1133 -253
- package/ChoroplethSvg.js.map +4 -4
- package/Column/Column.d.ts.map +1 -1
- package/Column.config.js +81 -24
- package/Column.config.js.map +3 -3
- package/Column.js +531 -300
- package/Column.js.map +4 -4
- package/Ellipse.config.js +1 -1
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +277 -161
- package/Ellipse.js.map +4 -4
- package/Events/config.d.ts.map +1 -1
- package/Events.config.js +13 -3
- package/Events.config.js.map +2 -2
- package/Events.js +330 -194
- package/Events.js.map +4 -4
- package/FillerGauge/FillerGauge.d.ts.map +1 -1
- package/FillerGauge/config.d.ts.map +1 -1
- package/FillerGauge.config.js +76 -24
- package/FillerGauge.config.js.map +2 -2
- package/FillerGauge.js +512 -271
- package/FillerGauge.js.map +4 -4
- package/Image/config.d.ts.map +1 -1
- package/Image.config.js +7 -0
- package/Image.config.js.map +2 -2
- package/Image.js +282 -149
- package/Image.js.map +4 -4
- package/LICENSE +13 -0
- package/Line/Line.d.ts.map +1 -1
- package/Line/config.d.ts.map +1 -1
- package/Line/lineUtils.d.ts.map +1 -1
- package/Line/mockdata/LineData.d.ts +21 -0
- package/Line/mockdata/LineData.d.ts.map +1 -1
- package/Line.config.js +86 -25
- package/Line.config.js.map +3 -3
- package/Line.js +638 -382
- package/Line.js.map +4 -4
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +47 -73
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts +11 -2
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Graph.d.ts +5 -5
- package/LinkGraph/PureLinkGraph/components/Node.d.ts +2 -2
- package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +2 -2
- package/LinkGraph.js +886 -759
- package/LinkGraph.js.map +4 -4
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/Tooltip.d.ts.map +1 -1
- package/Map/config.d.ts.map +1 -1
- package/Map.config.js +4 -1
- package/Map.config.js.map +2 -2
- package/Map.js +296 -169
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +283 -157
- package/Markdown.js.map +4 -4
- package/MarkerGauge/MarkerGauge.d.ts +1 -47
- package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +22 -68
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/config.d.ts.map +1 -1
- package/MarkerGauge.config.js +75 -23
- package/MarkerGauge.config.js.map +2 -2
- package/MarkerGauge.js +560 -375
- package/MarkerGauge.js.map +4 -4
- package/NetworkGraph/NetworkGraph.d.ts +2 -1
- package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +628 -434
- package/NetworkGraph.js.map +4 -4
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +288 -172
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/Pie.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts +2 -2
- package/Pie.config.js +74 -22
- package/Pie.config.js.map +2 -2
- package/Pie.js +522 -296
- package/Pie.js.map +4 -4
- package/ProcessTree/ProcessTree.d.ts +21 -0
- package/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +32 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts +8 -0
- package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +44 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts +20 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts +20 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +44 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts +23 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/mockdata/data.d.ts +235 -0
- package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +9 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts +36 -0
- package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +80 -0
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -0
- package/ProcessTree/config.d.ts +4 -0
- package/ProcessTree/config.d.ts.map +1 -0
- package/ProcessTree/index.d.ts +3 -0
- package/ProcessTree/index.d.ts.map +1 -0
- package/ProcessTree.config.js +192 -0
- package/ProcessTree.config.js.map +7 -0
- package/ProcessTree.js +5058 -0
- package/ProcessTree.js.map +7 -0
- package/Punchcard/Punchcard.d.ts +1 -5
- package/Punchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/Punchcard.d.ts +28 -32
- package/Punchcard/PurePunchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts +7 -12
- package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts +14 -19
- package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts +22 -27
- package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts +3 -8
- package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts +9 -14
- package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardRow.d.ts.map +1 -1
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +444 -631
- package/Punchcard.js.map +4 -4
- package/Rectangle.config.js +1 -1
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +289 -173
- package/Rectangle.js.map +4 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts +20 -0
- package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts +17 -0
- package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/FontSelector.d.ts +15 -0
- package/RichText/PureRichText/Editor/FontSelector.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/FormatButton.d.ts +23 -0
- package/RichText/PureRichText/Editor/FormatButton.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/editorPanelUtils.d.ts +19 -0
- package/RichText/PureRichText/Editor/editorPanelUtils.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts +11 -0
- package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts +26 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/index.d.ts +9 -0
- package/RichText/PureRichText/Editor/index.d.ts.map +1 -0
- package/RichText/PureRichText/InnerEditor.d.ts +41 -0
- package/RichText/PureRichText/InnerEditor.d.ts.map +1 -0
- package/RichText/PureRichText/PureRichText.d.ts +19 -0
- package/RichText/PureRichText/PureRichText.d.ts.map +1 -0
- package/RichText/PureRichText/PureRichTextContext.d.ts +64 -0
- package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -0
- package/RichText/PureRichText/RichTextStyles.d.ts +25 -0
- package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -0
- package/RichText/PureRichText/activeInstance.d.ts +23 -0
- package/RichText/PureRichText/activeInstance.d.ts.map +1 -0
- package/RichText/PureRichText/config.d.ts +17 -0
- package/RichText/PureRichText/config.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/index.d.ts +12 -0
- package/RichText/PureRichText/hooks/index.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useContentSave.d.ts +25 -0
- package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useContentSync.d.ts +28 -0
- package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts +33 -0
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useEditModeEffect.d.ts +10 -0
- package/RichText/PureRichText/hooks/useEditModeEffect.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts +36 -0
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +33 -0
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts +35 -0
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts +18 -0
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +24 -0
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useRichTextState.d.ts +38 -0
- package/RichText/PureRichText/hooks/useRichTextState.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts +17 -0
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +18 -0
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useTokenMap.d.ts +45 -0
- package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -0
- package/RichText/PureRichText/index.d.ts +16 -0
- package/RichText/PureRichText/index.d.ts.map +1 -0
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts +8 -0
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts.map +1 -0
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts +8 -0
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -0
- package/RichText/PureRichText/types.d.ts +111 -0
- package/RichText/PureRichText/types.d.ts.map +1 -0
- package/RichText/PureRichText/utils/a11yUtils.d.ts +9 -0
- package/RichText/PureRichText/utils/a11yUtils.d.ts.map +1 -0
- package/RichText/PureRichText/utils/fontSize.d.ts +6 -0
- package/RichText/PureRichText/utils/fontSize.d.ts.map +1 -0
- package/RichText/PureRichText/utils/slateUtils.d.ts +99 -0
- package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -0
- package/RichText/RichText.d.ts +17 -0
- package/RichText/RichText.d.ts.map +1 -0
- package/RichText/config.d.ts +4 -0
- package/RichText/config.d.ts.map +1 -0
- package/RichText/index.d.ts +7 -0
- package/RichText/index.d.ts.map +1 -0
- package/RichText.config.js +268 -0
- package/RichText.config.js.map +7 -0
- package/RichText.js +7674 -0
- package/RichText.js.map +7 -0
- package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyNode.d.ts +10 -3
- package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyUtils.d.ts +10 -0
- package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +562 -290
- package/Sankey.js.map +4 -4
- package/Scatter/Scatter.d.ts.map +1 -1
- package/Scatter.config.js +81 -24
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +528 -297
- package/Scatter.js.map +4 -4
- package/SingleValue/SingleValue.d.ts.map +1 -1
- package/SingleValue/config.d.ts.map +1 -1
- package/SingleValue.config.js +76 -24
- package/SingleValue.config.js.map +2 -2
- package/SingleValue.js +534 -314
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
- package/SingleValueIcon/config.d.ts.map +1 -1
- package/SingleValueIcon.config.js +76 -24
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +512 -287
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
- package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
- package/SingleValueRadial/config.d.ts.map +1 -1
- package/SingleValueRadial.config.js +76 -24
- package/SingleValueRadial.config.js.map +2 -2
- package/SingleValueRadial.js +543 -326
- package/SingleValueRadial.js.map +4 -4
- package/TRELLIS.md +48 -0
- package/Table/PureTable.d.ts +1 -0
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/Table.d.ts.map +1 -1
- package/Table/cells/ArrayCell.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts.map +1 -1
- package/Table/tableUtils.d.ts +14 -0
- package/Table/tableUtils.d.ts.map +1 -0
- package/Table.config.js +4 -10
- package/Table.config.js.map +2 -2
- package/Table.js +769 -355
- package/Table.js.map +4 -4
- package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +5 -0
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
- package/Timeline/Timeline.d.ts +2 -0
- package/Timeline/Timeline.d.ts.map +1 -1
- package/Timeline/config.d.ts.map +1 -1
- package/Timeline/mockdata/timelineDataSource.d.ts +34 -0
- package/Timeline/mockdata/timelineDataSource.d.ts.map +1 -1
- package/Timeline.config.js +15 -0
- package/Timeline.config.js.map +2 -2
- package/Timeline.js +348 -186
- package/Timeline.js.map +4 -4
- package/common/Charting.d.ts.map +1 -1
- package/common/Charting.js +50 -28
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.d.ts +1 -1
- package/common/ChartingApi.d.ts.map +1 -1
- package/common/ChartingApi.js.map +2 -2
- package/common/DocExampleWithVizSandbox.js.map +1 -1
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.d.ts +1 -1
- package/common/SplunkVisualization.d.ts.map +1 -1
- package/common/SplunkVisualization.js +6 -4
- package/common/SplunkVisualization.js.map +2 -2
- package/common/StyledSkipLink.d.ts +2 -0
- package/common/StyledSkipLink.d.ts.map +1 -0
- package/common/StyledSkipLink.js +81 -0
- package/common/StyledSkipLink.js.map +7 -0
- package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
- package/common/TimeSeriesChartWrapper.js +228 -107
- package/common/TimeSeriesChartWrapper.js.map +4 -4
- package/common/chartingUtils.d.ts +32 -6
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +166 -39
- package/common/chartingUtils.js.map +4 -4
- package/common/components/TrellisTitle.d.ts.map +1 -1
- package/common/docUtils.js +1 -1
- package/common/docUtils.js.map +2 -2
- package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
- package/common/editorConfig/AxesChartYGridAndLabels.d.ts.map +1 -1
- package/common/editorConfig/BackgroundColor.d.ts +2 -2
- package/common/editorConfig/TrellisEditors.d.ts +33 -5
- package/common/editorConfig/TrellisEditors.d.ts.map +1 -1
- package/common/hocs/mockdata/trellisData.d.ts +54 -0
- package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
- package/common/hocs/withTrellis.d.ts +9 -0
- package/common/hocs/withTrellis.d.ts.map +1 -1
- package/common/hooks/useSorting.d.ts +2 -2
- package/common/hooks/useSorting.d.ts.map +1 -1
- package/common/shapeUtils.d.ts +1 -1
- package/common/shapeUtils.d.ts.map +1 -1
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/dataUtils.js +2 -1
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/focusUtils.d.ts +4 -0
- package/common/utils/focusUtils.d.ts.map +1 -0
- package/common/utils/focusUtils.js +101 -0
- package/common/utils/focusUtils.js.map +7 -0
- package/common/utils/mapUtils.js +2 -6
- package/common/utils/mapUtils.js.map +2 -2
- package/common/utils/singleValueUtils.js +14 -26
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/trellisUtils.d.ts.map +1 -1
- package/common/utils/trellisUtils.js +76 -70
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +276 -151
- package/common/withDashboardViz.js.map +4 -4
- package/package.json +32 -27
- package/LICENSE.md +0 -449
package/Sankey.js
CHANGED
|
@@ -12,6 +12,7 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
12
12
|
var __getProtoOf = Object.getPrototypeOf;
|
|
13
13
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
14
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __pow = Math.pow;
|
|
15
16
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
17
|
var __spreadValues = (a, b) => {
|
|
17
18
|
for (var prop in b || (b = {}))
|
|
@@ -59,6 +60,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
59
60
|
mod
|
|
60
61
|
));
|
|
61
62
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
63
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
62
64
|
|
|
63
65
|
// src/Sankey/index.ts
|
|
64
66
|
var Sankey_exports = {};
|
|
@@ -229,7 +231,7 @@ var DefaultVizActionHandler = class {
|
|
|
229
231
|
var INITIAL_HEIGHT = 250;
|
|
230
232
|
var SplunkVisualization = class {
|
|
231
233
|
};
|
|
232
|
-
SplunkVisualization
|
|
234
|
+
__publicField(SplunkVisualization, "propTypes", {
|
|
233
235
|
/**
|
|
234
236
|
* display mode
|
|
235
237
|
*/
|
|
@@ -305,11 +307,11 @@ SplunkVisualization.propTypes = {
|
|
|
305
307
|
* A callback to request new data with updated request params
|
|
306
308
|
*/
|
|
307
309
|
onRequestParamsChange: prop_types_exports.func
|
|
308
|
-
};
|
|
310
|
+
});
|
|
309
311
|
/**
|
|
310
312
|
*
|
|
311
313
|
*/
|
|
312
|
-
SplunkVisualization
|
|
314
|
+
__publicField(SplunkVisualization, "defaults", {
|
|
313
315
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
314
316
|
width: "100%",
|
|
315
317
|
height: INITIAL_HEIGHT,
|
|
@@ -324,7 +326,7 @@ SplunkVisualization.defaults = {
|
|
|
324
326
|
onComputedProps: () => ({}),
|
|
325
327
|
loading: false,
|
|
326
328
|
onRequestParamsChange: lodash_exports.noop
|
|
327
|
-
};
|
|
329
|
+
});
|
|
328
330
|
var SplunkVisualization_default = SplunkVisualization;
|
|
329
331
|
|
|
330
332
|
// src/common/interfaces/DataSource.ts
|
|
@@ -378,9 +380,9 @@ var usePaginationParams = ({
|
|
|
378
380
|
meta,
|
|
379
381
|
onRequestParamsChange
|
|
380
382
|
}) => {
|
|
381
|
-
const totalCount = meta
|
|
382
|
-
const offset = requestParams
|
|
383
|
-
const count = requestParams
|
|
383
|
+
const totalCount = (meta == null ? void 0 : meta.totalCount) || 0;
|
|
384
|
+
const offset = (requestParams == null ? void 0 : requestParams.offset) || 0;
|
|
385
|
+
const count = requestParams == null ? void 0 : requestParams.count;
|
|
384
386
|
const totalPages = typeof count === "number" && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
385
387
|
const current = typeof count === "number" && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
386
388
|
const isPaging = totalPages > 1 && typeof onRequestParamsChange === "function";
|
|
@@ -497,7 +499,7 @@ var Cover = styled_components_default.div`
|
|
|
497
499
|
bottom: 0;
|
|
498
500
|
`;
|
|
499
501
|
var Blocker = styled_components_default.div.attrs({
|
|
500
|
-
"data-splunk-visualization-version": "28.
|
|
502
|
+
"data-splunk-visualization-version": "28.6.0 - 92427899a"
|
|
501
503
|
})`
|
|
502
504
|
position: relative;
|
|
503
505
|
width: 100%;
|
|
@@ -587,7 +589,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
587
589
|
FixSizeItem,
|
|
588
590
|
{
|
|
589
591
|
"data-test": "fix-size-item",
|
|
590
|
-
"data-splunk-visualization-version": "28.
|
|
592
|
+
"data-splunk-visualization-version": "28.6.0 - 92427899a",
|
|
591
593
|
width,
|
|
592
594
|
height,
|
|
593
595
|
backgroundColor
|
|
@@ -1128,6 +1130,24 @@ var defaultImport26 = __toESM(require("@splunk/react-icons/Triangle"));
|
|
|
1128
1130
|
__reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
|
|
1129
1131
|
var Triangle_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
|
|
1130
1132
|
|
|
1133
|
+
// esm-externals:@splunk/visualizations-shared/propUtils
|
|
1134
|
+
var propUtils_exports = {};
|
|
1135
|
+
__export(propUtils_exports, {
|
|
1136
|
+
default: () => propUtils_default
|
|
1137
|
+
});
|
|
1138
|
+
var defaultImport27 = __toESM(require("@splunk/visualizations-shared/propUtils"));
|
|
1139
|
+
__reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
|
|
1140
|
+
var propUtils_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
|
|
1141
|
+
|
|
1142
|
+
// esm-externals:@splunk/visualizations-shared/simpleXMLOptions
|
|
1143
|
+
var simpleXMLOptions_exports = {};
|
|
1144
|
+
__export(simpleXMLOptions_exports, {
|
|
1145
|
+
default: () => simpleXMLOptions_default
|
|
1146
|
+
});
|
|
1147
|
+
var defaultImport28 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1148
|
+
__reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1149
|
+
var simpleXMLOptions_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
1150
|
+
|
|
1131
1151
|
// src/common/chartingUtils.ts
|
|
1132
1152
|
var DEFAULT_LINE_WIDTH = 2;
|
|
1133
1153
|
var getAnnotationsForCanvas = ({
|
|
@@ -1165,9 +1185,9 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
|
1165
1185
|
const xAxisIsTime = xField === "_time";
|
|
1166
1186
|
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1167
1187
|
};
|
|
1168
|
-
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
1188
|
+
var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
|
|
1169
1189
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1170
|
-
return canvasSupportedTimeSeriesCharts.
|
|
1190
|
+
return canvasSupportedTimeSeriesCharts.includes(vizConfigKey);
|
|
1171
1191
|
};
|
|
1172
1192
|
var filterChartDataFromInternalFields = (chartData) => {
|
|
1173
1193
|
const { fields, columns } = chartData;
|
|
@@ -1322,46 +1342,66 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
|
|
|
1322
1342
|
}
|
|
1323
1343
|
return y2Config;
|
|
1324
1344
|
};
|
|
1325
|
-
var
|
|
1345
|
+
var getSeriesType = (isOverlay, isAreaChart, isStacked) => {
|
|
1346
|
+
if (isOverlay) return "line";
|
|
1347
|
+
if (!isAreaChart) return void 0;
|
|
1348
|
+
return isStacked ? "stacked-area" : "area";
|
|
1349
|
+
};
|
|
1350
|
+
var getY2Scale = (field, y2fields, overlayFields) => {
|
|
1351
|
+
const assignToY2 = (y2fields == null ? void 0 : y2fields.length) > 0 && y2fields.includes(field) || !(y2fields == null ? void 0 : y2fields.length) && (overlayFields == null ? void 0 : overlayFields.includes(field));
|
|
1352
|
+
return assignToY2 ? "y2" : "y";
|
|
1353
|
+
};
|
|
1354
|
+
var getSeriesOverrides = (opts) => {
|
|
1355
|
+
var _a;
|
|
1356
|
+
const {
|
|
1357
|
+
yfields,
|
|
1358
|
+
y2fields,
|
|
1359
|
+
lineWidth,
|
|
1360
|
+
overlayFields,
|
|
1361
|
+
y2Enabled,
|
|
1362
|
+
nullValueMode,
|
|
1363
|
+
markerDisplay,
|
|
1364
|
+
lineDashStyle,
|
|
1365
|
+
lineDashStylesByField,
|
|
1366
|
+
stepPosition,
|
|
1367
|
+
stepPositionsByField,
|
|
1368
|
+
type,
|
|
1369
|
+
stackMode,
|
|
1370
|
+
showLines
|
|
1371
|
+
} = opts;
|
|
1326
1372
|
const seriesConfig = {};
|
|
1327
1373
|
let spanGaps;
|
|
1328
|
-
let replaceNullsWithZero;
|
|
1329
1374
|
if (nullValueMode === "gaps") {
|
|
1330
1375
|
spanGaps = false;
|
|
1331
|
-
} else if (nullValueMode
|
|
1376
|
+
} else if (nullValueMode != null) {
|
|
1332
1377
|
spanGaps = true;
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}
|
|
1378
|
+
} else {
|
|
1379
|
+
spanGaps = void 0;
|
|
1336
1380
|
}
|
|
1337
|
-
|
|
1381
|
+
const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
|
|
1382
|
+
const isAreaChart = type === "area";
|
|
1383
|
+
const isStacked = isAreaChart && (stackMode === "stacked" || stackMode === "stacked100");
|
|
1384
|
+
const areaFields = isAreaChart ? yfields.filter((f) => !(overlayFields == null ? void 0 : overlayFields.includes(f))) : yfields;
|
|
1385
|
+
const overlayFieldsInOrder = (_a = overlayFields == null ? void 0 : overlayFields.filter((f) => yfields.includes(f))) != null ? _a : [];
|
|
1386
|
+
const orderedFields = isAreaChart ? [...areaFields, ...overlayFieldsInOrder] : yfields;
|
|
1387
|
+
orderedFields.forEach((field) => {
|
|
1388
|
+
var _a2;
|
|
1389
|
+
const isOverlay = (_a2 = overlayFields == null ? void 0 : overlayFields.includes(field)) != null ? _a2 : false;
|
|
1390
|
+
const isPercent = isAreaChart && stackMode === "stacked100" && !isOverlay;
|
|
1391
|
+
const shouldHideAreaOutline = isAreaChart && showLines === false && !isOverlay;
|
|
1338
1392
|
seriesConfig[field] = {
|
|
1339
|
-
overrides: {
|
|
1393
|
+
overrides: __spreadValues({
|
|
1394
|
+
width: shouldHideAreaOutline ? 0 : lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH
|
|
1395
|
+
}, isPercent ? { stacking: { mode: "percent", group: "A" } } : {})
|
|
1340
1396
|
};
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
if (y2Enabled)
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
);
|
|
1350
|
-
if (shouldAssignToY2) {
|
|
1351
|
-
seriesConfig[field].overrides.scale = "y2";
|
|
1352
|
-
} else {
|
|
1353
|
-
seriesConfig[field].overrides.scale = "y";
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
1357
|
-
seriesConfig[field].type = "line";
|
|
1358
|
-
}
|
|
1359
|
-
if (markerDisplay !== void 0) {
|
|
1360
|
-
seriesConfig[field].markerDisplay = markerDisplay;
|
|
1361
|
-
}
|
|
1362
|
-
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1363
|
-
if (fieldDashStyle) {
|
|
1364
|
-
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1397
|
+
const seriesType = getSeriesType(isOverlay, isAreaChart, isStacked);
|
|
1398
|
+
if (seriesType !== void 0) seriesConfig[field].type = seriesType;
|
|
1399
|
+
if (spanGaps !== void 0) seriesConfig[field].overrides.spanGaps = spanGaps;
|
|
1400
|
+
if (y2Enabled) seriesConfig[field].overrides.scale = getY2Scale(field, y2fields, overlayFields);
|
|
1401
|
+
if (markerDisplay !== void 0) seriesConfig[field].markerDisplay = markerDisplay;
|
|
1402
|
+
if (!isAreaChart || isOverlay) {
|
|
1403
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1404
|
+
if (fieldDashStyle) seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1365
1405
|
}
|
|
1366
1406
|
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
1367
1407
|
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
@@ -1409,9 +1449,9 @@ var visualization_schemas_exports = {};
|
|
|
1409
1449
|
__export(visualization_schemas_exports, {
|
|
1410
1450
|
default: () => visualization_schemas_default
|
|
1411
1451
|
});
|
|
1412
|
-
var
|
|
1452
|
+
var defaultImport29 = __toESM(require("@splunk/visualization-schemas"));
|
|
1413
1453
|
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
1414
|
-
var visualization_schemas_default = "default" in
|
|
1454
|
+
var visualization_schemas_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
1415
1455
|
|
|
1416
1456
|
// src/common/hooks/useTrellisEnabled.ts
|
|
1417
1457
|
var useTrellisFeatureFlagOn = () => {
|
|
@@ -1441,8 +1481,27 @@ var TrellisTitleDiv = styled_components_default.div`
|
|
|
1441
1481
|
background-color: ${(props) => props.backgroundColor};
|
|
1442
1482
|
box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
|
|
1443
1483
|
`;
|
|
1484
|
+
var formatTrellisKey = (value) => {
|
|
1485
|
+
if (value === null || value === void 0) {
|
|
1486
|
+
return "";
|
|
1487
|
+
}
|
|
1488
|
+
if (typeof value === "string") {
|
|
1489
|
+
return value;
|
|
1490
|
+
}
|
|
1491
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
1492
|
+
return value.toString();
|
|
1493
|
+
}
|
|
1494
|
+
if (typeof value === "symbol") {
|
|
1495
|
+
return value.toString();
|
|
1496
|
+
}
|
|
1497
|
+
try {
|
|
1498
|
+
return JSON.stringify(value);
|
|
1499
|
+
} catch (e) {
|
|
1500
|
+
return typeof value === "bigint" ? value.toString() : "";
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1444
1503
|
var TrellisTitle = (props) => {
|
|
1445
|
-
const titleText =
|
|
1504
|
+
const titleText = formatTrellisKey(props.trellisKey);
|
|
1446
1505
|
return /* @__PURE__ */ react_exports.createElement(
|
|
1447
1506
|
TrellisTitleDiv,
|
|
1448
1507
|
{
|
|
@@ -1578,6 +1637,38 @@ var parseArrayOption = (value) => {
|
|
|
1578
1637
|
}
|
|
1579
1638
|
return void 0;
|
|
1580
1639
|
};
|
|
1640
|
+
var getAreaOpacityForCanvas = (areaOpacity) => (
|
|
1641
|
+
// Preserve legacy visualizations behavior where area opacity is squared to match charting output.
|
|
1642
|
+
areaOpacity !== void 0 && areaOpacity !== null ? __pow(areaOpacity, 2) : areaOpacity
|
|
1643
|
+
);
|
|
1644
|
+
var parseTickIntervalOption = (simpleXMLValue, canvasValue) => {
|
|
1645
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
1646
|
+
if (canvasValue) return Number(canvasValue);
|
|
1647
|
+
return void 0;
|
|
1648
|
+
};
|
|
1649
|
+
var getYAxisTitles = ({
|
|
1650
|
+
y2Enabled,
|
|
1651
|
+
yFields,
|
|
1652
|
+
y2Fields,
|
|
1653
|
+
overlayFields,
|
|
1654
|
+
yAxisTitleText,
|
|
1655
|
+
yAxisTitleVisibility,
|
|
1656
|
+
y2AxisTitleText,
|
|
1657
|
+
y2AxisTitleVisibility,
|
|
1658
|
+
containerHeight
|
|
1659
|
+
}) => {
|
|
1660
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
1661
|
+
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
1662
|
+
const yAxisTitle = ellipsisAxisTitle(
|
|
1663
|
+
getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility),
|
|
1664
|
+
containerHeight
|
|
1665
|
+
);
|
|
1666
|
+
const y2AxisTitle = ellipsisAxisTitle(
|
|
1667
|
+
getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility),
|
|
1668
|
+
containerHeight
|
|
1669
|
+
);
|
|
1670
|
+
return { yAxisTitle, y2AxisTitle };
|
|
1671
|
+
};
|
|
1581
1672
|
var TimeSeriesChartWrapper = (props) => {
|
|
1582
1673
|
var _b, _c, _d;
|
|
1583
1674
|
const _a = props, {
|
|
@@ -1667,6 +1758,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1667
1758
|
"chart.overlayFields": overlayFieldsStr,
|
|
1668
1759
|
"chart.nullValueMode": nullValueMode,
|
|
1669
1760
|
"chart.showDataLabels": showDataLabels,
|
|
1761
|
+
"chart.showLines": showLines,
|
|
1762
|
+
"chart.stackMode": stackMode,
|
|
1670
1763
|
lineWidth,
|
|
1671
1764
|
lineDashStyle,
|
|
1672
1765
|
fieldDashStyles: lineDashStylesByFieldStr,
|
|
@@ -1695,7 +1788,10 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1695
1788
|
yAxisMinorTickSize,
|
|
1696
1789
|
y2AxisMinorTickSize,
|
|
1697
1790
|
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
1698
|
-
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
1791
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions,
|
|
1792
|
+
// area only props
|
|
1793
|
+
areaFillOpacity: areaOpacity,
|
|
1794
|
+
chart: chartType
|
|
1699
1795
|
} = options;
|
|
1700
1796
|
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
1701
1797
|
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
@@ -1712,13 +1808,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1712
1808
|
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
1713
1809
|
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
1714
1810
|
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
1721
|
-
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
1811
|
+
const yAxisMajorTickIntervalNum = parseTickIntervalOption(
|
|
1812
|
+
yAxisMajorUnitFromSimpleXML,
|
|
1813
|
+
yAxisMajorTickInterval
|
|
1814
|
+
);
|
|
1815
|
+
const y2AxisMajorTickIntervalNum = parseTickIntervalOption(
|
|
1722
1816
|
y2AxisMajorUnitFromSimpleXML,
|
|
1723
1817
|
y2AxisMajorTickInterval
|
|
1724
1818
|
);
|
|
@@ -1727,6 +1821,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1727
1821
|
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
1728
1822
|
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
1729
1823
|
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
1824
|
+
const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
|
|
1730
1825
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
1731
1826
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
1732
1827
|
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
@@ -1757,26 +1852,40 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1757
1852
|
);
|
|
1758
1853
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
1759
1854
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1855
|
+
const { yAxisTitle, y2AxisTitle } = getYAxisTitles({
|
|
1856
|
+
y2Enabled,
|
|
1857
|
+
yFields,
|
|
1858
|
+
y2Fields,
|
|
1859
|
+
overlayFields,
|
|
1860
|
+
yAxisTitleText,
|
|
1861
|
+
yAxisTitleVisibility,
|
|
1862
|
+
y2AxisTitleText,
|
|
1863
|
+
y2AxisTitleVisibility,
|
|
1864
|
+
containerHeight
|
|
1865
|
+
});
|
|
1766
1866
|
const xScaleConfig = (0, react_exports.useMemo)(
|
|
1767
1867
|
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
1768
1868
|
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
1769
1869
|
);
|
|
1870
|
+
const isStacked100 = stackMode === "stacked100";
|
|
1770
1871
|
const yScaleConfig = (0, react_exports.useMemo)(
|
|
1771
|
-
() =>
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1872
|
+
() => {
|
|
1873
|
+
const config2 = getYScaleConfig(
|
|
1874
|
+
yAxisTitle,
|
|
1875
|
+
yAxisAbbreviation,
|
|
1876
|
+
yAxisScale,
|
|
1877
|
+
yAxisLabelVisibility,
|
|
1878
|
+
yAxisMin,
|
|
1879
|
+
yAxisMax
|
|
1880
|
+
);
|
|
1881
|
+
if (isStacked100) {
|
|
1882
|
+
config2.y.tickFmt = (v) => `${Math.round(v * 100)}%`;
|
|
1883
|
+
config2.y.range = () => [0, 1];
|
|
1884
|
+
}
|
|
1885
|
+
return config2;
|
|
1886
|
+
},
|
|
1887
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1888
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax, isStacked100]
|
|
1780
1889
|
);
|
|
1781
1890
|
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
1782
1891
|
if (y2Enabled) {
|
|
@@ -1808,10 +1917,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1808
1917
|
];
|
|
1809
1918
|
chartData.fields = filteredChartData.fields;
|
|
1810
1919
|
chartData.columns = seriesDataFormatted;
|
|
1920
|
+
const normalizedStackMode = stackMode === "stacked" || stackMode === "stacked100" ? stackMode : "auto";
|
|
1811
1921
|
const seriesOverrides = (0, react_exports.useMemo)(
|
|
1812
|
-
() => getSeriesOverrides(
|
|
1813
|
-
yFields,
|
|
1814
|
-
y2Fields,
|
|
1922
|
+
() => getSeriesOverrides({
|
|
1923
|
+
yfields: yFields,
|
|
1924
|
+
y2fields: y2Fields,
|
|
1815
1925
|
lineWidth,
|
|
1816
1926
|
overlayFields,
|
|
1817
1927
|
y2Enabled,
|
|
@@ -1820,8 +1930,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1820
1930
|
lineDashStyle,
|
|
1821
1931
|
lineDashStylesByField,
|
|
1822
1932
|
stepPosition,
|
|
1823
|
-
stepPositionsByField
|
|
1824
|
-
|
|
1933
|
+
stepPositionsByField,
|
|
1934
|
+
type: chartType,
|
|
1935
|
+
stackMode: normalizedStackMode,
|
|
1936
|
+
showLines
|
|
1937
|
+
}),
|
|
1825
1938
|
[
|
|
1826
1939
|
yFields,
|
|
1827
1940
|
y2Fields,
|
|
@@ -1833,7 +1946,10 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1833
1946
|
lineDashStyle,
|
|
1834
1947
|
lineDashStylesByField,
|
|
1835
1948
|
stepPosition,
|
|
1836
|
-
stepPositionsByField
|
|
1949
|
+
stepPositionsByField,
|
|
1950
|
+
chartType,
|
|
1951
|
+
normalizedStackMode,
|
|
1952
|
+
showLines
|
|
1837
1953
|
]
|
|
1838
1954
|
);
|
|
1839
1955
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
@@ -1901,50 +2017,54 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1901
2017
|
react_exports.useEffect(() => {
|
|
1902
2018
|
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
1903
2019
|
}, [additionalTooltipValues]);
|
|
2020
|
+
const handleCrosshairMouseout = react_exports.useCallback(() => {
|
|
2021
|
+
if (onPointMouseOut && lastPayloadRef.current) {
|
|
2022
|
+
onPointMouseOut({
|
|
2023
|
+
type: "point.mouseout",
|
|
2024
|
+
originalEvent: lastOriginalEventRef.current,
|
|
2025
|
+
payload: lastPayloadRef.current
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
previousMouseoverPayloadRef.current = null;
|
|
2029
|
+
}, [onPointMouseOut]);
|
|
1904
2030
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
1905
2031
|
(event) => {
|
|
1906
|
-
if (onPointMouseOver
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
2032
|
+
if (!onPointMouseOver && !onPointMouseOut) {
|
|
2033
|
+
return;
|
|
2034
|
+
}
|
|
2035
|
+
if (!event) {
|
|
2036
|
+
handleCrosshairMouseout();
|
|
2037
|
+
return;
|
|
2038
|
+
}
|
|
2039
|
+
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
2040
|
+
name: event.seriesKey
|
|
2041
|
+
});
|
|
2042
|
+
delete payload.seriesKey;
|
|
2043
|
+
if (event.rowContext) {
|
|
2044
|
+
Object.assign(
|
|
2045
|
+
payload,
|
|
2046
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
2047
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
2048
|
+
return acc;
|
|
2049
|
+
}, {})
|
|
2050
|
+
);
|
|
2051
|
+
}
|
|
2052
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2053
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
lastPayloadRef.current = updatedPayload;
|
|
2057
|
+
lastOriginalEventRef.current = event;
|
|
2058
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
2059
|
+
if (onPointMouseOver) {
|
|
2060
|
+
onPointMouseOver({
|
|
2061
|
+
type: "point.mouseover",
|
|
2062
|
+
originalEvent: event,
|
|
2063
|
+
payload: updatedPayload
|
|
1920
2064
|
});
|
|
1921
|
-
delete payload.seriesKey;
|
|
1922
|
-
if (event.rowContext) {
|
|
1923
|
-
Object.assign(
|
|
1924
|
-
payload,
|
|
1925
|
-
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
1926
|
-
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
1927
|
-
return acc;
|
|
1928
|
-
}, {})
|
|
1929
|
-
);
|
|
1930
|
-
}
|
|
1931
|
-
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1932
|
-
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
1933
|
-
return;
|
|
1934
|
-
}
|
|
1935
|
-
lastPayloadRef.current = updatedPayload;
|
|
1936
|
-
lastOriginalEventRef.current = event;
|
|
1937
|
-
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
1938
|
-
if (onPointMouseOver) {
|
|
1939
|
-
onPointMouseOver({
|
|
1940
|
-
type: "point.mouseover",
|
|
1941
|
-
originalEvent: event,
|
|
1942
|
-
payload: updatedPayload
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
2065
|
}
|
|
1946
2066
|
},
|
|
1947
|
-
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
2067
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy, handleCrosshairMouseout]
|
|
1948
2068
|
);
|
|
1949
2069
|
const dataKey = `${(_b = chartData.columns[0]) == null ? void 0 : _b[0]}-${(_c = chartData.columns[0]) == null ? void 0 : _c[chartData.columns[0].length - 1]}-${(_d = chartData.columns[0]) == null ? void 0 : _d.length}`;
|
|
1950
2070
|
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
@@ -1999,7 +2119,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1999
2119
|
showXAxisLine,
|
|
2000
2120
|
showYAxisLine,
|
|
2001
2121
|
showY2AxisLine,
|
|
2002
|
-
xAxisMaxLabelParts
|
|
2122
|
+
xAxisMaxLabelParts,
|
|
2123
|
+
areaOpacity: areaOpacityForCanvas
|
|
2003
2124
|
}
|
|
2004
2125
|
));
|
|
2005
2126
|
}, [
|
|
@@ -2051,7 +2172,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2051
2172
|
showYAxisLine,
|
|
2052
2173
|
showY2AxisLine,
|
|
2053
2174
|
legendMode,
|
|
2054
|
-
xAxisMaxLabelParts
|
|
2175
|
+
xAxisMaxLabelParts,
|
|
2176
|
+
areaOpacityForCanvas
|
|
2055
2177
|
]);
|
|
2056
2178
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
2057
2179
|
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
@@ -2079,6 +2201,37 @@ var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
|
2079
2201
|
|
|
2080
2202
|
// src/common/withDashboardViz.tsx
|
|
2081
2203
|
var SanitizedTimeSeriesChartWrapper = (0, SanitizeProps_exports.withSanitizedProps)(TimeSeriesChartWrapper_default);
|
|
2204
|
+
var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTrigger) => {
|
|
2205
|
+
const result = {};
|
|
2206
|
+
Object.keys(supportedEvents).forEach((eventName) => {
|
|
2207
|
+
const { parentKeys, payloadKeys } = supportedEvents[eventName];
|
|
2208
|
+
const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
|
|
2209
|
+
let payload = {};
|
|
2210
|
+
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
2211
|
+
payloadKeys.forEach((p) => {
|
|
2212
|
+
payload[p] = evaluatedOptionsToUse[p];
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
result[eventCallbackPropName] = (ev) => {
|
|
2216
|
+
if (ev == null ? void 0 : ev.payload) {
|
|
2217
|
+
payload = __spreadValues({}, ev.payload);
|
|
2218
|
+
}
|
|
2219
|
+
return onEventTrigger({
|
|
2220
|
+
originalEvent: ev,
|
|
2221
|
+
payload,
|
|
2222
|
+
type: eventName
|
|
2223
|
+
});
|
|
2224
|
+
};
|
|
2225
|
+
if (parentKeys) {
|
|
2226
|
+
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
2227
|
+
const newObject = {};
|
|
2228
|
+
newObject[parentKeys[i]] = result[eventCallbackPropName];
|
|
2229
|
+
result[eventCallbackPropName] = newObject;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
});
|
|
2233
|
+
return result;
|
|
2234
|
+
};
|
|
2082
2235
|
var withDashboardViz = (opts) => {
|
|
2083
2236
|
const {
|
|
2084
2237
|
ReactViz,
|
|
@@ -2136,9 +2289,7 @@ var withDashboardViz = (opts) => {
|
|
|
2136
2289
|
const isDownsamplingEnabledByFeatureFlag = Boolean(
|
|
2137
2290
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
|
|
2138
2291
|
);
|
|
2139
|
-
const isTrellisFeatureFlagOn = Boolean(
|
|
2140
|
-
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
2141
|
-
);
|
|
2292
|
+
const isTrellisFeatureFlagOn = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
|
|
2142
2293
|
const isTrellisOn = isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
|
|
2143
2294
|
const isAcceleratedRenderFeatureFlagOn = Boolean(
|
|
2144
2295
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
|
|
@@ -2303,38 +2454,12 @@ var withDashboardViz = (opts) => {
|
|
|
2303
2454
|
}
|
|
2304
2455
|
);
|
|
2305
2456
|
}
|
|
2306
|
-
const eventCallbackProps = {};
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
let payload = {};
|
|
2313
|
-
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
2314
|
-
payloadKeys.forEach((p) => {
|
|
2315
|
-
payload[p] = evaluatedOptionsToUse[p];
|
|
2316
|
-
});
|
|
2317
|
-
}
|
|
2318
|
-
eventCallbackProps[eventCallbackPropName] = (ev) => {
|
|
2319
|
-
if (ev == null ? void 0 : ev.payload) {
|
|
2320
|
-
payload = __spreadValues({}, ev.payload);
|
|
2321
|
-
}
|
|
2322
|
-
return onEventTrigger({
|
|
2323
|
-
originalEvent: ev,
|
|
2324
|
-
payload,
|
|
2325
|
-
type: eventName
|
|
2326
|
-
});
|
|
2327
|
-
};
|
|
2328
|
-
if (parentKeys) {
|
|
2329
|
-
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
2330
|
-
const newObject = {};
|
|
2331
|
-
newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
|
|
2332
|
-
eventCallbackProps[eventCallbackPropName] = newObject;
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
});
|
|
2336
|
-
}
|
|
2337
|
-
const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
2457
|
+
const eventCallbackProps = hasEventHandlers && mode === "view" && vizConfig.supports.includes("events" /* EVENTS */) ? buildEventCallbackProps(vizConfig.events, evaluatedOptionsToUse, onEventTrigger) : {};
|
|
2458
|
+
const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
|
|
2459
|
+
// Align option transformation with the actual renderer selected below.
|
|
2460
|
+
// This prevents canvas-only option preservation from leaking into Highcharts mode.
|
|
2461
|
+
isAcceleratedRenderOn
|
|
2462
|
+
}), eventCallbackProps), {
|
|
2338
2463
|
themeFunc
|
|
2339
2464
|
}));
|
|
2340
2465
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
@@ -2368,36 +2493,36 @@ var visualization_color_palettes_exports = {};
|
|
|
2368
2493
|
__export(visualization_color_palettes_exports, {
|
|
2369
2494
|
default: () => visualization_color_palettes_default
|
|
2370
2495
|
});
|
|
2371
|
-
var
|
|
2496
|
+
var defaultImport30 = __toESM(require("@splunk/visualization-color-palettes"));
|
|
2372
2497
|
__reExport(visualization_color_palettes_exports, require("@splunk/visualization-color-palettes"));
|
|
2373
|
-
var visualization_color_palettes_default = "default" in
|
|
2498
|
+
var visualization_color_palettes_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
|
|
2374
2499
|
|
|
2375
2500
|
// esm-externals:d3-interpolate
|
|
2376
2501
|
var d3_interpolate_exports = {};
|
|
2377
2502
|
__export(d3_interpolate_exports, {
|
|
2378
2503
|
default: () => d3_interpolate_default
|
|
2379
2504
|
});
|
|
2380
|
-
var
|
|
2505
|
+
var defaultImport31 = __toESM(require("d3-interpolate"));
|
|
2381
2506
|
__reExport(d3_interpolate_exports, require("d3-interpolate"));
|
|
2382
|
-
var d3_interpolate_default = "default" in
|
|
2507
|
+
var d3_interpolate_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
|
|
2383
2508
|
|
|
2384
2509
|
// esm-externals:d3-array
|
|
2385
2510
|
var d3_array_exports = {};
|
|
2386
2511
|
__export(d3_array_exports, {
|
|
2387
2512
|
default: () => d3_array_default
|
|
2388
2513
|
});
|
|
2389
|
-
var
|
|
2514
|
+
var defaultImport32 = __toESM(require("d3-array"));
|
|
2390
2515
|
__reExport(d3_array_exports, require("d3-array"));
|
|
2391
|
-
var d3_array_default = "default" in
|
|
2516
|
+
var d3_array_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
|
|
2392
2517
|
|
|
2393
2518
|
// esm-externals:d3-collection
|
|
2394
2519
|
var d3_collection_exports = {};
|
|
2395
2520
|
__export(d3_collection_exports, {
|
|
2396
2521
|
default: () => d3_collection_default
|
|
2397
2522
|
});
|
|
2398
|
-
var
|
|
2523
|
+
var defaultImport33 = __toESM(require("d3-collection"));
|
|
2399
2524
|
__reExport(d3_collection_exports, require("d3-collection"));
|
|
2400
|
-
var d3_collection_default = "default" in
|
|
2525
|
+
var d3_collection_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
|
|
2401
2526
|
|
|
2402
2527
|
// src/Sankey/PureSankey/lib/sankey.js
|
|
2403
2528
|
var d3_sankey = function() {
|
|
@@ -2783,18 +2908,18 @@ var d3_scale_exports = {};
|
|
|
2783
2908
|
__export(d3_scale_exports, {
|
|
2784
2909
|
default: () => d3_scale_default
|
|
2785
2910
|
});
|
|
2786
|
-
var
|
|
2911
|
+
var defaultImport34 = __toESM(require("d3-scale"));
|
|
2787
2912
|
__reExport(d3_scale_exports, require("d3-scale"));
|
|
2788
|
-
var d3_scale_default = "default" in
|
|
2913
|
+
var d3_scale_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
|
|
2789
2914
|
|
|
2790
2915
|
// esm-externals:@splunk/visualization-encoding/utils/types
|
|
2791
2916
|
var types_exports = {};
|
|
2792
2917
|
__export(types_exports, {
|
|
2793
2918
|
default: () => types_default
|
|
2794
2919
|
});
|
|
2795
|
-
var
|
|
2920
|
+
var defaultImport35 = __toESM(require("@splunk/visualization-encoding/utils/types"));
|
|
2796
2921
|
__reExport(types_exports, require("@splunk/visualization-encoding/utils/types"));
|
|
2797
|
-
var types_default = "default" in
|
|
2922
|
+
var types_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
|
|
2798
2923
|
|
|
2799
2924
|
// src/Sankey/PureSankey/SankeyUtils.ts
|
|
2800
2925
|
var insertNodeIfNotExist = (sankeyData, nodeName) => {
|
|
@@ -2820,7 +2945,8 @@ var insertLink = (sankeyData, sourceFieldIdx, targetFieldIdx, linkValue, index)
|
|
|
2820
2945
|
});
|
|
2821
2946
|
};
|
|
2822
2947
|
var getNodesIndex = (sankeyData, nodeName) => {
|
|
2823
|
-
|
|
2948
|
+
var _a;
|
|
2949
|
+
if (!((_a = sankeyData == null ? void 0 : sankeyData.nodes) == null ? void 0 : _a.length)) {
|
|
2824
2950
|
return -1;
|
|
2825
2951
|
}
|
|
2826
2952
|
return sankeyData.nodes.findIndex((node) => node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase());
|
|
@@ -2890,7 +3016,8 @@ var getLinkId = (link) => {
|
|
|
2890
3016
|
return `link-${link.id}`;
|
|
2891
3017
|
};
|
|
2892
3018
|
var getAllNodeNames = (sankeyData) => {
|
|
2893
|
-
|
|
3019
|
+
var _a;
|
|
3020
|
+
if (!((_a = sankeyData == null ? void 0 : sankeyData.nodes) == null ? void 0 : _a.length)) {
|
|
2894
3021
|
return [];
|
|
2895
3022
|
}
|
|
2896
3023
|
return sankeyData.nodes.map((node) => node.name);
|
|
@@ -2931,7 +3058,7 @@ var extractLinkMidPoint = (pathStr) => {
|
|
|
2931
3058
|
};
|
|
2932
3059
|
var getAllConnectedLinks = (links, nodeIdx) => {
|
|
2933
3060
|
const result = { links: [], sourceNodes: [], targetNodes: [] };
|
|
2934
|
-
if (!links
|
|
3061
|
+
if (!(links == null ? void 0 : links.length)) {
|
|
2935
3062
|
return result;
|
|
2936
3063
|
}
|
|
2937
3064
|
links.forEach((link) => {
|
|
@@ -2966,33 +3093,92 @@ var computeAllConnectedLinksToNodes = (nodes, links) => {
|
|
|
2966
3093
|
var checkDigitsOnly = (input) => {
|
|
2967
3094
|
return /^\d+$/.test(input);
|
|
2968
3095
|
};
|
|
2969
|
-
var truncateSVGTextWithEllipsis = (textElement, textString, width) => {
|
|
2970
|
-
if (textElement && textElement.getSubStringLength !== void 0) {
|
|
2971
|
-
textElement.textContent = textString;
|
|
2972
|
-
if (textElement.getSubStringLength(0, textString.length) >= width) {
|
|
2973
|
-
for (let x = textString.length - 3; x > 0; x -= 3) {
|
|
2974
|
-
if (textElement.getSubStringLength(0, x) <= width) {
|
|
2975
|
-
textElement.textContent = `${textString.substring(0, x)}...`;
|
|
2976
|
-
return;
|
|
2977
|
-
}
|
|
2978
|
-
}
|
|
2979
|
-
textElement.textContent = "...";
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
};
|
|
2983
3096
|
var getMaxNode = (nodes) => {
|
|
2984
3097
|
if (!nodes || nodes.length === 0) return void 0;
|
|
2985
3098
|
return nodes.reduce(
|
|
2986
3099
|
(maxNode, currentNode) => currentNode.value > maxNode.value ? currentNode : maxNode
|
|
2987
3100
|
);
|
|
2988
3101
|
};
|
|
3102
|
+
var LABEL_PADDING = 8;
|
|
3103
|
+
var getColumnPositions = (nodes) => {
|
|
3104
|
+
const xSet = /* @__PURE__ */ new Set();
|
|
3105
|
+
nodes.forEach((node) => {
|
|
3106
|
+
xSet.add(Math.round(node.x));
|
|
3107
|
+
});
|
|
3108
|
+
return Array.from(xSet).sort((a, b) => a - b);
|
|
3109
|
+
};
|
|
3110
|
+
var getMaxTextLength = (nodes) => Math.max(...nodes.map((n) => {
|
|
3111
|
+
var _a;
|
|
3112
|
+
return ((_a = n.name) == null ? void 0 : _a.length) || 0;
|
|
3113
|
+
}));
|
|
3114
|
+
var computeColumnGap = (colX, colIdx, columnPositions, nodeWidth, chartWidth) => {
|
|
3115
|
+
const isLeftSide = colX < chartWidth / 2;
|
|
3116
|
+
if (isLeftSide && colIdx < columnPositions.length - 1) {
|
|
3117
|
+
const gapWidth = columnPositions[colIdx + 1] - (colX + nodeWidth);
|
|
3118
|
+
const sharedGap = columnPositions[colIdx + 1] >= chartWidth / 2;
|
|
3119
|
+
return { gapWidth, sharedGap };
|
|
3120
|
+
}
|
|
3121
|
+
if (isLeftSide) {
|
|
3122
|
+
return { gapWidth: chartWidth - colX - nodeWidth, sharedGap: false };
|
|
3123
|
+
}
|
|
3124
|
+
if (colIdx > 0) {
|
|
3125
|
+
const gapWidth = colX - (columnPositions[colIdx - 1] + nodeWidth);
|
|
3126
|
+
const sharedGap = columnPositions[colIdx - 1] < chartWidth / 2;
|
|
3127
|
+
return { gapWidth, sharedGap };
|
|
3128
|
+
}
|
|
3129
|
+
return { gapWidth: colX, sharedGap: false };
|
|
3130
|
+
};
|
|
3131
|
+
var computeShareRatio = (currentTextLen, adjacentTextLen) => {
|
|
3132
|
+
const totalTextLen = currentTextLen + adjacentTextLen;
|
|
3133
|
+
if (totalTextLen === 0) return 0.5;
|
|
3134
|
+
const ratio = currentTextLen / totalTextLen;
|
|
3135
|
+
if (ratio > 0.5 && 1 - ratio > 0.5) return 0.5;
|
|
3136
|
+
return Math.max(0.3, Math.min(0.7, ratio));
|
|
3137
|
+
};
|
|
3138
|
+
var computeNodeLabelWidths = (nodes, nodeWidth, chartWidth) => {
|
|
3139
|
+
const widthMap = /* @__PURE__ */ new Map();
|
|
3140
|
+
if (!(nodes == null ? void 0 : nodes.length)) return widthMap;
|
|
3141
|
+
const columnPositions = getColumnPositions(nodes);
|
|
3142
|
+
if (columnPositions.length === 0) return widthMap;
|
|
3143
|
+
const columnNodes = /* @__PURE__ */ new Map();
|
|
3144
|
+
nodes.forEach((node) => {
|
|
3145
|
+
const colX = Math.round(node.x);
|
|
3146
|
+
if (!columnNodes.has(colX)) columnNodes.set(colX, []);
|
|
3147
|
+
columnNodes.get(colX).push(node);
|
|
3148
|
+
});
|
|
3149
|
+
columnPositions.forEach((colX, colIdx) => {
|
|
3150
|
+
const isLeftSide = colX < chartWidth / 2;
|
|
3151
|
+
const { gapWidth, sharedGap } = computeColumnGap(
|
|
3152
|
+
colX,
|
|
3153
|
+
colIdx,
|
|
3154
|
+
columnPositions,
|
|
3155
|
+
nodeWidth,
|
|
3156
|
+
chartWidth
|
|
3157
|
+
);
|
|
3158
|
+
let shareRatio = 1;
|
|
3159
|
+
if (sharedGap) {
|
|
3160
|
+
const currentTextLen = getMaxTextLength(columnNodes.get(colX) || []);
|
|
3161
|
+
const adjacentColX = isLeftSide ? columnPositions[colIdx + 1] : columnPositions[colIdx - 1];
|
|
3162
|
+
const adjacentTextLen = getMaxTextLength(columnNodes.get(adjacentColX) || []);
|
|
3163
|
+
shareRatio = computeShareRatio(currentTextLen, adjacentTextLen);
|
|
3164
|
+
}
|
|
3165
|
+
const usableWidth = gapWidth - 2 * LABEL_PADDING;
|
|
3166
|
+
const allocatedWidth = Math.max(0, sharedGap ? usableWidth * shareRatio : usableWidth);
|
|
3167
|
+
const colNodes = columnNodes.get(colX) || [];
|
|
3168
|
+
colNodes.forEach((node) => {
|
|
3169
|
+
widthMap.set(node.index, allocatedWidth);
|
|
3170
|
+
});
|
|
3171
|
+
});
|
|
3172
|
+
return widthMap;
|
|
3173
|
+
};
|
|
2989
3174
|
|
|
2990
3175
|
// src/Sankey/PureSankey/SankeyNode.tsx
|
|
2991
|
-
var MAX_NODE_TEXT_WIDTH = 150;
|
|
2992
3176
|
var NODE_VALUE_PRECISION = 2;
|
|
2993
3177
|
var MIN_NODE_HEIGHT_FOR_LABEL_DISPLAY = 24;
|
|
3178
|
+
var LABEL_LINE_HEIGHT = 16;
|
|
3179
|
+
var MAX_LABEL_LINES = 3;
|
|
2994
3180
|
var getNodeOpacity = (nodeIndex, activeNodes) => {
|
|
2995
|
-
if (!activeNodes
|
|
3181
|
+
if (!(activeNodes == null ? void 0 : activeNodes.length)) {
|
|
2996
3182
|
return DEFAULT_NODE_OPACITY;
|
|
2997
3183
|
}
|
|
2998
3184
|
const isActiveNode = activeNodes.find((node) => node.index === nodeIndex);
|
|
@@ -3011,46 +3197,17 @@ NodeGroup.displayName = "NodeGroup";
|
|
|
3011
3197
|
var NodeRect = styled_components_default.rect`
|
|
3012
3198
|
fill: ${(props) => typeof props.colorCategoryMapping === "function" ? props.colorCategoryMapping(props.node.name) : DEFAULT_NODE_COLOR};
|
|
3013
3199
|
`;
|
|
3014
|
-
var NodeText = styled_components_default.text`
|
|
3015
|
-
text-anchor: ${(props) => props.node.x < props.chartWidth / 2 ? "start" : "end"};
|
|
3016
|
-
font-size: 12px;
|
|
3017
|
-
font-family: ${DEFAULT_FONT_FAMILY};
|
|
3018
|
-
letter-spacing: 0.02em;
|
|
3019
|
-
fill: ${(props) => props.isNodeValue && props.nodeValueColor ? props.nodeValueColor : props.nodeTextColor};
|
|
3020
|
-
opacity: ${(props) => props.isNodeValue ? "82%" : "100%"};
|
|
3021
|
-
`;
|
|
3022
3200
|
var SankeyNode = ({
|
|
3023
3201
|
node,
|
|
3024
|
-
maxNode,
|
|
3025
3202
|
activeNodes,
|
|
3026
3203
|
nodeWidth,
|
|
3027
|
-
chartWidth,
|
|
3028
3204
|
handleMouseOver = () => {
|
|
3029
3205
|
},
|
|
3030
3206
|
handleMouseLeave = () => {
|
|
3031
3207
|
},
|
|
3032
3208
|
handleNodeClick,
|
|
3033
|
-
colorCategoryMapping
|
|
3034
|
-
nodeTextColor,
|
|
3035
|
-
nodeValueColor,
|
|
3036
|
-
labelDisplay: labelDisplayInput,
|
|
3037
|
-
unit
|
|
3209
|
+
colorCategoryMapping
|
|
3038
3210
|
}) => {
|
|
3039
|
-
const labelDisplay = labelDisplayInput != null ? labelDisplayInput : "off";
|
|
3040
|
-
const nodeTextRef = (0, react_exports.useRef)();
|
|
3041
|
-
const nodeValuePercentRef = (0, react_exports.useRef)();
|
|
3042
|
-
let nodeValueFormatted = "";
|
|
3043
|
-
let nodePercentFormatted = "";
|
|
3044
|
-
if (labelDisplay !== "off" && maxNode) {
|
|
3045
|
-
nodeValueFormatted = (0, numberUtils_exports.formatNumber)(node.value, NODE_VALUE_PRECISION, {
|
|
3046
|
-
useTrendUnits: true
|
|
3047
|
-
});
|
|
3048
|
-
const nodePercent = node.value / maxNode.value * 100;
|
|
3049
|
-
nodePercentFormatted = `${(0, numberUtils_exports.formatNumber)(nodePercent, NODE_VALUE_PRECISION)}%`;
|
|
3050
|
-
}
|
|
3051
|
-
(0, react_exports.useEffect)(() => {
|
|
3052
|
-
truncateSVGTextWithEllipsis(nodeTextRef.current, node.name, MAX_NODE_TEXT_WIDTH);
|
|
3053
|
-
});
|
|
3054
3211
|
const nodeClickHandler = (0, react_exports.useCallback)(() => handleNodeClick(node), [node, handleNodeClick]);
|
|
3055
3212
|
const nodeHeight = getNodeHeight(node);
|
|
3056
3213
|
return /* @__PURE__ */ react_exports.createElement(
|
|
@@ -3064,7 +3221,7 @@ var SankeyNode = ({
|
|
|
3064
3221
|
transform: `translate(${node.x},${node.y})`,
|
|
3065
3222
|
onClick: nodeClickHandler
|
|
3066
3223
|
},
|
|
3067
|
-
/* @__PURE__ */ react_exports.createElement(
|
|
3224
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3068
3225
|
NodeRect,
|
|
3069
3226
|
{
|
|
3070
3227
|
node,
|
|
@@ -3075,37 +3232,116 @@ var SankeyNode = ({
|
|
|
3075
3232
|
onMouseOver: handleMouseOver,
|
|
3076
3233
|
onMouseLeave: handleMouseLeave
|
|
3077
3234
|
}
|
|
3078
|
-
)
|
|
3079
|
-
|
|
3235
|
+
)
|
|
3236
|
+
);
|
|
3237
|
+
};
|
|
3238
|
+
var SankeyNodeLabel = ({
|
|
3239
|
+
node,
|
|
3240
|
+
activeNodes,
|
|
3241
|
+
nodeWidth,
|
|
3242
|
+
chartWidth,
|
|
3243
|
+
availableLabelWidth,
|
|
3244
|
+
nodeTextColor,
|
|
3245
|
+
nodeValueColor,
|
|
3246
|
+
maxNode,
|
|
3247
|
+
labelDisplay: labelDisplayInput,
|
|
3248
|
+
unit
|
|
3249
|
+
}) => {
|
|
3250
|
+
const labelDisplay = labelDisplayInput != null ? labelDisplayInput : "off";
|
|
3251
|
+
let nodeValueFormatted = "";
|
|
3252
|
+
let nodePercentFormatted = "";
|
|
3253
|
+
if (labelDisplay !== "off" && maxNode) {
|
|
3254
|
+
nodeValueFormatted = (0, numberUtils_exports.formatNumber)(node.value, NODE_VALUE_PRECISION, {
|
|
3255
|
+
useTrendUnits: true
|
|
3256
|
+
});
|
|
3257
|
+
const nodePercent = node.value / maxNode.value * 100;
|
|
3258
|
+
nodePercentFormatted = `${(0, numberUtils_exports.formatNumber)(nodePercent, NODE_VALUE_PRECISION)}%`;
|
|
3259
|
+
}
|
|
3260
|
+
const nodeHeight = getNodeHeight(node);
|
|
3261
|
+
const isLeftSide = node.x < chartWidth / 2;
|
|
3262
|
+
const labelWidth = availableLabelWidth != null ? availableLabelWidth : 150;
|
|
3263
|
+
const showValues = labelDisplay !== "off" && nodeHeight >= MIN_NODE_HEIGHT_FOR_LABEL_DISPLAY;
|
|
3264
|
+
const availableHeightForText = Math.max(0, nodeHeight - 2 * LABEL_PADDING);
|
|
3265
|
+
const totalLinesFromHeight = Math.max(1, Math.floor(availableHeightForText / LABEL_LINE_HEIGHT));
|
|
3266
|
+
const totalLinesAvailable = Math.min(MAX_LABEL_LINES + (showValues ? 1 : 0), totalLinesFromHeight);
|
|
3267
|
+
const valueLinesNeeded = showValues ? 1 : 0;
|
|
3268
|
+
const nameLinesAvailable = Math.min(MAX_LABEL_LINES, Math.max(1, totalLinesAvailable - valueLinesNeeded));
|
|
3269
|
+
const contentLines = nameLinesAvailable + (showValues ? 1 : 0);
|
|
3270
|
+
const minContentHeight = contentLines * LABEL_LINE_HEIGHT;
|
|
3271
|
+
const foHeight = Math.max(nodeHeight, minContentHeight);
|
|
3272
|
+
const foY = (nodeHeight - foHeight) / 2;
|
|
3273
|
+
const foX = isLeftSide ? nodeWidth + LABEL_PADDING : -(labelWidth + LABEL_PADDING);
|
|
3274
|
+
const foWidth = Math.max(0, labelWidth);
|
|
3275
|
+
let valueText = "";
|
|
3276
|
+
if (showValues) {
|
|
3277
|
+
if (labelDisplay === "values") valueText = `${unit}${nodeValueFormatted}`;
|
|
3278
|
+
else if (labelDisplay === "percentage") valueText = nodePercentFormatted;
|
|
3279
|
+
else if (labelDisplay === "valuesAndPercentage")
|
|
3280
|
+
valueText = `${nodePercentFormatted} ${unit}${nodeValueFormatted}`;
|
|
3281
|
+
}
|
|
3282
|
+
const textAlign = isLeftSide ? "left" : "right";
|
|
3283
|
+
const baseTextStyle = {
|
|
3284
|
+
fontSize: "12px",
|
|
3285
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
3286
|
+
letterSpacing: "0.02em",
|
|
3287
|
+
lineHeight: `${LABEL_LINE_HEIGHT}px`,
|
|
3288
|
+
margin: 0,
|
|
3289
|
+
padding: 0
|
|
3290
|
+
};
|
|
3291
|
+
if (foWidth <= 0) return null;
|
|
3292
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3293
|
+
"foreignObject",
|
|
3294
|
+
{
|
|
3295
|
+
x: node.x + foX,
|
|
3296
|
+
y: node.y + foY,
|
|
3297
|
+
width: foWidth,
|
|
3298
|
+
height: foHeight,
|
|
3299
|
+
opacity: getNodeOpacity(node.index, activeNodes),
|
|
3300
|
+
style: { pointerEvents: "none", overflow: "visible" }
|
|
3301
|
+
},
|
|
3302
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3303
|
+
"div",
|
|
3080
3304
|
{
|
|
3081
|
-
ref: nodeTextRef,
|
|
3082
|
-
node,
|
|
3083
3305
|
"data-test": `node-text-${node.index}`,
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
{
|
|
3094
|
-
ref: nodeValuePercentRef,
|
|
3095
|
-
node,
|
|
3096
|
-
"data-test": `node-label-${node.index}`,
|
|
3097
|
-
chartWidth,
|
|
3098
|
-
x: node.x < chartWidth / 2 ? 6 + nodeWidth : -6,
|
|
3099
|
-
y: node.dy / 2 + 6.5,
|
|
3100
|
-
dy: ".35em",
|
|
3101
|
-
nodeTextColor,
|
|
3102
|
-
isNodeValue: true,
|
|
3103
|
-
nodeValueColor
|
|
3306
|
+
style: {
|
|
3307
|
+
display: "flex",
|
|
3308
|
+
flexDirection: "column",
|
|
3309
|
+
justifyContent: "center",
|
|
3310
|
+
height: "100%",
|
|
3311
|
+
overflow: "hidden",
|
|
3312
|
+
textAlign,
|
|
3313
|
+
pointerEvents: "none"
|
|
3314
|
+
}
|
|
3104
3315
|
},
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3316
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3317
|
+
"div",
|
|
3318
|
+
{
|
|
3319
|
+
style: __spreadProps(__spreadValues({}, baseTextStyle), {
|
|
3320
|
+
color: nodeTextColor,
|
|
3321
|
+
display: "-webkit-box",
|
|
3322
|
+
WebkitLineClamp: nameLinesAvailable,
|
|
3323
|
+
WebkitBoxOrient: "vertical",
|
|
3324
|
+
overflow: "hidden",
|
|
3325
|
+
wordBreak: "break-word"
|
|
3326
|
+
})
|
|
3327
|
+
},
|
|
3328
|
+
node.name
|
|
3329
|
+
),
|
|
3330
|
+
showValues && /* @__PURE__ */ react_exports.createElement(
|
|
3331
|
+
"div",
|
|
3332
|
+
{
|
|
3333
|
+
"data-test": `node-label-${node.index}`,
|
|
3334
|
+
style: __spreadProps(__spreadValues({}, baseTextStyle), {
|
|
3335
|
+
color: nodeValueColor || nodeTextColor,
|
|
3336
|
+
opacity: 0.82,
|
|
3337
|
+
overflow: "hidden",
|
|
3338
|
+
textOverflow: "ellipsis",
|
|
3339
|
+
whiteSpace: "nowrap"
|
|
3340
|
+
})
|
|
3341
|
+
},
|
|
3342
|
+
valueText
|
|
3343
|
+
)
|
|
3344
|
+
)
|
|
3109
3345
|
);
|
|
3110
3346
|
};
|
|
3111
3347
|
var SankeyNode_default = SankeyNode;
|
|
@@ -3115,10 +3351,10 @@ var getLinkFill = (link, colorCategoryMapping, colorMode) => {
|
|
|
3115
3351
|
if (colorMode === "categorical") {
|
|
3116
3352
|
return colorCategoryMapping ? colorCategoryMapping(link.source.name) : DEFAULT_LINK_COLOR;
|
|
3117
3353
|
}
|
|
3118
|
-
return colorCategoryMapping
|
|
3354
|
+
return (colorCategoryMapping == null ? void 0 : colorCategoryMapping[link.index]) || DEFAULT_LINK_COLOR;
|
|
3119
3355
|
};
|
|
3120
3356
|
var getLinkOpacity = (link, activeLinks, linkOpacity) => {
|
|
3121
|
-
if (!activeLinks
|
|
3357
|
+
if (!(activeLinks == null ? void 0 : activeLinks.length)) {
|
|
3122
3358
|
return linkOpacity;
|
|
3123
3359
|
}
|
|
3124
3360
|
const isActiveLink = activeLinks.find((l) => l.id === link.id);
|
|
@@ -3156,19 +3392,20 @@ var SankeyLink = ({
|
|
|
3156
3392
|
onClick: linkClickHandler,
|
|
3157
3393
|
onMouseOver: handleMouseOver,
|
|
3158
3394
|
onMouseLeave: (ev) => {
|
|
3159
|
-
const relatedTarget = ev.relatedTarget;
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3395
|
+
const relatedTarget = ev.nativeEvent.relatedTarget;
|
|
3396
|
+
if (relatedTarget) {
|
|
3397
|
+
let el = relatedTarget;
|
|
3398
|
+
while (el) {
|
|
3399
|
+
if (el.classList) {
|
|
3400
|
+
const classListStr = Array.from(el.classList).join(" ").toLowerCase();
|
|
3401
|
+
if (classListStr.includes("sankeytooltip") || classListStr.includes("popoverstyles")) {
|
|
3402
|
+
return;
|
|
3403
|
+
}
|
|
3166
3404
|
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
if (!isRelatedTargetPopover) {
|
|
3170
|
-
handleMouseLeave(ev);
|
|
3405
|
+
el = el.parentElement;
|
|
3406
|
+
}
|
|
3171
3407
|
}
|
|
3408
|
+
handleMouseLeave(ev);
|
|
3172
3409
|
}
|
|
3173
3410
|
},
|
|
3174
3411
|
/* @__PURE__ */ react_exports.createElement("path", { d: path(0)(link) }),
|
|
@@ -3184,9 +3421,9 @@ var Popover_exports = {};
|
|
|
3184
3421
|
__export(Popover_exports, {
|
|
3185
3422
|
default: () => Popover_default
|
|
3186
3423
|
});
|
|
3187
|
-
var
|
|
3424
|
+
var defaultImport36 = __toESM(require("@splunk/react-ui/Popover"));
|
|
3188
3425
|
__reExport(Popover_exports, require("@splunk/react-ui/Popover"));
|
|
3189
|
-
var Popover_default = "default" in
|
|
3426
|
+
var Popover_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
|
|
3190
3427
|
|
|
3191
3428
|
// src/Sankey/PureSankey/SankeyTooltip.tsx
|
|
3192
3429
|
var DEFAULT_PLACEMENT = "below";
|
|
@@ -3303,7 +3540,7 @@ var SankeyTooltip = ({
|
|
|
3303
3540
|
},
|
|
3304
3541
|
/* @__PURE__ */ react_exports.createElement(StyledTooltipContainer, { className: "sankeyToolTip" }, /* @__PURE__ */ react_exports.createElement(StyledTooltipRow, { rowColor: tooltipRowColor, "data-test": "main-row" }, /* @__PURE__ */ react_exports.createElement(StyledTooltipLeftCell, { "data-test": "main-row-name" }, /* @__PURE__ */ react_exports.createElement(ColorTile, { node, colorCategoryMapping }), /* @__PURE__ */ react_exports.createElement(NodeValue, null, node == null ? void 0 : node.name)), /* @__PURE__ */ react_exports.createElement(StyledTooltipRightCell, { "data-test": "main-row-value" }, (0, numberUtils_exports.formatNumber)(node == null ? void 0 : node.value, 0, {
|
|
3305
3542
|
useTrendUnits: true
|
|
3306
|
-
}))), showSection(connections, node, "source") && /* @__PURE__ */ react_exports.createElement(StyledTooltipHeader, { headerColor: tooltipHeaderColor }, /* @__PURE__ */ react_exports.createElement(StyledTooltipLeftCell, null, "Source"), /* @__PURE__ */ react_exports.createElement(StyledTooltipRightCell, null, linkValue)), /* @__PURE__ */ react_exports.createElement(StyledTooltipSection, null, connections
|
|
3543
|
+
}))), showSection(connections, node, "source") && /* @__PURE__ */ react_exports.createElement(StyledTooltipHeader, { headerColor: tooltipHeaderColor }, /* @__PURE__ */ react_exports.createElement(StyledTooltipLeftCell, null, "Source"), /* @__PURE__ */ react_exports.createElement(StyledTooltipRightCell, null, linkValue)), /* @__PURE__ */ react_exports.createElement(StyledTooltipSection, null, connections == null ? void 0 : connections.sourceNodes.map((sNode, idx) => {
|
|
3307
3544
|
var _a, _b;
|
|
3308
3545
|
if ((sNode == null ? void 0 : sNode.index) !== (node == null ? void 0 : node.index) || ((_a = connections.sourceNodes[idx]) == null ? void 0 : _a.index) === ((_b = connections.targetNodes[idx]) == null ? void 0 : _b.index)) {
|
|
3309
3546
|
return /* @__PURE__ */ react_exports.createElement(
|
|
@@ -3326,7 +3563,7 @@ var SankeyTooltip = ({
|
|
|
3326
3563
|
);
|
|
3327
3564
|
}
|
|
3328
3565
|
return null;
|
|
3329
|
-
})), showSection(connections, node, "target") && /* @__PURE__ */ react_exports.createElement(StyledTooltipHeader, { headerColor: tooltipHeaderColor }, /* @__PURE__ */ react_exports.createElement(StyledTooltipLeftCell, null, "Target"), /* @__PURE__ */ react_exports.createElement(StyledTooltipRightCell, null, linkValue)), /* @__PURE__ */ react_exports.createElement(StyledTooltipSection, null, connections
|
|
3566
|
+
})), showSection(connections, node, "target") && /* @__PURE__ */ react_exports.createElement(StyledTooltipHeader, { headerColor: tooltipHeaderColor }, /* @__PURE__ */ react_exports.createElement(StyledTooltipLeftCell, null, "Target"), /* @__PURE__ */ react_exports.createElement(StyledTooltipRightCell, null, linkValue)), /* @__PURE__ */ react_exports.createElement(StyledTooltipSection, null, connections == null ? void 0 : connections.targetNodes.map((tNode, idx) => {
|
|
3330
3567
|
var _a, _b;
|
|
3331
3568
|
if ((tNode == null ? void 0 : tNode.index) !== (node == null ? void 0 : node.index) || ((_a = connections.sourceNodes[idx]) == null ? void 0 : _a.index) === ((_b = connections.targetNodes[idx]) == null ? void 0 : _b.index)) {
|
|
3332
3569
|
return /* @__PURE__ */ react_exports.createElement(
|
|
@@ -3460,8 +3697,40 @@ var PureSankey = ({
|
|
|
3460
3697
|
},
|
|
3461
3698
|
[linkValueField, fields, onLinkClick, columns]
|
|
3462
3699
|
);
|
|
3700
|
+
const resetStates = (0, react_exports.useCallback)(() => {
|
|
3701
|
+
setActiveLinks([]);
|
|
3702
|
+
setActiveNodes([]);
|
|
3703
|
+
setHoveredLinkElement(null);
|
|
3704
|
+
setHoveredNodeElement(null);
|
|
3705
|
+
setNodeHovered(null);
|
|
3706
|
+
setOpenLinkToolTip(false);
|
|
3707
|
+
setOpenNodeToolTip(false);
|
|
3708
|
+
}, []);
|
|
3709
|
+
const isInsideTooltip = (0, react_exports.useCallback)((element) => {
|
|
3710
|
+
let el = element;
|
|
3711
|
+
while (el) {
|
|
3712
|
+
if (el.classList) {
|
|
3713
|
+
const classListStr = Array.from(el.classList).join(" ").toLowerCase();
|
|
3714
|
+
if (classListStr.includes("sankeytooltip") || classListStr.includes("popoverstyles")) {
|
|
3715
|
+
return true;
|
|
3716
|
+
}
|
|
3717
|
+
}
|
|
3718
|
+
el = el.parentElement;
|
|
3719
|
+
}
|
|
3720
|
+
return false;
|
|
3721
|
+
}, []);
|
|
3722
|
+
const handleWrapperMouseLeave = (0, react_exports.useCallback)(
|
|
3723
|
+
(ev) => {
|
|
3724
|
+
const relatedTarget = ev.nativeEvent.relatedTarget;
|
|
3725
|
+
if (relatedTarget && isInsideTooltip(relatedTarget)) {
|
|
3726
|
+
return;
|
|
3727
|
+
}
|
|
3728
|
+
resetStates();
|
|
3729
|
+
},
|
|
3730
|
+
[resetStates, isInsideTooltip]
|
|
3731
|
+
);
|
|
3463
3732
|
(0, react_exports.useEffect)(() => {
|
|
3464
|
-
if (sankeyContainerElement
|
|
3733
|
+
if (sankeyContainerElement == null ? void 0 : sankeyContainerElement.current) {
|
|
3465
3734
|
const w = sankeyContainerElement.current.getBoundingClientRect().width;
|
|
3466
3735
|
const h = sankeyContainerElement.current.getBoundingClientRect().height;
|
|
3467
3736
|
const sWidth = checkDigitsOnly(width) ? parseInt(width, 10) : w;
|
|
@@ -3501,17 +3770,8 @@ var PureSankey = ({
|
|
|
3501
3770
|
seriesColors,
|
|
3502
3771
|
linkColors
|
|
3503
3772
|
});
|
|
3504
|
-
const resetStates = () => {
|
|
3505
|
-
setActiveLinks([]);
|
|
3506
|
-
setActiveNodes([]);
|
|
3507
|
-
setHoveredLinkElement(null);
|
|
3508
|
-
setHoveredNodeElement(null);
|
|
3509
|
-
setNodeHovered(null);
|
|
3510
|
-
setOpenLinkToolTip(false);
|
|
3511
|
-
setOpenNodeToolTip(false);
|
|
3512
|
-
};
|
|
3513
3773
|
const maxNode = getMaxNode(sankeyData.nodes);
|
|
3514
|
-
const
|
|
3774
|
+
const nodeLabelWidths = computeNodeLabelWidths(sankeyData.nodes, nodeWidth, sankeyWidth);
|
|
3515
3775
|
const renderLinks = (links) => {
|
|
3516
3776
|
return links.map((link) => /* @__PURE__ */ react_exports.createElement(
|
|
3517
3777
|
SankeyLink_default,
|
|
@@ -3541,17 +3801,11 @@ var PureSankey = ({
|
|
|
3541
3801
|
SankeyNode_default,
|
|
3542
3802
|
{
|
|
3543
3803
|
node,
|
|
3544
|
-
maxNode,
|
|
3545
3804
|
key: getNodeId(node),
|
|
3546
3805
|
"data-test": getNodeId(node),
|
|
3547
3806
|
activeNodes,
|
|
3548
3807
|
nodeWidth,
|
|
3549
|
-
chartWidth,
|
|
3550
3808
|
colorCategoryMapping,
|
|
3551
|
-
labelDisplay,
|
|
3552
|
-
unit,
|
|
3553
|
-
nodeTextColor,
|
|
3554
|
-
nodeValueColor,
|
|
3555
3809
|
handleMouseOver: (ev) => {
|
|
3556
3810
|
const connections = nodeConnectionsMap[node.index];
|
|
3557
3811
|
setActiveLinks(connections.links);
|
|
@@ -3561,11 +3815,29 @@ var PureSankey = ({
|
|
|
3561
3815
|
setOpenLinkToolTip(false);
|
|
3562
3816
|
setOpenNodeToolTip(true);
|
|
3563
3817
|
},
|
|
3564
|
-
handleMouseLeave:
|
|
3818
|
+
handleMouseLeave: handleWrapperMouseLeave,
|
|
3565
3819
|
handleNodeClick
|
|
3566
3820
|
}
|
|
3567
3821
|
));
|
|
3568
3822
|
};
|
|
3823
|
+
const renderNodeLabels = (nodes) => {
|
|
3824
|
+
return nodes.map((node) => /* @__PURE__ */ react_exports.createElement(
|
|
3825
|
+
SankeyNodeLabel,
|
|
3826
|
+
{
|
|
3827
|
+
node,
|
|
3828
|
+
key: `label-${getNodeId(node)}`,
|
|
3829
|
+
activeNodes,
|
|
3830
|
+
nodeWidth,
|
|
3831
|
+
chartWidth: sankeyWidth,
|
|
3832
|
+
availableLabelWidth: nodeLabelWidths.get(node.index),
|
|
3833
|
+
maxNode,
|
|
3834
|
+
labelDisplay,
|
|
3835
|
+
unit,
|
|
3836
|
+
nodeTextColor,
|
|
3837
|
+
nodeValueColor
|
|
3838
|
+
}
|
|
3839
|
+
));
|
|
3840
|
+
};
|
|
3569
3841
|
if (containerWidth < CHART_MIN_WIDTH || containerHeight < CHART_MIN_HEIGHT) {
|
|
3570
3842
|
return /* @__PURE__ */ react_exports.createElement(SankeyContainer, { height, width, ref: sankeyContainerElement }, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), /* @__PURE__ */ react_exports.createElement(
|
|
3571
3843
|
Message_default,
|
|
@@ -3582,7 +3854,7 @@ var PureSankey = ({
|
|
|
3582
3854
|
{
|
|
3583
3855
|
backgroundColor,
|
|
3584
3856
|
dataTestKey: "SankeyWrapper",
|
|
3585
|
-
onMouseLeave:
|
|
3857
|
+
onMouseLeave: handleWrapperMouseLeave
|
|
3586
3858
|
},
|
|
3587
3859
|
/* @__PURE__ */ react_exports.createElement("svg", { height: "100%", width: "100%", "data-test": "sankey-svg" }, /* @__PURE__ */ react_exports.createElement("g", { transform: `translate(${TRANSLATE_POS.x},${TRANSLATE_POS.y})` }, /* @__PURE__ */ react_exports.createElement("g", { className: "link-group", "data-test": "link-group" }, renderLinks(sankeyData.links), openLinkToolTip && /* @__PURE__ */ react_exports.createElement(
|
|
3588
3860
|
SankeyTooltip_default,
|
|
@@ -3618,7 +3890,7 @@ var PureSankey = ({
|
|
|
3618
3890
|
tooltipLinkHeaderColor,
|
|
3619
3891
|
tooltipHeaderColor
|
|
3620
3892
|
}
|
|
3621
|
-
))))
|
|
3893
|
+
)), /* @__PURE__ */ react_exports.createElement("g", { className: "label-group", "data-test": "label-group", pointerEvents: "none" }, renderNodeLabels(sankeyData.nodes))))
|
|
3622
3894
|
));
|
|
3623
3895
|
};
|
|
3624
3896
|
var PureSankey_default = PureSankey;
|
|
@@ -3628,45 +3900,45 @@ var visualization_icons_exports = {};
|
|
|
3628
3900
|
__export(visualization_icons_exports, {
|
|
3629
3901
|
default: () => visualization_icons_default
|
|
3630
3902
|
});
|
|
3631
|
-
var
|
|
3903
|
+
var defaultImport37 = __toESM(require("@splunk/visualization-icons"));
|
|
3632
3904
|
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
3633
|
-
var visualization_icons_default = "default" in
|
|
3905
|
+
var visualization_icons_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
3634
3906
|
|
|
3635
3907
|
// esm-externals:@splunk/visualization-icons/placeholders
|
|
3636
3908
|
var placeholders_exports = {};
|
|
3637
3909
|
__export(placeholders_exports, {
|
|
3638
3910
|
default: () => placeholders_default
|
|
3639
3911
|
});
|
|
3640
|
-
var
|
|
3912
|
+
var defaultImport38 = __toESM(require("@splunk/visualization-icons/placeholders"));
|
|
3641
3913
|
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
3642
|
-
var placeholders_default = "default" in
|
|
3914
|
+
var placeholders_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
|
|
3643
3915
|
|
|
3644
3916
|
// esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
|
|
3645
3917
|
var PresetPalettes_exports = {};
|
|
3646
3918
|
__export(PresetPalettes_exports, {
|
|
3647
3919
|
default: () => PresetPalettes_default
|
|
3648
3920
|
});
|
|
3649
|
-
var
|
|
3921
|
+
var defaultImport39 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
3650
3922
|
__reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
3651
|
-
var PresetPalettes_default = "default" in
|
|
3923
|
+
var PresetPalettes_default = "default" in defaultImport39 ? defaultImport39.default : defaultImport39;
|
|
3652
3924
|
|
|
3653
3925
|
// esm-externals:@splunk/themes
|
|
3654
3926
|
var themes_exports = {};
|
|
3655
3927
|
__export(themes_exports, {
|
|
3656
3928
|
default: () => themes_default
|
|
3657
3929
|
});
|
|
3658
|
-
var
|
|
3930
|
+
var defaultImport40 = __toESM(require("@splunk/themes"));
|
|
3659
3931
|
__reExport(themes_exports, require("@splunk/themes"));
|
|
3660
|
-
var themes_default = "default" in
|
|
3932
|
+
var themes_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
|
|
3661
3933
|
|
|
3662
3934
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
3663
3935
|
var configUtils_exports = {};
|
|
3664
3936
|
__export(configUtils_exports, {
|
|
3665
3937
|
default: () => configUtils_default
|
|
3666
3938
|
});
|
|
3667
|
-
var
|
|
3939
|
+
var defaultImport41 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
3668
3940
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
3669
|
-
var configUtils_default = "default" in
|
|
3941
|
+
var configUtils_default = "default" in defaultImport41 ? defaultImport41.default : defaultImport41;
|
|
3670
3942
|
|
|
3671
3943
|
// src/common/utils/configUtils.ts
|
|
3672
3944
|
function enhanceConfig(vizConfig) {
|
|
@@ -3736,9 +4008,9 @@ var pick_exports = {};
|
|
|
3736
4008
|
__export(pick_exports, {
|
|
3737
4009
|
default: () => pick_default
|
|
3738
4010
|
});
|
|
3739
|
-
var
|
|
4011
|
+
var defaultImport42 = __toESM(require("@splunk/themes/pick"));
|
|
3740
4012
|
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
3741
|
-
var pick_default = "default" in
|
|
4013
|
+
var pick_default = "default" in defaultImport42 ? defaultImport42.default : defaultImport42;
|
|
3742
4014
|
|
|
3743
4015
|
// src/common/ThemedDefaults.tsx
|
|
3744
4016
|
var defaultBackgroundColor = (props) => pick_default({
|