@splunk/visualizations 28.8.0 → 28.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +2 -4
- package/Area.config.js.map +2 -2
- package/Area.js +245 -147
- package/Area.js.map +4 -4
- package/Bar.config.js +2 -4
- package/Bar.config.js.map +2 -2
- package/Bar.js +246 -148
- package/Bar.js.map +4 -4
- package/Bubble/Bubble.d.ts +3 -1
- package/Bubble/Bubble.d.ts.map +1 -1
- package/Bubble.js +216 -108
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +31 -1
- package/ChoroplethSvg/ChoroplethSvg.d.ts +3 -1
- package/ChoroplethSvg/ChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
- package/ChoroplethSvg.js +638 -209
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +2 -4
- package/Column.config.js.map +2 -2
- package/Column.js +246 -148
- package/Column.js.map +4 -4
- package/Ellipse/Ellipse.d.ts +3 -1
- package/Ellipse/Ellipse.d.ts.map +1 -1
- package/Ellipse.js +216 -105
- package/Ellipse.js.map +4 -4
- package/Events/Events.d.ts +5 -3
- package/Events/Events.d.ts.map +1 -1
- package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
- package/Events/PureEvents/PureEvents.d.ts +0 -1
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events.js +270 -157
- package/Events.js.map +4 -4
- package/FillerGauge.js +243 -140
- package/FillerGauge.js.map +4 -4
- package/Image/Image.d.ts +3 -1
- package/Image/Image.d.ts.map +1 -1
- package/Image.js +217 -106
- package/Image.js.map +4 -4
- package/Line.config.js +2 -4
- package/Line.config.js.map +2 -2
- package/Line.js +246 -148
- package/Line.js.map +4 -4
- package/LinkGraph/LinkGraph.d.ts +3 -1
- package/LinkGraph/LinkGraph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
- package/LinkGraph.config.js +1 -1
- package/LinkGraph.config.js.map +2 -2
- package/LinkGraph.js +802 -682
- package/LinkGraph.js.map +4 -4
- package/Map/Map.d.ts +10 -9
- package/Map/Map.d.ts.map +1 -1
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
- package/Map/PureMap/MapUtils.d.ts.map +1 -1
- package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
- package/Map/PureMap/PureMap.d.ts +8 -65
- package/Map/PureMap/PureMap.d.ts.map +1 -1
- package/Map.config.js +1 -1
- package/Map.config.js.map +2 -2
- package/Map.js +363 -313
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts +9 -1
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown/config.d.ts.map +1 -1
- package/Markdown.config.js +5 -0
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +225 -94
- package/Markdown.js.map +3 -3
- package/MarkerGauge.js +239 -134
- package/MarkerGauge.js.map +4 -4
- package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +3 -5
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js +4 -2
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +327 -188
- package/NetworkGraph.js.map +4 -4
- package/ParallelCoordinates/ParallelCoordinates.d.ts +3 -1
- package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
- package/ParallelCoordinates.js +239 -128
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/config.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts.map +1 -1
- package/Pie.config.js +4 -2
- package/Pie.config.js.map +2 -2
- package/Pie.js +228 -125
- package/Pie.js.map +3 -3
- package/ProcessTree/ProcessTree.d.ts +3 -1
- package/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +1 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +2 -1
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +2 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +5 -1
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -1
- package/ProcessTree.js +435 -192
- package/ProcessTree.js.map +4 -4
- package/Punchcard/Punchcard.d.ts +3 -1
- package/Punchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard.js +238 -129
- package/Punchcard.js.map +4 -4
- package/Rectangle/Rectangle.d.ts +3 -1
- package/Rectangle/Rectangle.d.ts.map +1 -1
- package/Rectangle.js +218 -116
- package/Rectangle.js.map +4 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts +1 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -1
- package/RichText/PureRichText/Editor/hooks/useConfigPanelFocus.d.ts +14 -0
- package/RichText/PureRichText/Editor/hooks/useConfigPanelFocus.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useEditorPanelSync.d.ts +15 -0
- package/RichText/PureRichText/Editor/hooks/useEditorPanelSync.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/Editor/hooks/usePortalTarget.d.ts +9 -0
- package/RichText/PureRichText/Editor/hooks/usePortalTarget.d.ts.map +1 -0
- package/RichText/PureRichText/InnerEditor.d.ts +15 -9
- package/RichText/PureRichText/InnerEditor.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichText.d.ts +5 -10
- package/RichText/PureRichText/PureRichText.d.ts.map +1 -1
- package/RichText/PureRichText/PureRichTextContext.d.ts +3 -6
- package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -1
- package/RichText/PureRichText/RichTextStyles.d.ts +5 -4
- package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -1
- package/RichText/PureRichText/activeInstance.d.ts +6 -7
- package/RichText/PureRichText/activeInstance.d.ts.map +1 -1
- package/RichText/PureRichText/config.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useContentSync.d.ts +9 -9
- package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts +2 -7
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts +8 -4
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts +2 -4
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +3 -7
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts +2 -2
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +2 -3
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -1
- package/RichText/PureRichText/hooks/useTokenMap.d.ts +13 -24
- package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -1
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts +2 -5
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts.map +1 -1
- package/RichText/PureRichText/types.d.ts +6 -0
- package/RichText/PureRichText/types.d.ts.map +1 -1
- package/RichText/PureRichText/utils/slateUtils.d.ts +26 -2
- package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -1
- package/RichText/RichText.d.ts +3 -1
- package/RichText/RichText.d.ts.map +1 -1
- package/RichText/config.d.ts.map +1 -1
- package/RichText.config.js +5 -0
- package/RichText.config.js.map +2 -2
- package/RichText.js +1848 -842
- package/RichText.js.map +4 -4
- package/Sankey/PureSankey/PureSankey.d.ts +2 -0
- package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyLink.d.ts +3 -1
- package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyNode.d.ts +5 -2
- package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
- package/Sankey/Sankey.d.ts +3 -1
- package/Sankey/Sankey.d.ts.map +1 -1
- package/Sankey.js +508 -219
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +3 -5
- package/Scatter.config.js.map +2 -2
- package/Scatter.js +244 -146
- package/Scatter.js.map +4 -4
- package/SingleValue/SingleValue.d.ts.map +1 -1
- package/SingleValue.js +273 -173
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +4 -4
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
- package/SingleValueIcon.js +264 -164
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial.js +267 -167
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine/SparkLine.d.ts.map +1 -1
- package/SparkLine.js.map +2 -2
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/Table.d.ts +2 -5
- package/Table/Table.d.ts.map +1 -1
- package/Table/hooks.d.ts.map +1 -1
- package/Table.config.js +1 -1
- package/Table.config.js.map +2 -2
- package/Table.js +293 -271
- package/Table.js.map +4 -4
- package/Timeline/Timeline.d.ts +3 -1
- package/Timeline/Timeline.d.ts.map +1 -1
- package/Timeline.config.js +2 -2
- package/Timeline.config.js.map +2 -2
- package/Timeline.js +266 -142
- package/Timeline.js.map +4 -4
- package/Treemap/Treemap.d.ts +3 -1
- package/Treemap/Treemap.d.ts.map +1 -1
- package/Treemap.js +263 -147
- package/Treemap.js.map +4 -4
- package/common/Charting.js +8 -10
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.d.ts.map +1 -1
- package/common/ChartingApi.js +5 -2
- package/common/ChartingApi.js.map +2 -2
- package/common/DocExampleWithVizSandbox.js +3 -3
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js.map +2 -2
- package/common/OptionsDoc.js +1 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +3 -3
- package/common/OverviewDoc.js.map +2 -2
- package/common/ThemesDoc.js.map +2 -2
- package/common/TimeSeriesChartWrapper.js +10 -9
- package/common/TimeSeriesChartWrapper.js.map +2 -2
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +12 -11
- package/common/chartingUtils.js.map +2 -2
- package/common/components/IconPlaceholder.d.ts.map +1 -1
- package/common/docUtils.d.ts.map +1 -1
- package/common/docUtils.js +15 -6
- package/common/docUtils.js.map +2 -2
- package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
- package/common/gaugeUtils.d.ts.map +1 -1
- package/common/gaugeUtils.js +4 -2
- package/common/gaugeUtils.js.map +2 -2
- package/common/hooks/useSorting.d.ts.map +1 -1
- package/common/interfaces/VizEvent.d.ts +7 -0
- package/common/interfaces/VizEvent.d.ts.map +1 -1
- package/common/utils/dataUtils.d.ts.map +1 -1
- package/common/utils/dataUtils.js +6 -10
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +2 -2
- package/common/utils/featureFlagUtils.js.map +2 -2
- package/common/utils/focusUtils.js +1 -1
- package/common/utils/focusUtils.js.map +2 -2
- package/common/utils/mapUtils.d.ts.map +1 -1
- package/common/utils/mapUtils.js +14 -18
- package/common/utils/mapUtils.js.map +2 -2
- package/common/utils/singleValueUtils.js +22 -25
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/textUtils.d.ts.map +1 -1
- package/common/utils/textUtils.js +37 -23
- package/common/utils/textUtils.js.map +2 -2
- package/common/utils/trellisUtils.d.ts.map +1 -1
- package/common/utils/trellisUtils.js +18 -17
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/utils/urlUtils.js.map +2 -2
- package/common/utils/visualizationTheme.d.ts +15 -0
- package/common/utils/visualizationTheme.d.ts.map +1 -0
- package/common/utils/visualizationTheme.js +72 -0
- package/common/utils/visualizationTheme.js.map +7 -0
- package/common/withDashboardViz.d.ts +3 -1
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +216 -105
- package/common/withDashboardViz.js.map +4 -4
- package/docs-llm/network-graph/options.md +2 -2
- package/docs-llm/pie/examples-json.md +195 -0
- package/docs-llm/pie/examples-react.md +123 -0
- package/docs-llm/pie/options.md +1 -1
- package/docs-llm/process-tree/options.md +3 -2
- package/package.json +24 -24
package/ChoroplethSvg.js
CHANGED
|
@@ -3,6 +3,7 @@ SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
|
3
3
|
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
6
|
+
var __freeze = Object.freeze;
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __defProps = Object.defineProperties;
|
|
8
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -61,6 +62,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
61
62
|
));
|
|
62
63
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
63
64
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
65
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
64
66
|
|
|
65
67
|
// src/ChoroplethSvg/index.ts
|
|
66
68
|
var ChoroplethSvg_exports = {};
|
|
@@ -363,7 +365,10 @@ var useSortingParams = ({ requestParams, onRequestParamsChange }) => {
|
|
|
363
365
|
onSort = (e, { sortKey, sortDir }) => {
|
|
364
366
|
if (typeof sortKey === "string") {
|
|
365
367
|
const nextSortDir = (0, lodash_exports.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : "none";
|
|
366
|
-
onRequestParamsChange(
|
|
368
|
+
onRequestParamsChange(__spreadProps(__spreadValues({}, requestParams), {
|
|
369
|
+
offset: 0,
|
|
370
|
+
sort: { [sortKey]: nextSortDir }
|
|
371
|
+
}));
|
|
367
372
|
} else {
|
|
368
373
|
onRequestParamsChange(requestParams);
|
|
369
374
|
}
|
|
@@ -507,7 +512,7 @@ var Cover = styled_components_default.div`
|
|
|
507
512
|
bottom: 0;
|
|
508
513
|
`;
|
|
509
514
|
var Blocker = styled_components_default.div.attrs({
|
|
510
|
-
"data-splunk-visualization-version": "28.
|
|
515
|
+
"data-splunk-visualization-version": "28.9.0 - 96b03188d"
|
|
511
516
|
})`
|
|
512
517
|
position: relative;
|
|
513
518
|
width: 100%;
|
|
@@ -542,14 +547,23 @@ var defaultImport22 = __toESM(require("@splunk/themes/variables"));
|
|
|
542
547
|
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
543
548
|
var variables_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
|
|
544
549
|
|
|
550
|
+
// esm-externals:@splunk/themes
|
|
551
|
+
var themes_exports = {};
|
|
552
|
+
__export(themes_exports, {
|
|
553
|
+
default: () => themes_default
|
|
554
|
+
});
|
|
555
|
+
var defaultImport23 = __toESM(require("@splunk/themes"));
|
|
556
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
557
|
+
var themes_default = "default" in defaultImport23 ? defaultImport23.default : defaultImport23;
|
|
558
|
+
|
|
545
559
|
// esm-externals:@splunk/visualizations-shared/style
|
|
546
560
|
var style_exports = {};
|
|
547
561
|
__export(style_exports, {
|
|
548
562
|
default: () => style_default
|
|
549
563
|
});
|
|
550
|
-
var
|
|
564
|
+
var defaultImport24 = __toESM(require("@splunk/visualizations-shared/style"));
|
|
551
565
|
__reExport(style_exports, require("@splunk/visualizations-shared/style"));
|
|
552
|
-
var style_default = "default" in
|
|
566
|
+
var style_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
|
|
553
567
|
|
|
554
568
|
// src/common/hocs/FixedSizeContainer.tsx
|
|
555
569
|
var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
@@ -606,7 +620,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
606
620
|
FixSizeItem,
|
|
607
621
|
{
|
|
608
622
|
"data-test": "fix-size-item",
|
|
609
|
-
"data-splunk-visualization-version": "28.
|
|
623
|
+
"data-splunk-visualization-version": "28.9.0 - 96b03188d",
|
|
610
624
|
width,
|
|
611
625
|
height,
|
|
612
626
|
backgroundColor
|
|
@@ -627,6 +641,14 @@ var shouldShowIconPlaceholder = (dataSources, loading = false) => {
|
|
|
627
641
|
const noFields = fields === void 0;
|
|
628
642
|
return loading || noData || noFields;
|
|
629
643
|
};
|
|
644
|
+
var PlaceholderContainer = styled_components_default.div`
|
|
645
|
+
/* The inline token color wins when supported. Older browsers discard an
|
|
646
|
+
unsupported oklch value and retain this inherited fallback instead. */
|
|
647
|
+
color: ${(0, themes_exports.pick)({
|
|
648
|
+
dark: "#fafafa",
|
|
649
|
+
light: "#2c2c2c"
|
|
650
|
+
})};
|
|
651
|
+
`;
|
|
630
652
|
var IconPlaceholder = (props) => {
|
|
631
653
|
const {
|
|
632
654
|
width = SplunkVisualization_default.defaults.width,
|
|
@@ -641,7 +663,6 @@ var IconPlaceholder = (props) => {
|
|
|
641
663
|
style: {
|
|
642
664
|
left: "50%",
|
|
643
665
|
top: "50%",
|
|
644
|
-
color: iconColor,
|
|
645
666
|
opacity: 0.15,
|
|
646
667
|
position: "absolute",
|
|
647
668
|
transform: "translate(-50%, -50%)"
|
|
@@ -651,7 +672,14 @@ var IconPlaceholder = (props) => {
|
|
|
651
672
|
"data-test": "icon-placeholder"
|
|
652
673
|
});
|
|
653
674
|
}
|
|
654
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
675
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
676
|
+
PlaceholderContainer,
|
|
677
|
+
{
|
|
678
|
+
"data-test": "icon-placeholder-container",
|
|
679
|
+
style: { width, height, background: backgroundColor, color: iconColor }
|
|
680
|
+
},
|
|
681
|
+
content
|
|
682
|
+
);
|
|
655
683
|
};
|
|
656
684
|
var IconPlaceholder_default = FixedSizeContainer_default(IconPlaceholder);
|
|
657
685
|
|
|
@@ -660,7 +688,7 @@ var withPlaceholder = (Visualization, useIconPlaceholder2 = shouldShowIconPlaceh
|
|
|
660
688
|
const { config: config3 } = Visualization;
|
|
661
689
|
const { themes: themes2 } = config3;
|
|
662
690
|
const Wrapper = (props) => {
|
|
663
|
-
var
|
|
691
|
+
var _a2, _b;
|
|
664
692
|
const {
|
|
665
693
|
dataSources,
|
|
666
694
|
loading,
|
|
@@ -669,7 +697,7 @@ var withPlaceholder = (Visualization, useIconPlaceholder2 = shouldShowIconPlaceh
|
|
|
669
697
|
width = SplunkVisualization_default.defaults.width
|
|
670
698
|
} = props;
|
|
671
699
|
const showPlaceholder = useIconPlaceholder2(dataSources, loading, options);
|
|
672
|
-
const icon = (
|
|
700
|
+
const icon = (_a2 = config3.placeholderIcon) != null ? _a2 : config3.icon;
|
|
673
701
|
const iconColor = variables_default.contentColorActive(props);
|
|
674
702
|
const bgColorFromTheme = (0, colorUtils_exports.isColor)(options == null ? void 0 : options.backgroundColor) ? options == null ? void 0 : options.backgroundColor : (_b = themes2 == null ? void 0 : themes2.defaultBackgroundColor) == null ? void 0 : _b.call(themes2, props);
|
|
675
703
|
if (config3.supports.includes("placeholder" /* PLACEHOLDER */) && showPlaceholder) {
|
|
@@ -697,9 +725,9 @@ var numberUtils_exports = {};
|
|
|
697
725
|
__export(numberUtils_exports, {
|
|
698
726
|
default: () => numberUtils_default
|
|
699
727
|
});
|
|
700
|
-
var
|
|
728
|
+
var defaultImport25 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
|
|
701
729
|
__reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
|
|
702
|
-
var numberUtils_default = "default" in
|
|
730
|
+
var numberUtils_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
|
|
703
731
|
|
|
704
732
|
// src/common/utils/dataUtils.ts
|
|
705
733
|
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
@@ -725,7 +753,7 @@ var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices)
|
|
|
725
753
|
let avgY = 0;
|
|
726
754
|
let avgRangeStart = Math.floor((i + 1) * every) + 1;
|
|
727
755
|
let avgRangeEnd = Math.floor((i + 2) * every) + 1;
|
|
728
|
-
avgRangeEnd = avgRangeEnd
|
|
756
|
+
avgRangeEnd = Math.min(avgRangeEnd, dataLength);
|
|
729
757
|
const avgRangeLength = avgRangeEnd - avgRangeStart;
|
|
730
758
|
for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {
|
|
731
759
|
avgX += Number(data[avgRangeStart][0]);
|
|
@@ -760,9 +788,9 @@ var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices)
|
|
|
760
788
|
};
|
|
761
789
|
var strictlyCoerceYColumn = (column, options) => {
|
|
762
790
|
const isNullCoercionEnabled = options.nullValueDisplay === "zero";
|
|
763
|
-
const canLooselyCoerceSomeValues = column.
|
|
791
|
+
const canLooselyCoerceSomeValues = column.some(
|
|
764
792
|
(value) => (0, numberUtils_exports.startsWithNumber)(`${value}`) || isNullCoercionEnabled && value === null
|
|
765
|
-
)
|
|
793
|
+
);
|
|
766
794
|
const coercedColumn = [];
|
|
767
795
|
const canDownsampleColumn = !column.some((value) => {
|
|
768
796
|
const coercedValue = Number(value);
|
|
@@ -781,7 +809,7 @@ var strictlyCoerceYColumn = (column, options) => {
|
|
|
781
809
|
};
|
|
782
810
|
var strictlyCoerceXColumn = (column, fieldType) => {
|
|
783
811
|
if (fieldType === "number") {
|
|
784
|
-
const coercedXColumn = column.map(
|
|
812
|
+
const coercedXColumn = column.map(Number);
|
|
785
813
|
if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {
|
|
786
814
|
return coercedXColumn;
|
|
787
815
|
}
|
|
@@ -794,8 +822,8 @@ var strictlyCoerceXColumn = (column, fieldType) => {
|
|
|
794
822
|
return [];
|
|
795
823
|
};
|
|
796
824
|
var isDownsamplingEnabledForViz = ({ vizConfig }) => {
|
|
797
|
-
var
|
|
798
|
-
return (
|
|
825
|
+
var _a2;
|
|
826
|
+
return (_a2 = vizConfig.supports) == null ? void 0 : _a2.includes("downsampling" /* DOWNSAMPLING */);
|
|
799
827
|
};
|
|
800
828
|
var isColumnStrictlyIncreasing = (column, fieldType) => {
|
|
801
829
|
return column.every((value, index) => {
|
|
@@ -819,9 +847,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
819
847
|
let xColumn = [];
|
|
820
848
|
const yColumns = [];
|
|
821
849
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
822
|
-
var
|
|
850
|
+
var _a2;
|
|
823
851
|
const fieldName = getFieldName(field);
|
|
824
|
-
const fieldType = (
|
|
852
|
+
const fieldType = (_a2 = fieldTypes[index]) != null ? _a2 : "unknown";
|
|
825
853
|
const column = ds.data.columns[index];
|
|
826
854
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
827
855
|
if (fieldName === xField) {
|
|
@@ -863,9 +891,9 @@ var pickIndicesFromDataSource = (ds, indices) => {
|
|
|
863
891
|
});
|
|
864
892
|
};
|
|
865
893
|
var downsampleDataSources = ({ dataSources, threshold, options }) => {
|
|
866
|
-
var
|
|
894
|
+
var _a2, _b, _c;
|
|
867
895
|
const primaryDS = dataSources == null ? void 0 : dataSources.primary;
|
|
868
|
-
const numPoints = (_c = (_b = (
|
|
896
|
+
const numPoints = (_c = (_b = (_a2 = primaryDS == null ? void 0 : primaryDS.data) == null ? void 0 : _a2.columns[0]) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
869
897
|
if (Number.isNaN(threshold) || numPoints <= threshold || threshold < 2) {
|
|
870
898
|
return dataSources;
|
|
871
899
|
}
|
|
@@ -926,14 +954,14 @@ var useGetXAndYFields = ({
|
|
|
926
954
|
dataSources
|
|
927
955
|
}) => {
|
|
928
956
|
const { dataSourcesWithOnlyOnePoint, dataFrameWithOnlyOnePoint } = (0, react_exports.useMemo)(() => {
|
|
929
|
-
var
|
|
957
|
+
var _a2, _b, _c;
|
|
930
958
|
if (!shouldEvaluateDSL) {
|
|
931
959
|
return {
|
|
932
960
|
dataSourcesWithOnlyOnePoint: null,
|
|
933
961
|
dataFrameWithOnlyOnePoint: null
|
|
934
962
|
};
|
|
935
963
|
}
|
|
936
|
-
if (!((_c = (_b = (
|
|
964
|
+
if (!((_c = (_b = (_a2 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a2.data) == null ? void 0 : _b.columns) == null ? void 0 : _c.length)) {
|
|
937
965
|
return {
|
|
938
966
|
dataSourcesWithOnlyOnePoint: null,
|
|
939
967
|
dataFrameWithOnlyOnePoint: null
|
|
@@ -1080,16 +1108,16 @@ var FeatureFlags_exports = {};
|
|
|
1080
1108
|
__export(FeatureFlags_exports, {
|
|
1081
1109
|
default: () => FeatureFlags_default
|
|
1082
1110
|
});
|
|
1083
|
-
var
|
|
1111
|
+
var defaultImport26 = __toESM(require("@splunk/visualization-context/FeatureFlags"));
|
|
1084
1112
|
__reExport(FeatureFlags_exports, require("@splunk/visualization-context/FeatureFlags"));
|
|
1085
|
-
var FeatureFlags_default = "default" in
|
|
1113
|
+
var FeatureFlags_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
|
|
1086
1114
|
|
|
1087
1115
|
// src/common/utils/featureFlagUtils.ts
|
|
1088
1116
|
var getFeatureFlag = (context, flagName) => {
|
|
1089
|
-
if (context && Object.keys(context).
|
|
1117
|
+
if (context && Object.keys(context).includes(flagName)) {
|
|
1090
1118
|
return context[flagName];
|
|
1091
1119
|
}
|
|
1092
|
-
if (Object.keys(FeatureFlags_default).
|
|
1120
|
+
if (Object.keys(FeatureFlags_default).includes(flagName)) {
|
|
1093
1121
|
return FeatureFlags_default[flagName];
|
|
1094
1122
|
}
|
|
1095
1123
|
return false;
|
|
@@ -1100,9 +1128,9 @@ var trellisUtils_exports = {};
|
|
|
1100
1128
|
__export(trellisUtils_exports, {
|
|
1101
1129
|
default: () => trellisUtils_default
|
|
1102
1130
|
});
|
|
1103
|
-
var
|
|
1131
|
+
var defaultImport27 = __toESM(require("@splunk/visualizations-shared/trellisUtils"));
|
|
1104
1132
|
__reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisUtils"));
|
|
1105
|
-
var trellisUtils_default = "default" in
|
|
1133
|
+
var trellisUtils_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
|
|
1106
1134
|
|
|
1107
1135
|
// src/common/utils/trellisUtils.ts
|
|
1108
1136
|
var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
@@ -1119,9 +1147,9 @@ var visualization_canvas_exports = {};
|
|
|
1119
1147
|
__export(visualization_canvas_exports, {
|
|
1120
1148
|
default: () => visualization_canvas_default
|
|
1121
1149
|
});
|
|
1122
|
-
var
|
|
1150
|
+
var defaultImport28 = __toESM(require("@splunk/visualization-canvas"));
|
|
1123
1151
|
__reExport(visualization_canvas_exports, require("@splunk/visualization-canvas"));
|
|
1124
|
-
var visualization_canvas_default = "default" in
|
|
1152
|
+
var visualization_canvas_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
1125
1153
|
|
|
1126
1154
|
// src/common/components/VizStyleWrapper.jsx
|
|
1127
1155
|
var VizStyleWrapper = styled_components_default.div.attrs(({ dataTestKey }) => ({
|
|
@@ -1143,27 +1171,27 @@ var Triangle_exports = {};
|
|
|
1143
1171
|
__export(Triangle_exports, {
|
|
1144
1172
|
default: () => Triangle_default
|
|
1145
1173
|
});
|
|
1146
|
-
var
|
|
1174
|
+
var defaultImport29 = __toESM(require("@splunk/react-icons/Triangle"));
|
|
1147
1175
|
__reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
|
|
1148
|
-
var Triangle_default = "default" in
|
|
1176
|
+
var Triangle_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
1149
1177
|
|
|
1150
1178
|
// esm-externals:@splunk/visualizations-shared/propUtils
|
|
1151
1179
|
var propUtils_exports = {};
|
|
1152
1180
|
__export(propUtils_exports, {
|
|
1153
1181
|
default: () => propUtils_default
|
|
1154
1182
|
});
|
|
1155
|
-
var
|
|
1183
|
+
var defaultImport30 = __toESM(require("@splunk/visualizations-shared/propUtils"));
|
|
1156
1184
|
__reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
|
|
1157
|
-
var propUtils_default = "default" in
|
|
1185
|
+
var propUtils_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
|
|
1158
1186
|
|
|
1159
1187
|
// esm-externals:@splunk/visualizations-shared/simpleXMLOptions
|
|
1160
1188
|
var simpleXMLOptions_exports = {};
|
|
1161
1189
|
__export(simpleXMLOptions_exports, {
|
|
1162
1190
|
default: () => simpleXMLOptions_default
|
|
1163
1191
|
});
|
|
1164
|
-
var
|
|
1192
|
+
var defaultImport31 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1165
1193
|
__reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
|
|
1166
|
-
var simpleXMLOptions_default = "default" in
|
|
1194
|
+
var simpleXMLOptions_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
|
|
1167
1195
|
|
|
1168
1196
|
// src/common/chartingUtils.ts
|
|
1169
1197
|
var DEFAULT_LINE_WIDTH = 2;
|
|
@@ -1195,16 +1223,16 @@ var triangleEventAnnotationRenderer = ({
|
|
|
1195
1223
|
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
1196
1224
|
const rangeSelectEventHandler = eventHandlers.find(
|
|
1197
1225
|
(eventHandler) => {
|
|
1198
|
-
var
|
|
1199
|
-
return (
|
|
1226
|
+
var _a2;
|
|
1227
|
+
return (_a2 = eventHandler.options.events) == null ? void 0 : _a2.includes("range.select");
|
|
1200
1228
|
}
|
|
1201
1229
|
);
|
|
1202
1230
|
const xAxisIsTime = xField === "_time";
|
|
1203
1231
|
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1204
1232
|
};
|
|
1205
|
-
var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
|
|
1233
|
+
var canvasSupportedTimeSeriesCharts = /* @__PURE__ */ new Set(["splunk.line", "splunk.area"]);
|
|
1206
1234
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1207
|
-
return canvasSupportedTimeSeriesCharts.
|
|
1235
|
+
return canvasSupportedTimeSeriesCharts.has(vizConfigKey);
|
|
1208
1236
|
};
|
|
1209
1237
|
var filterChartDataFromInternalFields = (chartData) => {
|
|
1210
1238
|
const { fields, columns } = chartData;
|
|
@@ -1220,7 +1248,7 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
1220
1248
|
return { fields: filteredFields, columns: filteredColumns };
|
|
1221
1249
|
};
|
|
1222
1250
|
var convert2DArrayToNumbers = (arr) => {
|
|
1223
|
-
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
1251
|
+
return arr.map((subArray) => subArray.map((element) => Number.parseFloat(element)));
|
|
1224
1252
|
};
|
|
1225
1253
|
var parseAxisValue = (val) => {
|
|
1226
1254
|
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
@@ -1258,6 +1286,7 @@ var getLegend = (props) => {
|
|
|
1258
1286
|
return (0, visualization_canvas_exports.TopLegendFactory)(__spreadValues({
|
|
1259
1287
|
wrap: true
|
|
1260
1288
|
}, commonLegendProps));
|
|
1289
|
+
// Note: By default, use right legend
|
|
1261
1290
|
default:
|
|
1262
1291
|
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1263
1292
|
}
|
|
@@ -1369,7 +1398,7 @@ var getY2Scale = (field, y2fields, overlayFields) => {
|
|
|
1369
1398
|
return assignToY2 ? "y2" : "y";
|
|
1370
1399
|
};
|
|
1371
1400
|
var getSeriesOverrides = (opts) => {
|
|
1372
|
-
var
|
|
1401
|
+
var _a2;
|
|
1373
1402
|
const {
|
|
1374
1403
|
yfields,
|
|
1375
1404
|
y2fields,
|
|
@@ -1390,20 +1419,20 @@ var getSeriesOverrides = (opts) => {
|
|
|
1390
1419
|
let spanGaps;
|
|
1391
1420
|
if (nullValueMode === "gaps") {
|
|
1392
1421
|
spanGaps = false;
|
|
1393
|
-
} else if (nullValueMode
|
|
1394
|
-
spanGaps = true;
|
|
1395
|
-
} else {
|
|
1422
|
+
} else if (nullValueMode == null) {
|
|
1396
1423
|
spanGaps = void 0;
|
|
1424
|
+
} else {
|
|
1425
|
+
spanGaps = true;
|
|
1397
1426
|
}
|
|
1398
1427
|
const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
|
|
1399
1428
|
const isAreaChart = type === "area";
|
|
1400
1429
|
const isStacked = isAreaChart && (stackMode === "stacked" || stackMode === "stacked100");
|
|
1401
1430
|
const areaFields = isAreaChart ? yfields.filter((f) => !(overlayFields == null ? void 0 : overlayFields.includes(f))) : yfields;
|
|
1402
|
-
const overlayFieldsInOrder = (
|
|
1431
|
+
const overlayFieldsInOrder = (_a2 = overlayFields == null ? void 0 : overlayFields.filter((f) => yfields.includes(f))) != null ? _a2 : [];
|
|
1403
1432
|
const orderedFields = isAreaChart ? [...areaFields, ...overlayFieldsInOrder] : yfields;
|
|
1404
1433
|
orderedFields.forEach((field) => {
|
|
1405
|
-
var
|
|
1406
|
-
const isOverlay = (
|
|
1434
|
+
var _a3;
|
|
1435
|
+
const isOverlay = (_a3 = overlayFields == null ? void 0 : overlayFields.includes(field)) != null ? _a3 : false;
|
|
1407
1436
|
const isPercent = isAreaChart && stackMode === "stacked100" && !isOverlay;
|
|
1408
1437
|
const shouldHideAreaOutline = isAreaChart && showLines === false && !isOverlay;
|
|
1409
1438
|
seriesConfig[field] = {
|
|
@@ -1466,9 +1495,9 @@ var visualization_schemas_exports = {};
|
|
|
1466
1495
|
__export(visualization_schemas_exports, {
|
|
1467
1496
|
default: () => visualization_schemas_default
|
|
1468
1497
|
});
|
|
1469
|
-
var
|
|
1498
|
+
var defaultImport32 = __toESM(require("@splunk/visualization-schemas"));
|
|
1470
1499
|
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
1471
|
-
var visualization_schemas_default = "default" in
|
|
1500
|
+
var visualization_schemas_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
|
|
1472
1501
|
|
|
1473
1502
|
// src/common/hooks/useTrellisEnabled.ts
|
|
1474
1503
|
var useTrellisFeatureFlagOn = () => {
|
|
@@ -1605,11 +1634,11 @@ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
|
1605
1634
|
}
|
|
1606
1635
|
};
|
|
1607
1636
|
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1608
|
-
var
|
|
1637
|
+
var _a2;
|
|
1609
1638
|
if (!rangeEvent) {
|
|
1610
1639
|
return;
|
|
1611
1640
|
}
|
|
1612
|
-
const xData = ((
|
|
1641
|
+
const xData = ((_a2 = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a2[0]) || [];
|
|
1613
1642
|
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1614
1643
|
const payload = {
|
|
1615
1644
|
startXIndex,
|
|
@@ -1627,8 +1656,8 @@ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellis
|
|
|
1627
1656
|
}
|
|
1628
1657
|
};
|
|
1629
1658
|
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1630
|
-
var
|
|
1631
|
-
const xData = ((
|
|
1659
|
+
var _a2;
|
|
1660
|
+
const xData = ((_a2 = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a2[0]) || [];
|
|
1632
1661
|
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1633
1662
|
const payload = {
|
|
1634
1663
|
startXIndex,
|
|
@@ -1688,7 +1717,7 @@ var getYAxisTitles = ({
|
|
|
1688
1717
|
};
|
|
1689
1718
|
var TimeSeriesChartWrapper = (props) => {
|
|
1690
1719
|
var _b, _c, _d;
|
|
1691
|
-
const
|
|
1720
|
+
const _a2 = props, {
|
|
1692
1721
|
width,
|
|
1693
1722
|
height,
|
|
1694
1723
|
chartData,
|
|
@@ -1714,7 +1743,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1714
1743
|
y2AxisLineVisibility,
|
|
1715
1744
|
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
1716
1745
|
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
1717
|
-
} =
|
|
1746
|
+
} = _a2, otherOptions = __objRest(_a2, [
|
|
1718
1747
|
"width",
|
|
1719
1748
|
"height",
|
|
1720
1749
|
"chartData",
|
|
@@ -1833,11 +1862,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1833
1862
|
y2AxisMajorUnitFromSimpleXML,
|
|
1834
1863
|
y2AxisMajorTickInterval
|
|
1835
1864
|
);
|
|
1836
|
-
const xAxisMajorTickSizeNum = xAxisMajorTickSize
|
|
1837
|
-
const yAxisMajorTickSizeNum = yAxisMajorTickSize
|
|
1838
|
-
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize
|
|
1839
|
-
const yAxisMinorTickSizeNum = yAxisMinorTickSize
|
|
1840
|
-
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize
|
|
1865
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize == null ? void 0 : Number(xAxisMajorTickSize);
|
|
1866
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize == null ? void 0 : Number(yAxisMajorTickSize);
|
|
1867
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize == null ? void 0 : Number(y2AxisMajorTickSize);
|
|
1868
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize == null ? void 0 : Number(yAxisMinorTickSize);
|
|
1869
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize == null ? void 0 : Number(y2AxisMinorTickSize);
|
|
1841
1870
|
const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
|
|
1842
1871
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
1843
1872
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
@@ -2249,6 +2278,76 @@ var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTr
|
|
|
2249
2278
|
});
|
|
2250
2279
|
return result;
|
|
2251
2280
|
};
|
|
2281
|
+
var buildAllEventCallbackProps = (events, evaluatedOptionsToUse, onEventTrigger, { supportsEvents, hasEventHandlers, mode }) => {
|
|
2282
|
+
if (!supportsEvents) return {};
|
|
2283
|
+
const defaultEvents = {};
|
|
2284
|
+
const userEvents = {};
|
|
2285
|
+
Object.entries(events || {}).forEach(([eventKey, eventConfig]) => {
|
|
2286
|
+
(eventConfig.source === "default" ? defaultEvents : userEvents)[eventKey] = eventConfig;
|
|
2287
|
+
});
|
|
2288
|
+
const userProps = hasEventHandlers && mode === "view" ? buildEventCallbackProps(userEvents, evaluatedOptionsToUse, onEventTrigger) : {};
|
|
2289
|
+
return __spreadValues(__spreadValues({}, userProps), buildEventCallbackProps(defaultEvents, evaluatedOptionsToUse, onEventTrigger));
|
|
2290
|
+
};
|
|
2291
|
+
var applyContextTimezone = (localeContext) => {
|
|
2292
|
+
if (localeContext.serializedTimezone && !moment_default.getDefaultSplunkTimezone()) {
|
|
2293
|
+
moment_default.setDefaultSplunkTimezone(localeContext.serializedTimezone);
|
|
2294
|
+
}
|
|
2295
|
+
};
|
|
2296
|
+
var getAsyncOptionsEvaluationParams = ({
|
|
2297
|
+
visualizationID,
|
|
2298
|
+
props,
|
|
2299
|
+
optionsToEvaluate,
|
|
2300
|
+
downsampledDataSources,
|
|
2301
|
+
vizConfig,
|
|
2302
|
+
bypassCloneDeepOptionScope,
|
|
2303
|
+
lazyLoadingDataFrame
|
|
2304
|
+
}) => {
|
|
2305
|
+
return {
|
|
2306
|
+
visualizationID,
|
|
2307
|
+
props,
|
|
2308
|
+
options: __spreadValues({}, optionsToEvaluate),
|
|
2309
|
+
dataSources: downsampledDataSources,
|
|
2310
|
+
theme: vizConfig.themes,
|
|
2311
|
+
bypassCloneDeepOptionScope,
|
|
2312
|
+
lazyLoadingDataFrame
|
|
2313
|
+
};
|
|
2314
|
+
};
|
|
2315
|
+
var evaluateOptionsSync = ({
|
|
2316
|
+
optionsToEvaluate,
|
|
2317
|
+
downsampledDataSources,
|
|
2318
|
+
dataSourcesInState,
|
|
2319
|
+
dataFramesInState,
|
|
2320
|
+
setDataSourcesInState,
|
|
2321
|
+
setDataFramesInState,
|
|
2322
|
+
computeDataFrames,
|
|
2323
|
+
featureFlagContext,
|
|
2324
|
+
themeFunc
|
|
2325
|
+
}) => {
|
|
2326
|
+
let dataFrames = dataFramesInState;
|
|
2327
|
+
if (downsampledDataSources !== dataSourcesInState) {
|
|
2328
|
+
setDataSourcesInState(downsampledDataSources);
|
|
2329
|
+
dataFrames = Options_exports.Options.dataFrameFromDataSource(
|
|
2330
|
+
downsampledDataSources,
|
|
2331
|
+
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2332
|
+
);
|
|
2333
|
+
setDataFramesInState(dataFrames);
|
|
2334
|
+
}
|
|
2335
|
+
let mergedFrames = dataFrames;
|
|
2336
|
+
if (computeDataFrames && dataFrames) {
|
|
2337
|
+
const derivedFrames = computeDataFrames({
|
|
2338
|
+
dataSources: downsampledDataSources,
|
|
2339
|
+
options: optionsToEvaluate.options
|
|
2340
|
+
});
|
|
2341
|
+
mergedFrames = __spreadValues(__spreadValues({}, dataFrames), derivedFrames);
|
|
2342
|
+
}
|
|
2343
|
+
return Options_exports.Options.evaluate(
|
|
2344
|
+
optionsToEvaluate,
|
|
2345
|
+
downsampledDataSources,
|
|
2346
|
+
themeFunc,
|
|
2347
|
+
mergedFrames,
|
|
2348
|
+
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2349
|
+
);
|
|
2350
|
+
};
|
|
2252
2351
|
var withDashboardViz = (opts) => {
|
|
2253
2352
|
const {
|
|
2254
2353
|
ReactViz,
|
|
@@ -2264,7 +2363,7 @@ var withDashboardViz = (opts) => {
|
|
|
2264
2363
|
const SanitizedReactViz = (0, SanitizeProps_exports.withSanitizedProps)(ReactViz);
|
|
2265
2364
|
const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(vizConfig.optionsSchema, "default");
|
|
2266
2365
|
const DashboardViz = (props) => {
|
|
2267
|
-
var
|
|
2366
|
+
var _a2;
|
|
2268
2367
|
const {
|
|
2269
2368
|
mode = "view",
|
|
2270
2369
|
hasEventHandlers,
|
|
@@ -2280,14 +2379,10 @@ var withDashboardViz = (opts) => {
|
|
|
2280
2379
|
onRequestParamsChange = lodash_exports.noop
|
|
2281
2380
|
} = props;
|
|
2282
2381
|
const localeContext = react_exports.useContext(TimezoneContext_default);
|
|
2283
|
-
|
|
2284
|
-
if (!moment_default.getDefaultSplunkTimezone()) {
|
|
2285
|
-
moment_default.setDefaultSplunkTimezone(localeContext.serializedTimezone);
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2382
|
+
applyContextTimezone(localeContext);
|
|
2288
2383
|
const themeFunc = (themeVar) => {
|
|
2289
|
-
var
|
|
2290
|
-
return (_b = (
|
|
2384
|
+
var _a3, _b;
|
|
2385
|
+
return (_b = (_a3 = vizConfig.themes)[themeVar]) == null ? void 0 : _b.call(_a3, props);
|
|
2291
2386
|
};
|
|
2292
2387
|
const {
|
|
2293
2388
|
family: currentThemeFamily,
|
|
@@ -2307,16 +2402,21 @@ var withDashboardViz = (opts) => {
|
|
|
2307
2402
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
|
|
2308
2403
|
);
|
|
2309
2404
|
const isTrellisFeatureFlagOn = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
|
|
2310
|
-
const isTrellisOn = isTrellisFeatureFlagOn && ((
|
|
2405
|
+
const isTrellisOn = isTrellisFeatureFlagOn && ((_a2 = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a2.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
|
|
2311
2406
|
const isAcceleratedRenderFeatureFlagOn = Boolean(
|
|
2312
2407
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
|
|
2313
2408
|
);
|
|
2314
2409
|
const isAcceleratedRenderOn = isAcceleratedRenderFeatureFlagOn && isTimeSeriesCanvasRenderSupported(vizConfig.key) && (options == null ? void 0 : options.acceleratedRender) === true;
|
|
2315
|
-
const
|
|
2410
|
+
const bypassCloneDeepOptionScope = Boolean(
|
|
2411
|
+
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2412
|
+
);
|
|
2413
|
+
const lazyLoadingDataFrame = Boolean(
|
|
2414
|
+
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2415
|
+
);
|
|
2316
2416
|
const optionsToEvaluate = react_exports.useMemo(() => {
|
|
2317
|
-
var
|
|
2417
|
+
var _a3;
|
|
2318
2418
|
const legendDisplay = turnOffLegendDisplayWhenTrellisIsOn(isTrellisOn, options);
|
|
2319
|
-
const computedOptions = (
|
|
2419
|
+
const computedOptions = (_a3 = computeVizPropsBeforeEval(options)) != null ? _a3 : {};
|
|
2320
2420
|
return {
|
|
2321
2421
|
context: (0, lodash_exports.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
2322
2422
|
options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)(
|
|
@@ -2351,63 +2451,74 @@ var withDashboardViz = (opts) => {
|
|
|
2351
2451
|
threshold,
|
|
2352
2452
|
isDownsamplingEnabled
|
|
2353
2453
|
});
|
|
2354
|
-
|
|
2454
|
+
const asyncOptionsEvaluationParams = useDeepMemo(
|
|
2455
|
+
() => getAsyncOptionsEvaluationParams({
|
|
2456
|
+
visualizationID,
|
|
2457
|
+
props,
|
|
2458
|
+
optionsToEvaluate,
|
|
2459
|
+
downsampledDataSources,
|
|
2460
|
+
vizConfig,
|
|
2461
|
+
bypassCloneDeepOptionScope,
|
|
2462
|
+
lazyLoadingDataFrame
|
|
2463
|
+
}),
|
|
2464
|
+
[
|
|
2465
|
+
visualizationID,
|
|
2466
|
+
optionsToEvaluate,
|
|
2467
|
+
downsampledDataSources,
|
|
2468
|
+
vizConfig,
|
|
2469
|
+
bypassCloneDeepOptionScope,
|
|
2470
|
+
lazyLoadingDataFrame,
|
|
2471
|
+
currentThemeFamily,
|
|
2472
|
+
currentThemeColorScheme,
|
|
2473
|
+
currentThemeDensity,
|
|
2474
|
+
localeContext.serializedTimezone
|
|
2475
|
+
]
|
|
2476
|
+
);
|
|
2477
|
+
react_exports.useEffect(() => {
|
|
2478
|
+
if (!useAsyncEvaluatedOptions) {
|
|
2479
|
+
return void 0;
|
|
2480
|
+
}
|
|
2481
|
+
let ownsEvaluation = true;
|
|
2355
2482
|
try {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
visualizationID,
|
|
2359
|
-
props,
|
|
2360
|
-
options: optionsToEvaluate,
|
|
2361
|
-
dataSources: downsampledDataSources,
|
|
2362
|
-
theme: vizConfig.themes,
|
|
2363
|
-
bypassCloneDeepOptionScope: Boolean(
|
|
2364
|
-
getFeatureFlag(featureFlagContext, "visualizations_bypassCloneDeepOptionScope")
|
|
2365
|
-
),
|
|
2366
|
-
lazyLoadingDataFrame: Boolean(
|
|
2367
|
-
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2368
|
-
)
|
|
2369
|
-
};
|
|
2370
|
-
async_dynamic_options_evaluator_default.evaluate(asyncDynamicOptionsEvaluatorParams).then((results) => {
|
|
2483
|
+
async_dynamic_options_evaluator_default.evaluate(asyncOptionsEvaluationParams).then((results) => {
|
|
2484
|
+
if (ownsEvaluation) {
|
|
2371
2485
|
setEvaluatedOptionsAsync(results.results);
|
|
2372
|
-
}).catch(() => {
|
|
2373
|
-
if (isMounted.current) {
|
|
2374
|
-
setUseAsyncEvaluatedOptions(false);
|
|
2375
|
-
}
|
|
2376
|
-
});
|
|
2377
|
-
} else {
|
|
2378
|
-
let dataFrames = dataFramesInState;
|
|
2379
|
-
if (downsampledDataSources !== dataSourcesInState) {
|
|
2380
|
-
setDataSourcesInState(downsampledDataSources);
|
|
2381
|
-
dataFrames = Options_exports.Options.dataFrameFromDataSource(
|
|
2382
|
-
downsampledDataSources,
|
|
2383
|
-
getFeatureFlag(featureFlagContext, "visualizations_lazyLoadingDataFrame")
|
|
2384
|
-
);
|
|
2385
|
-
setDataFramesInState(dataFrames);
|
|
2386
2486
|
}
|
|
2387
|
-
|
|
2388
|
-
if (
|
|
2389
|
-
|
|
2390
|
-
dataSources: downsampledDataSources,
|
|
2391
|
-
options: optionsToEvaluate.options
|
|
2392
|
-
});
|
|
2393
|
-
mergedFrames = __spreadValues(__spreadValues({}, dataFrames), derivedFrames);
|
|
2487
|
+
}).catch(() => {
|
|
2488
|
+
if (ownsEvaluation) {
|
|
2489
|
+
setUseAsyncEvaluatedOptions(false);
|
|
2394
2490
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2491
|
+
});
|
|
2492
|
+
} catch (e) {
|
|
2493
|
+
setUseAsyncEvaluatedOptions(false);
|
|
2494
|
+
}
|
|
2495
|
+
return () => {
|
|
2496
|
+
ownsEvaluation = false;
|
|
2497
|
+
async_dynamic_options_evaluator_default.reset(visualizationID);
|
|
2498
|
+
};
|
|
2499
|
+
}, [asyncOptionsEvaluationParams, useAsyncEvaluatedOptions, visualizationID]);
|
|
2500
|
+
evaluatedOptions = useDeepMemo(() => {
|
|
2501
|
+
try {
|
|
2502
|
+
if (useAsyncEvaluatedOptions) {
|
|
2503
|
+
return {};
|
|
2403
2504
|
}
|
|
2505
|
+
return evaluateOptionsSync({
|
|
2506
|
+
optionsToEvaluate,
|
|
2507
|
+
downsampledDataSources,
|
|
2508
|
+
dataSourcesInState,
|
|
2509
|
+
dataFramesInState,
|
|
2510
|
+
setDataSourcesInState,
|
|
2511
|
+
setDataFramesInState,
|
|
2512
|
+
computeDataFrames,
|
|
2513
|
+
featureFlagContext,
|
|
2514
|
+
themeFunc
|
|
2515
|
+
});
|
|
2404
2516
|
} catch (e) {
|
|
2405
2517
|
if (e instanceof Error) {
|
|
2406
2518
|
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
2407
2519
|
}
|
|
2408
2520
|
return {};
|
|
2409
2521
|
}
|
|
2410
|
-
return {};
|
|
2411
2522
|
}, [
|
|
2412
2523
|
currentThemeFamily,
|
|
2413
2524
|
currentThemeColorScheme,
|
|
@@ -2417,7 +2528,7 @@ var withDashboardViz = (opts) => {
|
|
|
2417
2528
|
localeContext.serializedTimezone,
|
|
2418
2529
|
useAsyncEvaluatedOptions
|
|
2419
2530
|
]);
|
|
2420
|
-
const evaluatedOptionsToUse =
|
|
2531
|
+
const evaluatedOptionsToUse = useAsyncEvaluatedOptions ? evaluatedOptionsAsync : evaluatedOptions;
|
|
2421
2532
|
let dataSourceMetadata = {};
|
|
2422
2533
|
const OptionKey = "paginateDataSourceKey";
|
|
2423
2534
|
const optsKey = (0, lodash_exports.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey];
|
|
@@ -2439,7 +2550,7 @@ var withDashboardViz = (opts) => {
|
|
|
2439
2550
|
sortParams,
|
|
2440
2551
|
paginatorParams
|
|
2441
2552
|
};
|
|
2442
|
-
if (vizConfig.supports.
|
|
2553
|
+
if (!vizConfig.supports.includes("page-and-sort" /* PAGE_AND_SORT */) && !(0, lodash_exports.has)(dataSources, paginateDataSourceKey)) {
|
|
2443
2554
|
dataSourceMetadata = {};
|
|
2444
2555
|
}
|
|
2445
2556
|
const clonedEvaluatedOptions = __spreadValues({}, evaluatedOptionsToUse);
|
|
@@ -2449,14 +2560,6 @@ var withDashboardViz = (opts) => {
|
|
|
2449
2560
|
react_exports.useEffect(() => {
|
|
2450
2561
|
onComputedProps(clonedEvaluatedOptions);
|
|
2451
2562
|
});
|
|
2452
|
-
react_exports.useEffect(() => {
|
|
2453
|
-
return () => {
|
|
2454
|
-
if (useAsyncEvaluatedOptions) {
|
|
2455
|
-
isMounted.current = false;
|
|
2456
|
-
async_dynamic_options_evaluator_default.reset(visualizationID);
|
|
2457
|
-
}
|
|
2458
|
-
};
|
|
2459
|
-
}, []);
|
|
2460
2563
|
const { requiredProps = [], supports } = vizConfig;
|
|
2461
2564
|
const missing = missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
2462
2565
|
if (missing.length > 0 && supports.includes("placeholder" /* PLACEHOLDER */) && vizConfig.key !== "splunk.singlevalue") {
|
|
@@ -2471,7 +2574,16 @@ var withDashboardViz = (opts) => {
|
|
|
2471
2574
|
}
|
|
2472
2575
|
);
|
|
2473
2576
|
}
|
|
2474
|
-
const eventCallbackProps =
|
|
2577
|
+
const eventCallbackProps = buildAllEventCallbackProps(
|
|
2578
|
+
vizConfig.events,
|
|
2579
|
+
evaluatedOptionsToUse,
|
|
2580
|
+
onEventTrigger,
|
|
2581
|
+
{
|
|
2582
|
+
supportsEvents: vizConfig.supports.includes("events" /* EVENTS */),
|
|
2583
|
+
hasEventHandlers,
|
|
2584
|
+
mode
|
|
2585
|
+
}
|
|
2586
|
+
);
|
|
2475
2587
|
const computedVizProps = computeVizProps(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
|
|
2476
2588
|
// Align option transformation with the actual renderer selected below.
|
|
2477
2589
|
// This prevents canvas-only option preservation from leaking into Highcharts mode.
|
|
@@ -2499,21 +2611,13 @@ var withDashboardViz = (opts) => {
|
|
|
2499
2611
|
onEventTrigger: SplunkVisualization_default.defaults.onEventTrigger
|
|
2500
2612
|
});
|
|
2501
2613
|
DashboardViz.config = vizConfig;
|
|
2502
|
-
return
|
|
2503
|
-
withPlaceholder_default(withEditModeCover_default(DashboardViz, disableEditModeCover), useIconPlaceholder2)
|
|
2614
|
+
return Object.assign(
|
|
2615
|
+
(0, styled_components_exports.withTheme)(withPlaceholder_default(withEditModeCover_default(DashboardViz, disableEditModeCover), useIconPlaceholder2)),
|
|
2616
|
+
{ config: vizConfig }
|
|
2504
2617
|
);
|
|
2505
2618
|
};
|
|
2506
2619
|
var withDashboardViz_default = withDashboardViz;
|
|
2507
2620
|
|
|
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
2621
|
// esm-externals:@splunk/react-ui/Button
|
|
2518
2622
|
var Button_exports = {};
|
|
2519
2623
|
__export(Button_exports, {
|
|
@@ -2561,6 +2665,7 @@ var jexl_default = "default" in defaultImport37 ? defaultImport37.default : defa
|
|
|
2561
2665
|
|
|
2562
2666
|
// src/ChoroplethSvg/PureChoroplethSvg/SvgMutator.ts
|
|
2563
2667
|
var ERROR_NON_ATTRIBUTE_MUTATION = "mutations only allowed on attribute nodes";
|
|
2668
|
+
var _a;
|
|
2564
2669
|
var _SvgMutator = class _SvgMutator {
|
|
2565
2670
|
/**
|
|
2566
2671
|
* parses the svg and stores the parsed Document in a local field. Keeps a copy of the props.
|
|
@@ -2636,8 +2741,8 @@ var _SvgMutator = class _SvgMutator {
|
|
|
2636
2741
|
const svgNode = _SvgMutator.getSvgElementFromDoc(node);
|
|
2637
2742
|
svgNode.setAttribute("width", currentProps.width || "100%");
|
|
2638
2743
|
svgNode.setAttribute("height", currentProps.height || "100%");
|
|
2639
|
-
const NONCE =
|
|
2640
|
-
const PARENT_ID =
|
|
2744
|
+
const NONCE = globalThis.crypto.getRandomValues(new Uint32Array(4)).join("");
|
|
2745
|
+
const PARENT_ID = globalThis.crypto.getRandomValues(new Uint32Array(4)).join("");
|
|
2641
2746
|
const html = _SvgMutator.getIframeHtml(NONCE, PARENT_ID, svgNode);
|
|
2642
2747
|
const blob = new Blob([html], { type: "text/html" });
|
|
2643
2748
|
const blobURL = URL.createObjectURL(blob);
|
|
@@ -2733,12 +2838,12 @@ var _SvgMutator = class _SvgMutator {
|
|
|
2733
2838
|
return xpath_exports.evaluate(xpath, doc, resolver, XPathResult.ANY_TYPE, null);
|
|
2734
2839
|
}
|
|
2735
2840
|
static getTitle(data, i) {
|
|
2736
|
-
var
|
|
2841
|
+
var _a2, _b;
|
|
2737
2842
|
let title = "";
|
|
2738
|
-
if ((
|
|
2843
|
+
if ((_a2 = data.featureIDs) == null ? void 0 : _a2[i]) {
|
|
2739
2844
|
title += `name: ${data.featureIDs[i]}`;
|
|
2740
2845
|
}
|
|
2741
|
-
if (data.values
|
|
2846
|
+
if (((_b = data.values) == null ? void 0 : _b[i]) !== void 0) {
|
|
2742
2847
|
title += `
|
|
2743
2848
|
value: ${data.values[i]}`;
|
|
2744
2849
|
}
|
|
@@ -2757,7 +2862,7 @@ value: ${data.values[i]}`;
|
|
|
2757
2862
|
* @returns {any}
|
|
2758
2863
|
*/
|
|
2759
2864
|
static mutateNode(n, dataBinding, data, i) {
|
|
2760
|
-
var
|
|
2865
|
+
var _a2, _b;
|
|
2761
2866
|
if (n.nodeType && n.nodeType != Node.ATTRIBUTE_NODE) {
|
|
2762
2867
|
throw new Error(ERROR_NON_ATTRIBUTE_MUTATION);
|
|
2763
2868
|
}
|
|
@@ -2771,10 +2876,10 @@ value: ${data.values[i]}`;
|
|
|
2771
2876
|
n.nodeValue = computed;
|
|
2772
2877
|
n.value = computed;
|
|
2773
2878
|
const parent = n.ownerElement;
|
|
2774
|
-
if (((
|
|
2775
|
-
parent.setAttribute("data-name", data.featureIDs[i]);
|
|
2776
|
-
} else {
|
|
2879
|
+
if (((_a2 = data.featureIDs) == null ? void 0 : _a2[i]) === void 0) {
|
|
2777
2880
|
parent.removeAttribute("data-name");
|
|
2881
|
+
} else {
|
|
2882
|
+
parent.setAttribute("data-name", data.featureIDs[i]);
|
|
2778
2883
|
}
|
|
2779
2884
|
const interactiveValue = (_b = data.values) == null ? void 0 : _b[i];
|
|
2780
2885
|
const hasInteractiveValue = interactiveValue !== void 0 && interactiveValue !== null && interactiveValue !== "";
|
|
@@ -2852,18 +2957,7 @@ value: ${data.values[i]}`;
|
|
|
2852
2957
|
return `default-src 'self'; child-src 'none'; style-src 'self' 'unsafe-inline'; img-src data: ; script-src 'nonce-${nonce}'`;
|
|
2853
2958
|
}
|
|
2854
2959
|
static getIframeHtml(nonce, parentId, svgNode) {
|
|
2855
|
-
return
|
|
2856
|
-
<meta http-equiv="Content-Security-Policy" content="${this.getCsp(`${nonce}`)}"/>
|
|
2857
|
-
<style>
|
|
2858
|
-
${_SvgMutator.getCssResetStyle()}
|
|
2859
|
-
</style>
|
|
2860
|
-
|
|
2861
|
-
</head>
|
|
2862
|
-
<body>
|
|
2863
|
-
<div id="svgChoroplethSvgDiv" style="position:absolute;height:100%;width:100%;overflow:hidden">
|
|
2864
|
-
${_SvgMutator.serializer.serializeToString(svgNode)}
|
|
2865
|
-
</div>
|
|
2866
|
-
<script nonce="${nonce}">
|
|
2960
|
+
return String.raw(_a || (_a = __template(['<html><head>\n <meta http-equiv="Content-Security-Policy" content="', '"/>\n <style>\n ', '\n </style>\n\n </head>\n <body>\n <div id="svgChoroplethSvgDiv" style="position:absolute;height:100%;width:100%;overflow:hidden">\n ', '\n </div>\n <script nonce="', `">
|
|
2867
2961
|
|
|
2868
2962
|
let parentOrigin = null;
|
|
2869
2963
|
let parentWindow = null;
|
|
@@ -2880,14 +2974,346 @@ value: ${data.values[i]}`;
|
|
|
2880
2974
|
if(!parentWindow){
|
|
2881
2975
|
return; // don't send any messages until we know where to send them
|
|
2882
2976
|
}
|
|
2883
|
-
m.nonce = '
|
|
2884
|
-
|
|
2977
|
+
m.nonce = '`, "'; // set nonce into message.\n parentWindow.postMessage(m,parentOrigin, transfer || []);\n }\n\n\n const parentSetupMessageListener = m =>{\n const {parentIdentity} = m.data;\n if(parentIdentity !== '", `'){
|
|
2978
|
+
return;
|
|
2979
|
+
}
|
|
2980
|
+
//set parent origin
|
|
2981
|
+
parentOrigin = m.origin;
|
|
2982
|
+
if(parentOrigin === 'null'){ // yes, this is supposed to be a string 'null'
|
|
2983
|
+
parentOrigin = '*';
|
|
2984
|
+
}
|
|
2985
|
+
if(!m.source){
|
|
2986
|
+
return;
|
|
2987
|
+
}
|
|
2988
|
+
parentWindow = m.source;
|
|
2989
|
+
sendMessage({}); //acknowledge
|
|
2990
|
+
// we can now remove ourself since initial setup complete
|
|
2991
|
+
window.removeEventListener('message', parentSetupMessageListener);
|
|
2992
|
+
};
|
|
2993
|
+
|
|
2994
|
+
function registerListeners(){
|
|
2995
|
+
|
|
2996
|
+
//listen for a first message to establish the parent origin
|
|
2997
|
+
window.addEventListener('message', parentSetupMessageListener);
|
|
2998
|
+
const svgElement = document.getElementsByTagName('svg')[0];
|
|
2999
|
+
if(!svgElement){
|
|
3000
|
+
return;
|
|
3001
|
+
}
|
|
3002
|
+
svgElement.addEventListener('click', event => {
|
|
3003
|
+
const target = getInteractiveTarget(event.target);
|
|
3004
|
+
if(!target){
|
|
3005
|
+
return;
|
|
3006
|
+
}
|
|
3007
|
+
sendPointerMessage({
|
|
3008
|
+
eventType: 'click',
|
|
3009
|
+
target,
|
|
3010
|
+
clientX: event.clientX,
|
|
3011
|
+
clientY: event.clientY,
|
|
3012
|
+
});
|
|
3013
|
+
});
|
|
3014
|
+
svgElement.addEventListener('mouseover', event => {
|
|
3015
|
+
const target = getInteractiveTarget(event.target);
|
|
3016
|
+
if(!target){
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
sendPointerMessage({
|
|
3020
|
+
eventType: 'mouseover',
|
|
3021
|
+
target,
|
|
3022
|
+
clientX: event.clientX,
|
|
3023
|
+
clientY: event.clientY,
|
|
3024
|
+
});
|
|
3025
|
+
});
|
|
3026
|
+
svgElement.addEventListener('mousemove', event => {
|
|
3027
|
+
const target = getInteractiveTarget(event.target);
|
|
3028
|
+
if(!target){
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
sendPointerMessage({
|
|
3032
|
+
eventType: 'mousemove',
|
|
3033
|
+
target,
|
|
3034
|
+
clientX: event.clientX,
|
|
3035
|
+
clientY: event.clientY,
|
|
3036
|
+
});
|
|
3037
|
+
});
|
|
3038
|
+
svgElement.addEventListener('mouseout', event => {
|
|
3039
|
+
const target = getInteractiveTarget(event.target);
|
|
3040
|
+
if(!target){
|
|
3041
|
+
return;
|
|
3042
|
+
}
|
|
3043
|
+
const relatedTarget = getInteractiveTarget(event.relatedTarget);
|
|
3044
|
+
if(relatedTarget === target){
|
|
3045
|
+
return;
|
|
3046
|
+
}
|
|
3047
|
+
sendPointerMessage({
|
|
3048
|
+
eventType: 'mouseout',
|
|
3049
|
+
target,
|
|
3050
|
+
clientX: event.clientX,
|
|
3051
|
+
clientY: event.clientY,
|
|
3052
|
+
});
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
function getInteractiveTarget(element){
|
|
3057
|
+
if(!element || !element.closest){
|
|
3058
|
+
return null;
|
|
3059
|
+
}
|
|
3060
|
+
let target = element.closest(FOCUSABLE_SELECTOR);
|
|
3061
|
+
while(target && !isFocusableElement(target)){
|
|
3062
|
+
target = target.parentElement ? target.parentElement.closest(FOCUSABLE_SELECTOR) : null;
|
|
3063
|
+
}
|
|
3064
|
+
return target;
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
function isFocusableElement(el){
|
|
3068
|
+
if(!el || !el.closest){
|
|
3069
|
+
return false;
|
|
3070
|
+
}
|
|
3071
|
+
const dataInteractive = el.getAttribute('data-interactive');
|
|
3072
|
+
if(dataInteractive === 'false'){
|
|
3073
|
+
return false;
|
|
3074
|
+
}
|
|
3075
|
+
if(dataInteractive !== 'true'){
|
|
3076
|
+
// Legacy fallback: treat non-empty data-value as interactive
|
|
3077
|
+
// unless explicitly marked data-interactive="false".
|
|
3078
|
+
const value = el.getAttribute('data-value');
|
|
3079
|
+
if(value === null || value === ''){
|
|
3080
|
+
return false;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
const id = el.getAttribute && el.getAttribute('id');
|
|
3084
|
+
if(id && id.startsWith('Icon/')){
|
|
3085
|
+
return false;
|
|
3086
|
+
}
|
|
3087
|
+
if(el.closest('defs, clipPath, mask, pattern, symbol, metadata, title, desc, style, script')){
|
|
3088
|
+
return false;
|
|
3089
|
+
}
|
|
3090
|
+
const style = window.getComputedStyle(el);
|
|
3091
|
+
if(style.display === 'none' || style.visibility === 'hidden' || style.pointerEvents === 'none'){
|
|
3092
|
+
return false;
|
|
3093
|
+
}
|
|
3094
|
+
return true;
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
function getFocusableElements(){
|
|
3098
|
+
const svgElement = document.getElementsByTagName('svg')[0];
|
|
3099
|
+
if(!svgElement){
|
|
3100
|
+
return [];
|
|
3101
|
+
}
|
|
3102
|
+
const elements = Array.from(svgElement.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
3103
|
+
return elements.filter(isFocusableElement);
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
function sendFocusMessage(target, eventType){
|
|
3107
|
+
if(!target || !target.getBoundingClientRect){
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
const rect = target.getBoundingClientRect();
|
|
3111
|
+
sendPointerMessage({
|
|
3112
|
+
eventType,
|
|
3113
|
+
target,
|
|
3114
|
+
clientX: rect.left + rect.width / 2,
|
|
3115
|
+
clientY: rect.top + rect.height / 2,
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
function sendKeyboardHoverMessage(target, eventType){
|
|
3120
|
+
if(!target || !target.getBoundingClientRect){
|
|
3121
|
+
return;
|
|
3122
|
+
}
|
|
3123
|
+
const rect = target.getBoundingClientRect();
|
|
3124
|
+
const value = target.getAttribute('data-value');
|
|
3125
|
+
const name = target.getAttribute('data-name');
|
|
3126
|
+
sendMessage({
|
|
3127
|
+
type: 'kbAreaHover',
|
|
3128
|
+
interactionSource: 'keyboard',
|
|
3129
|
+
eventType,
|
|
3130
|
+
clientX: rect.left + rect.width / 2,
|
|
3131
|
+
clientY: rect.top + rect.height / 2,
|
|
3132
|
+
anchorX: rect.right,
|
|
3133
|
+
anchorY: rect.top + rect.height / 2,
|
|
3134
|
+
value,
|
|
3135
|
+
name,
|
|
3136
|
+
tooltipText: getTooltipText(target),
|
|
3137
|
+
});
|
|
2885
3138
|
}
|
|
2886
3139
|
|
|
3140
|
+
function getTooltipText(target){
|
|
3141
|
+
if(!target){
|
|
3142
|
+
return '';
|
|
3143
|
+
}
|
|
3144
|
+
const name = target.getAttribute('data-name');
|
|
3145
|
+
const value = target.getAttribute('data-value');
|
|
3146
|
+
let text = '';
|
|
3147
|
+
if(name){
|
|
3148
|
+
text += 'name: ' + name;
|
|
3149
|
+
}
|
|
3150
|
+
if(value !== null && value !== undefined){
|
|
3151
|
+
text += (text ? '
|
|
3152
|
+
' : '') + 'value: ' + value;
|
|
3153
|
+
}
|
|
3154
|
+
return text;
|
|
3155
|
+
}
|
|
2887
3156
|
|
|
2888
|
-
|
|
2889
|
-
const
|
|
2890
|
-
|
|
3157
|
+
function sendPointerMessage({ eventType, target, clientX, clientY }){
|
|
3158
|
+
const value = target ? target.getAttribute('data-value') : null;
|
|
3159
|
+
const name = target ? target.getAttribute('data-name') : null;
|
|
3160
|
+
const rect =
|
|
3161
|
+
target && target.getBoundingClientRect
|
|
3162
|
+
? target.getBoundingClientRect()
|
|
3163
|
+
: null;
|
|
3164
|
+
sendMessage({
|
|
3165
|
+
interactionSource: 'mouse',
|
|
3166
|
+
eventType,
|
|
3167
|
+
clientX,
|
|
3168
|
+
clientY,
|
|
3169
|
+
anchorX: rect ? rect.right : clientX,
|
|
3170
|
+
anchorY: rect ? rect.top + rect.height / 2 : clientY,
|
|
3171
|
+
value,
|
|
3172
|
+
name,
|
|
3173
|
+
tooltipText: getTooltipText(target),
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
function clearFocusedElement(){
|
|
3178
|
+
if(focusedElement){
|
|
3179
|
+
sendKeyboardHoverMessage(focusedElement, 'mouseout');
|
|
3180
|
+
focusedElement.removeAttribute('data-kb-focus');
|
|
3181
|
+
sendFocusMessage(focusedElement, 'mouseout');
|
|
3182
|
+
focusedElement = null;
|
|
3183
|
+
focusedIndex = -1;
|
|
3184
|
+
}
|
|
3185
|
+
sendMessage({
|
|
3186
|
+
type: 'kbTooltipAnnouncement',
|
|
3187
|
+
tooltipText: '',
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
function focusElementAt(index){
|
|
3192
|
+
const elements = getFocusableElements();
|
|
3193
|
+
if(!elements.length){
|
|
3194
|
+
clearFocusedElement();
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
if(index < 0){
|
|
3198
|
+
index = 0;
|
|
3199
|
+
}
|
|
3200
|
+
if(index >= elements.length){
|
|
3201
|
+
index = elements.length - 1;
|
|
3202
|
+
}
|
|
3203
|
+
if(focusedElement){
|
|
3204
|
+
focusedElement.removeAttribute('data-kb-focus');
|
|
3205
|
+
sendFocusMessage(focusedElement, 'mouseout');
|
|
3206
|
+
}
|
|
3207
|
+
focusedIndex = index;
|
|
3208
|
+
focusedElement = elements[focusedIndex];
|
|
3209
|
+
focusedElement.setAttribute('data-kb-focus', 'true');
|
|
3210
|
+
sendKeyboardHoverMessage(focusedElement, 'mousemove');
|
|
3211
|
+
sendFocusMessage(focusedElement, 'mouseover');
|
|
3212
|
+
sendFocusMessage(focusedElement, 'mousemove');
|
|
3213
|
+
sendMessage({
|
|
3214
|
+
type: 'kbTooltipAnnouncement',
|
|
3215
|
+
tooltipText: getTooltipText(focusedElement),
|
|
3216
|
+
});
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
function moveFocus(direction){
|
|
3220
|
+
const elements = getFocusableElements();
|
|
3221
|
+
if(!elements.length){
|
|
3222
|
+
clearFocusedElement();
|
|
3223
|
+
return;
|
|
3224
|
+
}
|
|
3225
|
+
if(focusedIndex === -1){
|
|
3226
|
+
// After iframe remount, keyboard state is reset. Start deterministically from first.
|
|
3227
|
+
focusElementAt(0);
|
|
3228
|
+
return;
|
|
3229
|
+
}
|
|
3230
|
+
const nextIndex =
|
|
3231
|
+
direction === 'prev'
|
|
3232
|
+
? (focusedIndex - 1 + elements.length) % elements.length
|
|
3233
|
+
: (focusedIndex + 1) % elements.length;
|
|
3234
|
+
focusElementAt(nextIndex);
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
function handleKeyboardNavigation(event){
|
|
3238
|
+
if(!keyboardNavigationMode){
|
|
3239
|
+
return;
|
|
3240
|
+
}
|
|
3241
|
+
if(event.key === 'Tab' && event.shiftKey){
|
|
3242
|
+
keyboardNavigationMode = false;
|
|
3243
|
+
clearFocusedElement();
|
|
3244
|
+
sendMessage({ type: 'kbExitBackward' });
|
|
3245
|
+
event.preventDefault();
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3248
|
+
if(event.key === 'ArrowLeft' || event.key === 'ArrowRight'){
|
|
3249
|
+
moveFocus(event.key === 'ArrowLeft' ? 'prev' : 'next');
|
|
3250
|
+
event.preventDefault();
|
|
3251
|
+
return;
|
|
3252
|
+
}
|
|
3253
|
+
if(event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar'){
|
|
3254
|
+
if(!focusedElement){
|
|
3255
|
+
focusElementAt(0);
|
|
3256
|
+
}
|
|
3257
|
+
if(focusedElement){
|
|
3258
|
+
sendFocusMessage(focusedElement, 'click');
|
|
3259
|
+
}
|
|
3260
|
+
event.preventDefault();
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
registerListeners();
|
|
3264
|
+
|
|
3265
|
+
window.addEventListener('keydown', () => {
|
|
3266
|
+
lastInputModality = 'keyboard';
|
|
3267
|
+
}, true);
|
|
3268
|
+
|
|
3269
|
+
window.addEventListener('pointerdown', () => {
|
|
3270
|
+
lastInputModality = 'pointer';
|
|
3271
|
+
}, true);
|
|
3272
|
+
|
|
3273
|
+
window.addEventListener('mousedown', () => {
|
|
3274
|
+
lastInputModality = 'pointer';
|
|
3275
|
+
}, true);
|
|
3276
|
+
|
|
3277
|
+
window.addEventListener('focus', () => {
|
|
3278
|
+
if(lastInputModality !== 'pointer'){
|
|
3279
|
+
keyboardNavigationMode = true;
|
|
3280
|
+
}
|
|
3281
|
+
if(!keyboardNavigationMode){
|
|
3282
|
+
return;
|
|
3283
|
+
}
|
|
3284
|
+
if(!focusedElement){
|
|
3285
|
+
focusElementAt(0);
|
|
3286
|
+
}
|
|
3287
|
+
});
|
|
3288
|
+
|
|
3289
|
+
window.addEventListener('blur', () => {
|
|
3290
|
+
keyboardNavigationMode = false;
|
|
3291
|
+
lastInputModality = 'unknown';
|
|
3292
|
+
clearFocusedElement();
|
|
3293
|
+
});
|
|
3294
|
+
|
|
3295
|
+
window.addEventListener('keydown', event => {
|
|
3296
|
+
handleKeyboardNavigation(event);
|
|
3297
|
+
});
|
|
3298
|
+
<\/script>
|
|
3299
|
+
</body></html>`], ['<html><head>\n <meta http-equiv="Content-Security-Policy" content="', '"/>\n <style>\n ', '\n </style>\n\n </head>\n <body>\n <div id="svgChoroplethSvgDiv" style="position:absolute;height:100%;width:100%;overflow:hidden">\n ', '\n </div>\n <script nonce="', `">
|
|
3300
|
+
|
|
3301
|
+
let parentOrigin = null;
|
|
3302
|
+
let parentWindow = null;
|
|
3303
|
+
let keyboardNavigationMode = false;
|
|
3304
|
+
let lastInputModality = 'unknown';
|
|
3305
|
+
let focusedElement = null;
|
|
3306
|
+
let focusedIndex = -1;
|
|
3307
|
+
// Fallback to [data-value] for legacy/dashboard flows where SVG nodes are
|
|
3308
|
+
// data-annotated but do not yet have explicit data-interactive attributes.
|
|
3309
|
+
const FOCUSABLE_SELECTOR = '[data-interactive="true"], [data-value]';
|
|
3310
|
+
|
|
3311
|
+
function sendMessage(m, transfer){
|
|
3312
|
+
|
|
3313
|
+
if(!parentWindow){
|
|
3314
|
+
return; // don't send any messages until we know where to send them
|
|
3315
|
+
}
|
|
3316
|
+
m.nonce = '`, "'; // set nonce into message.\n parentWindow.postMessage(m,parentOrigin, transfer || []);\n }\n\n\n const parentSetupMessageListener = m =>{\n const {parentIdentity} = m.data;\n if(parentIdentity !== '", `'){
|
|
2891
3317
|
return;
|
|
2892
3318
|
}
|
|
2893
3319
|
//set parent origin
|
|
@@ -3208,7 +3634,7 @@ value: ${data.values[i]}`;
|
|
|
3208
3634
|
handleKeyboardNavigation(event);
|
|
3209
3635
|
});
|
|
3210
3636
|
<\/script>
|
|
3211
|
-
</body></html
|
|
3637
|
+
</body></html>`])), this.getCsp(`${nonce}`), _SvgMutator.getCssResetStyle(), _SvgMutator.serializer.serializeToString(svgNode), nonce, nonce, parentId);
|
|
3212
3638
|
}
|
|
3213
3639
|
static isInvalidIframeMessage(nonce, expectedNonce, origin, jsdom) {
|
|
3214
3640
|
return nonce !== expectedNonce || !jsdom && origin !== "null";
|
|
@@ -3395,9 +3821,9 @@ var SvgChoroplethDynamic = class extends react_exports.Component {
|
|
|
3395
3821
|
}
|
|
3396
3822
|
});
|
|
3397
3823
|
__publicField(this, "handleAreaKeydown", (ev) => {
|
|
3398
|
-
var
|
|
3824
|
+
var _a2, _b;
|
|
3399
3825
|
const customEvent = ev;
|
|
3400
|
-
const key = (_b = (
|
|
3826
|
+
const key = (_b = (_a2 = customEvent.detail) == null ? void 0 : _a2.key) != null ? _b : customEvent.key;
|
|
3401
3827
|
const isActivationKey = key === "Enter" || key === " " || key === "Spacebar";
|
|
3402
3828
|
if (typeof this.props.onAreaKeydown === "function") {
|
|
3403
3829
|
this.props.onAreaKeydown(__spreadProps(__spreadValues({}, customEvent), { payload: customEvent.detail }));
|
|
@@ -3558,8 +3984,8 @@ var KeyboardNavButton = styled_components_default(Button_default)`
|
|
|
3558
3984
|
var ChoroplethTooltipContent = styled_components_default.span`
|
|
3559
3985
|
white-space: pre-line;
|
|
3560
3986
|
`;
|
|
3561
|
-
var computeSvgDynamicProps = (
|
|
3562
|
-
var props = __objRest(
|
|
3987
|
+
var computeSvgDynamicProps = (_a2) => {
|
|
3988
|
+
var props = __objRest(_a2, []);
|
|
3563
3989
|
const data = {
|
|
3564
3990
|
featureIDs: props.areaIds || [],
|
|
3565
3991
|
values: props.areaValues || [],
|
|
@@ -3577,8 +4003,8 @@ var computeSvgDynamicProps = (_a) => {
|
|
|
3577
4003
|
});
|
|
3578
4004
|
};
|
|
3579
4005
|
var keyboardNavBtnText = (0, i18n_exports._)("Navigate map with left or right arrow");
|
|
3580
|
-
var PureChoroplethSvg = (
|
|
3581
|
-
var props = __objRest(
|
|
4006
|
+
var PureChoroplethSvg = (_a2) => {
|
|
4007
|
+
var props = __objRest(_a2, []);
|
|
3582
4008
|
const { width = "100%", height = 250, backgroundColor } = props;
|
|
3583
4009
|
const [keyboardNavigationEnabled, setKeyboardNavigationEnabled] = react_exports.useState(false);
|
|
3584
4010
|
const [liveRegionMessage, setLiveRegionMessage] = react_exports.useState("");
|
|
@@ -3599,16 +4025,16 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3599
4025
|
y: 0
|
|
3600
4026
|
});
|
|
3601
4027
|
const focusIframe = react_exports.useCallback(() => {
|
|
3602
|
-
var
|
|
3603
|
-
const iframe = (
|
|
4028
|
+
var _a3;
|
|
4029
|
+
const iframe = (_a3 = wrapperRef.current) == null ? void 0 : _a3.querySelector("#svgChoroplethIframe");
|
|
3604
4030
|
if (!iframe) {
|
|
3605
4031
|
return;
|
|
3606
4032
|
}
|
|
3607
4033
|
iframe.focus();
|
|
3608
4034
|
}, []);
|
|
3609
4035
|
const blurIframe = react_exports.useCallback(() => {
|
|
3610
|
-
var
|
|
3611
|
-
const iframe = (
|
|
4036
|
+
var _a3;
|
|
4037
|
+
const iframe = (_a3 = wrapperRef.current) == null ? void 0 : _a3.querySelector("#svgChoroplethIframe");
|
|
3612
4038
|
if (!iframe) {
|
|
3613
4039
|
return;
|
|
3614
4040
|
}
|
|
@@ -3619,15 +4045,15 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3619
4045
|
setWrapperElement(node);
|
|
3620
4046
|
}, []);
|
|
3621
4047
|
react_exports.useEffect(() => {
|
|
3622
|
-
var
|
|
4048
|
+
var _a3, _b;
|
|
3623
4049
|
if (keyboardNavigationEnabled) {
|
|
3624
|
-
(
|
|
4050
|
+
(_a3 = wrapperRef.current) == null ? void 0 : _a3.blur();
|
|
3625
4051
|
focusIframe();
|
|
3626
4052
|
} else {
|
|
3627
4053
|
(_b = wrapperRef.current) == null ? void 0 : _b.blur();
|
|
3628
4054
|
blurIframe();
|
|
3629
4055
|
if (hoverTooltipTimerRef.current) {
|
|
3630
|
-
|
|
4056
|
+
globalThis.clearTimeout(hoverTooltipTimerRef.current);
|
|
3631
4057
|
hoverTooltipTimerRef.current = null;
|
|
3632
4058
|
}
|
|
3633
4059
|
setAreaTooltip((prev) => __spreadProps(__spreadValues({}, prev), { open: false, text: "" }));
|
|
@@ -3659,13 +4085,13 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3659
4085
|
const handleWindowResize = () => {
|
|
3660
4086
|
setKeyboardNavigationEnabled(false);
|
|
3661
4087
|
};
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
4088
|
+
globalThis.addEventListener("mousedown", handleMouseDownOutside, true);
|
|
4089
|
+
globalThis.addEventListener("mousemove", handleMouseDragOutside, true);
|
|
4090
|
+
globalThis.addEventListener("resize", handleWindowResize);
|
|
3665
4091
|
return () => {
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
4092
|
+
globalThis.removeEventListener("mousedown", handleMouseDownOutside, true);
|
|
4093
|
+
globalThis.removeEventListener("mousemove", handleMouseDragOutside, true);
|
|
4094
|
+
globalThis.removeEventListener("resize", handleWindowResize);
|
|
3669
4095
|
};
|
|
3670
4096
|
}, [keyboardNavigationEnabled]);
|
|
3671
4097
|
react_exports.useEffect(() => {
|
|
@@ -3674,14 +4100,14 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3674
4100
|
};
|
|
3675
4101
|
}
|
|
3676
4102
|
const handleTooltipAnnouncement = (event) => {
|
|
3677
|
-
var
|
|
4103
|
+
var _a3;
|
|
3678
4104
|
const customEvent = event;
|
|
3679
|
-
setLiveRegionMessage(((
|
|
4105
|
+
setLiveRegionMessage(((_a3 = customEvent.detail) == null ? void 0 : _a3.text) || "");
|
|
3680
4106
|
};
|
|
3681
4107
|
const handleKeyboardExitBackward = () => {
|
|
3682
|
-
var
|
|
4108
|
+
var _a3;
|
|
3683
4109
|
setKeyboardNavigationEnabled(false);
|
|
3684
|
-
(
|
|
4110
|
+
(_a3 = keyboardNavButtonRef.current) == null ? void 0 : _a3.focus();
|
|
3685
4111
|
};
|
|
3686
4112
|
wrapperElement.addEventListener("kbTooltipAnnouncement", handleTooltipAnnouncement);
|
|
3687
4113
|
wrapperElement.addEventListener("kbExitBackward", handleKeyboardExitBackward);
|
|
@@ -3693,7 +4119,7 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3693
4119
|
react_exports.useEffect(() => {
|
|
3694
4120
|
return () => {
|
|
3695
4121
|
if (hoverTooltipTimerRef.current) {
|
|
3696
|
-
|
|
4122
|
+
globalThis.clearTimeout(hoverTooltipTimerRef.current);
|
|
3697
4123
|
hoverTooltipTimerRef.current = null;
|
|
3698
4124
|
}
|
|
3699
4125
|
};
|
|
@@ -3725,7 +4151,7 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3725
4151
|
};
|
|
3726
4152
|
if (eventType === "mouseout") {
|
|
3727
4153
|
if (hoverTooltipTimerRef.current) {
|
|
3728
|
-
|
|
4154
|
+
globalThis.clearTimeout(hoverTooltipTimerRef.current);
|
|
3729
4155
|
hoverTooltipTimerRef.current = null;
|
|
3730
4156
|
}
|
|
3731
4157
|
setAreaTooltip((prev) => __spreadProps(__spreadValues({}, prev), { open: false, text: "" }));
|
|
@@ -3733,15 +4159,15 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3733
4159
|
}
|
|
3734
4160
|
if (interactionSource === "mouse" && (eventType === "mouseover" || eventType === "mousemove")) {
|
|
3735
4161
|
if (hoverTooltipTimerRef.current) {
|
|
3736
|
-
|
|
4162
|
+
globalThis.clearTimeout(hoverTooltipTimerRef.current);
|
|
3737
4163
|
}
|
|
3738
|
-
hoverTooltipTimerRef.current = window.setTimeout(() => {
|
|
4164
|
+
hoverTooltipTimerRef.current = globalThis.window.setTimeout(() => {
|
|
3739
4165
|
applyTooltipPosition();
|
|
3740
4166
|
}, 120);
|
|
3741
4167
|
return;
|
|
3742
4168
|
}
|
|
3743
4169
|
if (hoverTooltipTimerRef.current) {
|
|
3744
|
-
|
|
4170
|
+
globalThis.clearTimeout(hoverTooltipTimerRef.current);
|
|
3745
4171
|
hoverTooltipTimerRef.current = null;
|
|
3746
4172
|
}
|
|
3747
4173
|
applyTooltipPosition();
|
|
@@ -3764,21 +4190,21 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3764
4190
|
style: keyboardNavigationEnabled ? { outline: "none" } : void 0,
|
|
3765
4191
|
"aria-label": "Choropleth SVG container",
|
|
3766
4192
|
onBlurCapture: (event) => {
|
|
3767
|
-
var
|
|
3768
|
-
const nextTarget = (
|
|
4193
|
+
var _a3;
|
|
4194
|
+
const nextTarget = (_a3 = event.relatedTarget) != null ? _a3 : document.activeElement;
|
|
3769
4195
|
if (!nextTarget || !event.currentTarget.contains(nextTarget)) {
|
|
3770
4196
|
setKeyboardNavigationEnabled(false);
|
|
3771
4197
|
}
|
|
3772
4198
|
}
|
|
3773
4199
|
},
|
|
3774
|
-
props.mode
|
|
4200
|
+
props.mode === "edit" ? null : /* @__PURE__ */ react_exports.createElement(
|
|
3775
4201
|
KeyboardNavButton,
|
|
3776
4202
|
{
|
|
3777
4203
|
onClick: () => setKeyboardNavigationEnabled(true),
|
|
3778
4204
|
elementRef: keyboardNavButtonRef
|
|
3779
4205
|
},
|
|
3780
4206
|
keyboardNavBtnText
|
|
3781
|
-
)
|
|
4207
|
+
),
|
|
3782
4208
|
/* @__PURE__ */ react_exports.createElement(LiveRegion, { "aria-live": "polite", "aria-atomic": "true" }, liveRegionMessage),
|
|
3783
4209
|
/* @__PURE__ */ react_exports.createElement(SvgChoroplethDynamic_default, __spreadProps(__spreadValues({}, svgProps), { onAreaHover: handleAreaHover })),
|
|
3784
4210
|
/* @__PURE__ */ react_exports.createElement(
|
|
@@ -3789,10 +4215,12 @@ var PureChoroplethSvg = (_a) => {
|
|
|
3789
4215
|
inline: false,
|
|
3790
4216
|
defaultPlacement: "right",
|
|
3791
4217
|
renderAnchor: (anchorProps) => {
|
|
3792
|
-
const
|
|
4218
|
+
const _a3 = anchorProps, { describedBy, labelledBy, elementRef } = _a3, restAnchorProps = __objRest(_a3, ["describedBy", "labelledBy", "elementRef"]);
|
|
3793
4219
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3794
4220
|
"span",
|
|
3795
4221
|
__spreadProps(__spreadValues({}, restAnchorProps), {
|
|
4222
|
+
"aria-describedby": describedBy,
|
|
4223
|
+
"aria-labelledby": labelledBy,
|
|
3796
4224
|
ref: (node) => {
|
|
3797
4225
|
if (typeof elementRef === "function") {
|
|
3798
4226
|
elementRef(node);
|
|
@@ -4081,8 +4509,8 @@ var Message = styled_components_default.div`
|
|
|
4081
4509
|
width: 100%;
|
|
4082
4510
|
word-break: break-all;
|
|
4083
4511
|
`;
|
|
4084
|
-
var ErrorMessage = (
|
|
4085
|
-
var props = __objRest(
|
|
4512
|
+
var ErrorMessage = (_a2) => {
|
|
4513
|
+
var props = __objRest(_a2, []);
|
|
4086
4514
|
const { error } = props;
|
|
4087
4515
|
return /* @__PURE__ */ react_exports.createElement(Container2, null, /* @__PURE__ */ react_exports.createElement(visualization_icons_exports.Image, { "data-testid": "image-icon" }), /* @__PURE__ */ react_exports.createElement(Message, null, error));
|
|
4088
4516
|
};
|
|
@@ -4107,8 +4535,8 @@ var createProtocolHandlers = (featureFlagContext = {}, imageContext = null) => {
|
|
|
4107
4535
|
}
|
|
4108
4536
|
return handlers;
|
|
4109
4537
|
};
|
|
4110
|
-
var ChoroplethSvg = (
|
|
4111
|
-
var props = __objRest(
|
|
4538
|
+
var ChoroplethSvg = (_a2) => {
|
|
4539
|
+
var props = __objRest(_a2, []);
|
|
4112
4540
|
const { svg } = props;
|
|
4113
4541
|
const url = react_exports.useMemo(() => {
|
|
4114
4542
|
if (!svg) {
|
|
@@ -4121,7 +4549,7 @@ var ChoroplethSvg = (_a) => {
|
|
|
4121
4549
|
if (/.*<svg.*/i.test(trimmed)) {
|
|
4122
4550
|
return trimmed;
|
|
4123
4551
|
}
|
|
4124
|
-
return `${
|
|
4552
|
+
return `${globalThis.location.origin}/${trimmed}`;
|
|
4125
4553
|
}, [svg]);
|
|
4126
4554
|
return /* @__PURE__ */ react_exports.createElement(ImageContext_default.Consumer, null, (imageContext) => /* @__PURE__ */ react_exports.createElement(FeatureFlagContext_default.Consumer, null, (featureFlagContext) => /* @__PURE__ */ react_exports.createElement(
|
|
4127
4555
|
FileDownloader_exports.FileDownloader,
|
|
@@ -4148,10 +4576,11 @@ function useIconPlaceholder(dataSources, loading, options) {
|
|
|
4148
4576
|
const missingData = shouldShowIconPlaceholder(dataSources, loading);
|
|
4149
4577
|
return missingData && !svg;
|
|
4150
4578
|
}
|
|
4151
|
-
var
|
|
4579
|
+
var platformVizOpts = {
|
|
4152
4580
|
ReactViz: ChoroplethSvg,
|
|
4153
4581
|
vizConfig: config_default,
|
|
4154
4582
|
useIconPlaceholder
|
|
4155
|
-
}
|
|
4583
|
+
};
|
|
4584
|
+
var platformViz = withDashboardViz_default(platformVizOpts);
|
|
4156
4585
|
var ChoroplethSvg_default = platformViz;
|
|
4157
4586
|
//# sourceMappingURL=ChoroplethSvg.js.map
|