@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
|
@@ -5,14 +5,31 @@ export declare const isTrellisEnabled: ({ options, featureFlags }: {
|
|
|
5
5
|
options: any;
|
|
6
6
|
featureFlags: any;
|
|
7
7
|
}) => boolean;
|
|
8
|
-
export declare const TrellisEditorConfig:
|
|
8
|
+
export declare const TrellisEditorConfig: {
|
|
9
9
|
label: any;
|
|
10
10
|
option: string;
|
|
11
11
|
editor: string;
|
|
12
12
|
showEditor: ({ featureFlags }: {
|
|
13
13
|
featureFlags: any;
|
|
14
14
|
}) => boolean;
|
|
15
|
-
}[]
|
|
15
|
+
}[][];
|
|
16
|
+
export declare const GaugeTrellisEditorConfig: {
|
|
17
|
+
label: any;
|
|
18
|
+
option: string;
|
|
19
|
+
editor: string;
|
|
20
|
+
showEditor: ({ featureFlags }: {
|
|
21
|
+
featureFlags: any;
|
|
22
|
+
}) => boolean;
|
|
23
|
+
}[][];
|
|
24
|
+
export declare const SingleValueTrellisEditorConfig: {
|
|
25
|
+
label: any;
|
|
26
|
+
option: string;
|
|
27
|
+
editor: string;
|
|
28
|
+
showEditor: ({ featureFlags }: {
|
|
29
|
+
featureFlags: any;
|
|
30
|
+
}) => boolean;
|
|
31
|
+
}[][];
|
|
32
|
+
export declare const TimechartTrellisEditorConfig: ({
|
|
16
33
|
label: any;
|
|
17
34
|
option: string;
|
|
18
35
|
editor: string;
|
|
@@ -34,12 +51,15 @@ export declare const TrellisEditorConfig: ({
|
|
|
34
51
|
options: any;
|
|
35
52
|
featureFlags: any;
|
|
36
53
|
}) => boolean;
|
|
37
|
-
}[]
|
|
38
|
-
export declare const TimechartTrellisEditorConfig: ({
|
|
54
|
+
}[] | {
|
|
39
55
|
label: any;
|
|
40
56
|
option: string;
|
|
41
57
|
editor: string;
|
|
42
|
-
|
|
58
|
+
editorProps: {
|
|
59
|
+
values: any;
|
|
60
|
+
};
|
|
61
|
+
showEditor: ({ options, featureFlags }: {
|
|
62
|
+
options: any;
|
|
43
63
|
featureFlags: any;
|
|
44
64
|
}) => boolean;
|
|
45
65
|
}[] | {
|
|
@@ -53,6 +73,14 @@ export declare const TimechartTrellisEditorConfig: ({
|
|
|
53
73
|
help: any;
|
|
54
74
|
helpFormat: string;
|
|
55
75
|
};
|
|
76
|
+
}[] | {
|
|
77
|
+
label: any;
|
|
78
|
+
option: string;
|
|
79
|
+
editor: string;
|
|
80
|
+
showEditor: ({ options, featureFlags }: {
|
|
81
|
+
options: any;
|
|
82
|
+
featureFlags: any;
|
|
83
|
+
}) => boolean;
|
|
56
84
|
}[])[];
|
|
57
85
|
export declare const TrellisBackgroundColorEditor: {
|
|
58
86
|
label: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrellisEditors.d.ts","sourceRoot":"","sources":["../../src/common/editorConfig/TrellisEditors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,GAAI;;CAAgB,KAAG,OAEzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI;;;CAAyB,KAAG,OAG5D,CAAC;
|
|
1
|
+
{"version":3,"file":"TrellisEditors.d.ts","sourceRoot":"","sources":["../../src/common/editorConfig/TrellisEditors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,GAAI;;CAAgB,KAAG,OAEzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI;;;CAAyB,KAAG,OAG5D,CAAC;AAyGF,eAAO,MAAM,mBAAmB;;;;;;UAhH0B,OAAO;KAqHhE,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;UAvHqB,OAAO;KA4HhE,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;UA9He,OAAO;KAmIhE,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;UAjIoB,OAAO;;;;;;;;;;;UAAP,OAAO;;;;;;;;;;;UAAP,OAAO;;;;;;;UAJV,OAAO;;;;;;;;;;;;UAIJ,OAAO;MA2JnE,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;UA7JoB,OAAO;CAkKnE,CAAC"}
|
|
@@ -1404,4 +1404,58 @@ export declare const resultTimechartSameSplitByFieldAndValueTrellisAggregation:
|
|
|
1404
1404
|
};
|
|
1405
1405
|
};
|
|
1406
1406
|
};
|
|
1407
|
+
export declare const statsCountBySourcetypeSortDSTrellis: {
|
|
1408
|
+
primary: {
|
|
1409
|
+
requestParams: {
|
|
1410
|
+
offset: number;
|
|
1411
|
+
count: number;
|
|
1412
|
+
};
|
|
1413
|
+
data: {
|
|
1414
|
+
fields: ({
|
|
1415
|
+
name: string;
|
|
1416
|
+
type_special?: undefined;
|
|
1417
|
+
} | {
|
|
1418
|
+
name: string;
|
|
1419
|
+
type_special: string;
|
|
1420
|
+
})[];
|
|
1421
|
+
columns: string[][];
|
|
1422
|
+
};
|
|
1423
|
+
meta: {
|
|
1424
|
+
totalCount: number;
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
};
|
|
1428
|
+
export declare const timechartCountBySourcetypeSortTrendDSTrellis: {
|
|
1429
|
+
primary: {
|
|
1430
|
+
requestParams: {
|
|
1431
|
+
offset: number;
|
|
1432
|
+
count: number;
|
|
1433
|
+
};
|
|
1434
|
+
data: {
|
|
1435
|
+
fields: ({
|
|
1436
|
+
name: string;
|
|
1437
|
+
groupby_rank: string;
|
|
1438
|
+
splitby_field?: undefined;
|
|
1439
|
+
splitby_value?: undefined;
|
|
1440
|
+
data_source?: undefined;
|
|
1441
|
+
} | {
|
|
1442
|
+
name: string;
|
|
1443
|
+
splitby_field: string;
|
|
1444
|
+
splitby_value: string;
|
|
1445
|
+
data_source: string;
|
|
1446
|
+
groupby_rank?: undefined;
|
|
1447
|
+
} | {
|
|
1448
|
+
name: string;
|
|
1449
|
+
groupby_rank?: undefined;
|
|
1450
|
+
splitby_field?: undefined;
|
|
1451
|
+
splitby_value?: undefined;
|
|
1452
|
+
data_source?: undefined;
|
|
1453
|
+
})[];
|
|
1454
|
+
columns: string[][];
|
|
1455
|
+
};
|
|
1456
|
+
meta: {
|
|
1457
|
+
totalCount: number;
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1407
1461
|
//# sourceMappingURL=trellisData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trellisData.d.ts","sourceRoot":"","sources":["../../../src/common/hocs/mockdata/trellisData.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D3C,CAAC;AAGF,eAAO,MAAM,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HzD,CAAC;AAGF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CrC,CAAC;AAGF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C3C,CAAC;AAG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
+
type TrellisSortOrder = 'ascending' | 'descending';
|
|
5
|
+
export declare const evaluatePanelOption: (panelDataSources: {
|
|
6
|
+
[name: string]: DataSource;
|
|
7
|
+
}, allOptions: Record<string, unknown>, optionKey: string, vizContext?: Record<string, unknown>) => number;
|
|
8
|
+
export declare const sortTrellisKeys: (keys: string[], trellisSortBy: TrellisSortBy | undefined, trellisSortOrder: TrellisSortOrder | undefined, modifiedDataSourceBySplitBy: Record<string, {
|
|
9
|
+
[name: string]: DataSource;
|
|
10
|
+
}>, mergedOptions: Record<string, unknown>, vizContext?: Record<string, unknown>) => void;
|
|
3
11
|
export interface VizWithTrellisProps {
|
|
4
12
|
options?: KV;
|
|
13
|
+
context?: Record<string, unknown>;
|
|
5
14
|
dataSources: {
|
|
6
15
|
[name: string]: DataSource;
|
|
7
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTrellis.d.ts","sourceRoot":"","sources":["../../src/common/hocs/withTrellis.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"withTrellis.d.ts","sourceRoot":"","sources":["../../src/common/hocs/withTrellis.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAK1C,KAAK,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAC3D,KAAK,gBAAgB,GAAG,WAAW,GAAG,YAAY,CAAC;AAEnD,eAAO,MAAM,mBAAmB,GAC5B,kBAAkB;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,EAChD,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,WAAW,MAAM,EACjB,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACrC,MAQF,CAAC;AAEF,eAAO,MAAM,eAAe,GACxB,MAAM,MAAM,EAAE,EACd,eAAe,aAAa,GAAG,SAAS,EACxC,kBAAkB,gBAAgB,GAAG,SAAS,EAC9C,6BAA6B,MAAM,CAAC,MAAM,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC,EAC3E,eAAe,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACrC,IAqCF,CAAC;AA+DF,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;IAC5C,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAUD,QAAA,MAAM,WAAW,GAAG,QAAG;WACW,mBAAmB,GAAG,GAAG,CAAC,OAAO;;;CAyMlE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as T from 'prop-types';
|
|
2
2
|
import { DataSourceMeta, SortDirType } from '../interfaces/DataSource';
|
|
3
3
|
export interface SortParams {
|
|
4
|
-
currentSortKey?:
|
|
5
|
-
currentSortDir?:
|
|
4
|
+
currentSortKey?: string;
|
|
5
|
+
currentSortDir?: SortDirType;
|
|
6
6
|
onSort?: (e: MouseEvent, { sortKey, sortDir }: {
|
|
7
7
|
sortKey: string;
|
|
8
8
|
sortDir: SortDirType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSorting.d.ts","sourceRoot":"","sources":["../../src/common/hooks/useSorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtF,MAAM,WAAW,UAAU;IACvB,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"useSorting.d.ts","sourceRoot":"","sources":["../../src/common/hooks/useSorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAEtF,MAAM,WAAW,UAAU;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;CACrG;AAED,eAAO,MAAM,mBAAmB;;;;GAI9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,GAAI,0CAA0C,cAAc,KAAG,UAoC3F,CAAC"}
|
package/common/shapeUtils.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ type ClickableSvgProps = {
|
|
|
21
21
|
onClick?: () => void;
|
|
22
22
|
shape: Shape;
|
|
23
23
|
};
|
|
24
|
-
export declare function ClickableShape({ children, onClick, shape }: ClickableSvgProps): React.JSX.Element;
|
|
24
|
+
export declare function ClickableShape({ children, onClick, shape }: Readonly<ClickableSvgProps>): React.JSX.Element;
|
|
25
25
|
export {};
|
|
26
26
|
//# sourceMappingURL=shapeUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeUtils.d.ts","sourceRoot":"","sources":["../src/common/shapeUtils.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAA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|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/common/shapeUtils.tsx", "esm-externals:lodash", "esm-externals:styled-components", "esm-externals:@splunk/themes/pick", "esm-externals:@splunk/themes/variables", "esm-externals:@splunk/visualizations-shared/propUtils", "esm-externals:react", "esm-externals:@splunk/react-ui/ScreenReaderContent", "esm-externals:@splunk/ui-utils/id", "esm-externals:@splunk/ui-utils/i18n"],
|
|
4
|
-
"sourcesContent": ["import { mapKeys } from 'lodash';\nimport styled, { css } from 'styled-components';\nimport pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\nimport { formatColor } from '@splunk/visualizations-shared/propUtils';\nimport React, { useMemo } from 'react';\nimport ScreenReaderContent from '@splunk/react-ui/ScreenReaderContent';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport { _ } from '@splunk/ui-utils/i18n';\n\ninterface ShapeOptions {\n [key: string]: any;\n}\n\n// map for new options names to old option names\nconst shapeOptionsMapping = {\n fillColor: 'fill',\n strokeColor: 'stroke',\n strokeDashStyle: 'strokeDasharray',\n strokeJoinStyle: 'strokeLinejoin',\n};\n\n/**\n * Helper method to update the option names to old option names\n * @method mapToOldKey\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToOldKey = (options: ShapeOptions): ShapeOptions =>\n mapKeys(options, (val, key) => (shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key));\n\ntype Shape = 'ellipse' | 'rect';\n\n/**\n * Helper method to get styled component for ellipse or rectangle\n * @method getStyledShape\n * @param {Shape} shape\n */\nexport const getStyledShape = (shape: Shape) => styled(shape)`\n fill: ${props =>\n (props.fill && formatColor(props.fill)) ||\n pick({\n enterprise: {\n light: variables.gray80,\n dark: variables.gray25,\n },\n prisma: variables.backgroundColorSidebar,\n })(props)};\n stroke: ${props =>\n (props.stroke && formatColor(props.stroke)) ||\n pick({\n enterprise: {\n dark: variables.gray80,\n light: variables.textColor,\n },\n prisma: variables.neutral500,\n })(props)};\n`;\n\ntype ClickableSvgProps = {\n children: React.ReactNode;\n onClick?: () => void;\n shape: Shape;\n};\n\nexport function ClickableShape({ children, onClick, shape }: ClickableSvgProps) {\n const descriptionId = useMemo(() => createDOMID('clickable-svg-description'), []);\n return (\n <>\n <ScreenReaderContent id={descriptionId}>{_('Click to trigger interaction')}</ScreenReaderContent>\n <StyledButton\n onClick={onClick}\n aria-label={shape === 'rect' ? _('Rectangle visualization') : _('Ellipse visualization')}\n aria-describedby={descriptionId}\n shape={shape}\n >\n {children}\n </StyledButton>\n </>\n );\n}\n\nconst StyledButton = styled.button.attrs({ type: 'button' })<{ shape?: Shape }>`\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n &:focus {\n outline: none;\n ${props =>\n props.shape === 'rect'\n ? css`\n box-shadow: ${variables.focusShadow};\n `\n : css`\n & > svg > ellipse {\n filter: drop-shadow(2px 0px 1px ${variables.focusColor})\n drop-shadow(-2px 0px 1px ${variables.focusColor})\n drop-shadow(0px 2px 1px ${variables.focusColor})\n drop-shadow(0px -2px 1px ${variables.focusColor});\n }\n `}\n }\n`;\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"styled-components\";\nexport * from \"styled-components\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/pick\";\nexport * from \"@splunk/themes/pick\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/variables\";\nexport * from \"@splunk/themes/variables\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/propUtils\";\nexport * from \"@splunk/visualizations-shared/propUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/ScreenReaderContent\";\nexport * from \"@splunk/react-ui/ScreenReaderContent\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/id\";\nexport * from \"@splunk/ui-utils/id\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,sCAAc;AACd,IAAO,4BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,8BAAc;AACd,IAAO,oBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,8BAAc;AACd,IAAO,oBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,wCAAc;AACd,IAAO,8BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,uBAAc;AACd,IAAO,aAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,yBAAc;AACd,IAAO,eAAS,aAAaA,iBAA8B,yBAAUA;;;ATYrE,IAAM,sBAAsB;AAAA,EACxB,WAAW;AAAA,EACX,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,iBAAiB;AACrB;AAQO,IAAM,cAAc,CAAC,gBACxB,wBAAQ,SAAS,CAAC,KAAK,QAAS,oBAAoB,GAAG,IAAI,oBAAoB,GAAG,IAAI,GAAI;AASvF,IAAM,iBAAiB,CAAC,UAAiB,0BAAO,KAAK;AAAA,YAChD,WACH,MAAM,YAAQ,+BAAY,MAAM,IAAI,KACrC,aAAK;AAAA,EACD,YAAY;AAAA,IACR,OAAO,kBAAU;AAAA,IACjB,MAAM,kBAAU;AAAA,EACpB;AAAA,EACA,QAAQ,kBAAU;AACtB,CAAC,EAAE,KAAK,CAAC;AAAA,cACH,WACL,MAAM,cAAU,+BAAY,MAAM,MAAM,KACzC,aAAK;AAAA,EACD,YAAY;AAAA,IACR,MAAM,kBAAU;AAAA,IAChB,OAAO,kBAAU;AAAA,EACrB;AAAA,EACA,QAAQ,kBAAU;AACtB,CAAC,EAAE,KAAK,CAAC;AAAA;AASV,SAAS,eAAe,EAAE,UAAU,SAAS,MAAM,
|
|
4
|
+
"sourcesContent": ["import { mapKeys } from 'lodash';\nimport styled, { css } from 'styled-components';\nimport pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\nimport { formatColor } from '@splunk/visualizations-shared/propUtils';\nimport React, { useMemo } from 'react';\nimport ScreenReaderContent from '@splunk/react-ui/ScreenReaderContent';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport { _ } from '@splunk/ui-utils/i18n';\n\ninterface ShapeOptions {\n [key: string]: any;\n}\n\n// map for new options names to old option names\nconst shapeOptionsMapping = {\n fillColor: 'fill',\n strokeColor: 'stroke',\n strokeDashStyle: 'strokeDasharray',\n strokeJoinStyle: 'strokeLinejoin',\n};\n\n/**\n * Helper method to update the option names to old option names\n * @method mapToOldKey\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToOldKey = (options: ShapeOptions): ShapeOptions =>\n mapKeys(options, (val, key) => (shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key));\n\ntype Shape = 'ellipse' | 'rect';\n\n/**\n * Helper method to get styled component for ellipse or rectangle\n * @method getStyledShape\n * @param {Shape} shape\n */\nexport const getStyledShape = (shape: Shape) => styled(shape)`\n fill: ${props =>\n (props.fill && formatColor(props.fill)) ||\n pick({\n enterprise: {\n light: variables.gray80,\n dark: variables.gray25,\n },\n prisma: variables.backgroundColorSidebar,\n })(props)};\n stroke: ${props =>\n (props.stroke && formatColor(props.stroke)) ||\n pick({\n enterprise: {\n dark: variables.gray80,\n light: variables.textColor,\n },\n prisma: variables.neutral500,\n })(props)};\n`;\n\ntype ClickableSvgProps = {\n children: React.ReactNode;\n onClick?: () => void;\n shape: Shape;\n};\n\nexport function ClickableShape({ children, onClick, shape }: Readonly<ClickableSvgProps>) {\n const descriptionId = useMemo(() => createDOMID('clickable-svg-description'), []);\n return (\n <>\n <ScreenReaderContent id={descriptionId}>{_('Click to trigger interaction')}</ScreenReaderContent>\n <StyledButton\n onClick={onClick}\n aria-label={shape === 'rect' ? _('Rectangle visualization') : _('Ellipse visualization')}\n aria-describedby={descriptionId}\n shape={shape}\n >\n {children}\n </StyledButton>\n </>\n );\n}\n\nconst StyledButton = styled.button.attrs({ type: 'button' })<{ shape?: Shape }>`\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n &:focus {\n outline: none;\n ${props =>\n props.shape === 'rect'\n ? css`\n box-shadow: ${variables.focusShadow};\n `\n : css`\n & > svg > ellipse {\n filter: drop-shadow(2px 0px 1px ${variables.focusColor})\n drop-shadow(-2px 0px 1px ${variables.focusColor})\n drop-shadow(0px 2px 1px ${variables.focusColor})\n drop-shadow(0px -2px 1px ${variables.focusColor});\n }\n `}\n }\n`;\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"styled-components\";\nexport * from \"styled-components\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/pick\";\nexport * from \"@splunk/themes/pick\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/variables\";\nexport * from \"@splunk/themes/variables\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/propUtils\";\nexport * from \"@splunk/visualizations-shared/propUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/ScreenReaderContent\";\nexport * from \"@splunk/react-ui/ScreenReaderContent\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/id\";\nexport * from \"@splunk/ui-utils/id\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,sCAAc;AACd,IAAO,4BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC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U;AAAA,IAChB,OAAO,kBAAU;AAAA,EACrB;AAAA,EACA,QAAQ,kBAAU;AACtB,CAAC,EAAE,KAAK,CAAC;AAAA;AASV,SAAS,eAAe,EAAE,UAAU,SAAS,MAAM,GAAgC;AACtF,QAAM,oBAAgB,uBAAQ,UAAM,wBAAY,2BAA2B,GAAG,CAAC,CAAC;AAChF,SACI,0EACI,4CAAC,+BAAoB,IAAI,qBAAgB,gBAAE,8BAA8B,CAAE,GAC3E;AAAA,IAAC;AAAA;AAAA,MACG;AAAA,MACA,cAAY,UAAU,aAAS,gBAAE,yBAAyB,QAAI,gBAAE,uBAAuB;AAAA,MACvF,oBAAkB;AAAA,MAClB;AAAA;AAAA,IAEC;AAAA,EACL,CACJ;AAER;AAEA,IAAM,eAAe,0BAAO,OAAO,MAAM,EAAE,MAAM,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAOjD,WACE,MAAM,UAAU,SACV;AAAA,oCACkB,kBAAU,WAAW;AAAA,sBAEvC;AAAA;AAAA,4DAE0C,kBAAU,UAAU;AAAA,yDACvB,kBAAU,UAAU;AAAA,wDACrB,kBAAU,UAAU;AAAA,yDACnB,kBAAU,UAAU;AAAA;AAAA,mBAE1D;AAAA;AAAA;",
|
|
6
6
|
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport"]
|
|
7
7
|
}
|
|
@@ -70,7 +70,8 @@ var numberUtils_default = "default" in defaultImport ? defaultImport.default : d
|
|
|
70
70
|
|
|
71
71
|
// src/common/utils/dataUtils.ts
|
|
72
72
|
var convertToArrOfObjects = (columns, fields) => {
|
|
73
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
if (!((_a = columns == null ? void 0 : columns[0]) == null ? void 0 : _a.length)) return [];
|
|
74
75
|
const data = [];
|
|
75
76
|
for (let i = 0; i < columns[0].length; i += 1) {
|
|
76
77
|
const newObj = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/common/utils/dataUtils.ts", "esm-externals:@splunk/visualizations-shared/numberUtils"],
|
|
4
|
-
"sourcesContent": ["import type { FieldEntry } from '@splunk/visualizations-shared/dataSourceUtils';\nimport { startsWithNumber } from '@splunk/visualizations-shared/numberUtils';\nimport type { DashboardVizProps, DataSource, VizConfig } from '../interfaces';\nimport { VizBehavior } from '../interfaces';\nimport { ChartEvent } from '../interfaces/ChartEvent';\n\nexport const convertToArrOfObjects = (columns: (string | any[])[], fields: any[]): any[] => {\n if (!columns || !columns[0] || !columns[0].length) return [];\n\n const data = [];\n\n for (let i = 0; i < columns[0].length; i += 1) {\n const newObj = {};\n fields.forEach((field, index) => {\n const fieldName = getFieldName(field);\n if (columns[index][i] === '') {\n newObj[fieldName] = null;\n } else {\n newObj[fieldName] = columns[index][i];\n }\n });\n data.push(newObj);\n }\n\n return data;\n};\n\nconst getFieldName = (field: FieldEntry | string): string => (typeof field === 'string' ? field : field.name);\n\n// LTTB algorithm which can be used to downsample time series data while striving to maintain\n// the spikes and overall shape of the chart\n// Copied from https://github.com/sveinn-steinarsson/flot-downsample/blob/0815010016fc94b1bbc6a010afb8aad13ada6d0d/jquery.flot.downsample.js\n// Modifications include:\n// 1) Convert to modern JavaScript(use const, let, and use array.push to push to last element of array)\n// 2) Convert to camel case\n// 3) Convert to TS and also return the indices of the points that are in the downsampled result.\n// 4) Add a new parameter preferredDownsampleIndices that correspond to the indices of points\n// that should be used in case of a tie of the max area in a bucket\nconst largestTriangleThreeBuckets = (\n data: [Date | number, number][],\n threshold: number,\n preferredDownsampleIndices: Set<number>\n): {\n downsampledData: [Date | number, number][];\n downsampledIndices: number[];\n} => {\n const dataLength = data.length;\n const downsampledIndices = [];\n if (threshold >= dataLength || threshold === 0) {\n const allIndices = data.map((values, index) => index);\n return { downsampledData: data, downsampledIndices: allIndices }; // Nothing to do\n }\n\n const sampled: [Date | number, number][] = [];\n let sampledIndex = 0;\n\n // Bucket size. Leave room for start and end data points\n const every = (dataLength - 2) / (threshold - 2);\n\n let a = 0; // Initially a is the first point in the triangle\n let maxAreaPoint: [Date | number, number];\n let maxArea: number | undefined;\n let area: number | undefined;\n let nextA: number | undefined;\n\n sampled.push(data[a]); // Always add the first point\n downsampledIndices.push(0);\n\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < threshold - 2; i++) {\n // Calculate point average for next bucket (containing c)\n let avgX = 0;\n let avgY = 0;\n let avgRangeStart = Math.floor((i + 1) * every) + 1;\n let avgRangeEnd = Math.floor((i + 2) * every) + 1;\n avgRangeEnd = avgRangeEnd < dataLength ? avgRangeEnd : dataLength;\n\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n // eslint-disable-next-line no-plusplus\n for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {\n avgX += Number(data[avgRangeStart][0]); // * 1 enforces Number (value may be Date)\n avgY += data[avgRangeStart][1] * 1;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Get the range for this bucket\n let rangeOffs = Math.floor((i + 0) * every) + 1;\n const rangeTo = Math.floor((i + 1) * every) + 1;\n\n // Point a\n const pointAX = Number(data[a][0]); // Enforce Number (value may be Date)\n const pointAY = data[a][1] * 1;\n\n // eslint-disable-next-line no-multi-assign\n maxArea = area = -1;\n let maxAreaIndex = rangeOffs;\n\n // eslint-disable-next-line no-plusplus\n for (; rangeOffs < rangeTo; rangeOffs++) {\n // Calculate triangle area over three buckets\n area =\n Math.abs(\n (pointAX - avgX) * (data[rangeOffs][1] - pointAY) -\n (pointAX - Number(data[rangeOffs][0])) * (avgY - pointAY)\n ) * 0.5;\n // Modification: try to downsample the least amount of points possible when there are multiple series\n // If all points in a bucket have the same area, prioritize the one with an x index\n // that also existed from another series so we don't add another point unnecessarily.\n // By default LTTB picks the leftmost point in the bucket\n if (area > maxArea || (area === maxArea && preferredDownsampleIndices.has(rangeOffs))) {\n maxArea = area;\n maxAreaPoint = data[rangeOffs];\n nextA = rangeOffs; // Next a is this b\n // Modification: save the index of the point with the most area\n maxAreaIndex = rangeOffs;\n }\n }\n\n // eslint-disable-next-line no-plusplus\n sampled[sampledIndex++] = maxAreaPoint; // Pick this point from the bucket\n downsampledIndices.push(maxAreaIndex);\n a = nextA; // This a is the next a (chosen b)\n }\n\n // eslint-disable-next-line no-plusplus\n sampled[sampledIndex++] = data[dataLength - 1]; // Always add last\n downsampledIndices.push(dataLength - 1);\n\n return { downsampledData: sampled, downsampledIndices };\n};\n\nexport type DownsampleOptions = { threshold: number } & Pick<DashboardVizProps, 'dataSources' | 'options'>;\n\ntype CoerceYColumnResult = {\n canDownsampleColumn: boolean;\n canLooselyCoerceSomeValues: boolean;\n coercedColumn: number[];\n};\n\n/**\n * Strictly coerces the entire column to numbers if it only consists of numeric strings or numbers. Also determines\n * if at least one of the values in the column can be loosely coerced to a number.\n * If the column cannot be strictly downsampled (if it contains nulls or non-numeric strings), returns an empty array and\n * returns that it cannot downsample the column.\n */\nconst strictlyCoerceYColumn = (\n column: (string | number)[] | number[],\n options: DownsampleOptions['options']\n): CoerceYColumnResult => {\n const isNullCoercionEnabled = options.nullValueDisplay === 'zero';\n // Splunk charting allows for numbers in formats such as negative hex that\n // Number() does not support and also allows loose coercion of hex numbers (but not other formats)\n // We want to identify columns which contain at least one value that can be loosely coerced\n const canLooselyCoerceSomeValues =\n column.findIndex(\n value => startsWithNumber(`${value}`) || (isNullCoercionEnabled && value === null)\n ) >= 0;\n\n // If not all values in column can be strictly coerced to a number, we do not downsample\n const coercedColumn: number[] = [];\n const canDownsampleColumn = !column.some(value => {\n const coercedValue = Number(value);\n const coerceValueToZero = isNullCoercionEnabled && value === null;\n\n // if it can't be parsed or isn't safe, fail\n if (\n Number.isNaN(coercedValue) ||\n coercedValue <= Number.MIN_SAFE_INTEGER ||\n coercedValue >= Number.MAX_SAFE_INTEGER ||\n (typeof value !== 'string' && typeof value !== 'number' && !coerceValueToZero)\n ) {\n return true;\n }\n // save value and continue to next\n coercedColumn.push(coercedValue);\n return false;\n });\n\n return {\n canDownsampleColumn,\n canLooselyCoerceSomeValues,\n coercedColumn: canDownsampleColumn ? coercedColumn : [],\n };\n};\n\n/**\n * Tries to coerce the x-column to numbers or dates, if it is eligible for downsampling.\n * Only strictly increasing x-columns are eligible for downsampling.\n * If the column is not eligible for downsampling, returns an empty array.\n */\nconst strictlyCoerceXColumn = (column: (string | number)[], fieldType: string): Date[] | number[] => {\n if (fieldType === 'number') {\n const coercedXColumn = column.map(xValue => Number(xValue));\n if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {\n return coercedXColumn;\n }\n } else if (fieldType === 'time') {\n const coercedXColumn = column.map(xValue => new Date(xValue));\n if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {\n return coercedXColumn;\n }\n }\n return [];\n};\n\nexport const isDownsamplingEnabledForViz = ({ vizConfig }: { vizConfig: VizConfig }) => {\n return vizConfig.supports?.includes(VizBehavior.DOWNSAMPLING);\n};\n\nexport const calculateThresholdOnRangeSelect = ({\n firstIndex,\n lastIndex,\n dataSources,\n width,\n}: Pick<DashboardVizProps, 'dataSources'> & {\n firstIndex: number;\n lastIndex: number;\n width: number | string;\n}): number => {\n const window = lastIndex - firstIndex + 1;\n // eslint-disable-next-line no-unsafe-optional-chaining\n const ratio = Math.round(Number(dataSources?.primary?.data?.columns[0]?.length / window) * 10) / 10;\n return Math.round(ratio * Number(width));\n};\n\n/**\n * Calculates the downsampling threshold based on the range selection. If search zoom is enabled or there is no selection,\n * then returns the width of the visualization.\n *\n * Otherwise calculates the threshold based on the ratio of the window selected compared to the size of the non-downsampled\n * data sources. Returns null if the chart event's dataset does not match the passed in primary data source or if the chart is zoomed\n * in for a categorical chart.\n */\nexport const calculateDownsamplingThreshold = ({\n enableSearchZoom,\n dataSources,\n selectChartEvent,\n width,\n xField,\n}: {\n enableSearchZoom: boolean;\n dataSources: Record<string, DataSource> | null;\n selectChartEvent: ChartEvent<'chartRangeSelect'> | null;\n width: number;\n xField: string;\n}): number | null => {\n if (enableSearchZoom || !selectChartEvent) {\n return Number(width);\n }\n\n const primaryDataSource = dataSources?.primary;\n if (!primaryDataSource) {\n return null;\n }\n\n const { startXIndex, endXIndex, currentTarget } = selectChartEvent;\n\n try {\n const xFieldIndex = primaryDataSource?.data?.fields.findIndex(field => {\n const name = typeof field === 'string' ? field : field.name;\n return name === xField;\n });\n const downsampledXFieldIndex = currentTarget.dataSet?.fields.findIndex(field => field === xField);\n\n if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {\n return null;\n }\n\n const fullSeries = primaryDataSource?.data?.columns[xFieldIndex];\n const downsampledSeries = currentTarget.dataSet.seriesList[downsampledXFieldIndex];\n\n const firstIndex = fullSeries.findIndex(x => {\n return downsampledSeries[startXIndex] === x;\n });\n const lastIndex = fullSeries.findIndex(x => {\n return downsampledSeries[endXIndex] === x;\n });\n\n if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {\n return calculateThresholdOnRangeSelect({\n firstIndex,\n lastIndex,\n dataSources,\n width,\n });\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error occurred while setting downsample threshold on range select event', e);\n }\n\n return null;\n};\n\nconst isColumnStrictlyIncreasing = (column: (number | Date)[], fieldType: 'number' | 'time') => {\n return column.every((value, index) => {\n if (fieldType === 'number') {\n if (Number.isNaN(value)) {\n return false;\n }\n }\n\n if (fieldType === 'time') {\n if (Number.isNaN((value as Date).getTime())) {\n return false;\n }\n }\n if (index === 0) {\n return true;\n }\n return value > column[index - 1];\n });\n};\n\n/**\n * Verifies that all of the columns that are displayed in a chart can be downsampled. Valid columns that can be\n * displayed are those that contain at least one number. We can only downsample columns that only consist of numbers.\n *\n * If all columns can be downsampled, returns the x column coerced to time/number and y columns coerced to numbers.\n * If not all columns can be downsampled, then returns empty arrays for both x and y\n */\nconst tryToCoerceAllDisplayedFields = (\n ds: DataSource,\n xField: string,\n yFields: Set<string>,\n fieldTypes: string[],\n options: DownsampleOptions['options']\n): { xColumn: Date[] | number[]; yColumns: number[][] } => {\n let xColumn: Date[] | number[] = [];\n const yColumns: number[][] = [];\n\n const canDownsample = !ds.data.fields.some((field, index) => {\n const fieldName = getFieldName(field);\n const fieldType = fieldTypes[index] ?? 'unknown';\n const column = ds.data.columns[index];\n let hasDisplayedColumnThatCantBeDownsampled = false;\n\n if (fieldName === xField) {\n xColumn = strictlyCoerceXColumn(column, fieldType);\n } else if (yFields.has(fieldName)) {\n const { coercedColumn, canLooselyCoerceSomeValues, canDownsampleColumn } = strictlyCoerceYColumn(\n ds.data.columns[index],\n options\n );\n // do not perform downsampling if a column can possibly be displayed but cannot\n // be downsampled using LTTB\n hasDisplayedColumnThatCantBeDownsampled = canLooselyCoerceSomeValues && !canDownsampleColumn;\n if (hasDisplayedColumnThatCantBeDownsampled) {\n return true;\n }\n if (canDownsampleColumn) {\n yColumns.push(coercedColumn);\n }\n }\n return false;\n });\n\n if (canDownsample) {\n return { xColumn, yColumns };\n }\n return { xColumn: [], yColumns: [] };\n};\n\nconst pickIndicesFromDataSource = (ds: DataSource, indices: Set<number>): DataSource => {\n const sortedIndices = Array.from(indices).sort((a: number, b: number) => a - b);\n const slicedColumns = [];\n ds.data.columns.forEach(column => {\n const slicedColumn = [];\n sortedIndices.forEach(index => {\n slicedColumn.push(column[index]);\n });\n slicedColumns.push(slicedColumn);\n });\n\n // update data columns with downsampled columns\n return {\n ...ds,\n data: {\n ...ds.data,\n columns: slicedColumns,\n },\n };\n};\n\nexport const downsampleDataSources = ({ dataSources, threshold, options }: DownsampleOptions) => {\n const primaryDS = dataSources?.primary;\n // only downsample time series when number of data points are over threshold\n const numPoints = primaryDS?.data?.columns[0]?.length ?? 0;\n if (Number.isNaN(threshold) || numPoints <= threshold || threshold < 2) {\n return dataSources;\n }\n\n const { xField, yFields, fieldTypes } = options;\n if (!xField || !yFields?.length || !fieldTypes?.length) {\n return dataSources;\n }\n\n const nonInternalYFields = new Set<string>(yFields.filter(yField => !yField.startsWith('_')));\n const maxPointsInDownsample = Math.min(nonInternalYFields.size * threshold, numPoints);\n\n // Do not try to downsample if there are too many downsampled pts\n // At the worst case, each series has non-overlapping downsampled pts\n // which will mean that all points will be included in the downsampled result\n // This will just lead to additional overhead due to coercing each\n // x and y field to number\n if (maxPointsInDownsample >= numPoints) {\n return dataSources;\n }\n\n const { xColumn, yColumns } = tryToCoerceAllDisplayedFields(\n primaryDS,\n xField,\n nonInternalYFields,\n fieldTypes,\n options\n );\n\n if (!yColumns.length || !xColumn.length) {\n return dataSources;\n }\n\n const downsampledDataSources = { ...dataSources };\n const downsampledIndices = new Set<number>();\n\n yColumns.forEach((yColumn, columnIndex) => {\n // perform LTTB downsampling for current series, LTTB takes an [x, y] pair\n const xyPair: [Date | number, number][] = yColumn.map((yValue, index) => {\n return [xColumn[index], yValue];\n });\n\n try {\n const { downsampledIndices: downsampledIndicesForSeries } = largestTriangleThreeBuckets(\n xyPair,\n threshold,\n downsampledIndices\n );\n downsampledIndicesForSeries.forEach(downsampleIndex => downsampledIndices.add(downsampleIndex));\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`Error occurred while downsampling column ${columnIndex}`, e);\n }\n });\n // update data columns with downsampled columns\n downsampledDataSources.primary = pickIndicesFromDataSource(primaryDS, downsampledIndices);\n\n return downsampledDataSources;\n};\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/numberUtils\";\nexport * from \"@splunk/visualizations-shared/numberUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,gCAAc;AACd,IAAO,sBAAS,aAAa,gBAA8B,wBAAU;;;ADG9D,IAAM,wBAAwB,CAAC,SAA6B,WAAyB;
|
|
4
|
+
"sourcesContent": ["import type { FieldEntry } from '@splunk/visualizations-shared/dataSourceUtils';\nimport { startsWithNumber } from '@splunk/visualizations-shared/numberUtils';\nimport type { DashboardVizProps, DataSource, VizConfig } from '../interfaces';\nimport { VizBehavior } from '../interfaces';\nimport { ChartEvent } from '../interfaces/ChartEvent';\n\nexport const convertToArrOfObjects = (columns: (string | any[])[], fields: any[]): any[] => {\n if (!columns?.[0]?.length) return [];\n\n const data = [];\n\n for (let i = 0; i < columns[0].length; i += 1) {\n const newObj = {};\n fields.forEach((field, index) => {\n const fieldName = getFieldName(field);\n if (columns[index][i] === '') {\n newObj[fieldName] = null;\n } else {\n newObj[fieldName] = columns[index][i];\n }\n });\n data.push(newObj);\n }\n\n return data;\n};\n\nconst getFieldName = (field: FieldEntry | string): string => (typeof field === 'string' ? field : field.name);\n\n// LTTB algorithm which can be used to downsample time series data while striving to maintain\n// the spikes and overall shape of the chart\n// Copied from https://github.com/sveinn-steinarsson/flot-downsample/blob/0815010016fc94b1bbc6a010afb8aad13ada6d0d/jquery.flot.downsample.js\n// Modifications include:\n// 1) Convert to modern JavaScript(use const, let, and use array.push to push to last element of array)\n// 2) Convert to camel case\n// 3) Convert to TS and also return the indices of the points that are in the downsampled result.\n// 4) Add a new parameter preferredDownsampleIndices that correspond to the indices of points\n// that should be used in case of a tie of the max area in a bucket\nconst largestTriangleThreeBuckets = (\n data: [Date | number, number][],\n threshold: number,\n preferredDownsampleIndices: Set<number>\n): {\n downsampledData: [Date | number, number][];\n downsampledIndices: number[];\n} => {\n const dataLength = data.length;\n const downsampledIndices = [];\n if (threshold >= dataLength || threshold === 0) {\n const allIndices = data.map((values, index) => index);\n return { downsampledData: data, downsampledIndices: allIndices }; // Nothing to do\n }\n\n const sampled: [Date | number, number][] = [];\n let sampledIndex = 0;\n\n // Bucket size. Leave room for start and end data points\n const every = (dataLength - 2) / (threshold - 2);\n\n let a = 0; // Initially a is the first point in the triangle\n let maxAreaPoint: [Date | number, number];\n let maxArea: number | undefined;\n let area: number | undefined;\n let nextA: number | undefined;\n\n sampled.push(data[a]); // Always add the first point\n downsampledIndices.push(0);\n\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < threshold - 2; i++) {\n // Calculate point average for next bucket (containing c)\n let avgX = 0;\n let avgY = 0;\n let avgRangeStart = Math.floor((i + 1) * every) + 1;\n let avgRangeEnd = Math.floor((i + 2) * every) + 1;\n avgRangeEnd = avgRangeEnd < dataLength ? avgRangeEnd : dataLength;\n\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n // eslint-disable-next-line no-plusplus\n for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {\n avgX += Number(data[avgRangeStart][0]); // * 1 enforces Number (value may be Date)\n avgY += data[avgRangeStart][1] * 1;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n\n // Get the range for this bucket\n let rangeOffs = Math.floor((i + 0) * every) + 1;\n const rangeTo = Math.floor((i + 1) * every) + 1;\n\n // Point a\n const pointAX = Number(data[a][0]); // Enforce Number (value may be Date)\n const pointAY = data[a][1] * 1;\n\n // eslint-disable-next-line no-multi-assign\n maxArea = area = -1;\n let maxAreaIndex = rangeOffs;\n\n // eslint-disable-next-line no-plusplus\n for (; rangeOffs < rangeTo; rangeOffs++) {\n // Calculate triangle area over three buckets\n area =\n Math.abs(\n (pointAX - avgX) * (data[rangeOffs][1] - pointAY) -\n (pointAX - Number(data[rangeOffs][0])) * (avgY - pointAY)\n ) * 0.5;\n // Modification: try to downsample the least amount of points possible when there are multiple series\n // If all points in a bucket have the same area, prioritize the one with an x index\n // that also existed from another series so we don't add another point unnecessarily.\n // By default LTTB picks the leftmost point in the bucket\n if (area > maxArea || (area === maxArea && preferredDownsampleIndices.has(rangeOffs))) {\n maxArea = area;\n maxAreaPoint = data[rangeOffs];\n nextA = rangeOffs; // Next a is this b\n // Modification: save the index of the point with the most area\n maxAreaIndex = rangeOffs;\n }\n }\n\n // eslint-disable-next-line no-plusplus\n sampled[sampledIndex++] = maxAreaPoint; // Pick this point from the bucket\n downsampledIndices.push(maxAreaIndex);\n a = nextA; // This a is the next a (chosen b)\n }\n\n // eslint-disable-next-line no-plusplus\n sampled[sampledIndex++] = data[dataLength - 1]; // Always add last\n downsampledIndices.push(dataLength - 1);\n\n return { downsampledData: sampled, downsampledIndices };\n};\n\nexport type DownsampleOptions = { threshold: number } & Pick<DashboardVizProps, 'dataSources' | 'options'>;\n\ntype CoerceYColumnResult = {\n canDownsampleColumn: boolean;\n canLooselyCoerceSomeValues: boolean;\n coercedColumn: number[];\n};\n\n/**\n * Strictly coerces the entire column to numbers if it only consists of numeric strings or numbers. Also determines\n * if at least one of the values in the column can be loosely coerced to a number.\n * If the column cannot be strictly downsampled (if it contains nulls or non-numeric strings), returns an empty array and\n * returns that it cannot downsample the column.\n */\nconst strictlyCoerceYColumn = (\n column: (string | number)[] | number[],\n options: DownsampleOptions['options']\n): CoerceYColumnResult => {\n const isNullCoercionEnabled = options.nullValueDisplay === 'zero';\n // Splunk charting allows for numbers in formats such as negative hex that\n // Number() does not support and also allows loose coercion of hex numbers (but not other formats)\n // We want to identify columns which contain at least one value that can be loosely coerced\n const canLooselyCoerceSomeValues =\n column.findIndex(\n value => startsWithNumber(`${value}`) || (isNullCoercionEnabled && value === null)\n ) >= 0;\n\n // If not all values in column can be strictly coerced to a number, we do not downsample\n const coercedColumn: number[] = [];\n const canDownsampleColumn = !column.some(value => {\n const coercedValue = Number(value);\n const coerceValueToZero = isNullCoercionEnabled && value === null;\n\n // if it can't be parsed or isn't safe, fail\n if (\n Number.isNaN(coercedValue) ||\n coercedValue <= Number.MIN_SAFE_INTEGER ||\n coercedValue >= Number.MAX_SAFE_INTEGER ||\n (typeof value !== 'string' && typeof value !== 'number' && !coerceValueToZero)\n ) {\n return true;\n }\n // save value and continue to next\n coercedColumn.push(coercedValue);\n return false;\n });\n\n return {\n canDownsampleColumn,\n canLooselyCoerceSomeValues,\n coercedColumn: canDownsampleColumn ? coercedColumn : [],\n };\n};\n\n/**\n * Tries to coerce the x-column to numbers or dates, if it is eligible for downsampling.\n * Only strictly increasing x-columns are eligible for downsampling.\n * If the column is not eligible for downsampling, returns an empty array.\n */\nconst strictlyCoerceXColumn = (column: (string | number)[], fieldType: string): Date[] | number[] => {\n if (fieldType === 'number') {\n const coercedXColumn = column.map(xValue => Number(xValue));\n if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {\n return coercedXColumn;\n }\n } else if (fieldType === 'time') {\n const coercedXColumn = column.map(xValue => new Date(xValue));\n if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {\n return coercedXColumn;\n }\n }\n return [];\n};\n\nexport const isDownsamplingEnabledForViz = ({ vizConfig }: { vizConfig: VizConfig }) => {\n return vizConfig.supports?.includes(VizBehavior.DOWNSAMPLING);\n};\n\nexport const calculateThresholdOnRangeSelect = ({\n firstIndex,\n lastIndex,\n dataSources,\n width,\n}: Pick<DashboardVizProps, 'dataSources'> & {\n firstIndex: number;\n lastIndex: number;\n width: number | string;\n}): number => {\n const window = lastIndex - firstIndex + 1;\n // eslint-disable-next-line no-unsafe-optional-chaining\n const ratio = Math.round(Number(dataSources?.primary?.data?.columns[0]?.length / window) * 10) / 10;\n return Math.round(ratio * Number(width));\n};\n\n/**\n * Calculates the downsampling threshold based on the range selection. If search zoom is enabled or there is no selection,\n * then returns the width of the visualization.\n *\n * Otherwise calculates the threshold based on the ratio of the window selected compared to the size of the non-downsampled\n * data sources. Returns null if the chart event's dataset does not match the passed in primary data source or if the chart is zoomed\n * in for a categorical chart.\n */\nexport const calculateDownsamplingThreshold = ({\n enableSearchZoom,\n dataSources,\n selectChartEvent,\n width,\n xField,\n}: {\n enableSearchZoom: boolean;\n dataSources: Record<string, DataSource> | null;\n selectChartEvent: ChartEvent<'chartRangeSelect'> | null;\n width: number;\n xField: string;\n}): number | null => {\n if (enableSearchZoom || !selectChartEvent) {\n return Number(width);\n }\n\n const primaryDataSource = dataSources?.primary;\n if (!primaryDataSource) {\n return null;\n }\n\n const { startXIndex, endXIndex, currentTarget } = selectChartEvent;\n\n try {\n const xFieldIndex = primaryDataSource?.data?.fields.findIndex(field => {\n const name = typeof field === 'string' ? field : field.name;\n return name === xField;\n });\n const downsampledXFieldIndex = currentTarget.dataSet?.fields.findIndex(field => field === xField);\n\n if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {\n return null;\n }\n\n const fullSeries = primaryDataSource?.data?.columns[xFieldIndex];\n const downsampledSeries = currentTarget.dataSet.seriesList[downsampledXFieldIndex];\n\n const firstIndex = fullSeries.findIndex(x => {\n return downsampledSeries[startXIndex] === x;\n });\n const lastIndex = fullSeries.findIndex(x => {\n return downsampledSeries[endXIndex] === x;\n });\n\n if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {\n return calculateThresholdOnRangeSelect({\n firstIndex,\n lastIndex,\n dataSources,\n width,\n });\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error occurred while setting downsample threshold on range select event', e);\n }\n\n return null;\n};\n\nconst isColumnStrictlyIncreasing = (column: (number | Date)[], fieldType: 'number' | 'time') => {\n return column.every((value, index) => {\n if (fieldType === 'number') {\n if (Number.isNaN(value)) {\n return false;\n }\n }\n\n if (fieldType === 'time') {\n if (Number.isNaN((value as Date).getTime())) {\n return false;\n }\n }\n if (index === 0) {\n return true;\n }\n return value > column[index - 1];\n });\n};\n\n/**\n * Verifies that all of the columns that are displayed in a chart can be downsampled. Valid columns that can be\n * displayed are those that contain at least one number. We can only downsample columns that only consist of numbers.\n *\n * If all columns can be downsampled, returns the x column coerced to time/number and y columns coerced to numbers.\n * If not all columns can be downsampled, then returns empty arrays for both x and y\n */\nconst tryToCoerceAllDisplayedFields = (\n ds: DataSource,\n xField: string,\n yFields: Set<string>,\n fieldTypes: string[],\n options: DownsampleOptions['options']\n): { xColumn: Date[] | number[]; yColumns: number[][] } => {\n let xColumn: Date[] | number[] = [];\n const yColumns: number[][] = [];\n\n const canDownsample = !ds.data.fields.some((field, index) => {\n const fieldName = getFieldName(field);\n const fieldType = fieldTypes[index] ?? 'unknown';\n const column = ds.data.columns[index];\n let hasDisplayedColumnThatCantBeDownsampled = false;\n\n if (fieldName === xField) {\n xColumn = strictlyCoerceXColumn(column, fieldType);\n } else if (yFields.has(fieldName)) {\n const { coercedColumn, canLooselyCoerceSomeValues, canDownsampleColumn } = strictlyCoerceYColumn(\n ds.data.columns[index],\n options\n );\n // do not perform downsampling if a column can possibly be displayed but cannot\n // be downsampled using LTTB\n hasDisplayedColumnThatCantBeDownsampled = canLooselyCoerceSomeValues && !canDownsampleColumn;\n if (hasDisplayedColumnThatCantBeDownsampled) {\n return true;\n }\n if (canDownsampleColumn) {\n yColumns.push(coercedColumn);\n }\n }\n return false;\n });\n\n if (canDownsample) {\n return { xColumn, yColumns };\n }\n return { xColumn: [], yColumns: [] };\n};\n\nconst pickIndicesFromDataSource = (ds: DataSource, indices: Set<number>): DataSource => {\n const sortedIndices = Array.from(indices).sort((a: number, b: number) => a - b);\n const slicedColumns = [];\n ds.data.columns.forEach(column => {\n const slicedColumn = [];\n sortedIndices.forEach(index => {\n slicedColumn.push(column[index]);\n });\n slicedColumns.push(slicedColumn);\n });\n\n // update data columns with downsampled columns\n return {\n ...ds,\n data: {\n ...ds.data,\n columns: slicedColumns,\n },\n };\n};\n\nexport const downsampleDataSources = ({ dataSources, threshold, options }: DownsampleOptions) => {\n const primaryDS = dataSources?.primary;\n // only downsample time series when number of data points are over threshold\n const numPoints = primaryDS?.data?.columns[0]?.length ?? 0;\n if (Number.isNaN(threshold) || numPoints <= threshold || threshold < 2) {\n return dataSources;\n }\n\n const { xField, yFields, fieldTypes } = options;\n if (!xField || !yFields?.length || !fieldTypes?.length) {\n return dataSources;\n }\n\n const nonInternalYFields = new Set<string>(yFields.filter(yField => !yField.startsWith('_')));\n const maxPointsInDownsample = Math.min(nonInternalYFields.size * threshold, numPoints);\n\n // Do not try to downsample if there are too many downsampled pts\n // At the worst case, each series has non-overlapping downsampled pts\n // which will mean that all points will be included in the downsampled result\n // This will just lead to additional overhead due to coercing each\n // x and y field to number\n if (maxPointsInDownsample >= numPoints) {\n return dataSources;\n }\n\n const { xColumn, yColumns } = tryToCoerceAllDisplayedFields(\n primaryDS,\n xField,\n nonInternalYFields,\n fieldTypes,\n options\n );\n\n if (!yColumns.length || !xColumn.length) {\n return dataSources;\n }\n\n const downsampledDataSources = { ...dataSources };\n const downsampledIndices = new Set<number>();\n\n yColumns.forEach((yColumn, columnIndex) => {\n // perform LTTB downsampling for current series, LTTB takes an [x, y] pair\n const xyPair: [Date | number, number][] = yColumn.map((yValue, index) => {\n return [xColumn[index], yValue];\n });\n\n try {\n const { downsampledIndices: downsampledIndicesForSeries } = largestTriangleThreeBuckets(\n xyPair,\n threshold,\n downsampledIndices\n );\n downsampledIndicesForSeries.forEach(downsampleIndex => downsampledIndices.add(downsampleIndex));\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`Error occurred while downsampling column ${columnIndex}`, e);\n }\n });\n // update data columns with downsampled columns\n downsampledDataSources.primary = pickIndicesFromDataSource(primaryDS, downsampledIndices);\n\n return downsampledDataSources;\n};\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/numberUtils\";\nexport * from \"@splunk/visualizations-shared/numberUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,gCAAc;AACd,IAAO,sBAAS,aAAa,gBAA8B,wBAAU;;;ADG9D,IAAM,wBAAwB,CAAC,SAA6B,WAAyB;AAN5F;AAOI,MAAI,GAAC,wCAAU,OAAV,mBAAc,QAAQ,QAAO,CAAC;AAEnC,QAAM,OAAO,CAAC;AAEd,WAAS,IAAI,GAAG,IAAI,QAAQ,CAAC,EAAE,QAAQ,KAAK,GAA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E;AAAA,EACJ,CAAC;AAED,yBAAuB,UAAU,0BAA0B,WAAW,kBAAkB;AAExF,SAAO;AACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const moveFocusOutside: (container: ParentNode, selector: string, event: React.MouseEvent) => void;
|
|
3
|
+
export declare const moveFocusInto: (container: ParentNode, selector: string, event: React.MouseEvent) => void;
|
|
4
|
+
//# sourceMappingURL=focusUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusUtils.d.ts","sourceRoot":"","sources":["../../src/common/utils/focusUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgG/B,eAAO,MAAM,gBAAgB,GAAI,WAAW,UAAU,EAAE,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC,UAAU,KAAG,IAGnG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW,UAAU,EAAE,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC,UAAU,KAAG,IAGhG,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
"use strict";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
|
|
23
|
+
// src/common/utils/focusUtils.ts
|
|
24
|
+
var focusUtils_exports = {};
|
|
25
|
+
__export(focusUtils_exports, {
|
|
26
|
+
moveFocusInto: () => moveFocusInto,
|
|
27
|
+
moveFocusOutside: () => moveFocusOutside
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(focusUtils_exports);
|
|
30
|
+
var DEFAULT_FOCUSABLE_SELECTORS = [
|
|
31
|
+
"a[href]",
|
|
32
|
+
"button:not([disabled])",
|
|
33
|
+
"input:not([disabled])",
|
|
34
|
+
"select:not([disabled])",
|
|
35
|
+
"textarea:not([disabled])",
|
|
36
|
+
"[tabindex]:not([disabled]):not([hidden])",
|
|
37
|
+
"area[href]",
|
|
38
|
+
"iframe",
|
|
39
|
+
"object",
|
|
40
|
+
"embed",
|
|
41
|
+
'[contenteditable]:not([contenteditable="false"])',
|
|
42
|
+
"summary",
|
|
43
|
+
"audio[controls]",
|
|
44
|
+
"video[controls]"
|
|
45
|
+
].join(",");
|
|
46
|
+
var getFocusableElements = () => {
|
|
47
|
+
return Array.from(document.querySelectorAll(DEFAULT_FOCUSABLE_SELECTORS));
|
|
48
|
+
};
|
|
49
|
+
var isElementHidden = (element) => {
|
|
50
|
+
const computedStyle = window.getComputedStyle(element);
|
|
51
|
+
return element.hasAttribute("hidden") || element.getAttribute("aria-hidden") === "true" || computedStyle.display === "none" || computedStyle.visibility === "hidden";
|
|
52
|
+
};
|
|
53
|
+
var isVisibleFocusableElement = (element) => {
|
|
54
|
+
let currentElement = element;
|
|
55
|
+
while (currentElement) {
|
|
56
|
+
if (isElementHidden(currentElement)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
currentElement = currentElement.parentElement;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
};
|
|
63
|
+
var resolveTargetElement = (container, selector) => {
|
|
64
|
+
if (container instanceof Element && container.matches(selector)) {
|
|
65
|
+
return container;
|
|
66
|
+
}
|
|
67
|
+
return container.querySelector(selector);
|
|
68
|
+
};
|
|
69
|
+
var findFirstFocusableElementAfter = (container, selector) => {
|
|
70
|
+
const targetElement = resolveTargetElement(container, selector);
|
|
71
|
+
if (!targetElement) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return getFocusableElements().find((element) => {
|
|
75
|
+
if (targetElement.contains(element)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const relativePosition = targetElement.compareDocumentPosition(element);
|
|
79
|
+
return relativePosition === Node.DOCUMENT_POSITION_FOLLOWING && isVisibleFocusableElement(element);
|
|
80
|
+
}) || null;
|
|
81
|
+
};
|
|
82
|
+
var findFirstFocusableElementInside = (container, selector) => {
|
|
83
|
+
const targetElement = resolveTargetElement(container, selector);
|
|
84
|
+
if (!targetElement) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return getFocusableElements().find((element) => {
|
|
88
|
+
return element !== targetElement && targetElement.contains(element) && isVisibleFocusableElement(element);
|
|
89
|
+
}) || null;
|
|
90
|
+
};
|
|
91
|
+
var moveFocusOutside = (container, selector, event) => {
|
|
92
|
+
var _a;
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
(_a = findFirstFocusableElementAfter(container, selector)) == null ? void 0 : _a.focus();
|
|
95
|
+
};
|
|
96
|
+
var moveFocusInto = (container, selector, event) => {
|
|
97
|
+
var _a;
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
(_a = findFirstFocusableElementInside(container, selector)) == null ? void 0 : _a.focus();
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=focusUtils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/common/utils/focusUtils.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\n\nconst DEFAULT_FOCUSABLE_SELECTORS = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([disabled]):not([hidden])',\n 'area[href]',\n 'iframe',\n 'object',\n 'embed',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'summary',\n 'audio[controls]',\n 'video[controls]',\n].join(',');\n\nconst getFocusableElements = (): HTMLElement[] => {\n return Array.from(document.querySelectorAll(DEFAULT_FOCUSABLE_SELECTORS));\n};\n\nconst isElementHidden = (element: HTMLElement): boolean => {\n const computedStyle = window.getComputedStyle(element);\n\n return (\n element.hasAttribute('hidden') ||\n element.getAttribute('aria-hidden') === 'true' ||\n computedStyle.display === 'none' ||\n computedStyle.visibility === 'hidden'\n );\n};\n\nconst isVisibleFocusableElement = (element: HTMLElement): boolean => {\n let currentElement: HTMLElement | null = element;\n\n while (currentElement) {\n if (isElementHidden(currentElement)) {\n return false;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return true;\n};\n\nconst resolveTargetElement = (container: ParentNode, selector: string): Element | null => {\n if (container instanceof Element && container.matches(selector)) {\n return container;\n }\n\n return container.querySelector(selector);\n};\n\nconst findFirstFocusableElementAfter = (container: ParentNode, selector: string): HTMLElement | null => {\n const targetElement = resolveTargetElement(container, selector);\n\n if (!targetElement) {\n return null;\n }\n\n return (\n getFocusableElements().find(element => {\n if (targetElement.contains(element)) {\n return false;\n }\n\n const relativePosition = targetElement.compareDocumentPosition(element);\n\n return (\n relativePosition === Node.DOCUMENT_POSITION_FOLLOWING && isVisibleFocusableElement(element)\n );\n }) || null\n );\n};\n\nconst findFirstFocusableElementInside = (container: ParentNode, selector: string): HTMLElement | null => {\n const targetElement = resolveTargetElement(container, selector);\n\n if (!targetElement) {\n return null;\n }\n\n return (\n getFocusableElements().find(element => {\n return (\n element !== targetElement &&\n targetElement.contains(element) &&\n isVisibleFocusableElement(element)\n );\n }) || null\n );\n};\n\nexport const moveFocusOutside = (container: ParentNode, selector: string, event: React.MouseEvent): void => {\n event.preventDefault();\n findFirstFocusableElementAfter(container, selector)?.focus();\n};\n\nexport const moveFocusInto = (container: ParentNode, selector: string, event: React.MouseEvent): void => {\n event.preventDefault();\n findFirstFocusableElementInside(container, selector)?.focus();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,8BAA8B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,EAAE,KAAK,GAAG;AAEV,IAAM,uBAAuB,MAAqB;AAC9C,SAAO,MAAM,KAAK,SAAS,iBAAiB,2BAA2B,CAAC;AAC5E;AAEA,IAAM,kBAAkB,CAAC,YAAkC;AACvD,QAAM,gBAAgB,OAAO,iBAAiB,OAAO;AAErD,SACI,QAAQ,aAAa,QAAQ,KAC7B,QAAQ,aAAa,aAAa,MAAM,UACxC,cAAc,YAAY,UAC1B,cAAc,eAAe;AAErC;AAEA,IAAM,4BAA4B,CAAC,YAAkC;AACjE,MAAI,iBAAqC;AAEzC,SAAO,gBAAgB;AACnB,QAAI,gBAAgB,cAAc,GAAG;AACjC,aAAO;AAAA,IACX;AAEA,qBAAiB,eAAe;AAAA,EACpC;AAEA,SAAO;AACX;AAEA,IAAM,uBAAuB,CAAC,WAAuB,aAAqC;AACtF,MAAI,qBAAqB,WAAW,UAAU,QAAQ,QAAQ,GAAG;AAC7D,WAAO;AAAA,EACX;AAEA,SAAO,UAAU,cAAc,QAAQ;AAC3C;AAEA,IAAM,iCAAiC,CAAC,WAAuB,aAAyC;AACpG,QAAM,gBAAgB,qBAAqB,WAAW,QAAQ;AAE9D,MAAI,CAAC,eAAe;AAChB,WAAO;AAAA,EACX;AAEA,SACI,qBAAqB,EAAE,KAAK,aAAW;AACnC,QAAI,cAAc,SAAS,OAAO,GAAG;AACjC,aAAO;AAAA,IACX;AAEA,UAAM,mBAAmB,cAAc,wBAAwB,OAAO;AAEtE,WACI,qBAAqB,KAAK,+BAA+B,0BAA0B,OAAO;AAAA,EAElG,CAAC,KAAK;AAEd;AAEA,IAAM,kCAAkC,CAAC,WAAuB,aAAyC;AACrG,QAAM,gBAAgB,qBAAqB,WAAW,QAAQ;AAE9D,MAAI,CAAC,eAAe;AAChB,WAAO;AAAA,EACX;AAEA,SACI,qBAAqB,EAAE,KAAK,aAAW;AACnC,WACI,YAAY,iBACZ,cAAc,SAAS,OAAO,KAC9B,0BAA0B,OAAO;AAAA,EAEzC,CAAC,KAAK;AAEd;AAEO,IAAM,mBAAmB,CAAC,WAAuB,UAAkB,UAAkC;AAhG5G;AAiGI,QAAM,eAAe;AACrB,uCAA+B,WAAW,QAAQ,MAAlD,mBAAqD;AACzD;AAEO,IAAM,gBAAgB,CAAC,WAAuB,UAAkB,UAAkC;AArGzG;AAsGI,QAAM,eAAe;AACrB,wCAAgC,WAAW,QAAQ,MAAnD,mBAAsD;AAC1D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/common/utils/mapUtils.js
CHANGED
|
@@ -347,9 +347,7 @@ var Tooltip = ({
|
|
|
347
347
|
tooltipHeader = null
|
|
348
348
|
}) => {
|
|
349
349
|
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
350
|
-
const isTooltipIconFlagEnabled = Boolean(
|
|
351
|
-
featureFlagContext && featureFlagContext.visualizations_enableTooltipIcon
|
|
352
|
-
);
|
|
350
|
+
const isTooltipIconFlagEnabled = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTooltipIcon);
|
|
353
351
|
return /* @__PURE__ */ react_exports.createElement(
|
|
354
352
|
StyledPopover,
|
|
355
353
|
{
|
|
@@ -536,9 +534,7 @@ var Bubble = react_exports.memo(
|
|
|
536
534
|
showCoordinates
|
|
537
535
|
}) => {
|
|
538
536
|
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
539
|
-
const isBubbleMapIconFlagEnabled = Boolean(
|
|
540
|
-
featureFlagContext && featureFlagContext.visualizations_enableBubbleMapIcon
|
|
541
|
-
);
|
|
537
|
+
const isBubbleMapIconFlagEnabled = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableBubbleMapIcon);
|
|
542
538
|
const onBubbleClick = react_exports.useCallback(
|
|
543
539
|
(e, name, value) => {
|
|
544
540
|
handleMapClick(e, name, value);
|