@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/ChoroplethSvg.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/ChoroplethSvg/index.ts
|
|
64
66
|
var ChoroplethSvg_exports = {};
|
|
@@ -237,7 +239,7 @@ var DefaultVizActionHandler = class {
|
|
|
237
239
|
var INITIAL_HEIGHT = 250;
|
|
238
240
|
var SplunkVisualization = class {
|
|
239
241
|
};
|
|
240
|
-
SplunkVisualization
|
|
242
|
+
__publicField(SplunkVisualization, "propTypes", {
|
|
241
243
|
/**
|
|
242
244
|
* display mode
|
|
243
245
|
*/
|
|
@@ -313,11 +315,11 @@ SplunkVisualization.propTypes = {
|
|
|
313
315
|
* A callback to request new data with updated request params
|
|
314
316
|
*/
|
|
315
317
|
onRequestParamsChange: prop_types_exports.func
|
|
316
|
-
};
|
|
318
|
+
});
|
|
317
319
|
/**
|
|
318
320
|
*
|
|
319
321
|
*/
|
|
320
|
-
SplunkVisualization
|
|
322
|
+
__publicField(SplunkVisualization, "defaults", {
|
|
321
323
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
322
324
|
width: "100%",
|
|
323
325
|
height: INITIAL_HEIGHT,
|
|
@@ -332,7 +334,7 @@ SplunkVisualization.defaults = {
|
|
|
332
334
|
onComputedProps: () => ({}),
|
|
333
335
|
loading: false,
|
|
334
336
|
onRequestParamsChange: lodash_exports.noop
|
|
335
|
-
};
|
|
337
|
+
});
|
|
336
338
|
var SplunkVisualization_default = SplunkVisualization;
|
|
337
339
|
|
|
338
340
|
// src/common/interfaces/DataSource.ts
|
|
@@ -386,9 +388,9 @@ var usePaginationParams = ({
|
|
|
386
388
|
meta,
|
|
387
389
|
onRequestParamsChange
|
|
388
390
|
}) => {
|
|
389
|
-
const totalCount = meta
|
|
390
|
-
const offset = requestParams
|
|
391
|
-
const count = requestParams
|
|
391
|
+
const totalCount = (meta == null ? void 0 : meta.totalCount) || 0;
|
|
392
|
+
const offset = (requestParams == null ? void 0 : requestParams.offset) || 0;
|
|
393
|
+
const count = requestParams == null ? void 0 : requestParams.count;
|
|
392
394
|
const totalPages = typeof count === "number" && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
393
395
|
const current = typeof count === "number" && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
394
396
|
const isPaging = totalPages > 1 && typeof onRequestParamsChange === "function";
|
|
@@ -505,7 +507,7 @@ var Cover = styled_components_default.div`
|
|
|
505
507
|
bottom: 0;
|
|
506
508
|
`;
|
|
507
509
|
var Blocker = styled_components_default.div.attrs({
|
|
508
|
-
"data-splunk-visualization-version": "28.
|
|
510
|
+
"data-splunk-visualization-version": "28.6.0 - 92427899a"
|
|
509
511
|
})`
|
|
510
512
|
position: relative;
|
|
511
513
|
width: 100%;
|
|
@@ -604,7 +606,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
604
606
|
FixSizeItem,
|
|
605
607
|
{
|
|
606
608
|
"data-test": "fix-size-item",
|
|
607
|
-
"data-splunk-visualization-version": "28.
|
|
609
|
+
"data-splunk-visualization-version": "28.6.0 - 92427899a",
|
|
608
610
|
width,
|
|
609
611
|
height,
|
|
610
612
|
backgroundColor
|
|
@@ -1145,6 +1147,24 @@ var defaultImport28 = __toESM(require("@splunk/react-icons/Triangle"));
|
|
|
1145
1147
|
__reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
|
|
1146
1148
|
var Triangle_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
1147
1149
|
|
|
1150
|
+
// esm-externals:@splunk/visualizations-shared/propUtils
|
|
1151
|
+
var propUtils_exports = {};
|
|
1152
|
+
__export(propUtils_exports, {
|
|
1153
|
+
default: () => propUtils_default
|
|
1154
|
+
});
|
|
1155
|
+
var defaultImport29 = __toESM(require("@splunk/visualizations-shared/propUtils"));
|
|
1156
|
+
__reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
|
|
1157
|
+
var propUtils_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
1158
|
+
|
|
1159
|
+
// esm-externals:@splunk/visualizations-shared/simpleXMLOptions
|
|
1160
|
+
var simpleXMLOptions_exports = {};
|
|
1161
|
+
__export(simpleXMLOptions_exports, {
|
|
1162
|
+
default: () => simpleXMLOptions_default
|
|
1163
|
+
});
|
|
1164
|
+
var defaultImport30 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1165
|
+
__reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1166
|
+
var simpleXMLOptions_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
|
|
1167
|
+
|
|
1148
1168
|
// src/common/chartingUtils.ts
|
|
1149
1169
|
var DEFAULT_LINE_WIDTH = 2;
|
|
1150
1170
|
var getAnnotationsForCanvas = ({
|
|
@@ -1182,9 +1202,9 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
|
1182
1202
|
const xAxisIsTime = xField === "_time";
|
|
1183
1203
|
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1184
1204
|
};
|
|
1185
|
-
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
1205
|
+
var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
|
|
1186
1206
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1187
|
-
return canvasSupportedTimeSeriesCharts.
|
|
1207
|
+
return canvasSupportedTimeSeriesCharts.includes(vizConfigKey);
|
|
1188
1208
|
};
|
|
1189
1209
|
var filterChartDataFromInternalFields = (chartData) => {
|
|
1190
1210
|
const { fields, columns } = chartData;
|
|
@@ -1339,46 +1359,66 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
|
|
|
1339
1359
|
}
|
|
1340
1360
|
return y2Config;
|
|
1341
1361
|
};
|
|
1342
|
-
var
|
|
1362
|
+
var getSeriesType = (isOverlay, isAreaChart, isStacked) => {
|
|
1363
|
+
if (isOverlay) return "line";
|
|
1364
|
+
if (!isAreaChart) return void 0;
|
|
1365
|
+
return isStacked ? "stacked-area" : "area";
|
|
1366
|
+
};
|
|
1367
|
+
var getY2Scale = (field, y2fields, overlayFields) => {
|
|
1368
|
+
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));
|
|
1369
|
+
return assignToY2 ? "y2" : "y";
|
|
1370
|
+
};
|
|
1371
|
+
var getSeriesOverrides = (opts) => {
|
|
1372
|
+
var _a;
|
|
1373
|
+
const {
|
|
1374
|
+
yfields,
|
|
1375
|
+
y2fields,
|
|
1376
|
+
lineWidth,
|
|
1377
|
+
overlayFields,
|
|
1378
|
+
y2Enabled,
|
|
1379
|
+
nullValueMode,
|
|
1380
|
+
markerDisplay,
|
|
1381
|
+
lineDashStyle,
|
|
1382
|
+
lineDashStylesByField,
|
|
1383
|
+
stepPosition,
|
|
1384
|
+
stepPositionsByField,
|
|
1385
|
+
type,
|
|
1386
|
+
stackMode,
|
|
1387
|
+
showLines
|
|
1388
|
+
} = opts;
|
|
1343
1389
|
const seriesConfig = {};
|
|
1344
1390
|
let spanGaps;
|
|
1345
|
-
let replaceNullsWithZero;
|
|
1346
1391
|
if (nullValueMode === "gaps") {
|
|
1347
1392
|
spanGaps = false;
|
|
1348
|
-
} else if (nullValueMode
|
|
1393
|
+
} else if (nullValueMode != null) {
|
|
1349
1394
|
spanGaps = true;
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
}
|
|
1395
|
+
} else {
|
|
1396
|
+
spanGaps = void 0;
|
|
1353
1397
|
}
|
|
1354
|
-
|
|
1398
|
+
const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
|
|
1399
|
+
const isAreaChart = type === "area";
|
|
1400
|
+
const isStacked = isAreaChart && (stackMode === "stacked" || stackMode === "stacked100");
|
|
1401
|
+
const areaFields = isAreaChart ? yfields.filter((f) => !(overlayFields == null ? void 0 : overlayFields.includes(f))) : yfields;
|
|
1402
|
+
const overlayFieldsInOrder = (_a = overlayFields == null ? void 0 : overlayFields.filter((f) => yfields.includes(f))) != null ? _a : [];
|
|
1403
|
+
const orderedFields = isAreaChart ? [...areaFields, ...overlayFieldsInOrder] : yfields;
|
|
1404
|
+
orderedFields.forEach((field) => {
|
|
1405
|
+
var _a2;
|
|
1406
|
+
const isOverlay = (_a2 = overlayFields == null ? void 0 : overlayFields.includes(field)) != null ? _a2 : false;
|
|
1407
|
+
const isPercent = isAreaChart && stackMode === "stacked100" && !isOverlay;
|
|
1408
|
+
const shouldHideAreaOutline = isAreaChart && showLines === false && !isOverlay;
|
|
1355
1409
|
seriesConfig[field] = {
|
|
1356
|
-
overrides: {
|
|
1410
|
+
overrides: __spreadValues({
|
|
1411
|
+
width: shouldHideAreaOutline ? 0 : lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH
|
|
1412
|
+
}, isPercent ? { stacking: { mode: "percent", group: "A" } } : {})
|
|
1357
1413
|
};
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
if (y2Enabled)
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
);
|
|
1367
|
-
if (shouldAssignToY2) {
|
|
1368
|
-
seriesConfig[field].overrides.scale = "y2";
|
|
1369
|
-
} else {
|
|
1370
|
-
seriesConfig[field].overrides.scale = "y";
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
1374
|
-
seriesConfig[field].type = "line";
|
|
1375
|
-
}
|
|
1376
|
-
if (markerDisplay !== void 0) {
|
|
1377
|
-
seriesConfig[field].markerDisplay = markerDisplay;
|
|
1378
|
-
}
|
|
1379
|
-
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1380
|
-
if (fieldDashStyle) {
|
|
1381
|
-
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1414
|
+
const seriesType = getSeriesType(isOverlay, isAreaChart, isStacked);
|
|
1415
|
+
if (seriesType !== void 0) seriesConfig[field].type = seriesType;
|
|
1416
|
+
if (spanGaps !== void 0) seriesConfig[field].overrides.spanGaps = spanGaps;
|
|
1417
|
+
if (y2Enabled) seriesConfig[field].overrides.scale = getY2Scale(field, y2fields, overlayFields);
|
|
1418
|
+
if (markerDisplay !== void 0) seriesConfig[field].markerDisplay = markerDisplay;
|
|
1419
|
+
if (!isAreaChart || isOverlay) {
|
|
1420
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1421
|
+
if (fieldDashStyle) seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1382
1422
|
}
|
|
1383
1423
|
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
1384
1424
|
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
@@ -1426,9 +1466,9 @@ var visualization_schemas_exports = {};
|
|
|
1426
1466
|
__export(visualization_schemas_exports, {
|
|
1427
1467
|
default: () => visualization_schemas_default
|
|
1428
1468
|
});
|
|
1429
|
-
var
|
|
1469
|
+
var defaultImport31 = __toESM(require("@splunk/visualization-schemas"));
|
|
1430
1470
|
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
1431
|
-
var visualization_schemas_default = "default" in
|
|
1471
|
+
var visualization_schemas_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
|
|
1432
1472
|
|
|
1433
1473
|
// src/common/hooks/useTrellisEnabled.ts
|
|
1434
1474
|
var useTrellisFeatureFlagOn = () => {
|
|
@@ -1458,8 +1498,27 @@ var TrellisTitleDiv = styled_components_default.div`
|
|
|
1458
1498
|
background-color: ${(props) => props.backgroundColor};
|
|
1459
1499
|
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.
|
|
1460
1500
|
`;
|
|
1501
|
+
var formatTrellisKey = (value) => {
|
|
1502
|
+
if (value === null || value === void 0) {
|
|
1503
|
+
return "";
|
|
1504
|
+
}
|
|
1505
|
+
if (typeof value === "string") {
|
|
1506
|
+
return value;
|
|
1507
|
+
}
|
|
1508
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
1509
|
+
return value.toString();
|
|
1510
|
+
}
|
|
1511
|
+
if (typeof value === "symbol") {
|
|
1512
|
+
return value.toString();
|
|
1513
|
+
}
|
|
1514
|
+
try {
|
|
1515
|
+
return JSON.stringify(value);
|
|
1516
|
+
} catch (e) {
|
|
1517
|
+
return typeof value === "bigint" ? value.toString() : "";
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1461
1520
|
var TrellisTitle = (props) => {
|
|
1462
|
-
const titleText =
|
|
1521
|
+
const titleText = formatTrellisKey(props.trellisKey);
|
|
1463
1522
|
return /* @__PURE__ */ react_exports.createElement(
|
|
1464
1523
|
TrellisTitleDiv,
|
|
1465
1524
|
{
|
|
@@ -1595,6 +1654,38 @@ var parseArrayOption = (value) => {
|
|
|
1595
1654
|
}
|
|
1596
1655
|
return void 0;
|
|
1597
1656
|
};
|
|
1657
|
+
var getAreaOpacityForCanvas = (areaOpacity) => (
|
|
1658
|
+
// Preserve legacy visualizations behavior where area opacity is squared to match charting output.
|
|
1659
|
+
areaOpacity !== void 0 && areaOpacity !== null ? __pow(areaOpacity, 2) : areaOpacity
|
|
1660
|
+
);
|
|
1661
|
+
var parseTickIntervalOption = (simpleXMLValue, canvasValue) => {
|
|
1662
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
1663
|
+
if (canvasValue) return Number(canvasValue);
|
|
1664
|
+
return void 0;
|
|
1665
|
+
};
|
|
1666
|
+
var getYAxisTitles = ({
|
|
1667
|
+
y2Enabled,
|
|
1668
|
+
yFields,
|
|
1669
|
+
y2Fields,
|
|
1670
|
+
overlayFields,
|
|
1671
|
+
yAxisTitleText,
|
|
1672
|
+
yAxisTitleVisibility,
|
|
1673
|
+
y2AxisTitleText,
|
|
1674
|
+
y2AxisTitleVisibility,
|
|
1675
|
+
containerHeight
|
|
1676
|
+
}) => {
|
|
1677
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
1678
|
+
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
1679
|
+
const yAxisTitle = ellipsisAxisTitle(
|
|
1680
|
+
getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility),
|
|
1681
|
+
containerHeight
|
|
1682
|
+
);
|
|
1683
|
+
const y2AxisTitle = ellipsisAxisTitle(
|
|
1684
|
+
getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility),
|
|
1685
|
+
containerHeight
|
|
1686
|
+
);
|
|
1687
|
+
return { yAxisTitle, y2AxisTitle };
|
|
1688
|
+
};
|
|
1598
1689
|
var TimeSeriesChartWrapper = (props) => {
|
|
1599
1690
|
var _b, _c, _d;
|
|
1600
1691
|
const _a = props, {
|
|
@@ -1684,6 +1775,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1684
1775
|
"chart.overlayFields": overlayFieldsStr,
|
|
1685
1776
|
"chart.nullValueMode": nullValueMode,
|
|
1686
1777
|
"chart.showDataLabels": showDataLabels,
|
|
1778
|
+
"chart.showLines": showLines,
|
|
1779
|
+
"chart.stackMode": stackMode,
|
|
1687
1780
|
lineWidth,
|
|
1688
1781
|
lineDashStyle,
|
|
1689
1782
|
fieldDashStyles: lineDashStylesByFieldStr,
|
|
@@ -1712,7 +1805,10 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1712
1805
|
yAxisMinorTickSize,
|
|
1713
1806
|
y2AxisMinorTickSize,
|
|
1714
1807
|
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
1715
|
-
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
1808
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions,
|
|
1809
|
+
// area only props
|
|
1810
|
+
areaFillOpacity: areaOpacity,
|
|
1811
|
+
chart: chartType
|
|
1716
1812
|
} = options;
|
|
1717
1813
|
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
1718
1814
|
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
@@ -1729,13 +1825,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1729
1825
|
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
1730
1826
|
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
1731
1827
|
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
1738
|
-
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
1828
|
+
const yAxisMajorTickIntervalNum = parseTickIntervalOption(
|
|
1829
|
+
yAxisMajorUnitFromSimpleXML,
|
|
1830
|
+
yAxisMajorTickInterval
|
|
1831
|
+
);
|
|
1832
|
+
const y2AxisMajorTickIntervalNum = parseTickIntervalOption(
|
|
1739
1833
|
y2AxisMajorUnitFromSimpleXML,
|
|
1740
1834
|
y2AxisMajorTickInterval
|
|
1741
1835
|
);
|
|
@@ -1744,6 +1838,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1744
1838
|
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
1745
1839
|
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
1746
1840
|
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
1841
|
+
const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
|
|
1747
1842
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
1748
1843
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
1749
1844
|
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
@@ -1774,26 +1869,40 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1774
1869
|
);
|
|
1775
1870
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
1776
1871
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1872
|
+
const { yAxisTitle, y2AxisTitle } = getYAxisTitles({
|
|
1873
|
+
y2Enabled,
|
|
1874
|
+
yFields,
|
|
1875
|
+
y2Fields,
|
|
1876
|
+
overlayFields,
|
|
1877
|
+
yAxisTitleText,
|
|
1878
|
+
yAxisTitleVisibility,
|
|
1879
|
+
y2AxisTitleText,
|
|
1880
|
+
y2AxisTitleVisibility,
|
|
1881
|
+
containerHeight
|
|
1882
|
+
});
|
|
1783
1883
|
const xScaleConfig = (0, react_exports.useMemo)(
|
|
1784
1884
|
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
1785
1885
|
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
1786
1886
|
);
|
|
1887
|
+
const isStacked100 = stackMode === "stacked100";
|
|
1787
1888
|
const yScaleConfig = (0, react_exports.useMemo)(
|
|
1788
|
-
() =>
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1889
|
+
() => {
|
|
1890
|
+
const config3 = getYScaleConfig(
|
|
1891
|
+
yAxisTitle,
|
|
1892
|
+
yAxisAbbreviation,
|
|
1893
|
+
yAxisScale,
|
|
1894
|
+
yAxisLabelVisibility,
|
|
1895
|
+
yAxisMin,
|
|
1896
|
+
yAxisMax
|
|
1897
|
+
);
|
|
1898
|
+
if (isStacked100) {
|
|
1899
|
+
config3.y.tickFmt = (v) => `${Math.round(v * 100)}%`;
|
|
1900
|
+
config3.y.range = () => [0, 1];
|
|
1901
|
+
}
|
|
1902
|
+
return config3;
|
|
1903
|
+
},
|
|
1904
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1905
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax, isStacked100]
|
|
1797
1906
|
);
|
|
1798
1907
|
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
1799
1908
|
if (y2Enabled) {
|
|
@@ -1825,10 +1934,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1825
1934
|
];
|
|
1826
1935
|
chartData.fields = filteredChartData.fields;
|
|
1827
1936
|
chartData.columns = seriesDataFormatted;
|
|
1937
|
+
const normalizedStackMode = stackMode === "stacked" || stackMode === "stacked100" ? stackMode : "auto";
|
|
1828
1938
|
const seriesOverrides = (0, react_exports.useMemo)(
|
|
1829
|
-
() => getSeriesOverrides(
|
|
1830
|
-
yFields,
|
|
1831
|
-
y2Fields,
|
|
1939
|
+
() => getSeriesOverrides({
|
|
1940
|
+
yfields: yFields,
|
|
1941
|
+
y2fields: y2Fields,
|
|
1832
1942
|
lineWidth,
|
|
1833
1943
|
overlayFields,
|
|
1834
1944
|
y2Enabled,
|
|
@@ -1837,8 +1947,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1837
1947
|
lineDashStyle,
|
|
1838
1948
|
lineDashStylesByField,
|
|
1839
1949
|
stepPosition,
|
|
1840
|
-
stepPositionsByField
|
|
1841
|
-
|
|
1950
|
+
stepPositionsByField,
|
|
1951
|
+
type: chartType,
|
|
1952
|
+
stackMode: normalizedStackMode,
|
|
1953
|
+
showLines
|
|
1954
|
+
}),
|
|
1842
1955
|
[
|
|
1843
1956
|
yFields,
|
|
1844
1957
|
y2Fields,
|
|
@@ -1850,7 +1963,10 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1850
1963
|
lineDashStyle,
|
|
1851
1964
|
lineDashStylesByField,
|
|
1852
1965
|
stepPosition,
|
|
1853
|
-
stepPositionsByField
|
|
1966
|
+
stepPositionsByField,
|
|
1967
|
+
chartType,
|
|
1968
|
+
normalizedStackMode,
|
|
1969
|
+
showLines
|
|
1854
1970
|
]
|
|
1855
1971
|
);
|
|
1856
1972
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
@@ -1918,50 +2034,54 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1918
2034
|
react_exports.useEffect(() => {
|
|
1919
2035
|
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
1920
2036
|
}, [additionalTooltipValues]);
|
|
2037
|
+
const handleCrosshairMouseout = react_exports.useCallback(() => {
|
|
2038
|
+
if (onPointMouseOut && lastPayloadRef.current) {
|
|
2039
|
+
onPointMouseOut({
|
|
2040
|
+
type: "point.mouseout",
|
|
2041
|
+
originalEvent: lastOriginalEventRef.current,
|
|
2042
|
+
payload: lastPayloadRef.current
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
previousMouseoverPayloadRef.current = null;
|
|
2046
|
+
}, [onPointMouseOut]);
|
|
1921
2047
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
1922
2048
|
(event) => {
|
|
1923
|
-
if (onPointMouseOver
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
2049
|
+
if (!onPointMouseOver && !onPointMouseOut) {
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
if (!event) {
|
|
2053
|
+
handleCrosshairMouseout();
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
2057
|
+
name: event.seriesKey
|
|
2058
|
+
});
|
|
2059
|
+
delete payload.seriesKey;
|
|
2060
|
+
if (event.rowContext) {
|
|
2061
|
+
Object.assign(
|
|
2062
|
+
payload,
|
|
2063
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
2064
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
2065
|
+
return acc;
|
|
2066
|
+
}, {})
|
|
2067
|
+
);
|
|
2068
|
+
}
|
|
2069
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2070
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
lastPayloadRef.current = updatedPayload;
|
|
2074
|
+
lastOriginalEventRef.current = event;
|
|
2075
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
2076
|
+
if (onPointMouseOver) {
|
|
2077
|
+
onPointMouseOver({
|
|
2078
|
+
type: "point.mouseover",
|
|
2079
|
+
originalEvent: event,
|
|
2080
|
+
payload: updatedPayload
|
|
1937
2081
|
});
|
|
1938
|
-
delete payload.seriesKey;
|
|
1939
|
-
if (event.rowContext) {
|
|
1940
|
-
Object.assign(
|
|
1941
|
-
payload,
|
|
1942
|
-
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
1943
|
-
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
1944
|
-
return acc;
|
|
1945
|
-
}, {})
|
|
1946
|
-
);
|
|
1947
|
-
}
|
|
1948
|
-
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1949
|
-
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
1950
|
-
return;
|
|
1951
|
-
}
|
|
1952
|
-
lastPayloadRef.current = updatedPayload;
|
|
1953
|
-
lastOriginalEventRef.current = event;
|
|
1954
|
-
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
1955
|
-
if (onPointMouseOver) {
|
|
1956
|
-
onPointMouseOver({
|
|
1957
|
-
type: "point.mouseover",
|
|
1958
|
-
originalEvent: event,
|
|
1959
|
-
payload: updatedPayload
|
|
1960
|
-
});
|
|
1961
|
-
}
|
|
1962
2082
|
}
|
|
1963
2083
|
},
|
|
1964
|
-
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
2084
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy, handleCrosshairMouseout]
|
|
1965
2085
|
);
|
|
1966
2086
|
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}`;
|
|
1967
2087
|
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
@@ -2016,7 +2136,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2016
2136
|
showXAxisLine,
|
|
2017
2137
|
showYAxisLine,
|
|
2018
2138
|
showY2AxisLine,
|
|
2019
|
-
xAxisMaxLabelParts
|
|
2139
|
+
xAxisMaxLabelParts,
|
|
2140
|
+
areaOpacity: areaOpacityForCanvas
|
|
2020
2141
|
}
|
|
2021
2142
|
));
|
|
2022
2143
|
}, [
|
|
@@ -2068,7 +2189,8 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2068
2189
|
showYAxisLine,
|
|
2069
2190
|
showY2AxisLine,
|
|
2070
2191
|
legendMode,
|
|
2071
|
-
xAxisMaxLabelParts
|
|
2192
|
+
xAxisMaxLabelParts,
|
|
2193
|
+
areaOpacityForCanvas
|
|
2072
2194
|
]);
|
|
2073
2195
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
2074
2196
|
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
@@ -2096,6 +2218,37 @@ var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
|
2096
2218
|
|
|
2097
2219
|
// src/common/withDashboardViz.tsx
|
|
2098
2220
|
var SanitizedTimeSeriesChartWrapper = (0, SanitizeProps_exports.withSanitizedProps)(TimeSeriesChartWrapper_default);
|
|
2221
|
+
var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTrigger) => {
|
|
2222
|
+
const result = {};
|
|
2223
|
+
Object.keys(supportedEvents).forEach((eventName) => {
|
|
2224
|
+
const { parentKeys, payloadKeys } = supportedEvents[eventName];
|
|
2225
|
+
const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
|
|
2226
|
+
let payload = {};
|
|
2227
|
+
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
2228
|
+
payloadKeys.forEach((p) => {
|
|
2229
|
+
payload[p] = evaluatedOptionsToUse[p];
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
result[eventCallbackPropName] = (ev) => {
|
|
2233
|
+
if (ev == null ? void 0 : ev.payload) {
|
|
2234
|
+
payload = __spreadValues({}, ev.payload);
|
|
2235
|
+
}
|
|
2236
|
+
return onEventTrigger({
|
|
2237
|
+
originalEvent: ev,
|
|
2238
|
+
payload,
|
|
2239
|
+
type: eventName
|
|
2240
|
+
});
|
|
2241
|
+
};
|
|
2242
|
+
if (parentKeys) {
|
|
2243
|
+
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
2244
|
+
const newObject = {};
|
|
2245
|
+
newObject[parentKeys[i]] = result[eventCallbackPropName];
|
|
2246
|
+
result[eventCallbackPropName] = newObject;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
});
|
|
2250
|
+
return result;
|
|
2251
|
+
};
|
|
2099
2252
|
var withDashboardViz = (opts) => {
|
|
2100
2253
|
const {
|
|
2101
2254
|
ReactViz,
|
|
@@ -2153,9 +2306,7 @@ var withDashboardViz = (opts) => {
|
|
|
2153
2306
|
const isDownsamplingEnabledByFeatureFlag = Boolean(
|
|
2154
2307
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
|
|
2155
2308
|
);
|
|
2156
|
-
const isTrellisFeatureFlagOn = Boolean(
|
|
2157
|
-
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
2158
|
-
);
|
|
2309
|
+
const isTrellisFeatureFlagOn = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
|
|
2159
2310
|
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 */;
|
|
2160
2311
|
const isAcceleratedRenderFeatureFlagOn = Boolean(
|
|
2161
2312
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
|
|
@@ -2320,38 +2471,12 @@ var withDashboardViz = (opts) => {
|
|
|
2320
2471
|
}
|
|
2321
2472
|
);
|
|
2322
2473
|
}
|
|
2323
|
-
const eventCallbackProps = {};
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
let payload = {};
|
|
2330
|
-
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
2331
|
-
payloadKeys.forEach((p) => {
|
|
2332
|
-
payload[p] = evaluatedOptionsToUse[p];
|
|
2333
|
-
});
|
|
2334
|
-
}
|
|
2335
|
-
eventCallbackProps[eventCallbackPropName] = (ev) => {
|
|
2336
|
-
if (ev == null ? void 0 : ev.payload) {
|
|
2337
|
-
payload = __spreadValues({}, ev.payload);
|
|
2338
|
-
}
|
|
2339
|
-
return onEventTrigger({
|
|
2340
|
-
originalEvent: ev,
|
|
2341
|
-
payload,
|
|
2342
|
-
type: eventName
|
|
2343
|
-
});
|
|
2344
|
-
};
|
|
2345
|
-
if (parentKeys) {
|
|
2346
|
-
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
2347
|
-
const newObject = {};
|
|
2348
|
-
newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
|
|
2349
|
-
eventCallbackProps[eventCallbackPropName] = newObject;
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
|
-
});
|
|
2353
|
-
}
|
|
2354
|
-
const computedVizProps = computeVizProps(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
2474
|
+
const eventCallbackProps = hasEventHandlers && mode === "view" && vizConfig.supports.includes("events" /* EVENTS */) ? buildEventCallbackProps(vizConfig.events, evaluatedOptionsToUse, onEventTrigger) : {};
|
|
2475
|
+
const computedVizProps = computeVizProps(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
|
|
2476
|
+
// Align option transformation with the actual renderer selected below.
|
|
2477
|
+
// This prevents canvas-only option preservation from leaking into Highcharts mode.
|
|
2478
|
+
isAcceleratedRenderOn
|
|
2479
|
+
}), eventCallbackProps), {
|
|
2355
2480
|
themeFunc
|
|
2356
2481
|
}));
|
|
2357
2482
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
@@ -2380,32 +2505,59 @@ var withDashboardViz = (opts) => {
|
|
|
2380
2505
|
};
|
|
2381
2506
|
var withDashboardViz_default = withDashboardViz;
|
|
2382
2507
|
|
|
2508
|
+
// esm-externals:@splunk/themes
|
|
2509
|
+
var themes_exports = {};
|
|
2510
|
+
__export(themes_exports, {
|
|
2511
|
+
default: () => themes_default
|
|
2512
|
+
});
|
|
2513
|
+
var defaultImport32 = __toESM(require("@splunk/themes"));
|
|
2514
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
2515
|
+
var themes_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
|
|
2516
|
+
|
|
2517
|
+
// esm-externals:@splunk/react-ui/Button
|
|
2518
|
+
var Button_exports = {};
|
|
2519
|
+
__export(Button_exports, {
|
|
2520
|
+
default: () => Button_default
|
|
2521
|
+
});
|
|
2522
|
+
var defaultImport33 = __toESM(require("@splunk/react-ui/Button"));
|
|
2523
|
+
__reExport(Button_exports, require("@splunk/react-ui/Button"));
|
|
2524
|
+
var Button_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
|
|
2525
|
+
|
|
2526
|
+
// esm-externals:@splunk/react-ui/Tooltip
|
|
2527
|
+
var Tooltip_exports = {};
|
|
2528
|
+
__export(Tooltip_exports, {
|
|
2529
|
+
default: () => Tooltip_default
|
|
2530
|
+
});
|
|
2531
|
+
var defaultImport34 = __toESM(require("@splunk/react-ui/Tooltip"));
|
|
2532
|
+
__reExport(Tooltip_exports, require("@splunk/react-ui/Tooltip"));
|
|
2533
|
+
var Tooltip_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
|
|
2534
|
+
|
|
2383
2535
|
// esm-externals:xpath
|
|
2384
2536
|
var xpath_exports = {};
|
|
2385
2537
|
__export(xpath_exports, {
|
|
2386
2538
|
default: () => xpath_default
|
|
2387
2539
|
});
|
|
2388
|
-
var
|
|
2540
|
+
var defaultImport35 = __toESM(require("xpath"));
|
|
2389
2541
|
__reExport(xpath_exports, require("xpath"));
|
|
2390
|
-
var xpath_default = "default" in
|
|
2542
|
+
var xpath_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
|
|
2391
2543
|
|
|
2392
2544
|
// esm-externals:@xmldom/xmldom
|
|
2393
2545
|
var xmldom_exports = {};
|
|
2394
2546
|
__export(xmldom_exports, {
|
|
2395
2547
|
default: () => xmldom_default
|
|
2396
2548
|
});
|
|
2397
|
-
var
|
|
2549
|
+
var defaultImport36 = __toESM(require("@xmldom/xmldom"));
|
|
2398
2550
|
__reExport(xmldom_exports, require("@xmldom/xmldom"));
|
|
2399
|
-
var xmldom_default = "default" in
|
|
2551
|
+
var xmldom_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
|
|
2400
2552
|
|
|
2401
2553
|
// esm-externals:jexl
|
|
2402
2554
|
var jexl_exports = {};
|
|
2403
2555
|
__export(jexl_exports, {
|
|
2404
2556
|
default: () => jexl_default
|
|
2405
2557
|
});
|
|
2406
|
-
var
|
|
2558
|
+
var defaultImport37 = __toESM(require("jexl"));
|
|
2407
2559
|
__reExport(jexl_exports, require("jexl"));
|
|
2408
|
-
var jexl_default = "default" in
|
|
2560
|
+
var jexl_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
2409
2561
|
|
|
2410
2562
|
// src/ChoroplethSvg/PureChoroplethSvg/SvgMutator.ts
|
|
2411
2563
|
var ERROR_NON_ATTRIBUTE_MUTATION = "mutations only allowed on attribute nodes";
|
|
@@ -2415,6 +2567,8 @@ var _SvgMutator = class _SvgMutator {
|
|
|
2415
2567
|
* @param {SvgMutatorArgs} props
|
|
2416
2568
|
*/
|
|
2417
2569
|
constructor(props) {
|
|
2570
|
+
__publicField(this, "svgDoc");
|
|
2571
|
+
__publicField(this, "props");
|
|
2418
2572
|
const { svg } = props;
|
|
2419
2573
|
this.svgDoc = new xmldom_exports.DOMParser().parseFromString(svg);
|
|
2420
2574
|
this.props = __spreadValues({}, props);
|
|
@@ -2504,6 +2658,8 @@ var _SvgMutator = class _SvgMutator {
|
|
|
2504
2658
|
sandbox: "allow-scripts",
|
|
2505
2659
|
id: "svgChoroplethIframe",
|
|
2506
2660
|
"data-test": "svgChoroplethIframe",
|
|
2661
|
+
tabIndex: -1,
|
|
2662
|
+
"data-kb-message-nonce": NONCE,
|
|
2507
2663
|
"data-viz-supports-simulated-clicks": true
|
|
2508
2664
|
});
|
|
2509
2665
|
let intervalID = null;
|
|
@@ -2577,8 +2733,9 @@ var _SvgMutator = class _SvgMutator {
|
|
|
2577
2733
|
return xpath_exports.evaluate(xpath, doc, resolver, XPathResult.ANY_TYPE, null);
|
|
2578
2734
|
}
|
|
2579
2735
|
static getTitle(data, i) {
|
|
2736
|
+
var _a;
|
|
2580
2737
|
let title = "";
|
|
2581
|
-
if (data.featureIDs
|
|
2738
|
+
if ((_a = data.featureIDs) == null ? void 0 : _a[i]) {
|
|
2582
2739
|
title += `name: ${data.featureIDs[i]}`;
|
|
2583
2740
|
}
|
|
2584
2741
|
if (data.values && data.values[i] !== void 0) {
|
|
@@ -2600,6 +2757,7 @@ value: ${data.values[i]}`;
|
|
|
2600
2757
|
* @returns {any}
|
|
2601
2758
|
*/
|
|
2602
2759
|
static mutateNode(n, dataBinding, data, i) {
|
|
2760
|
+
var _a, _b;
|
|
2603
2761
|
if (n.nodeType && n.nodeType != Node.ATTRIBUTE_NODE) {
|
|
2604
2762
|
throw new Error(ERROR_NON_ATTRIBUTE_MUTATION);
|
|
2605
2763
|
}
|
|
@@ -2613,20 +2771,19 @@ value: ${data.values[i]}`;
|
|
|
2613
2771
|
n.nodeValue = computed;
|
|
2614
2772
|
n.value = computed;
|
|
2615
2773
|
const parent = n.ownerElement;
|
|
2616
|
-
|
|
2617
|
-
if (data.featureIDs && data.featureIDs[i]) {
|
|
2774
|
+
if (((_a = data.featureIDs) == null ? void 0 : _a[i]) !== void 0) {
|
|
2618
2775
|
parent.setAttribute("data-name", data.featureIDs[i]);
|
|
2776
|
+
} else {
|
|
2777
|
+
parent.removeAttribute("data-name");
|
|
2619
2778
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
parent.
|
|
2627
|
-
|
|
2628
|
-
if (data.featureIDs) {
|
|
2629
|
-
parent.setAttribute("data-name", data.featureIDs[i]);
|
|
2779
|
+
const interactiveValue = (_b = data.values) == null ? void 0 : _b[i];
|
|
2780
|
+
const hasInteractiveValue = interactiveValue !== void 0 && interactiveValue !== null && interactiveValue !== "";
|
|
2781
|
+
if (hasInteractiveValue) {
|
|
2782
|
+
parent.setAttribute("data-value", interactiveValue);
|
|
2783
|
+
parent.setAttribute("data-interactive", "true");
|
|
2784
|
+
} else {
|
|
2785
|
+
parent.removeAttribute("data-value");
|
|
2786
|
+
parent.setAttribute("data-interactive", "false");
|
|
2630
2787
|
}
|
|
2631
2788
|
return computed;
|
|
2632
2789
|
}
|
|
@@ -2681,6 +2838,14 @@ value: ${data.values[i]}`;
|
|
|
2681
2838
|
}
|
|
2682
2839
|
svg {
|
|
2683
2840
|
pointer-events:all;
|
|
2841
|
+
}
|
|
2842
|
+
svg [data-kb-focus="true"] {
|
|
2843
|
+
outline: 2px solid #2684FF;
|
|
2844
|
+
outline-offset: 2px;
|
|
2845
|
+
stroke: #2684FF;
|
|
2846
|
+
stroke-width: 2px;
|
|
2847
|
+
vector-effect: non-scaling-stroke;
|
|
2848
|
+
}
|
|
2684
2849
|
}`;
|
|
2685
2850
|
}
|
|
2686
2851
|
static getCsp(nonce) {
|
|
@@ -2702,14 +2867,21 @@ value: ${data.values[i]}`;
|
|
|
2702
2867
|
|
|
2703
2868
|
let parentOrigin = null;
|
|
2704
2869
|
let parentWindow = null;
|
|
2870
|
+
let keyboardNavigationMode = false;
|
|
2871
|
+
let lastInputModality = 'unknown';
|
|
2872
|
+
let focusedElement = null;
|
|
2873
|
+
let focusedIndex = -1;
|
|
2874
|
+
// Fallback to [data-value] for legacy/dashboard flows where SVG nodes are
|
|
2875
|
+
// data-annotated but do not yet have explicit data-interactive attributes.
|
|
2876
|
+
const FOCUSABLE_SELECTOR = '[data-interactive="true"], [data-value]';
|
|
2705
2877
|
|
|
2706
|
-
function sendMessage(m){
|
|
2878
|
+
function sendMessage(m, transfer){
|
|
2707
2879
|
|
|
2708
2880
|
if(!parentWindow){
|
|
2709
2881
|
return; // don't send any messages until we know where to send them
|
|
2710
2882
|
}
|
|
2711
2883
|
m.nonce = '${nonce}'; // set nonce into message.
|
|
2712
|
-
parentWindow.postMessage(m,parentOrigin);
|
|
2884
|
+
parentWindow.postMessage(m,parentOrigin, transfer || []);
|
|
2713
2885
|
}
|
|
2714
2886
|
|
|
2715
2887
|
|
|
@@ -2736,72 +2908,466 @@ value: ${data.values[i]}`;
|
|
|
2736
2908
|
|
|
2737
2909
|
//listen for a first message to establish the parent origin
|
|
2738
2910
|
window.addEventListener('message', parentSetupMessageListener);
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2911
|
+
const svgElement = document.getElementsByTagName('svg')[0];
|
|
2912
|
+
if(!svgElement){
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
svgElement.addEventListener('click', event => {
|
|
2916
|
+
const target = getInteractiveTarget(event.target);
|
|
2917
|
+
if(!target){
|
|
2918
|
+
return;
|
|
2919
|
+
}
|
|
2920
|
+
sendPointerMessage({
|
|
2921
|
+
eventType: 'click',
|
|
2922
|
+
target,
|
|
2923
|
+
clientX: event.clientX,
|
|
2924
|
+
clientY: event.clientY,
|
|
2925
|
+
});
|
|
2926
|
+
});
|
|
2927
|
+
svgElement.addEventListener('mouseover', event => {
|
|
2928
|
+
const target = getInteractiveTarget(event.target);
|
|
2929
|
+
if(!target){
|
|
2930
|
+
return;
|
|
2931
|
+
}
|
|
2932
|
+
sendPointerMessage({
|
|
2933
|
+
eventType: 'mouseover',
|
|
2934
|
+
target,
|
|
2935
|
+
clientX: event.clientX,
|
|
2936
|
+
clientY: event.clientY,
|
|
2937
|
+
});
|
|
2938
|
+
});
|
|
2939
|
+
svgElement.addEventListener('mousemove', event => {
|
|
2940
|
+
const target = getInteractiveTarget(event.target);
|
|
2941
|
+
if(!target){
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
sendPointerMessage({
|
|
2945
|
+
eventType: 'mousemove',
|
|
2946
|
+
target,
|
|
2947
|
+
clientX: event.clientX,
|
|
2948
|
+
clientY: event.clientY,
|
|
2753
2949
|
});
|
|
2754
2950
|
});
|
|
2951
|
+
svgElement.addEventListener('mouseout', event => {
|
|
2952
|
+
const target = getInteractiveTarget(event.target);
|
|
2953
|
+
if(!target){
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
const relatedTarget = getInteractiveTarget(event.relatedTarget);
|
|
2957
|
+
if(relatedTarget === target){
|
|
2958
|
+
return;
|
|
2959
|
+
}
|
|
2960
|
+
sendPointerMessage({
|
|
2961
|
+
eventType: 'mouseout',
|
|
2962
|
+
target,
|
|
2963
|
+
clientX: event.clientX,
|
|
2964
|
+
clientY: event.clientY,
|
|
2965
|
+
});
|
|
2966
|
+
});
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
function getInteractiveTarget(element){
|
|
2970
|
+
if(!element || !element.closest){
|
|
2971
|
+
return null;
|
|
2972
|
+
}
|
|
2973
|
+
let target = element.closest(FOCUSABLE_SELECTOR);
|
|
2974
|
+
while(target && !isFocusableElement(target)){
|
|
2975
|
+
target = target.parentElement ? target.parentElement.closest(FOCUSABLE_SELECTOR) : null;
|
|
2976
|
+
}
|
|
2977
|
+
return target;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
function isFocusableElement(el){
|
|
2981
|
+
if(!el || !el.closest){
|
|
2982
|
+
return false;
|
|
2983
|
+
}
|
|
2984
|
+
const dataInteractive = el.getAttribute('data-interactive');
|
|
2985
|
+
if(dataInteractive === 'false'){
|
|
2986
|
+
return false;
|
|
2987
|
+
}
|
|
2988
|
+
if(dataInteractive !== 'true'){
|
|
2989
|
+
// Legacy fallback: treat non-empty data-value as interactive
|
|
2990
|
+
// unless explicitly marked data-interactive="false".
|
|
2991
|
+
const value = el.getAttribute('data-value');
|
|
2992
|
+
if(value === null || value === ''){
|
|
2993
|
+
return false;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
const id = el.getAttribute && el.getAttribute('id');
|
|
2997
|
+
if(id && id.startsWith('Icon/')){
|
|
2998
|
+
return false;
|
|
2999
|
+
}
|
|
3000
|
+
if(el.closest('defs, clipPath, mask, pattern, symbol, metadata, title, desc, style, script')){
|
|
3001
|
+
return false;
|
|
3002
|
+
}
|
|
3003
|
+
const style = window.getComputedStyle(el);
|
|
3004
|
+
if(style.display === 'none' || style.visibility === 'hidden' || style.pointerEvents === 'none'){
|
|
3005
|
+
return false;
|
|
3006
|
+
}
|
|
3007
|
+
return true;
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
function getFocusableElements(){
|
|
3011
|
+
const svgElement = document.getElementsByTagName('svg')[0];
|
|
3012
|
+
if(!svgElement){
|
|
3013
|
+
return [];
|
|
3014
|
+
}
|
|
3015
|
+
const elements = Array.from(svgElement.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
3016
|
+
return elements.filter(isFocusableElement);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
function sendFocusMessage(target, eventType){
|
|
3020
|
+
if(!target || !target.getBoundingClientRect){
|
|
3021
|
+
return;
|
|
3022
|
+
}
|
|
3023
|
+
const rect = target.getBoundingClientRect();
|
|
3024
|
+
sendPointerMessage({
|
|
3025
|
+
eventType,
|
|
3026
|
+
target,
|
|
3027
|
+
clientX: rect.left + rect.width / 2,
|
|
3028
|
+
clientY: rect.top + rect.height / 2,
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
function sendKeyboardHoverMessage(target, eventType){
|
|
3033
|
+
if(!target || !target.getBoundingClientRect){
|
|
3034
|
+
return;
|
|
3035
|
+
}
|
|
3036
|
+
const rect = target.getBoundingClientRect();
|
|
3037
|
+
const value = target.getAttribute('data-value');
|
|
3038
|
+
const name = target.getAttribute('data-name');
|
|
3039
|
+
sendMessage({
|
|
3040
|
+
type: 'kbAreaHover',
|
|
3041
|
+
interactionSource: 'keyboard',
|
|
3042
|
+
eventType,
|
|
3043
|
+
clientX: rect.left + rect.width / 2,
|
|
3044
|
+
clientY: rect.top + rect.height / 2,
|
|
3045
|
+
anchorX: rect.right,
|
|
3046
|
+
anchorY: rect.top + rect.height / 2,
|
|
3047
|
+
value,
|
|
3048
|
+
name,
|
|
3049
|
+
tooltipText: getTooltipText(target),
|
|
3050
|
+
});
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
function getTooltipText(target){
|
|
3054
|
+
if(!target){
|
|
3055
|
+
return '';
|
|
3056
|
+
}
|
|
3057
|
+
const name = target.getAttribute('data-name');
|
|
3058
|
+
const value = target.getAttribute('data-value');
|
|
3059
|
+
let text = '';
|
|
3060
|
+
if(name){
|
|
3061
|
+
text += 'name: ' + name;
|
|
3062
|
+
}
|
|
3063
|
+
if(value !== null && value !== undefined){
|
|
3064
|
+
text += (text ? '\\n' : '') + 'value: ' + value;
|
|
3065
|
+
}
|
|
3066
|
+
return text;
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
function sendPointerMessage({ eventType, target, clientX, clientY }){
|
|
3070
|
+
const value = target ? target.getAttribute('data-value') : null;
|
|
3071
|
+
const name = target ? target.getAttribute('data-name') : null;
|
|
3072
|
+
const rect =
|
|
3073
|
+
target && target.getBoundingClientRect
|
|
3074
|
+
? target.getBoundingClientRect()
|
|
3075
|
+
: null;
|
|
3076
|
+
sendMessage({
|
|
3077
|
+
interactionSource: 'mouse',
|
|
3078
|
+
eventType,
|
|
3079
|
+
clientX,
|
|
3080
|
+
clientY,
|
|
3081
|
+
anchorX: rect ? rect.right : clientX,
|
|
3082
|
+
anchorY: rect ? rect.top + rect.height / 2 : clientY,
|
|
3083
|
+
value,
|
|
3084
|
+
name,
|
|
3085
|
+
tooltipText: getTooltipText(target),
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
2755
3088
|
|
|
3089
|
+
function clearFocusedElement(){
|
|
3090
|
+
if(focusedElement){
|
|
3091
|
+
sendKeyboardHoverMessage(focusedElement, 'mouseout');
|
|
3092
|
+
focusedElement.removeAttribute('data-kb-focus');
|
|
3093
|
+
sendFocusMessage(focusedElement, 'mouseout');
|
|
3094
|
+
focusedElement = null;
|
|
3095
|
+
focusedIndex = -1;
|
|
3096
|
+
}
|
|
3097
|
+
sendMessage({
|
|
3098
|
+
type: 'kbTooltipAnnouncement',
|
|
3099
|
+
tooltipText: '',
|
|
3100
|
+
});
|
|
3101
|
+
}
|
|
2756
3102
|
|
|
3103
|
+
function focusElementAt(index){
|
|
3104
|
+
const elements = getFocusableElements();
|
|
3105
|
+
if(!elements.length){
|
|
3106
|
+
clearFocusedElement();
|
|
3107
|
+
return;
|
|
3108
|
+
}
|
|
3109
|
+
if(index < 0){
|
|
3110
|
+
index = 0;
|
|
3111
|
+
}
|
|
3112
|
+
if(index >= elements.length){
|
|
3113
|
+
index = elements.length - 1;
|
|
3114
|
+
}
|
|
3115
|
+
if(focusedElement){
|
|
3116
|
+
focusedElement.removeAttribute('data-kb-focus');
|
|
3117
|
+
sendFocusMessage(focusedElement, 'mouseout');
|
|
3118
|
+
}
|
|
3119
|
+
focusedIndex = index;
|
|
3120
|
+
focusedElement = elements[focusedIndex];
|
|
3121
|
+
focusedElement.setAttribute('data-kb-focus', 'true');
|
|
3122
|
+
sendKeyboardHoverMessage(focusedElement, 'mousemove');
|
|
3123
|
+
sendFocusMessage(focusedElement, 'mouseover');
|
|
3124
|
+
sendFocusMessage(focusedElement, 'mousemove');
|
|
3125
|
+
sendMessage({
|
|
3126
|
+
type: 'kbTooltipAnnouncement',
|
|
3127
|
+
tooltipText: getTooltipText(focusedElement),
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
function moveFocus(direction){
|
|
3132
|
+
const elements = getFocusableElements();
|
|
3133
|
+
if(!elements.length){
|
|
3134
|
+
clearFocusedElement();
|
|
3135
|
+
return;
|
|
3136
|
+
}
|
|
3137
|
+
if(focusedIndex === -1){
|
|
3138
|
+
// After iframe remount, keyboard state is reset. Start deterministically from first.
|
|
3139
|
+
focusElementAt(0);
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3142
|
+
const nextIndex =
|
|
3143
|
+
direction === 'prev'
|
|
3144
|
+
? (focusedIndex - 1 + elements.length) % elements.length
|
|
3145
|
+
: (focusedIndex + 1) % elements.length;
|
|
3146
|
+
focusElementAt(nextIndex);
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
function handleKeyboardNavigation(event){
|
|
3150
|
+
if(!keyboardNavigationMode){
|
|
3151
|
+
return;
|
|
3152
|
+
}
|
|
3153
|
+
if(event.key === 'Tab' && event.shiftKey){
|
|
3154
|
+
keyboardNavigationMode = false;
|
|
3155
|
+
clearFocusedElement();
|
|
3156
|
+
sendMessage({ type: 'kbExitBackward' });
|
|
3157
|
+
event.preventDefault();
|
|
3158
|
+
return;
|
|
3159
|
+
}
|
|
3160
|
+
if(event.key === 'ArrowLeft' || event.key === 'ArrowRight'){
|
|
3161
|
+
moveFocus(event.key === 'ArrowLeft' ? 'prev' : 'next');
|
|
3162
|
+
event.preventDefault();
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
if(event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar'){
|
|
3166
|
+
if(!focusedElement){
|
|
3167
|
+
focusElementAt(0);
|
|
3168
|
+
}
|
|
3169
|
+
if(focusedElement){
|
|
3170
|
+
sendFocusMessage(focusedElement, 'click');
|
|
3171
|
+
}
|
|
3172
|
+
event.preventDefault();
|
|
3173
|
+
}
|
|
2757
3174
|
}
|
|
2758
3175
|
registerListeners();
|
|
3176
|
+
|
|
3177
|
+
window.addEventListener('keydown', () => {
|
|
3178
|
+
lastInputModality = 'keyboard';
|
|
3179
|
+
}, true);
|
|
3180
|
+
|
|
3181
|
+
window.addEventListener('pointerdown', () => {
|
|
3182
|
+
lastInputModality = 'pointer';
|
|
3183
|
+
}, true);
|
|
3184
|
+
|
|
3185
|
+
window.addEventListener('mousedown', () => {
|
|
3186
|
+
lastInputModality = 'pointer';
|
|
3187
|
+
}, true);
|
|
3188
|
+
|
|
3189
|
+
window.addEventListener('focus', () => {
|
|
3190
|
+
if(lastInputModality !== 'pointer'){
|
|
3191
|
+
keyboardNavigationMode = true;
|
|
3192
|
+
}
|
|
3193
|
+
if(!keyboardNavigationMode){
|
|
3194
|
+
return;
|
|
3195
|
+
}
|
|
3196
|
+
if(!focusedElement){
|
|
3197
|
+
focusElementAt(0);
|
|
3198
|
+
}
|
|
3199
|
+
});
|
|
3200
|
+
|
|
3201
|
+
window.addEventListener('blur', () => {
|
|
3202
|
+
keyboardNavigationMode = false;
|
|
3203
|
+
lastInputModality = 'unknown';
|
|
3204
|
+
clearFocusedElement();
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
window.addEventListener('keydown', event => {
|
|
3208
|
+
handleKeyboardNavigation(event);
|
|
3209
|
+
});
|
|
2759
3210
|
<\/script>
|
|
2760
3211
|
</body></html>`;
|
|
2761
3212
|
}
|
|
3213
|
+
static isInvalidIframeMessage(nonce, expectedNonce, origin, jsdom) {
|
|
3214
|
+
return nonce !== expectedNonce || !jsdom && origin !== "null";
|
|
3215
|
+
}
|
|
3216
|
+
static dispatchKbExitBackwardEvent(div) {
|
|
3217
|
+
const mEvent = new CustomEvent("kbExitBackward", {
|
|
3218
|
+
bubbles: true,
|
|
3219
|
+
cancelable: false,
|
|
3220
|
+
composed: true
|
|
3221
|
+
});
|
|
3222
|
+
div.dispatchEvent(mEvent);
|
|
3223
|
+
}
|
|
3224
|
+
static dispatchKbAreaHoverEvent(div, boundingRect, payload) {
|
|
3225
|
+
const { clientX, clientY, anchorX, anchorY, value, name, tooltipText, eventType, interactionSource } = payload;
|
|
3226
|
+
const hoverEvent = new CustomEvent("areaHover", {
|
|
3227
|
+
detail: {
|
|
3228
|
+
clientX: Number.isFinite(clientX) ? Math.round(clientX + boundingRect.left) : void 0,
|
|
3229
|
+
clientY: Number.isFinite(clientY) ? Math.round(clientY + boundingRect.top) : void 0,
|
|
3230
|
+
anchorX: Number.isFinite(anchorX) ? Math.round(anchorX + boundingRect.left) : void 0,
|
|
3231
|
+
anchorY: Number.isFinite(anchorY) ? Math.round(anchorY + boundingRect.top) : void 0,
|
|
3232
|
+
value,
|
|
3233
|
+
name,
|
|
3234
|
+
tooltipText,
|
|
3235
|
+
eventType,
|
|
3236
|
+
interactionSource
|
|
3237
|
+
},
|
|
3238
|
+
bubbles: true,
|
|
3239
|
+
cancelable: true,
|
|
3240
|
+
composed: true
|
|
3241
|
+
});
|
|
3242
|
+
div.dispatchEvent(hoverEvent);
|
|
3243
|
+
}
|
|
3244
|
+
static dispatchKbTooltipAnnouncementEvent(div, tooltipText) {
|
|
3245
|
+
const mEvent = new CustomEvent("kbTooltipAnnouncement", {
|
|
3246
|
+
detail: { text: tooltipText || "" },
|
|
3247
|
+
bubbles: true,
|
|
3248
|
+
cancelable: false,
|
|
3249
|
+
composed: true
|
|
3250
|
+
});
|
|
3251
|
+
div.dispatchEvent(mEvent);
|
|
3252
|
+
}
|
|
3253
|
+
static dispatchOutlineFocusEvent(div) {
|
|
3254
|
+
const outlineDiv = div.closest('[data-test="select-outline"]');
|
|
3255
|
+
if (!outlineDiv) {
|
|
3256
|
+
return;
|
|
3257
|
+
}
|
|
3258
|
+
const focusEvent = new FocusEvent("focusin", {
|
|
3259
|
+
relatedTarget: outlineDiv
|
|
3260
|
+
});
|
|
3261
|
+
outlineDiv.dispatchEvent(focusEvent);
|
|
3262
|
+
}
|
|
3263
|
+
static dispatchAreaClickEvent(div, clientX, clientY, value, name, eventSetting) {
|
|
3264
|
+
const clickEvent = new CustomEvent("areaClick", __spreadValues({
|
|
3265
|
+
detail: {
|
|
3266
|
+
clientX,
|
|
3267
|
+
clientY,
|
|
3268
|
+
value,
|
|
3269
|
+
name
|
|
3270
|
+
}
|
|
3271
|
+
}, eventSetting));
|
|
3272
|
+
_SvgMutator.dispatchOutlineFocusEvent(div);
|
|
3273
|
+
div.dispatchEvent(clickEvent);
|
|
3274
|
+
}
|
|
3275
|
+
static dispatchMouseAndHoverEvents(div, boundingRect, payload, eventSetting) {
|
|
3276
|
+
const { eventType, clientX, clientY, anchorX, anchorY, value, name, tooltipText, interactionSource } = payload;
|
|
3277
|
+
const mouseEvent = new MouseEvent(eventType, __spreadValues({
|
|
3278
|
+
clientX,
|
|
3279
|
+
clientY
|
|
3280
|
+
}, eventSetting));
|
|
3281
|
+
const hoverEvent = new CustomEvent("areaHover", __spreadValues({
|
|
3282
|
+
detail: {
|
|
3283
|
+
clientX,
|
|
3284
|
+
clientY,
|
|
3285
|
+
anchorX: Number.isFinite(anchorX) ? Math.round(anchorX + boundingRect.left) : clientX,
|
|
3286
|
+
anchorY: Number.isFinite(anchorY) ? Math.round(anchorY + boundingRect.top) : clientY,
|
|
3287
|
+
value,
|
|
3288
|
+
name,
|
|
3289
|
+
tooltipText,
|
|
3290
|
+
eventType,
|
|
3291
|
+
interactionSource
|
|
3292
|
+
}
|
|
3293
|
+
}, eventSetting));
|
|
3294
|
+
div.dispatchEvent(hoverEvent);
|
|
3295
|
+
div.dispatchEvent(mouseEvent);
|
|
3296
|
+
}
|
|
2762
3297
|
static createIframeMessageListener(expectedNonce, intervalId, div, jsdom = false) {
|
|
2763
3298
|
return (m) => {
|
|
2764
|
-
const {
|
|
2765
|
-
|
|
3299
|
+
const {
|
|
3300
|
+
nonce,
|
|
3301
|
+
eventType,
|
|
3302
|
+
clientX,
|
|
3303
|
+
clientY,
|
|
3304
|
+
value,
|
|
3305
|
+
name,
|
|
3306
|
+
type,
|
|
3307
|
+
tooltipText,
|
|
3308
|
+
anchorX,
|
|
3309
|
+
anchorY,
|
|
3310
|
+
interactionSource
|
|
3311
|
+
} = m.data;
|
|
3312
|
+
if (_SvgMutator.isInvalidIframeMessage(nonce, expectedNonce, m.origin, jsdom)) {
|
|
2766
3313
|
return;
|
|
2767
3314
|
}
|
|
2768
3315
|
if (intervalId) {
|
|
2769
3316
|
clearInterval(intervalId);
|
|
2770
3317
|
}
|
|
2771
3318
|
const boundingRect = div.getBoundingClientRect();
|
|
2772
|
-
if (
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
}
|
|
2797
|
-
} else {
|
|
2798
|
-
mEvent = new MouseEvent(eventType, __spreadValues({
|
|
2799
|
-
clientX: realClientX,
|
|
2800
|
-
clientY: realClientY
|
|
2801
|
-
}, eventSetting));
|
|
2802
|
-
}
|
|
2803
|
-
div.dispatchEvent(mEvent);
|
|
3319
|
+
if (type === "kbExitBackward") {
|
|
3320
|
+
_SvgMutator.dispatchKbExitBackwardEvent(div);
|
|
3321
|
+
return;
|
|
3322
|
+
}
|
|
3323
|
+
if (type === "kbAreaHover") {
|
|
3324
|
+
_SvgMutator.dispatchKbAreaHoverEvent(div, boundingRect, {
|
|
3325
|
+
clientX,
|
|
3326
|
+
clientY,
|
|
3327
|
+
anchorX,
|
|
3328
|
+
anchorY,
|
|
3329
|
+
value,
|
|
3330
|
+
name,
|
|
3331
|
+
tooltipText,
|
|
3332
|
+
eventType,
|
|
3333
|
+
interactionSource
|
|
3334
|
+
});
|
|
3335
|
+
return;
|
|
3336
|
+
}
|
|
3337
|
+
if (type === "kbTooltipAnnouncement") {
|
|
3338
|
+
_SvgMutator.dispatchKbTooltipAnnouncementEvent(div, tooltipText);
|
|
3339
|
+
return;
|
|
3340
|
+
}
|
|
3341
|
+
if (!eventType || !Number.isFinite(clientX) || !Number.isFinite(clientY)) {
|
|
3342
|
+
return;
|
|
2804
3343
|
}
|
|
3344
|
+
const realClientX = Math.round(clientX + boundingRect.left);
|
|
3345
|
+
const realClientY = Math.round(clientY + boundingRect.top);
|
|
3346
|
+
const eventSetting = {
|
|
3347
|
+
bubbles: true,
|
|
3348
|
+
cancelable: true,
|
|
3349
|
+
composed: true
|
|
3350
|
+
};
|
|
3351
|
+
if (eventType === "click") {
|
|
3352
|
+
_SvgMutator.dispatchAreaClickEvent(div, realClientX, realClientY, value, name, eventSetting);
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
_SvgMutator.dispatchMouseAndHoverEvents(
|
|
3356
|
+
div,
|
|
3357
|
+
boundingRect,
|
|
3358
|
+
{
|
|
3359
|
+
eventType,
|
|
3360
|
+
clientX: realClientX,
|
|
3361
|
+
clientY: realClientY,
|
|
3362
|
+
anchorX,
|
|
3363
|
+
anchorY,
|
|
3364
|
+
value,
|
|
3365
|
+
name,
|
|
3366
|
+
tooltipText,
|
|
3367
|
+
interactionSource
|
|
3368
|
+
},
|
|
3369
|
+
eventSetting
|
|
3370
|
+
);
|
|
2805
3371
|
};
|
|
2806
3372
|
}
|
|
2807
3373
|
static removeIframeEventListener(element, messageListener, intervalID, refCallback) {
|
|
@@ -2814,25 +3380,48 @@ value: ${data.values[i]}`;
|
|
|
2814
3380
|
refCallback(element);
|
|
2815
3381
|
}
|
|
2816
3382
|
};
|
|
2817
|
-
_SvgMutator
|
|
3383
|
+
__publicField(_SvgMutator, "serializer", new xmldom_exports.XMLSerializer());
|
|
2818
3384
|
var SvgMutator = _SvgMutator;
|
|
2819
3385
|
|
|
2820
3386
|
// src/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.tsx
|
|
2821
3387
|
var SvgChoroplethDynamic = class extends react_exports.Component {
|
|
2822
3388
|
constructor(props, context) {
|
|
2823
3389
|
super(props, context);
|
|
2824
|
-
this
|
|
3390
|
+
__publicField(this, "node");
|
|
3391
|
+
__publicField(this, "handleAreaClick", (ev) => {
|
|
3392
|
+
const customEvent = ev;
|
|
2825
3393
|
if (typeof this.props.onAreaClick === "function") {
|
|
2826
|
-
this.props.onAreaClick(__spreadProps(__spreadValues({},
|
|
3394
|
+
this.props.onAreaClick(__spreadProps(__spreadValues({}, customEvent), { payload: customEvent.detail }));
|
|
2827
3395
|
}
|
|
2828
|
-
};
|
|
2829
|
-
this
|
|
2830
|
-
|
|
3396
|
+
});
|
|
3397
|
+
__publicField(this, "handleAreaKeydown", (ev) => {
|
|
3398
|
+
var _a, _b;
|
|
3399
|
+
const customEvent = ev;
|
|
3400
|
+
const key = (_b = (_a = customEvent.detail) == null ? void 0 : _a.key) != null ? _b : customEvent.key;
|
|
3401
|
+
const isActivationKey = key === "Enter" || key === " " || key === "Spacebar";
|
|
3402
|
+
if (typeof this.props.onAreaKeydown === "function") {
|
|
3403
|
+
this.props.onAreaKeydown(__spreadProps(__spreadValues({}, customEvent), { payload: customEvent.detail }));
|
|
3404
|
+
}
|
|
3405
|
+
if (isActivationKey && typeof this.props.onAreaClick === "function") {
|
|
3406
|
+
this.props.onAreaClick(__spreadProps(__spreadValues({}, customEvent), { payload: customEvent.detail }));
|
|
3407
|
+
}
|
|
3408
|
+
});
|
|
3409
|
+
__publicField(this, "handleAreaHover", (ev) => {
|
|
3410
|
+
const customEvent = ev;
|
|
3411
|
+
if (typeof this.props.onAreaHover === "function") {
|
|
3412
|
+
this.props.onAreaHover(__spreadProps(__spreadValues({}, customEvent), { payload: customEvent.detail }));
|
|
3413
|
+
}
|
|
3414
|
+
});
|
|
3415
|
+
__publicField(this, "rootRef", (node) => {
|
|
3416
|
+
if (this.node === node) {
|
|
3417
|
+
this.setForwardedRef(node);
|
|
2831
3418
|
return;
|
|
2832
3419
|
}
|
|
2833
|
-
|
|
3420
|
+
this.detachListeners(this.node);
|
|
3421
|
+
this.attachListeners(node);
|
|
2834
3422
|
this.node = node;
|
|
2835
|
-
|
|
3423
|
+
this.setForwardedRef(node);
|
|
3424
|
+
});
|
|
2836
3425
|
this.state = { svgNode: null, renderCT: 0 };
|
|
2837
3426
|
this.node = null;
|
|
2838
3427
|
}
|
|
@@ -2849,9 +3438,35 @@ var SvgChoroplethDynamic = class extends react_exports.Component {
|
|
|
2849
3438
|
}
|
|
2850
3439
|
}
|
|
2851
3440
|
componentWillUnmount() {
|
|
2852
|
-
|
|
2853
|
-
|
|
3441
|
+
this.detachListeners(this.node);
|
|
3442
|
+
this.setForwardedRef(null);
|
|
3443
|
+
}
|
|
3444
|
+
setForwardedRef(node) {
|
|
3445
|
+
const { forwardedRef } = this.props;
|
|
3446
|
+
if (!forwardedRef) {
|
|
3447
|
+
return;
|
|
3448
|
+
}
|
|
3449
|
+
if (typeof forwardedRef === "function") {
|
|
3450
|
+
forwardedRef(node);
|
|
3451
|
+
return;
|
|
3452
|
+
}
|
|
3453
|
+
forwardedRef.current = node;
|
|
3454
|
+
}
|
|
3455
|
+
detachListeners(node) {
|
|
3456
|
+
if (!node) {
|
|
3457
|
+
return;
|
|
3458
|
+
}
|
|
3459
|
+
node.removeEventListener("areaClick", this.handleAreaClick);
|
|
3460
|
+
node.removeEventListener("areaHover", this.handleAreaHover);
|
|
3461
|
+
node.removeEventListener("areaKeydown", this.handleAreaKeydown);
|
|
3462
|
+
}
|
|
3463
|
+
attachListeners(node) {
|
|
3464
|
+
if (!node) {
|
|
3465
|
+
return;
|
|
2854
3466
|
}
|
|
3467
|
+
node.addEventListener("areaClick", this.handleAreaClick);
|
|
3468
|
+
node.addEventListener("areaHover", this.handleAreaHover);
|
|
3469
|
+
node.addEventListener("areaKeydown", this.handleAreaKeydown);
|
|
2855
3470
|
}
|
|
2856
3471
|
mutate() {
|
|
2857
3472
|
const { svg } = this.props;
|
|
@@ -2867,23 +3482,33 @@ var SvgChoroplethDynamic = class extends react_exports.Component {
|
|
|
2867
3482
|
}
|
|
2868
3483
|
}
|
|
2869
3484
|
render() {
|
|
2870
|
-
const { width = "100%", height = "100%" } = this.props;
|
|
3485
|
+
const { width = "100%", height = "100%", onFocus, onKeyDown } = this.props;
|
|
2871
3486
|
const { svgNode, renderCT } = this.state;
|
|
2872
3487
|
if (svgNode) {
|
|
2873
|
-
return
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
"
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
3488
|
+
return (
|
|
3489
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
3490
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3491
|
+
"div",
|
|
3492
|
+
{
|
|
3493
|
+
"data-test": "svgChoroplethDynamic",
|
|
3494
|
+
style: { width, height, outline: "none" },
|
|
3495
|
+
ref: this.rootRef,
|
|
3496
|
+
key: renderCT,
|
|
3497
|
+
onFocus,
|
|
3498
|
+
onKeyDown
|
|
3499
|
+
},
|
|
3500
|
+
svgNode
|
|
3501
|
+
)
|
|
2882
3502
|
);
|
|
2883
3503
|
}
|
|
2884
3504
|
return null;
|
|
2885
3505
|
}
|
|
2886
3506
|
};
|
|
3507
|
+
var ForwardedSvgChoroplethDynamic = react_exports.forwardRef(
|
|
3508
|
+
(props, ref) => /* @__PURE__ */ react_exports.createElement(SvgChoroplethDynamic, __spreadProps(__spreadValues({}, props), { forwardedRef: ref }))
|
|
3509
|
+
);
|
|
3510
|
+
ForwardedSvgChoroplethDynamic.displayName = "SvgChoroplethDynamic";
|
|
3511
|
+
var SvgChoroplethDynamic_default = ForwardedSvgChoroplethDynamic;
|
|
2887
3512
|
|
|
2888
3513
|
// src/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.tsx
|
|
2889
3514
|
var Container = styled_components_default.div`
|
|
@@ -2898,6 +3523,41 @@ var ChoroplethSvgWrapper = styled_components_default.div`
|
|
|
2898
3523
|
flex: 1;
|
|
2899
3524
|
position: relative;
|
|
2900
3525
|
`;
|
|
3526
|
+
var LiveRegion = styled_components_default.div`
|
|
3527
|
+
position: absolute;
|
|
3528
|
+
width: 1px;
|
|
3529
|
+
height: 1px;
|
|
3530
|
+
padding: 0;
|
|
3531
|
+
margin: -1px;
|
|
3532
|
+
overflow: hidden;
|
|
3533
|
+
clip: rect(0 0 0 0);
|
|
3534
|
+
white-space: nowrap;
|
|
3535
|
+
border: 0;
|
|
3536
|
+
`;
|
|
3537
|
+
var KeyboardNavButton = styled_components_default(Button_default)`
|
|
3538
|
+
${themes_exports.mixins.skipLink()}
|
|
3539
|
+
position: absolute;
|
|
3540
|
+
top: 8px;
|
|
3541
|
+
right: 8px;
|
|
3542
|
+
z-index: 2;
|
|
3543
|
+
/**
|
|
3544
|
+
* Need to override the secondary Button's specificity to set a background color
|
|
3545
|
+
* because it's explicitly set as transparent by default
|
|
3546
|
+
*/
|
|
3547
|
+
&:not([disabled], [aria-disabled='true']) {
|
|
3548
|
+
background-color: ${themes_exports.variables.backgroundColorSection};
|
|
3549
|
+
|
|
3550
|
+
&:hover,
|
|
3551
|
+
&:active,
|
|
3552
|
+
&:focus,
|
|
3553
|
+
&:focus-visible {
|
|
3554
|
+
background-color: ${themes_exports.variables.backgroundColorSection};
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
`;
|
|
3558
|
+
var ChoroplethTooltipContent = styled_components_default.span`
|
|
3559
|
+
white-space: pre-line;
|
|
3560
|
+
`;
|
|
2901
3561
|
var computeSvgDynamicProps = (_a) => {
|
|
2902
3562
|
var props = __objRest(_a, []);
|
|
2903
3563
|
const data = {
|
|
@@ -2916,24 +3576,244 @@ var computeSvgDynamicProps = (_a) => {
|
|
|
2916
3576
|
dataBinding
|
|
2917
3577
|
});
|
|
2918
3578
|
};
|
|
3579
|
+
var keyboardNavBtnText = (0, i18n_exports._)("Navigate map with left or right arrow");
|
|
2919
3580
|
var PureChoroplethSvg = (_a) => {
|
|
2920
3581
|
var props = __objRest(_a, []);
|
|
2921
3582
|
const { width = "100%", height = 250, backgroundColor } = props;
|
|
3583
|
+
const [keyboardNavigationEnabled, setKeyboardNavigationEnabled] = react_exports.useState(false);
|
|
3584
|
+
const [liveRegionMessage, setLiveRegionMessage] = react_exports.useState("");
|
|
3585
|
+
const wrapperRef = react_exports.useRef(null);
|
|
3586
|
+
const keyboardNavButtonRef = react_exports.useRef(null);
|
|
2922
3587
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
2923
3588
|
setContainerWidth(w);
|
|
2924
3589
|
setContainerHeight(h);
|
|
2925
3590
|
}, []);
|
|
2926
3591
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(width));
|
|
2927
3592
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(height));
|
|
3593
|
+
const [wrapperElement, setWrapperElement] = react_exports.useState(null);
|
|
3594
|
+
const hoverTooltipTimerRef = react_exports.useRef(null);
|
|
3595
|
+
const [areaTooltip, setAreaTooltip] = react_exports.useState({
|
|
3596
|
+
open: false,
|
|
3597
|
+
text: "",
|
|
3598
|
+
x: 0,
|
|
3599
|
+
y: 0
|
|
3600
|
+
});
|
|
3601
|
+
const focusIframe = react_exports.useCallback(() => {
|
|
3602
|
+
var _a2;
|
|
3603
|
+
const iframe = (_a2 = wrapperRef.current) == null ? void 0 : _a2.querySelector("#svgChoroplethIframe");
|
|
3604
|
+
if (!iframe) {
|
|
3605
|
+
return;
|
|
3606
|
+
}
|
|
3607
|
+
iframe.focus();
|
|
3608
|
+
}, []);
|
|
3609
|
+
const blurIframe = react_exports.useCallback(() => {
|
|
3610
|
+
var _a2;
|
|
3611
|
+
const iframe = (_a2 = wrapperRef.current) == null ? void 0 : _a2.querySelector("#svgChoroplethIframe");
|
|
3612
|
+
if (!iframe) {
|
|
3613
|
+
return;
|
|
3614
|
+
}
|
|
3615
|
+
iframe.blur();
|
|
3616
|
+
}, []);
|
|
3617
|
+
const handleWrapperRef = react_exports.useCallback((node) => {
|
|
3618
|
+
wrapperRef.current = node;
|
|
3619
|
+
setWrapperElement(node);
|
|
3620
|
+
}, []);
|
|
3621
|
+
react_exports.useEffect(() => {
|
|
3622
|
+
var _a2, _b;
|
|
3623
|
+
if (keyboardNavigationEnabled) {
|
|
3624
|
+
(_a2 = wrapperRef.current) == null ? void 0 : _a2.blur();
|
|
3625
|
+
focusIframe();
|
|
3626
|
+
} else {
|
|
3627
|
+
(_b = wrapperRef.current) == null ? void 0 : _b.blur();
|
|
3628
|
+
blurIframe();
|
|
3629
|
+
if (hoverTooltipTimerRef.current) {
|
|
3630
|
+
window.clearTimeout(hoverTooltipTimerRef.current);
|
|
3631
|
+
hoverTooltipTimerRef.current = null;
|
|
3632
|
+
}
|
|
3633
|
+
setAreaTooltip((prev) => __spreadProps(__spreadValues({}, prev), { open: false, text: "" }));
|
|
3634
|
+
setLiveRegionMessage("");
|
|
3635
|
+
}
|
|
3636
|
+
}, [keyboardNavigationEnabled, focusIframe, blurIframe]);
|
|
3637
|
+
react_exports.useEffect(() => {
|
|
3638
|
+
if (!keyboardNavigationEnabled) {
|
|
3639
|
+
return () => {
|
|
3640
|
+
};
|
|
3641
|
+
}
|
|
3642
|
+
const shouldDisableKeyboardNav = (target) => {
|
|
3643
|
+
const wrapperNode = wrapperRef.current;
|
|
3644
|
+
if (!wrapperNode || !(target instanceof Node)) {
|
|
3645
|
+
return false;
|
|
3646
|
+
}
|
|
3647
|
+
return !wrapperNode.contains(target);
|
|
3648
|
+
};
|
|
3649
|
+
const handleMouseDownOutside = (mouseEvent) => {
|
|
3650
|
+
if (shouldDisableKeyboardNav(mouseEvent.target)) {
|
|
3651
|
+
setKeyboardNavigationEnabled(false);
|
|
3652
|
+
}
|
|
3653
|
+
};
|
|
3654
|
+
const handleMouseDragOutside = (mouseEvent) => {
|
|
3655
|
+
if (mouseEvent.buttons > 0 && shouldDisableKeyboardNav(mouseEvent.target)) {
|
|
3656
|
+
setKeyboardNavigationEnabled(false);
|
|
3657
|
+
}
|
|
3658
|
+
};
|
|
3659
|
+
const handleWindowResize = () => {
|
|
3660
|
+
setKeyboardNavigationEnabled(false);
|
|
3661
|
+
};
|
|
3662
|
+
window.addEventListener("mousedown", handleMouseDownOutside, true);
|
|
3663
|
+
window.addEventListener("mousemove", handleMouseDragOutside, true);
|
|
3664
|
+
window.addEventListener("resize", handleWindowResize);
|
|
3665
|
+
return () => {
|
|
3666
|
+
window.removeEventListener("mousedown", handleMouseDownOutside, true);
|
|
3667
|
+
window.removeEventListener("mousemove", handleMouseDragOutside, true);
|
|
3668
|
+
window.removeEventListener("resize", handleWindowResize);
|
|
3669
|
+
};
|
|
3670
|
+
}, [keyboardNavigationEnabled]);
|
|
3671
|
+
react_exports.useEffect(() => {
|
|
3672
|
+
if (!wrapperElement) {
|
|
3673
|
+
return () => {
|
|
3674
|
+
};
|
|
3675
|
+
}
|
|
3676
|
+
const handleTooltipAnnouncement = (event) => {
|
|
3677
|
+
var _a2;
|
|
3678
|
+
const customEvent = event;
|
|
3679
|
+
setLiveRegionMessage(((_a2 = customEvent.detail) == null ? void 0 : _a2.text) || "");
|
|
3680
|
+
};
|
|
3681
|
+
const handleKeyboardExitBackward = () => {
|
|
3682
|
+
var _a2;
|
|
3683
|
+
setKeyboardNavigationEnabled(false);
|
|
3684
|
+
(_a2 = keyboardNavButtonRef.current) == null ? void 0 : _a2.focus();
|
|
3685
|
+
};
|
|
3686
|
+
wrapperElement.addEventListener("kbTooltipAnnouncement", handleTooltipAnnouncement);
|
|
3687
|
+
wrapperElement.addEventListener("kbExitBackward", handleKeyboardExitBackward);
|
|
3688
|
+
return () => {
|
|
3689
|
+
wrapperElement.removeEventListener("kbTooltipAnnouncement", handleTooltipAnnouncement);
|
|
3690
|
+
wrapperElement.removeEventListener("kbExitBackward", handleKeyboardExitBackward);
|
|
3691
|
+
};
|
|
3692
|
+
}, [wrapperElement]);
|
|
3693
|
+
react_exports.useEffect(() => {
|
|
3694
|
+
return () => {
|
|
3695
|
+
if (hoverTooltipTimerRef.current) {
|
|
3696
|
+
window.clearTimeout(hoverTooltipTimerRef.current);
|
|
3697
|
+
hoverTooltipTimerRef.current = null;
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
}, []);
|
|
3701
|
+
const handleAreaHover = react_exports.useCallback((event) => {
|
|
3702
|
+
const payload = (event == null ? void 0 : event.payload) || {};
|
|
3703
|
+
const { eventType, clientX, clientY, anchorX, anchorY, name, value, interactionSource } = payload;
|
|
3704
|
+
const applyTooltipPosition = () => {
|
|
3705
|
+
const text = SvgMutator.getTitle(
|
|
3706
|
+
{
|
|
3707
|
+
featureIDs: [name],
|
|
3708
|
+
values: [value]
|
|
3709
|
+
},
|
|
3710
|
+
0
|
|
3711
|
+
);
|
|
3712
|
+
if (!text || !wrapperRef.current) {
|
|
3713
|
+
setAreaTooltip((prev) => __spreadProps(__spreadValues({}, prev), { open: false, text: "" }));
|
|
3714
|
+
return;
|
|
3715
|
+
}
|
|
3716
|
+
const anchorRect = wrapperRef.current.getBoundingClientRect();
|
|
3717
|
+
const hostX = Number.isFinite(anchorX) ? anchorX : clientX;
|
|
3718
|
+
const hostY = Number.isFinite(anchorY) ? anchorY : clientY;
|
|
3719
|
+
setAreaTooltip({
|
|
3720
|
+
open: true,
|
|
3721
|
+
text,
|
|
3722
|
+
x: Math.max(0, Math.round(hostX - anchorRect.left)),
|
|
3723
|
+
y: Math.max(0, Math.round(hostY - anchorRect.top))
|
|
3724
|
+
});
|
|
3725
|
+
};
|
|
3726
|
+
if (eventType === "mouseout") {
|
|
3727
|
+
if (hoverTooltipTimerRef.current) {
|
|
3728
|
+
window.clearTimeout(hoverTooltipTimerRef.current);
|
|
3729
|
+
hoverTooltipTimerRef.current = null;
|
|
3730
|
+
}
|
|
3731
|
+
setAreaTooltip((prev) => __spreadProps(__spreadValues({}, prev), { open: false, text: "" }));
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3734
|
+
if (interactionSource === "mouse" && (eventType === "mouseover" || eventType === "mousemove")) {
|
|
3735
|
+
if (hoverTooltipTimerRef.current) {
|
|
3736
|
+
window.clearTimeout(hoverTooltipTimerRef.current);
|
|
3737
|
+
}
|
|
3738
|
+
hoverTooltipTimerRef.current = window.setTimeout(() => {
|
|
3739
|
+
applyTooltipPosition();
|
|
3740
|
+
}, 120);
|
|
3741
|
+
return;
|
|
3742
|
+
}
|
|
3743
|
+
if (hoverTooltipTimerRef.current) {
|
|
3744
|
+
window.clearTimeout(hoverTooltipTimerRef.current);
|
|
3745
|
+
hoverTooltipTimerRef.current = null;
|
|
3746
|
+
}
|
|
3747
|
+
applyTooltipPosition();
|
|
3748
|
+
}, []);
|
|
2928
3749
|
const renderVisualization = () => {
|
|
2929
3750
|
if (!containerWidth || !containerHeight) {
|
|
2930
3751
|
return null;
|
|
2931
3752
|
}
|
|
2932
3753
|
const svgProps = computeSvgDynamicProps(__spreadProps(__spreadValues({}, props), {
|
|
2933
3754
|
width: containerWidth,
|
|
2934
|
-
height: containerHeight
|
|
3755
|
+
height: containerHeight,
|
|
3756
|
+
keyboardNavigationEnabled
|
|
2935
3757
|
}));
|
|
2936
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
3758
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3759
|
+
VizStyleWrapper_default,
|
|
3760
|
+
{
|
|
3761
|
+
backgroundColor,
|
|
3762
|
+
dataTestKey: "ChoroplethSvgWrapper",
|
|
3763
|
+
ref: handleWrapperRef,
|
|
3764
|
+
style: keyboardNavigationEnabled ? { outline: "none" } : void 0,
|
|
3765
|
+
"aria-label": "Choropleth SVG container",
|
|
3766
|
+
onBlurCapture: (event) => {
|
|
3767
|
+
var _a2;
|
|
3768
|
+
const nextTarget = (_a2 = event.relatedTarget) != null ? _a2 : document.activeElement;
|
|
3769
|
+
if (!nextTarget || !event.currentTarget.contains(nextTarget)) {
|
|
3770
|
+
setKeyboardNavigationEnabled(false);
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
},
|
|
3774
|
+
props.mode !== "edit" ? /* @__PURE__ */ react_exports.createElement(
|
|
3775
|
+
KeyboardNavButton,
|
|
3776
|
+
{
|
|
3777
|
+
onClick: () => setKeyboardNavigationEnabled(true),
|
|
3778
|
+
elementRef: keyboardNavButtonRef
|
|
3779
|
+
},
|
|
3780
|
+
keyboardNavBtnText
|
|
3781
|
+
) : null,
|
|
3782
|
+
/* @__PURE__ */ react_exports.createElement(LiveRegion, { "aria-live": "polite", "aria-atomic": "true" }, liveRegionMessage),
|
|
3783
|
+
/* @__PURE__ */ react_exports.createElement(SvgChoroplethDynamic_default, __spreadProps(__spreadValues({}, svgProps), { onAreaHover: handleAreaHover })),
|
|
3784
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3785
|
+
Tooltip_default,
|
|
3786
|
+
{
|
|
3787
|
+
open: areaTooltip.open,
|
|
3788
|
+
content: /* @__PURE__ */ react_exports.createElement(ChoroplethTooltipContent, null, areaTooltip.text),
|
|
3789
|
+
inline: false,
|
|
3790
|
+
defaultPlacement: "right",
|
|
3791
|
+
renderAnchor: (anchorProps) => {
|
|
3792
|
+
const _a2 = anchorProps, { elementRef } = _a2, restAnchorProps = __objRest(_a2, ["elementRef"]);
|
|
3793
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3794
|
+
"span",
|
|
3795
|
+
__spreadProps(__spreadValues({}, restAnchorProps), {
|
|
3796
|
+
ref: (node) => {
|
|
3797
|
+
if (typeof elementRef === "function") {
|
|
3798
|
+
elementRef(node);
|
|
3799
|
+
} else if (elementRef && "current" in elementRef) {
|
|
3800
|
+
elementRef.current = node;
|
|
3801
|
+
}
|
|
3802
|
+
},
|
|
3803
|
+
style: {
|
|
3804
|
+
position: "absolute",
|
|
3805
|
+
left: areaTooltip.x,
|
|
3806
|
+
top: areaTooltip.y,
|
|
3807
|
+
width: 0,
|
|
3808
|
+
height: 0,
|
|
3809
|
+
pointerEvents: "none"
|
|
3810
|
+
}
|
|
3811
|
+
})
|
|
3812
|
+
);
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
)
|
|
3816
|
+
);
|
|
2937
3817
|
};
|
|
2938
3818
|
return /* @__PURE__ */ react_exports.createElement(Container, { width, height }, /* @__PURE__ */ react_exports.createElement(ChoroplethSvgWrapper, null, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), renderVisualization()));
|
|
2939
3819
|
};
|
|
@@ -2944,36 +3824,36 @@ var PresetPalettes_exports = {};
|
|
|
2944
3824
|
__export(PresetPalettes_exports, {
|
|
2945
3825
|
default: () => PresetPalettes_default
|
|
2946
3826
|
});
|
|
2947
|
-
var
|
|
3827
|
+
var defaultImport38 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
2948
3828
|
__reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
2949
|
-
var PresetPalettes_default = "default" in
|
|
3829
|
+
var PresetPalettes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
|
|
2950
3830
|
|
|
2951
3831
|
// esm-externals:@splunk/visualization-icons
|
|
2952
3832
|
var visualization_icons_exports = {};
|
|
2953
3833
|
__export(visualization_icons_exports, {
|
|
2954
3834
|
default: () => visualization_icons_default
|
|
2955
3835
|
});
|
|
2956
|
-
var
|
|
3836
|
+
var defaultImport39 = __toESM(require("@splunk/visualization-icons"));
|
|
2957
3837
|
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
2958
|
-
var visualization_icons_default = "default" in
|
|
3838
|
+
var visualization_icons_default = "default" in defaultImport39 ? defaultImport39.default : defaultImport39;
|
|
2959
3839
|
|
|
2960
3840
|
// esm-externals:@splunk/visualization-icons/placeholders
|
|
2961
3841
|
var placeholders_exports = {};
|
|
2962
3842
|
__export(placeholders_exports, {
|
|
2963
3843
|
default: () => placeholders_default
|
|
2964
3844
|
});
|
|
2965
|
-
var
|
|
3845
|
+
var defaultImport40 = __toESM(require("@splunk/visualization-icons/placeholders"));
|
|
2966
3846
|
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
2967
|
-
var placeholders_default = "default" in
|
|
3847
|
+
var placeholders_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
|
|
2968
3848
|
|
|
2969
3849
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
2970
3850
|
var configUtils_exports = {};
|
|
2971
3851
|
__export(configUtils_exports, {
|
|
2972
3852
|
default: () => configUtils_default
|
|
2973
3853
|
});
|
|
2974
|
-
var
|
|
3854
|
+
var defaultImport41 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
2975
3855
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
2976
|
-
var configUtils_default = "default" in
|
|
3856
|
+
var configUtils_default = "default" in defaultImport41 ? defaultImport41.default : defaultImport41;
|
|
2977
3857
|
|
|
2978
3858
|
// src/common/utils/configUtils.ts
|
|
2979
3859
|
function enhanceConfig(vizConfig) {
|
|
@@ -2998,9 +3878,9 @@ var pick_exports = {};
|
|
|
2998
3878
|
__export(pick_exports, {
|
|
2999
3879
|
default: () => pick_default
|
|
3000
3880
|
});
|
|
3001
|
-
var
|
|
3881
|
+
var defaultImport42 = __toESM(require("@splunk/themes/pick"));
|
|
3002
3882
|
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
3003
|
-
var pick_default = "default" in
|
|
3883
|
+
var pick_default = "default" in defaultImport42 ? defaultImport42.default : defaultImport42;
|
|
3004
3884
|
|
|
3005
3885
|
// src/common/ThemedDefaults.tsx
|
|
3006
3886
|
var defaultBackgroundColor = (props) => pick_default({
|
|
@@ -3215,7 +4095,7 @@ var createProtocolHandlers = (featureFlagContext = {}, imageContext = null) => {
|
|
|
3215
4095
|
const handlers = {
|
|
3216
4096
|
data: new Downloader_exports.URLDownloader()
|
|
3217
4097
|
};
|
|
3218
|
-
if (imageContext
|
|
4098
|
+
if (imageContext == null ? void 0 : imageContext.listProviders) {
|
|
3219
4099
|
imageContext.listProviders().forEach(({ type }) => {
|
|
3220
4100
|
handlers[type] = new Downloader_exports.ImageRegistryFetcher(imageContext);
|
|
3221
4101
|
});
|