@splunk/visualizations 28.1.0 → 28.2.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 +27 -0
- package/Area.config.js.map +2 -2
- package/Area.js +721 -354
- package/Area.js.map +4 -4
- package/Bar.config.js +27 -0
- package/Bar.config.js.map +2 -2
- package/Bar.js +753 -386
- package/Bar.js.map +4 -4
- package/Bubble.config.js +27 -0
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +683 -320
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +33 -0
- package/ChoroplethSvg.js +569 -193
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +27 -0
- package/Column.config.js.map +2 -2
- package/Column.js +768 -401
- package/Column.js.map +4 -4
- package/Ellipse.js +592 -213
- package/Ellipse.js.map +4 -4
- package/Events.js +591 -200
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +1 -0
- package/FillerGauge.js +564 -190
- package/FillerGauge.js.map +4 -4
- package/Image.js +589 -216
- package/Image.js.map +4 -4
- package/Line.config.js +28 -1
- package/Line.config.js.map +2 -2
- package/Line.js +736 -369
- package/Line.js.map +4 -4
- package/LinkGraph.js +1093 -690
- package/LinkGraph.js.map +4 -4
- package/Map.config.js +2 -0
- package/Map.config.js.map +2 -2
- package/Map.js +533 -141
- package/Map.js.map +4 -4
- package/Markdown.js +613 -229
- package/Markdown.js.map +4 -4
- package/MarkerGauge.js +543 -168
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.js +564 -173
- package/ParallelCoordinates.js.map +4 -4
- package/Pie.js +650 -315
- package/Pie.js.map +4 -4
- package/Punchcard.js +588 -199
- package/Punchcard.js.map +4 -4
- package/Rectangle.js +603 -223
- package/Rectangle.js.map +4 -4
- package/Sankey.js +576 -200
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +27 -0
- package/Scatter.config.js.map +2 -2
- package/Scatter.js +687 -325
- package/Scatter.js.map +4 -4
- package/SingleValue.js +540 -165
- package/SingleValue.js.map +4 -4
- package/SingleValueIcon.js +534 -159
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial.js +527 -152
- package/SingleValueRadial.js.map +4 -4
- package/Table.config.js +87 -32
- package/Table.config.js.map +4 -4
- package/Table.js +931 -441
- package/Table.js.map +4 -4
- package/Timeline.js +611 -272
- package/Timeline.js.map +4 -4
- package/common/Charting.js +49 -111
- package/common/Charting.js.map +4 -4
- package/common/GaugeMajorTicks.js +6 -14
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +6 -14
- package/common/GaugeValueMarker.js.map +2 -2
- package/common/OptionsDoc.js +3 -2
- package/common/OptionsDoc.js.map +2 -2
- package/common/SplunkVisualization.js +1 -1
- package/common/SplunkVisualization.js.map +2 -2
- package/common/TimeSeriesChartWrapper.js +485 -0
- package/common/TimeSeriesChartWrapper.js.map +7 -0
- package/common/chartingUtils.js +252 -1
- package/common/chartingUtils.js.map +4 -4
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/hocUtils.js +1 -1
- package/common/utils/hocUtils.js.map +2 -2
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/tableUtils.js +29 -28
- package/common/utils/tableUtils.js.map +2 -2
- package/common/withDashboardViz.js +551 -160
- package/common/withDashboardViz.js.map +4 -4
- package/dist/types/Area/Area.d.ts +13 -0
- package/dist/types/Area/Area.d.ts.map +1 -0
- package/dist/types/Area/areaUtils.d.ts +15 -0
- package/dist/types/Area/areaUtils.d.ts.map +1 -0
- package/dist/types/Area/config.d.ts +4 -0
- package/dist/types/Area/config.d.ts.map +1 -0
- package/dist/types/Area/index.d.ts +3 -0
- package/dist/types/Area/index.d.ts.map +1 -0
- package/dist/types/Bar/Bar.d.ts +13 -0
- package/dist/types/Bar/Bar.d.ts.map +1 -0
- package/dist/types/Bar/barUtils.d.ts +30 -0
- package/dist/types/Bar/barUtils.d.ts.map +1 -0
- package/dist/types/Bar/config.d.ts +4 -0
- package/dist/types/Bar/config.d.ts.map +1 -0
- package/dist/types/Bar/index.d.ts +3 -0
- package/dist/types/Bar/index.d.ts.map +1 -0
- package/dist/types/Bubble/Bubble.d.ts +9 -0
- package/dist/types/Bubble/Bubble.d.ts.map +1 -0
- package/dist/types/Bubble/bubbleUtils.d.ts +47 -0
- package/dist/types/Bubble/bubbleUtils.d.ts.map +1 -0
- package/dist/types/Bubble/config.d.ts +4 -0
- package/dist/types/Bubble/config.d.ts.map +1 -0
- package/dist/types/Bubble/index.d.ts +3 -0
- package/dist/types/Bubble/index.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/ChoroplethSvg.d.ts +24 -0
- package/dist/types/ChoroplethSvg/ChoroplethSvg.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/ErrorMessage/ErrorMessage.d.ts +6 -0
- package/dist/types/ChoroplethSvg/ErrorMessage/ErrorMessage.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts +29 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts +34 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts +144 -0
- package/dist/types/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/config.d.ts +4 -0
- package/dist/types/ChoroplethSvg/config.d.ts.map +1 -0
- package/dist/types/ChoroplethSvg/index.d.ts +3 -0
- package/dist/types/ChoroplethSvg/index.d.ts.map +1 -0
- package/dist/types/Column/Column.d.ts +11 -0
- package/dist/types/Column/Column.d.ts.map +1 -0
- package/dist/types/Column/columnUtils.d.ts +82 -0
- package/dist/types/Column/columnUtils.d.ts.map +1 -0
- package/dist/types/Column/config.d.ts +4 -0
- package/dist/types/Column/config.d.ts.map +1 -0
- package/dist/types/Column/index.d.ts +3 -0
- package/dist/types/Column/index.d.ts.map +1 -0
- package/dist/types/Ellipse/Ellipse.d.ts +7 -0
- package/dist/types/Ellipse/Ellipse.d.ts.map +1 -0
- package/dist/types/Ellipse/config.d.ts +4 -0
- package/dist/types/Ellipse/config.d.ts.map +1 -0
- package/dist/types/Ellipse/index.d.ts +3 -0
- package/dist/types/Ellipse/index.d.ts.map +1 -0
- package/dist/types/Events/EventUtils.d.ts +137 -0
- package/dist/types/Events/EventUtils.d.ts.map +1 -0
- package/dist/types/Events/Events.d.ts +19 -0
- package/dist/types/Events/Events.d.ts.map +1 -0
- package/dist/types/Events/PureEvents/FieldSummaryTooltip.d.ts +50 -0
- package/dist/types/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -0
- package/dist/types/Events/PureEvents/PureEvents.d.ts +34 -0
- package/dist/types/Events/PureEvents/PureEvents.d.ts.map +1 -0
- package/dist/types/Events/PureEvents/TimeControlsPopover.d.ts +33 -0
- package/dist/types/Events/PureEvents/TimeControlsPopover.d.ts.map +1 -0
- package/dist/types/Events/config.d.ts +4 -0
- package/dist/types/Events/config.d.ts.map +1 -0
- package/dist/types/Events/index.d.ts +3 -0
- package/dist/types/Events/index.d.ts.map +1 -0
- package/dist/types/FillerGauge/FillerGauge.d.ts +13 -0
- package/dist/types/FillerGauge/FillerGauge.d.ts.map +1 -0
- package/dist/types/FillerGauge/PureFillerGauge/FillerGauge.d.ts +32 -0
- package/dist/types/FillerGauge/PureFillerGauge/FillerGauge.d.ts.map +1 -0
- package/dist/types/FillerGauge/config.d.ts +4 -0
- package/dist/types/FillerGauge/config.d.ts.map +1 -0
- package/dist/types/FillerGauge/index.d.ts +3 -0
- package/dist/types/FillerGauge/index.d.ts.map +1 -0
- package/dist/types/Image/Image.d.ts +13 -0
- package/dist/types/Image/Image.d.ts.map +1 -0
- package/dist/types/Image/ImageApi.d.ts +15 -0
- package/dist/types/Image/ImageApi.d.ts.map +1 -0
- package/dist/types/Image/config.d.ts +4 -0
- package/dist/types/Image/config.d.ts.map +1 -0
- package/dist/types/Image/index.d.ts +3 -0
- package/dist/types/Image/index.d.ts.map +1 -0
- package/dist/types/Line/Line.d.ts +13 -0
- package/dist/types/Line/Line.d.ts.map +1 -0
- package/dist/types/Line/config.d.ts +4 -0
- package/dist/types/Line/config.d.ts.map +1 -0
- package/dist/types/Line/index.d.ts +3 -0
- package/dist/types/Line/index.d.ts.map +1 -0
- package/dist/types/Line/lineUtils.d.ts +22 -0
- package/dist/types/Line/lineUtils.d.ts.map +1 -0
- package/dist/types/Line/mockdata/LineData.d.ts +184 -0
- package/dist/types/Line/mockdata/LineData.d.ts.map +1 -0
- package/dist/types/LinkGraph/ESTestDataSources.d.ts +32 -0
- package/dist/types/LinkGraph/ESTestDataSources.d.ts.map +1 -0
- package/dist/types/LinkGraph/ESTestTemplate.d.ts +2 -0
- package/dist/types/LinkGraph/ESTestTemplate.d.ts.map +1 -0
- package/dist/types/LinkGraph/LinkGraph.d.ts +22 -0
- package/dist/types/LinkGraph/LinkGraph.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +89 -0
- package/dist/types/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts +74 -0
- package/dist/types/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Edges.d.ts +9 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Edges.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Field.d.ts +14 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Field.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/FieldStyles.d.ts +5 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/FieldStyles.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Graph.d.ts +49 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Graph.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts +11 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Node.d.ts +24 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Nodes.d.ts +16 -0
- package/dist/types/LinkGraph/PureLinkGraph/components/Nodes.d.ts.map +1 -0
- package/dist/types/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts +168 -0
- package/dist/types/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts.map +1 -0
- package/dist/types/LinkGraph/config.d.ts +4 -0
- package/dist/types/LinkGraph/config.d.ts.map +1 -0
- package/dist/types/LinkGraph/index.d.ts +3 -0
- package/dist/types/LinkGraph/index.d.ts.map +1 -0
- package/dist/types/Map/Map.d.ts +28 -0
- package/dist/types/Map/Map.d.ts.map +1 -0
- package/dist/types/Map/MapContextDefault.d.ts +39 -0
- package/dist/types/Map/MapContextDefault.d.ts.map +1 -0
- package/dist/types/Map/PureMap/BubbleLayer.d.ts +51 -0
- package/dist/types/Map/PureMap/BubbleLayer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/ChoroplethLayer.d.ts +36 -0
- package/dist/types/Map/PureMap/ChoroplethLayer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/ClusterLayer.d.ts +17 -0
- package/dist/types/Map/PureMap/ClusterLayer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/LocalChoroplethLayer.d.ts +18 -0
- package/dist/types/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/MapUtils.d.ts +141 -0
- package/dist/types/Map/PureMap/MapUtils.d.ts.map +1 -0
- package/dist/types/Map/PureMap/MarkerLayer.d.ts +34 -0
- package/dist/types/Map/PureMap/MarkerLayer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/MarkerWrapper.d.ts +17 -0
- package/dist/types/Map/PureMap/MarkerWrapper.d.ts.map +1 -0
- package/dist/types/Map/PureMap/PureMap.d.ts +102 -0
- package/dist/types/Map/PureMap/PureMap.d.ts.map +1 -0
- package/dist/types/Map/PureMap/PureMapContainer.d.ts +15 -0
- package/dist/types/Map/PureMap/PureMapContainer.d.ts.map +1 -0
- package/dist/types/Map/PureMap/Tooltip.d.ts +20 -0
- package/dist/types/Map/PureMap/Tooltip.d.ts.map +1 -0
- package/dist/types/Map/PureMap/mockdata/data.d.ts +90 -0
- package/dist/types/Map/PureMap/mockdata/data.d.ts.map +1 -0
- package/dist/types/Map/config.d.ts +4 -0
- package/dist/types/Map/config.d.ts.map +1 -0
- package/dist/types/Map/index.d.ts +3 -0
- package/dist/types/Map/index.d.ts.map +1 -0
- package/dist/types/Markdown/Markdown.d.ts +31 -0
- package/dist/types/Markdown/Markdown.d.ts.map +1 -0
- package/dist/types/Markdown/config.d.ts +4 -0
- package/dist/types/Markdown/config.d.ts.map +1 -0
- package/dist/types/Markdown/index.d.ts +3 -0
- package/dist/types/Markdown/index.d.ts.map +1 -0
- package/dist/types/MarkerGauge/MarkerGauge.d.ts +55 -0
- package/dist/types/MarkerGauge/MarkerGauge.d.ts.map +1 -0
- package/dist/types/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +72 -0
- package/dist/types/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -0
- package/dist/types/MarkerGauge/config.d.ts +4 -0
- package/dist/types/MarkerGauge/config.d.ts.map +1 -0
- package/dist/types/MarkerGauge/index.d.ts +3 -0
- package/dist/types/MarkerGauge/index.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/ParallelCoordinates.d.ts +58 -0
- package/dist/types/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +69 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesCanvas.d.ts +30 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesCanvas.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +42 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesPrompt.d.ts +22 -0
- package/dist/types/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesPrompt.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/config.d.ts +4 -0
- package/dist/types/ParallelCoordinates/config.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/index.d.ts +3 -0
- package/dist/types/ParallelCoordinates/index.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/mockdata/arrayValueData.d.ts +6 -0
- package/dist/types/ParallelCoordinates/mockdata/arrayValueData.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleCarData.d.ts +6 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleCarData.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleCarNumericalData.d.ts +6 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleCarNumericalData.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleFoodData.d.ts +6 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleFoodData.d.ts.map +1 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleStringNumericalData.d.ts +6 -0
- package/dist/types/ParallelCoordinates/mockdata/sampleStringNumericalData.d.ts.map +1 -0
- package/dist/types/Pie/Pie.d.ts +15 -0
- package/dist/types/Pie/Pie.d.ts.map +1 -0
- package/dist/types/Pie/config.d.ts +4 -0
- package/dist/types/Pie/config.d.ts.map +1 -0
- package/dist/types/Pie/index.d.ts +3 -0
- package/dist/types/Pie/index.d.ts.map +1 -0
- package/dist/types/Pie/pieUtils.d.ts +78 -0
- package/dist/types/Pie/pieUtils.d.ts.map +1 -0
- package/dist/types/Punchcard/Punchcard.d.ts +13 -0
- package/dist/types/Punchcard/Punchcard.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/Punchcard.d.ts +40 -0
- package/dist/types/Punchcard/PurePunchcard/Punchcard.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts +20 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts +27 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts +40 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts +17 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts +21 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardRow.d.ts +10 -0
- package/dist/types/Punchcard/PurePunchcard/src/PunchcardRow.d.ts.map +1 -0
- package/dist/types/Punchcard/PurePunchcard/src/utils/punchcardUtils.d.ts +285 -0
- package/dist/types/Punchcard/PurePunchcard/src/utils/punchcardUtils.d.ts.map +1 -0
- package/dist/types/Punchcard/config.d.ts +4 -0
- package/dist/types/Punchcard/config.d.ts.map +1 -0
- package/dist/types/Punchcard/index.d.ts +3 -0
- package/dist/types/Punchcard/index.d.ts.map +1 -0
- package/dist/types/Punchcard/punchcardUtils.d.ts +32 -0
- package/dist/types/Punchcard/punchcardUtils.d.ts.map +1 -0
- package/dist/types/Rectangle/Rectangle.d.ts +14 -0
- package/dist/types/Rectangle/Rectangle.d.ts.map +1 -0
- package/dist/types/Rectangle/config.d.ts +4 -0
- package/dist/types/Rectangle/config.d.ts.map +1 -0
- package/dist/types/Rectangle/index.d.ts +3 -0
- package/dist/types/Rectangle/index.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/PureSankey.d.ts +98 -0
- package/dist/types/Sankey/PureSankey/PureSankey.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/SankeyLink.d.ts +33 -0
- package/dist/types/Sankey/PureSankey/SankeyLink.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/SankeyModels.d.ts +48 -0
- package/dist/types/Sankey/PureSankey/SankeyModels.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/SankeyNode.d.ts +38 -0
- package/dist/types/Sankey/PureSankey/SankeyNode.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/SankeyTooltip.d.ts +43 -0
- package/dist/types/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/SankeyUtils.d.ts +20 -0
- package/dist/types/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -0
- package/dist/types/Sankey/PureSankey/mockdata/data.d.ts +35 -0
- package/dist/types/Sankey/PureSankey/mockdata/data.d.ts.map +1 -0
- package/dist/types/Sankey/Sankey.d.ts +31 -0
- package/dist/types/Sankey/Sankey.d.ts.map +1 -0
- package/dist/types/Sankey/config.d.ts +4 -0
- package/dist/types/Sankey/config.d.ts.map +1 -0
- package/dist/types/Sankey/index.d.ts +3 -0
- package/dist/types/Sankey/index.d.ts.map +1 -0
- package/dist/types/Scatter/Scatter.d.ts +11 -0
- package/dist/types/Scatter/Scatter.d.ts.map +1 -0
- package/dist/types/Scatter/config.d.ts +4 -0
- package/dist/types/Scatter/config.d.ts.map +1 -0
- package/dist/types/Scatter/index.d.ts +3 -0
- package/dist/types/Scatter/index.d.ts.map +1 -0
- package/dist/types/Scatter/mockdata/data.d.ts +35 -0
- package/dist/types/Scatter/mockdata/data.d.ts.map +1 -0
- package/dist/types/Scatter/scatterUtils.d.ts +47 -0
- package/dist/types/Scatter/scatterUtils.d.ts.map +1 -0
- package/dist/types/SingleValue/SingleValue.d.ts +16 -0
- package/dist/types/SingleValue/SingleValue.d.ts.map +1 -0
- package/dist/types/SingleValue/config.d.ts +4 -0
- package/dist/types/SingleValue/config.d.ts.map +1 -0
- package/dist/types/SingleValue/index.d.ts +3 -0
- package/dist/types/SingleValue/index.d.ts.map +1 -0
- package/dist/types/SingleValueBasic/index.d.ts +3 -0
- package/dist/types/SingleValueBasic/index.d.ts.map +1 -0
- package/dist/types/SingleValueIcon/SingleValueIcon.d.ts +29 -0
- package/dist/types/SingleValueIcon/SingleValueIcon.d.ts.map +1 -0
- package/dist/types/SingleValueIcon/config.d.ts +4 -0
- package/dist/types/SingleValueIcon/config.d.ts.map +1 -0
- package/dist/types/SingleValueIcon/index.d.ts +3 -0
- package/dist/types/SingleValueIcon/index.d.ts.map +1 -0
- package/dist/types/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts +20 -0
- package/dist/types/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -0
- package/dist/types/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +82 -0
- package/dist/types/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -0
- package/dist/types/SingleValueRadial/SingleValueRadial.d.ts +17 -0
- package/dist/types/SingleValueRadial/SingleValueRadial.d.ts.map +1 -0
- package/dist/types/SingleValueRadial/config.d.ts +4 -0
- package/dist/types/SingleValueRadial/config.d.ts.map +1 -0
- package/dist/types/SingleValueRadial/index.d.ts +3 -0
- package/dist/types/SingleValueRadial/index.d.ts.map +1 -0
- package/dist/types/SparkLine/index.d.ts +2 -0
- package/dist/types/SparkLine/index.d.ts.map +1 -0
- package/dist/types/Table/PureTable.d.ts +50 -0
- package/dist/types/Table/PureTable.d.ts.map +1 -0
- package/dist/types/Table/Table.d.ts +10 -0
- package/dist/types/Table/Table.d.ts.map +1 -0
- package/dist/types/Table/cells/ArrayCell.d.ts +12 -0
- package/dist/types/Table/cells/ArrayCell.d.ts.map +1 -0
- package/dist/types/Table/cells/SparklineCell.d.ts +13 -0
- package/dist/types/Table/cells/SparklineCell.d.ts.map +1 -0
- package/dist/types/Table/cells/SwitchTableCell.d.ts +5 -0
- package/dist/types/Table/cells/SwitchTableCell.d.ts.map +1 -0
- package/dist/types/Table/cells/TextCell.d.ts +12 -0
- package/dist/types/Table/cells/TextCell.d.ts.map +1 -0
- package/dist/types/Table/cells/index.d.ts +5 -0
- package/dist/types/Table/cells/index.d.ts.map +1 -0
- package/dist/types/Table/config.d.ts +4 -0
- package/dist/types/Table/config.d.ts.map +1 -0
- package/dist/types/Table/hooks.d.ts +130 -0
- package/dist/types/Table/hooks.d.ts.map +1 -0
- package/dist/types/Table/index.d.ts +3 -0
- package/dist/types/Table/index.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/PureTimeline.d.ts +81 -0
- package/dist/types/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/CursorPlugin.d.ts +8 -0
- package/dist/types/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineLegend.d.ts +28 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/TimelinePlugin.d.ts +16 -0
- package/dist/types/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineTooltip.d.ts +11 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineTooltip.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineUplot.d.ts +22 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineUplot.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineYAxis.d.ts +20 -0
- package/dist/types/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/XAxisPlugin.d.ts +18 -0
- package/dist/types/Timeline/PureTimeline/src/XAxisPlugin.d.ts.map +1 -0
- package/dist/types/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +34 -0
- package/dist/types/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -0
- package/dist/types/Timeline/Timeline.d.ts +22 -0
- package/dist/types/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/Timeline/config.d.ts +4 -0
- package/dist/types/Timeline/config.d.ts.map +1 -0
- package/dist/types/Timeline/index.d.ts +3 -0
- package/dist/types/Timeline/index.d.ts.map +1 -0
- package/dist/types/Timeline/mockdata/basicTimelineData.d.ts +76 -0
- package/dist/types/Timeline/mockdata/basicTimelineData.d.ts.map +1 -0
- package/dist/types/Timeline/mockdata/categoricalTimelineData.d.ts +31 -0
- package/dist/types/Timeline/mockdata/categoricalTimelineData.d.ts.map +1 -0
- package/dist/types/Timeline/mockdata/timelineDataSource.d.ts +52 -0
- package/dist/types/Timeline/mockdata/timelineDataSource.d.ts.map +1 -0
- package/dist/types/common/Charting.d.ts +46 -0
- package/dist/types/common/Charting.d.ts.map +1 -0
- package/dist/types/common/ChartingApi.d.ts +36 -0
- package/dist/types/common/ChartingApi.d.ts.map +1 -0
- package/dist/types/common/DocExampleWithVizSandbox.d.ts +22 -0
- package/dist/types/common/DocExampleWithVizSandbox.d.ts.map +1 -0
- package/dist/types/common/OverviewDoc.d.ts +20 -0
- package/dist/types/common/OverviewDoc.d.ts.map +1 -0
- package/dist/types/common/SplunkVisualization.d.ts +16 -0
- package/dist/types/common/SplunkVisualization.d.ts.map +1 -0
- package/dist/types/common/SplunkVisualizationApi.d.ts +16 -0
- package/dist/types/common/SplunkVisualizationApi.d.ts.map +1 -0
- package/dist/types/common/ThemedDefaults.d.ts +2 -0
- package/dist/types/common/ThemedDefaults.d.ts.map +1 -0
- package/dist/types/common/TimeSeriesChartWrapper.d.ts +7 -0
- package/dist/types/common/TimeSeriesChartWrapper.d.ts.map +1 -0
- package/dist/types/common/chartingUtils.d.ts +164 -0
- package/dist/types/common/chartingUtils.d.ts.map +1 -0
- package/dist/types/common/components/IconPlaceholder.d.ts +21 -0
- package/dist/types/common/components/IconPlaceholder.d.ts.map +1 -0
- package/dist/types/common/components/MissingPropsMessage.d.ts +28 -0
- package/dist/types/common/components/MissingPropsMessage.d.ts.map +1 -0
- package/dist/types/common/components/TrellisTitle.d.ts +10 -0
- package/dist/types/common/components/TrellisTitle.d.ts.map +1 -0
- package/dist/types/common/configContext/singleValueContext.d.ts +3 -0
- package/dist/types/common/configContext/singleValueContext.d.ts.map +1 -0
- package/dist/types/common/docUtils.d.ts +24 -0
- package/dist/types/common/docUtils.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartColorAndStyle.d.ts +5 -0
- package/dist/types/common/editorConfig/AxesChartColorAndStyle.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartDataConfig.d.ts +31 -0
- package/dist/types/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartDataDisplay.d.ts +14 -0
- package/dist/types/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartLegend.d.ts +8 -0
- package/dist/types/common/editorConfig/AxesChartLegend.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartXGridAndLabels.d.ts +6 -0
- package/dist/types/common/editorConfig/AxesChartXGridAndLabels.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartY2GridAndLabels.d.ts +11 -0
- package/dist/types/common/editorConfig/AxesChartY2GridAndLabels.d.ts.map +1 -0
- package/dist/types/common/editorConfig/AxesChartYGridAndLabels.d.ts +4 -0
- package/dist/types/common/editorConfig/AxesChartYGridAndLabels.d.ts.map +1 -0
- package/dist/types/common/editorConfig/BackgroundColor.d.ts +10 -0
- package/dist/types/common/editorConfig/BackgroundColor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/DynamicFillColorEditor.d.ts +29 -0
- package/dist/types/common/editorConfig/DynamicFillColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/DynamicGaugeColorEditor.d.ts +29 -0
- package/dist/types/common/editorConfig/DynamicGaugeColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/DynamicStrokeColorEditor.d.ts +29 -0
- package/dist/types/common/editorConfig/DynamicStrokeColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/Gauge.d.ts +4 -0
- package/dist/types/common/editorConfig/Gauge.d.ts.map +1 -0
- package/dist/types/common/editorConfig/Legend.d.ts +4 -0
- package/dist/types/common/editorConfig/Legend.d.ts.map +1 -0
- package/dist/types/common/editorConfig/RadialBackgroundColor.d.ts +10 -0
- package/dist/types/common/editorConfig/RadialBackgroundColor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/StaticFillColorEditor.d.ts +10 -0
- package/dist/types/common/editorConfig/StaticFillColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/StaticGaugeColorEditor.d.ts +10 -0
- package/dist/types/common/editorConfig/StaticGaugeColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/StaticStrokeColorEditor.d.ts +10 -0
- package/dist/types/common/editorConfig/StaticStrokeColorEditor.d.ts.map +1 -0
- package/dist/types/common/editorConfig/TrellisEditors.d.ts +66 -0
- package/dist/types/common/editorConfig/TrellisEditors.d.ts.map +1 -0
- package/dist/types/common/gaugeUtils.d.ts +387 -0
- package/dist/types/common/gaugeUtils.d.ts.map +1 -0
- package/dist/types/common/hocs/FixedSizeContainer.d.ts +9 -0
- package/dist/types/common/hocs/FixedSizeContainer.d.ts.map +1 -0
- package/dist/types/common/hocs/mockdata/trellisData.d.ts +1288 -0
- package/dist/types/common/hocs/mockdata/trellisData.d.ts.map +1 -0
- package/dist/types/common/hocs/withEditModeCover.d.ts +10 -0
- package/dist/types/common/hocs/withEditModeCover.d.ts.map +1 -0
- package/dist/types/common/hocs/withPlaceholder.d.ts +8 -0
- package/dist/types/common/hocs/withPlaceholder.d.ts.map +1 -0
- package/dist/types/common/hocs/withTrellis.d.ts +18 -0
- package/dist/types/common/hocs/withTrellis.d.ts.map +1 -0
- package/dist/types/common/hooks/useDeepMemo.d.ts +15 -0
- package/dist/types/common/hooks/useDeepMemo.d.ts.map +1 -0
- package/dist/types/common/hooks/useDownsampleDataSources.d.ts +7 -0
- package/dist/types/common/hooks/useDownsampleDataSources.d.ts.map +1 -0
- package/dist/types/common/hooks/useEventCallback.d.ts +9 -0
- package/dist/types/common/hooks/useEventCallback.d.ts.map +1 -0
- package/dist/types/common/hooks/useGetXAndYFields.d.ts +10 -0
- package/dist/types/common/hooks/useGetXAndYFields.d.ts.map +1 -0
- package/dist/types/common/hooks/usePagination.d.ts +21 -0
- package/dist/types/common/hooks/usePagination.d.ts.map +1 -0
- package/dist/types/common/hooks/usePrevious.d.ts +2 -0
- package/dist/types/common/hooks/usePrevious.d.ts.map +1 -0
- package/dist/types/common/hooks/useSorting.d.ts +17 -0
- package/dist/types/common/hooks/useSorting.d.ts.map +1 -0
- package/dist/types/common/hooks/useTrellisEnabled.d.ts +4 -0
- package/dist/types/common/hooks/useTrellisEnabled.d.ts.map +1 -0
- package/dist/types/common/interfaces/ChartEvent.d.ts +26 -0
- package/dist/types/common/interfaces/ChartEvent.d.ts.map +1 -0
- package/dist/types/common/interfaces/DashboardVizProps.d.ts +27 -0
- package/dist/types/common/interfaces/DashboardVizProps.d.ts.map +1 -0
- package/dist/types/common/interfaces/DataContract.d.ts +19 -0
- package/dist/types/common/interfaces/DataContract.d.ts.map +1 -0
- package/dist/types/common/interfaces/DataSource.d.ts +45 -0
- package/dist/types/common/interfaces/DataSource.d.ts.map +1 -0
- package/dist/types/common/interfaces/DefaultContext.d.ts +30 -0
- package/dist/types/common/interfaces/DefaultContext.d.ts.map +1 -0
- package/dist/types/common/interfaces/Editor.d.ts +23 -0
- package/dist/types/common/interfaces/Editor.d.ts.map +1 -0
- package/dist/types/common/interfaces/ExtendedDashViz.d.ts +7 -0
- package/dist/types/common/interfaces/ExtendedDashViz.d.ts.map +1 -0
- package/dist/types/common/interfaces/Object.d.ts +4 -0
- package/dist/types/common/interfaces/Object.d.ts.map +1 -0
- package/dist/types/common/interfaces/Overview.d.ts +14 -0
- package/dist/types/common/interfaces/Overview.d.ts.map +1 -0
- package/dist/types/common/interfaces/ThemedDefaults.d.ts +5 -0
- package/dist/types/common/interfaces/ThemedDefaults.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizActionHandler.d.ts +15 -0
- package/dist/types/common/interfaces/VizActionHandler.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizBehavior.d.ts +25 -0
- package/dist/types/common/interfaces/VizBehavior.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizCategory.d.ts +16 -0
- package/dist/types/common/interfaces/VizCategory.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizConfig.d.ts +34 -0
- package/dist/types/common/interfaces/VizConfig.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizEvent.d.ts +13 -0
- package/dist/types/common/interfaces/VizEvent.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizProps.d.ts +8 -0
- package/dist/types/common/interfaces/VizProps.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizRegistry.d.ts +7 -0
- package/dist/types/common/interfaces/VizRegistry.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizSize.d.ts +8 -0
- package/dist/types/common/interfaces/VizSize.d.ts.map +1 -0
- package/dist/types/common/interfaces/VizStatus.d.ts +2 -0
- package/dist/types/common/interfaces/VizStatus.d.ts.map +1 -0
- package/dist/types/common/interfaces/index.d.ts +19 -0
- package/dist/types/common/interfaces/index.d.ts.map +1 -0
- package/dist/types/common/shapeUtils.d.ts +26 -0
- package/dist/types/common/shapeUtils.d.ts.map +1 -0
- package/dist/types/common/utils/configUtils.d.ts +59 -0
- package/dist/types/common/utils/configUtils.d.ts.map +1 -0
- package/dist/types/common/utils/dataUtils.d.ts +31 -0
- package/dist/types/common/utils/dataUtils.d.ts.map +1 -0
- package/dist/types/common/utils/featureFlagUtils.d.ts +3 -0
- package/dist/types/common/utils/featureFlagUtils.d.ts.map +1 -0
- package/dist/types/common/utils/hocUtils.d.ts +12 -0
- package/dist/types/common/utils/hocUtils.d.ts.map +1 -0
- package/dist/types/common/utils/mapUtils.d.ts +2 -0
- package/dist/types/common/utils/mapUtils.d.ts.map +1 -0
- package/dist/types/common/utils/styleUtils.d.ts +2 -0
- package/dist/types/common/utils/styleUtils.d.ts.map +1 -0
- package/dist/types/common/utils/tableUtils.d.ts +3 -0
- package/dist/types/common/utils/tableUtils.d.ts.map +1 -0
- package/dist/types/common/utils/trellisUtils.d.ts +60 -0
- package/dist/types/common/utils/trellisUtils.d.ts.map +1 -0
- package/dist/types/common/utils/urlUtils.d.ts +2 -0
- package/dist/types/common/utils/urlUtils.d.ts.map +1 -0
- package/dist/types/common/withDashboardViz.d.ts +22 -0
- package/dist/types/common/withDashboardViz.d.ts.map +1 -0
- package/package.json +32 -34
package/common/Charting.js
CHANGED
|
@@ -96,104 +96,86 @@ var defaultImport4 = __toESM(require("react"));
|
|
|
96
96
|
__reExport(react_exports, require("react"));
|
|
97
97
|
var react_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
98
98
|
|
|
99
|
-
// esm-externals:prop-types
|
|
100
|
-
var prop_types_exports = {};
|
|
101
|
-
__export(prop_types_exports, {
|
|
102
|
-
default: () => prop_types_default
|
|
103
|
-
});
|
|
104
|
-
var defaultImport5 = __toESM(require("prop-types"));
|
|
105
|
-
__reExport(prop_types_exports, require("prop-types"));
|
|
106
|
-
var prop_types_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
107
|
-
|
|
108
99
|
// esm-externals:react-event-listener
|
|
109
100
|
var react_event_listener_exports = {};
|
|
110
101
|
__export(react_event_listener_exports, {
|
|
111
102
|
default: () => react_event_listener_default
|
|
112
103
|
});
|
|
113
|
-
var
|
|
104
|
+
var defaultImport5 = __toESM(require("react-event-listener"));
|
|
114
105
|
__reExport(react_event_listener_exports, require("react-event-listener"));
|
|
115
|
-
var react_event_listener_default = "default" in
|
|
106
|
+
var react_event_listener_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
116
107
|
|
|
117
108
|
// esm-externals:@splunk/visualizations-shared/i18n
|
|
118
109
|
var i18n_exports2 = {};
|
|
119
110
|
__export(i18n_exports2, {
|
|
120
111
|
default: () => i18n_default2
|
|
121
112
|
});
|
|
122
|
-
var
|
|
113
|
+
var defaultImport6 = __toESM(require("@splunk/visualizations-shared/i18n"));
|
|
123
114
|
__reExport(i18n_exports2, require("@splunk/visualizations-shared/i18n"));
|
|
124
|
-
var i18n_default2 = "default" in
|
|
115
|
+
var i18n_default2 = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
125
116
|
|
|
126
117
|
// esm-externals:@splunk/charting-bundle
|
|
127
118
|
var charting_bundle_exports = {};
|
|
128
119
|
__export(charting_bundle_exports, {
|
|
129
120
|
default: () => charting_bundle_default
|
|
130
121
|
});
|
|
131
|
-
var
|
|
122
|
+
var defaultImport7 = __toESM(require("@splunk/charting-bundle"));
|
|
132
123
|
__reExport(charting_bundle_exports, require("@splunk/charting-bundle"));
|
|
133
|
-
var charting_bundle_default = "default" in
|
|
124
|
+
var charting_bundle_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
134
125
|
|
|
135
126
|
// esm-externals:@splunk/visualization-context/TimezoneContext
|
|
136
127
|
var TimezoneContext_exports = {};
|
|
137
128
|
__export(TimezoneContext_exports, {
|
|
138
129
|
default: () => TimezoneContext_default
|
|
139
130
|
});
|
|
140
|
-
var
|
|
131
|
+
var defaultImport8 = __toESM(require("@splunk/visualization-context/TimezoneContext"));
|
|
141
132
|
__reExport(TimezoneContext_exports, require("@splunk/visualization-context/TimezoneContext"));
|
|
142
|
-
var TimezoneContext_default = "default" in
|
|
133
|
+
var TimezoneContext_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
143
134
|
|
|
144
135
|
// esm-externals:@splunk/visualizations-shared/style
|
|
145
136
|
var style_exports = {};
|
|
146
137
|
__export(style_exports, {
|
|
147
138
|
default: () => style_default
|
|
148
139
|
});
|
|
149
|
-
var
|
|
140
|
+
var defaultImport9 = __toESM(require("@splunk/visualizations-shared/style"));
|
|
150
141
|
__reExport(style_exports, require("@splunk/visualizations-shared/style"));
|
|
151
|
-
var style_default = "default" in
|
|
142
|
+
var style_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
152
143
|
|
|
153
144
|
// esm-externals:styled-components
|
|
154
145
|
var styled_components_exports = {};
|
|
155
146
|
__export(styled_components_exports, {
|
|
156
147
|
default: () => styled_components_default
|
|
157
148
|
});
|
|
158
|
-
var
|
|
149
|
+
var defaultImport10 = __toESM(require("styled-components"));
|
|
159
150
|
__reExport(styled_components_exports, require("styled-components"));
|
|
160
|
-
var styled_components_default = "default" in
|
|
151
|
+
var styled_components_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
161
152
|
|
|
162
153
|
// esm-externals:@splunk/visualizations-shared/Message
|
|
163
154
|
var Message_exports = {};
|
|
164
155
|
__export(Message_exports, {
|
|
165
156
|
default: () => Message_default
|
|
166
157
|
});
|
|
167
|
-
var
|
|
158
|
+
var defaultImport11 = __toESM(require("@splunk/visualizations-shared/Message"));
|
|
168
159
|
__reExport(Message_exports, require("@splunk/visualizations-shared/Message"));
|
|
169
|
-
var Message_default = "default" in
|
|
160
|
+
var Message_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
|
|
170
161
|
|
|
171
162
|
// esm-externals:@splunk/themes/useSplunkTheme
|
|
172
163
|
var useSplunkTheme_exports = {};
|
|
173
164
|
__export(useSplunkTheme_exports, {
|
|
174
165
|
default: () => useSplunkTheme_default
|
|
175
166
|
});
|
|
176
|
-
var
|
|
167
|
+
var defaultImport12 = __toESM(require("@splunk/themes/useSplunkTheme"));
|
|
177
168
|
__reExport(useSplunkTheme_exports, require("@splunk/themes/useSplunkTheme"));
|
|
178
|
-
var useSplunkTheme_default = "default" in
|
|
169
|
+
var useSplunkTheme_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
|
|
179
170
|
|
|
180
171
|
// esm-externals:@splunk/visualizations-shared/themeUtils
|
|
181
172
|
var themeUtils_exports = {};
|
|
182
173
|
__export(themeUtils_exports, {
|
|
183
174
|
default: () => themeUtils_default
|
|
184
175
|
});
|
|
185
|
-
var
|
|
176
|
+
var defaultImport13 = __toESM(require("@splunk/visualizations-shared/themeUtils"));
|
|
186
177
|
__reExport(themeUtils_exports, require("@splunk/visualizations-shared/themeUtils"));
|
|
187
|
-
var themeUtils_default = "default" in
|
|
188
|
-
|
|
189
|
-
// esm-externals:@splunk/visualization-schemas
|
|
190
|
-
var visualization_schemas_exports = {};
|
|
191
|
-
__export(visualization_schemas_exports, {
|
|
192
|
-
default: () => visualization_schemas_default
|
|
193
|
-
});
|
|
194
|
-
var defaultImport15 = __toESM(require("@splunk/visualization-schemas"));
|
|
195
|
-
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
196
|
-
var visualization_schemas_default = "default" in defaultImport15 ? defaultImport15.default : defaultImport15;
|
|
178
|
+
var themeUtils_default = "default" in defaultImport13 ? defaultImport13.default : defaultImport13;
|
|
197
179
|
|
|
198
180
|
// src/common/ChartingApi.ts
|
|
199
181
|
var ChartingApiFunctional = class {
|
|
@@ -248,9 +230,9 @@ var numberUtils_exports = {};
|
|
|
248
230
|
__export(numberUtils_exports, {
|
|
249
231
|
default: () => numberUtils_default
|
|
250
232
|
});
|
|
251
|
-
var
|
|
233
|
+
var defaultImport14 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
|
|
252
234
|
__reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
|
|
253
|
-
var numberUtils_default = "default" in
|
|
235
|
+
var numberUtils_default = "default" in defaultImport14 ? defaultImport14.default : defaultImport14;
|
|
254
236
|
|
|
255
237
|
// src/common/utils/dataUtils.ts
|
|
256
238
|
var calculateThresholdOnRangeSelect = ({
|
|
@@ -316,9 +298,18 @@ var FeatureFlagContext_exports = {};
|
|
|
316
298
|
__export(FeatureFlagContext_exports, {
|
|
317
299
|
default: () => FeatureFlagContext_default
|
|
318
300
|
});
|
|
319
|
-
var
|
|
301
|
+
var defaultImport15 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
|
|
320
302
|
__reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
|
|
321
|
-
var FeatureFlagContext_default = "default" in
|
|
303
|
+
var FeatureFlagContext_default = "default" in defaultImport15 ? defaultImport15.default : defaultImport15;
|
|
304
|
+
|
|
305
|
+
// esm-externals:@splunk/visualization-schemas
|
|
306
|
+
var visualization_schemas_exports = {};
|
|
307
|
+
__export(visualization_schemas_exports, {
|
|
308
|
+
default: () => visualization_schemas_default
|
|
309
|
+
});
|
|
310
|
+
var defaultImport16 = __toESM(require("@splunk/visualization-schemas"));
|
|
311
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
312
|
+
var visualization_schemas_default = "default" in defaultImport16 ? defaultImport16.default : defaultImport16;
|
|
322
313
|
|
|
323
314
|
// src/common/hooks/useTrellisEnabled.ts
|
|
324
315
|
var useTrellisFeatureFlagOn = () => {
|
|
@@ -408,31 +399,6 @@ var ChartingContainer = styled_components_default.div.attrs((props) => ({
|
|
|
408
399
|
position: relative;
|
|
409
400
|
${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
|
|
410
401
|
`;
|
|
411
|
-
var propTypes = {
|
|
412
|
-
width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
413
|
-
height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
414
|
-
options: prop_types_exports.object,
|
|
415
|
-
chartData: prop_types_exports.object,
|
|
416
|
-
onEventTrigger: prop_types_exports.func,
|
|
417
|
-
onClick: prop_types_exports.func,
|
|
418
|
-
onSelect: prop_types_exports.func,
|
|
419
|
-
onPointMouseOver: prop_types_exports.func,
|
|
420
|
-
onPointMouseOut: prop_types_exports.func,
|
|
421
|
-
style: prop_types_exports.object,
|
|
422
|
-
colorPalette: prop_types_exports.array,
|
|
423
|
-
visualizationApiRef: prop_types_exports.func,
|
|
424
|
-
themeKey: prop_types_exports.string,
|
|
425
|
-
originalDataSources: prop_types_exports.object,
|
|
426
|
-
onDownsamplingThresholdChange: prop_types_exports.func,
|
|
427
|
-
xField: prop_types_exports.string,
|
|
428
|
-
y2Fields: prop_types_exports.array,
|
|
429
|
-
additionalTooltipFields: prop_types_exports.array,
|
|
430
|
-
splitByLayout: prop_types_exports.oneOf(Object.values(visualization_schemas_exports.LAYOUT_TYPE)),
|
|
431
|
-
trellisKey: prop_types_exports.string,
|
|
432
|
-
trellisSplitBy: prop_types_exports.string,
|
|
433
|
-
backgroundColor: prop_types_exports.string,
|
|
434
|
-
defaultFontColor: prop_types_exports.string
|
|
435
|
-
};
|
|
436
402
|
var Charting = (props) => {
|
|
437
403
|
var _a, _b;
|
|
438
404
|
const container = (0, react_exports.useRef)(null);
|
|
@@ -456,22 +422,22 @@ var Charting = (props) => {
|
|
|
456
422
|
const splunkTheme = useSplunkTheme_default();
|
|
457
423
|
const themeKey = props.themeKey ? props.themeKey : (0, themeUtils_exports.getChartingThemeKey)({ splunkThemeV1: splunkTheme });
|
|
458
424
|
const {
|
|
459
|
-
width,
|
|
460
|
-
height,
|
|
461
|
-
|
|
425
|
+
width = "100%",
|
|
426
|
+
height = 250,
|
|
427
|
+
options = {},
|
|
428
|
+
style = {},
|
|
462
429
|
chartData,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
onEventTrigger,
|
|
430
|
+
colorPalette = visualization_color_palettes_exports.VIZ_CATEGORICAL,
|
|
431
|
+
onClick = lodash_exports.noop,
|
|
432
|
+
onSelect = lodash_exports.noop,
|
|
433
|
+
onPointMouseOut = lodash_exports.noop,
|
|
434
|
+
onPointMouseOver = lodash_exports.noop,
|
|
435
|
+
onEventTrigger = lodash_exports.noop,
|
|
470
436
|
originalDataSources,
|
|
471
437
|
onDownsamplingThresholdChange,
|
|
472
438
|
xField,
|
|
473
|
-
backgroundColor,
|
|
474
|
-
defaultFontColor,
|
|
439
|
+
backgroundColor = "",
|
|
440
|
+
defaultFontColor = "",
|
|
475
441
|
trellisKey,
|
|
476
442
|
additionalTooltipFields
|
|
477
443
|
} = props;
|
|
@@ -678,10 +644,12 @@ var Charting = (props) => {
|
|
|
678
644
|
const prevTheme = usePrevious(themeKey);
|
|
679
645
|
const prevOnClick = usePrevious(onClick);
|
|
680
646
|
(0, react_exports.useEffect)(() => {
|
|
647
|
+
var _a2;
|
|
681
648
|
debouncedDrawChart();
|
|
682
|
-
props.visualizationApiRef(api.current);
|
|
649
|
+
(_a2 = props == null ? void 0 : props.visualizationApiRef) == null ? void 0 : _a2.call(props, api == null ? void 0 : api.current);
|
|
683
650
|
return () => {
|
|
684
|
-
|
|
651
|
+
var _a3;
|
|
652
|
+
(_a3 = props == null ? void 0 : props.visualizationApiRef) == null ? void 0 : _a3.call(props, null);
|
|
685
653
|
destroyChart();
|
|
686
654
|
};
|
|
687
655
|
}, []);
|
|
@@ -721,45 +689,15 @@ var Charting = (props) => {
|
|
|
721
689
|
/* @__PURE__ */ react_exports.createElement(react_event_listener_default, { target: window, onResize: debouncedDrawChart })
|
|
722
690
|
));
|
|
723
691
|
};
|
|
724
|
-
var defaultProps = {
|
|
725
|
-
width: "100%",
|
|
726
|
-
height: 250,
|
|
727
|
-
options: {},
|
|
728
|
-
style: {},
|
|
729
|
-
// todo: need remove it
|
|
730
|
-
onEventTrigger: lodash_exports.noop,
|
|
731
|
-
onClick: lodash_exports.noop,
|
|
732
|
-
onSelect: lodash_exports.noop,
|
|
733
|
-
onPointMouseOver: lodash_exports.noop,
|
|
734
|
-
onPointMouseOut: lodash_exports.noop,
|
|
735
|
-
colorPalette: visualization_color_palettes_exports.VIZ_CATEGORICAL,
|
|
736
|
-
visualizationApiRef: lodash_exports.noop,
|
|
737
|
-
chartData: null,
|
|
738
|
-
themeKey: null,
|
|
739
|
-
onDownsamplingThresholdChange: null,
|
|
740
|
-
originalDataSources: null,
|
|
741
|
-
xField: null,
|
|
742
|
-
y2Fields: [],
|
|
743
|
-
splitByLayout: void 0,
|
|
744
|
-
trellisKey: void 0,
|
|
745
|
-
trellisSplitBy: void 0,
|
|
746
|
-
backgroundColor: "",
|
|
747
|
-
defaultFontColor: "",
|
|
748
|
-
additionalTooltipFields: []
|
|
749
|
-
};
|
|
750
|
-
Charting.propTypes = propTypes;
|
|
751
|
-
Charting.defaultProps = defaultProps;
|
|
752
692
|
var ChartingWrapper = (props) => {
|
|
753
693
|
const { chartData } = props;
|
|
754
694
|
if (!chartData) {
|
|
755
|
-
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No DataSource"), level: "warning" });
|
|
695
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No DataSource"), level: "warning", width: "100%", height: "100%" });
|
|
756
696
|
}
|
|
757
697
|
if (!Object.keys(chartData).length) {
|
|
758
|
-
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No Result"), level: "info" });
|
|
698
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No Result"), level: "info", width: "100%", height: "100%" });
|
|
759
699
|
}
|
|
760
700
|
return /* @__PURE__ */ react_exports.createElement(Charting, __spreadValues({}, props));
|
|
761
701
|
};
|
|
762
|
-
ChartingWrapper.propTypes = propTypes;
|
|
763
|
-
ChartingWrapper.defaultProps = defaultProps;
|
|
764
702
|
var Charting_default = ChartingWrapper;
|
|
765
703
|
//# sourceMappingURL=Charting.js.map
|
package/common/Charting.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/common/Charting.tsx", "esm-externals:lodash", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/visualization-color-palettes", "esm-externals:react", "esm-externals:
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\nimport { pick, debounce, noop } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport * as React from 'react';\nimport { useContext, useEffect, useRef } from 'react';\nimport * as T from 'prop-types';\nimport EventListener from 'react-event-listener';\nimport '@splunk/visualizations-shared/i18n'; // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions\nimport jsCharting from '@splunk/charting-bundle';\nimport TimezoneContext, { TimezoneContextInterface } from '@splunk/visualization-context/TimezoneContext';\nimport { toDimension } from '@splunk/visualizations-shared/style';\nimport styled from 'styled-components';\nimport Message from '@splunk/visualizations-shared/Message';\nimport useSplunkTheme from '@splunk/themes/useSplunkTheme';\nimport { getChartingThemeKey } from '@splunk/visualizations-shared/themeUtils';\nimport { LAYOUT_TYPE } from '@splunk/visualization-schemas';\nimport { ChartingApiFunctional } from './ChartingApi';\nimport usePrevious from './hooks/usePrevious';\nimport useEventCallback from './hooks/useEventCallback';\nimport { DataSource } from './interfaces';\nimport { calculateDownsamplingThreshold } from './utils/dataUtils';\nimport type { ChartEvent } from './interfaces/ChartEvent';\nimport { useTrellisEnabled } from './hooks/useTrellisEnabled';\nimport { TrellisTitle, TRELLIS_TITLE_HEIGHT } from './components/TrellisTitle';\n\nexport const NO_INPLACE_PROPS = [\n 'chart',\n 'chart.orientation',\n 'layout.splitSeries',\n 'chart.style',\n 'legend.placement',\n];\n\nexport const appendTrellisToPayload = (\n props: ChartingProps,\n payload: Record<string, unknown>\n): Record<string, unknown> => {\n if (props.trellisSplitBy) {\n // eslint-disable-next-line no-param-reassign\n payload['trellis.name'] = props.trellisSplitBy;\n }\n if (props.trellisKey) {\n // eslint-disable-next-line no-param-reassign\n payload['trellis.value'] = props.trellisKey;\n }\n return payload;\n};\n\nexport const changedOptions = (\n curOptions: Record<string, unknown>,\n nextOptions: Record<string, unknown>\n): string[] =>\n Object.keys(curOptions)\n .filter(key => !(key in nextOptions))\n .concat(\n Object.keys(nextOptions).filter(\n key => !(key in curOptions) || curOptions[key] !== nextOptions[key]\n )\n );\n\nexport const canUpdateInPlace = (\n curOptions: Record<string, unknown>,\n nextOptions: Record<string, unknown>\n): boolean => {\n // if either of the options are undefined\n // it cannot update in place.\n if (!curOptions || !nextOptions) {\n return false;\n }\n return (\n !NO_INPLACE_PROPS.some(p => curOptions[p] !== nextOptions[p]) &&\n !changedOptions(curOptions, nextOptions).some(p => p.toLowerCase().endsWith('color'))\n );\n};\n\n// create 'row' payloads from 'rowContext' in the flattened format:\n// row.<fieldname>.value\nexport const updateRowPayload = (\n chartEventRowContext: Record<string, unknown>,\n payload: Record<string, unknown>\n): Record<string, unknown> => {\n Object.keys(chartEventRowContext || {}).forEach(key => {\n // eslint-disable-next-line no-param-reassign\n payload[`${key}.value`] = chartEventRowContext[key];\n });\n\n return payload;\n};\n\nexport interface ContainerProps {\n width: string | number;\n height: string | number;\n}\n\nenum VizChartEventType {\n POINT_CLICK = 'point.click',\n POINT_MOUSE_OUT = 'point.mouseout',\n POINT_MOUSE_OVER = 'point.mouseover',\n LEGEND_CLICK = 'legend.click',\n}\n\n// @TODO(pwied): remove after HC upgrade to 8+\n// .highcharts-a11y-proxy-container rule addresses a HighCharts < 8 bug\n// caused by the accessibility plugin\n// https://github.com/highcharts/highcharts/issues/12883\nconst ChartingContainer = styled.div.attrs((props: ContainerProps) => ({\n 'data-test': 'charting-container',\n width: props.width,\n height: props.height,\n}))`\n & .highcharts-a11y-proxy-container {\n pointer-events: none;\n }\n overflow: hidden;\n position: relative;\n ${props => toDimension(pick(props, ['width', 'height']))};\n`;\n\nexport interface ChartingProps {\n // width in pixel or string, defaults to 100%\n width: string | number;\n // height in pixel or string\n height: string | number;\n // visualization formatting options\n options?: Record<string, any>;\n // charting dataset from jsCharting.extractChartReadyData\n chartData: Record<string, any>;\n // callbacks to trigger event\n onEventTrigger?: (...args: any[]) => void;\n onSelect?: (...args: any[]) => void;\n onClick?: (...args: any[]) => void;\n onPointMouseOver?: (...args: any[]) => void;\n onPointMouseOut?: (...args: any[]) => void;\n // Custom style on visualization\n style?: Record<string, unknown>;\n colorPalette?: Array<string>;\n visualizationApiRef?: (...args: any[]) => void;\n themeKey?: string;\n // The non-downsampled data sources used by this chart. Passed in if downsampling\n // is enabled for this chart.\n originalDataSources?: Record<string, DataSource> | null;\n // Callback for when downsampling threshold changes. Passed in if downsampling\n // is enabled for this chart.\n onDownsamplingThresholdChange?: (threshold: number) => void | null;\n // The xField for this chart if it is an axis chart\n xField?: string;\n // The y2Fields for this chart if it is specified and it is an axis chart\n y2Fields?: string[];\n // The additional tooltip fields for this chart if it is specified and it is an axis chart\n additionalTooltipFields?: string[];\n splitByLayout?: LAYOUT_TYPE;\n trellisKey?: string;\n trellisSplitBy?: string;\n backgroundColor?: string;\n defaultFontColor?: string;\n}\n\nconst propTypes: Record<keyof ChartingProps, T.Validator<any>> = {\n width: T.oneOfType([T.string, T.number]),\n height: T.oneOfType([T.string, T.number]),\n options: T.object,\n chartData: T.object,\n onEventTrigger: T.func,\n onClick: T.func,\n onSelect: T.func,\n onPointMouseOver: T.func,\n onPointMouseOut: T.func,\n style: T.object,\n colorPalette: T.array,\n visualizationApiRef: T.func,\n themeKey: T.string,\n originalDataSources: T.object,\n onDownsamplingThresholdChange: T.func,\n xField: T.string,\n y2Fields: T.array,\n additionalTooltipFields: T.array,\n splitByLayout: T.oneOf(Object.values(LAYOUT_TYPE)),\n trellisKey: T.string,\n trellisSplitBy: T.string,\n backgroundColor: T.string,\n defaultFontColor: T.string,\n};\n\nconst Charting: React.FC<ChartingProps> = props => {\n const container = useRef<HTMLDivElement>(null);\n const needsInit = useRef<boolean>(true);\n const chart = useRef<jsCharting>();\n const needsRedraw = useRef<boolean>(true);\n const api = useRef(new ChartingApiFunctional(chart));\n const timezone = useContext<TimezoneContextInterface>(TimezoneContext);\n const selectChartEvent = useRef<ChartEvent<'chartRangeSelect'>>(null);\n const trellisEnabled = useTrellisEnabled(props.splitByLayout);\n\n const computeChartingSize = () => {\n if (container.current) {\n const rect = container.current.getBoundingClientRect();\n return {\n height: rect.height,\n width: rect.width,\n };\n }\n return {};\n };\n const splunkTheme = useSplunkTheme();\n const themeKey = props.themeKey ? props.themeKey : getChartingThemeKey({ splunkThemeV1: splunkTheme });\n const {\n width,\n height,\n style,\n chartData,\n options,\n colorPalette,\n onClick,\n onSelect,\n onPointMouseOut,\n onPointMouseOver,\n onEventTrigger,\n originalDataSources,\n onDownsamplingThresholdChange,\n xField,\n backgroundColor,\n defaultFontColor,\n trellisKey,\n additionalTooltipFields,\n } = props;\n const prevOptions = usePrevious(options);\n const prevTimezone = usePrevious(timezone);\n\n const handleClick = (\n chartEvent: ChartEvent<'pointClick' | 'legendClick'>,\n type: VizChartEventType\n ): void => {\n let payload: Partial<ChartEvent<'pointClick' | 'legendClick'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n\n if (type === VizChartEventType.POINT_CLICK) {\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = updateRowPayload(chartEvent.rowContext, payload);\n }\n\n payload = appendTrellisToPayload(props, payload);\n\n onClick({\n type,\n originalEvent: chartEvent,\n payload,\n });\n };\n\n const destroyChart = (): void => {\n if (chart.current) {\n chart.current.destroy();\n chart.current = null;\n }\n needsRedraw.current = true;\n needsInit.current = true;\n };\n\n const enableSearchZoom = chartData?.chartDataOptions?.enableSearchZoom ?? false;\n const recalculateDownsamplingThreshold = React.useCallback(() => {\n if (!onDownsamplingThresholdChange || !xField) {\n return;\n }\n\n const newThreshold = calculateDownsamplingThreshold({\n enableSearchZoom,\n dataSources: originalDataSources,\n width: Number(width),\n selectChartEvent: selectChartEvent.current,\n xField,\n });\n\n if (Number.isFinite(newThreshold)) {\n onDownsamplingThresholdChange(newThreshold);\n }\n }, [enableSearchZoom, originalDataSources, onDownsamplingThresholdChange, width, xField]);\n\n React.useEffect(() => {\n recalculateDownsamplingThreshold();\n }, [recalculateDownsamplingThreshold]);\n\n // useEventCallback is used for these handlers to make sure that they are a stable reference and\n // we always use the latest version of the callback\n // Since chart drawing is debounced, there is a race condition where a stale callback may be called\n // if a prop changes and the event handler is called before the chart redraws. This means that\n // it will use the old callback rather than the newer one, which can lead to inaccurate results\n const handleSelect = useEventCallback((chartEvent: ChartEvent<'chartRangeSelect'>): void => {\n selectChartEvent.current = chartEvent;\n recalculateDownsamplingThreshold();\n const payload = appendTrellisToPayload(\n props,\n pick(chartEvent, 'startXIndex', 'endXIndex', 'startXValue', 'endXValue')\n );\n\n // todo: need change this after breaking all visualizations\n if (onSelect && typeof onSelect === 'function') {\n onSelect({\n type: 'range.select',\n originalEvent: chartEvent,\n payload,\n });\n\n return;\n }\n\n // the chartEvent here is a jQuery event\n onEventTrigger({\n type: 'range.select',\n originalEvent: chartEvent,\n payload,\n });\n });\n\n const handlePointMouseOut = useEventCallback(\n (chartEvent: ChartEvent<'pointMouseOut'>, type: VizChartEventType): void => {\n let payload: Partial<ChartEvent<'pointMouseOut'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey',\n 'tooltipContext'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));\n\n onPointMouseOut({\n type,\n originalEvent: chartEvent,\n payload,\n });\n }\n );\n\n const handlePointMouseOver = useEventCallback(\n (chartEvent: ChartEvent<'pointMouseOver'>, type: VizChartEventType): void => {\n let payload: Partial<ChartEvent<'pointMouseOver'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey',\n 'tooltipContext'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));\n\n onPointMouseOver({\n type,\n originalEvent: chartEvent,\n payload,\n });\n }\n );\n\n const drawChart = (): void => {\n const updatedOptions = { ...options, shouldColorizeTooltipData: false };\n const computedChartSize = computeChartingSize();\n const computedWidth = computedChartSize.width;\n const computedHeight = computedChartSize.height;\n const serializedTimezone = timezone?.serializedTimezone;\n const ianaTimezone = timezone?.ianaTimezone;\n const utcOffset = timezone?.utcOffset;\n if (!computedWidth || !computedHeight) {\n return;\n }\n if (!chartData || !Object.keys(chartData).length) {\n return;\n }\n\n // splunk-charting layers configuration option updates.\n // when an option is removed it needs to be set to an empty string\n // to override the previous configuration\n if (prevOptions) {\n Object.keys(prevOptions).forEach(key => {\n if (prevOptions[key] && updatedOptions[key] === undefined) {\n updatedOptions[key] = '';\n }\n });\n }\n\n try {\n if (needsInit.current) {\n destroyChart();\n jsCharting.setTheme(themeKey);\n if (colorPalette.length > 0) {\n jsCharting.setColorPalette(colorPalette);\n }\n chart.current = jsCharting.createChart(container.current, {\n ...updatedOptions,\n drilldown: 'all',\n ...(typeof serializedTimezone === 'string' && {\n 'time.serializedTz': serializedTimezone,\n }),\n ...(typeof ianaTimezone === 'string' && {\n 'time.ianaTimezone': ianaTimezone,\n }),\n ...(typeof utcOffset === 'number' && {\n 'time.timezoneOffset': utcOffset,\n }),\n });\n // bind event handlers\n chart.current.on('pointClick', e => {\n handleClick(e, VizChartEventType.POINT_CLICK);\n });\n chart.current.on('pointMouseOver', e => {\n handlePointMouseOver(e, VizChartEventType.POINT_MOUSE_OVER);\n });\n chart.current.on('pointMouseOut', e => {\n handlePointMouseOut(e, VizChartEventType.POINT_MOUSE_OUT);\n });\n chart.current.on('legendClick', e => {\n handleClick(e, VizChartEventType.LEGEND_CLICK);\n });\n chart.current.on('chartRangeSelect', handleSelect);\n }\n if (needsRedraw.current) {\n jsCharting.setTheme(themeKey);\n if (colorPalette.length > 0) {\n jsCharting.setColorPalette(colorPalette);\n }\n const payload = appendTrellisToPayload(props, {\n width,\n height,\n currentTime: new Date().getTime(),\n });\n chart.current.prepareAndDraw(chartData, updatedOptions, () => {\n onEventTrigger({\n type: 'viz.renderedWithData',\n payload,\n });\n });\n }\n if (chart.current) {\n if (\n Math.round(chart.current.height) !== Math.round(computedHeight) ||\n Math.round(chart.current.width) !== Math.round(computedWidth)\n ) {\n chart.current.resize(computedWidth, computedHeight);\n }\n }\n needsInit.current = false;\n needsRedraw.current = false;\n } catch (e) {\n window.console.error('Caught error rendering chart:', e);\n }\n };\n\n const debouncedDrawChart = debounce(drawChart, 5);\n\n const onContainerMount = chartingContainer => {\n container.current = chartingContainer;\n debouncedDrawChart();\n };\n\n const prevTheme = usePrevious(themeKey);\n const prevOnClick = usePrevious(onClick);\n\n useEffect(() => {\n debouncedDrawChart();\n props.visualizationApiRef(api.current);\n return () => {\n props.visualizationApiRef(null);\n destroyChart();\n };\n }, []);\n\n useEffect(() => {\n // TODO: figure out why re-init is needed for functional components (i.e. PlatformViz) when changing theme\n // seems like redraw doesn't suffice to update the background colors\n if (\n !chart.current ||\n !canUpdateInPlace(prevOptions, options) ||\n // timezone is a simple object so this comparison should be fast\n JSON.stringify(prevTimezone) !== JSON.stringify(timezone) ||\n (!props.themeKey && prevTheme !== themeKey) ||\n prevOnClick !== onClick\n ) {\n needsInit.current = true;\n }\n // need to immediately call drawChart upon an option or chartData change\n // otherwise a noop would occur if the onContainerMount drawChart is re-invoked when dimensions change\n needsRedraw.current = true;\n drawChart();\n }, [\n JSON.stringify(options),\n JSON.stringify(chartData.toJSON()),\n JSON.stringify(chartData.annotations),\n timezone?.ianaTimezone,\n timezone?.utcOffset,\n timezone?.serializedTimezone,\n themeKey,\n onClick,\n additionalTooltipFields,\n ]);\n\n return (\n <>\n {trellisEnabled && (\n <TrellisTitle\n trellisKey={trellisKey}\n backgroundColor={backgroundColor}\n fontColor={defaultFontColor}\n />\n )}\n <ChartingContainer\n style={style}\n ref={onContainerMount}\n width={width}\n height={trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height}\n >\n <EventListener target={window} onResize={debouncedDrawChart} />\n </ChartingContainer>\n </>\n );\n};\n\nconst defaultProps: Record<keyof ChartingProps, any> = {\n width: '100%',\n height: 250,\n options: {},\n style: {},\n // todo: need remove it\n onEventTrigger: noop,\n onClick: noop,\n onSelect: noop,\n onPointMouseOver: noop,\n onPointMouseOut: noop,\n colorPalette: VIZ_CATEGORICAL,\n visualizationApiRef: noop,\n chartData: null,\n themeKey: null,\n onDownsamplingThresholdChange: null,\n originalDataSources: null,\n xField: null,\n y2Fields: [],\n splitByLayout: undefined,\n trellisKey: undefined,\n trellisSplitBy: undefined,\n backgroundColor: '',\n defaultFontColor: '',\n additionalTooltipFields: [],\n};\n\nCharting.propTypes = propTypes;\nCharting.defaultProps = defaultProps;\n\n// allow for early return in case of empty chartData while still following hook rules\nconst ChartingWrapper: React.FC<ChartingProps> = props => {\n const { chartData } = props;\n\n if (!chartData) {\n return <Message message={_('No DataSource')} level=\"warning\" />;\n }\n\n if (!Object.keys(chartData).length) {\n return <Message message={_('No Result')} level=\"info\" />;\n }\n\n return <Charting {...props} />;\n};\n\nChartingWrapper.propTypes = propTypes;\nChartingWrapper.defaultProps = defaultProps;\nexport default ChartingWrapper;\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\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", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes\";\nexport * from \"@splunk/visualization-color-palettes\";\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 \"prop-types\";\nexport * from \"prop-types\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"react-event-listener\";\nexport * from \"react-event-listener\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/i18n\";\nexport * from \"@splunk/visualizations-shared/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/charting-bundle\";\nexport * from \"@splunk/charting-bundle\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-context/TimezoneContext\";\nexport * from \"@splunk/visualization-context/TimezoneContext\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/style\";\nexport * from \"@splunk/visualizations-shared/style\";\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/visualizations-shared/Message\";\nexport * from \"@splunk/visualizations-shared/Message\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/useSplunkTheme\";\nexport * from \"@splunk/themes/useSplunkTheme\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/themeUtils\";\nexport * from \"@splunk/visualizations-shared/themeUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import jsCharting from '@splunk/charting-bundle';\n\ninterface Point {\n /**\n * Valid xValue of the chart\n *\n * @type {string|number}\n * @memberof Point\n */\n xValue?: string | number;\n\n /**\n * Valid seriesName for a chart\n *\n * @type {string}\n * @memberof Point\n */\n seriesName?: string;\n}\n\nexport class ChartingApiFunctional {\n // eslint-disable-next-line no-useless-constructor\n constructor(private chartRef: any) {}\n\n /**\n * Allows users to programmatically highlight a point on the chart\n *\n * @memberof ChartingApiFunctional\n */\n highlight({ xValue, seriesName }: Point = { xValue: '', seriesName: '' }): void {\n this.getChart().highlight(xValue, seriesName);\n }\n\n /**\n * Allows users to programmatically unhighlight all points on the chart\n *\n * @memberof ChartingApiFunctional\n */\n unHighlight(): void {\n this.getChart().unHighlight();\n }\n\n // returns chart object\n getChart(): jsCharting {\n return this.chartRef?.current;\n }\n}\n", "import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T>();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n", "import { useRef, useLayoutEffect, useCallback } from 'react';\n\n/**\n * This is an escape hatch for the case where an event handler function depends on some states that changes too often thus the event handle is recreated frequently which causes bugs in some edge cases.\n *\n * For example if an old callback is called, it may not use the most recent props, but the previous props when that callback was created.\n */\n\ntype Fn<ARGS extends any[], R> = (...args: ARGS) => R;\nconst useEventCallback = <A extends any[], R>(fn: Fn<A, R>): Fn<A, R> => {\n const ref = useRef<Fn<A, R>>(fn);\n useLayoutEffect(() => {\n ref.current = fn;\n });\n return useCallback((...args: A): R => ref.current(...args), []);\n};\n\nexport default useEventCallback;\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/numberUtils\";\nexport * from \"@splunk/visualizations-shared/numberUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "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\n// TODO: utilize this fn in ParallelCoordinates\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 = typeof field === 'string' ? field : field.name;\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\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 = (field as FieldEntry).name ?? 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/visualization-context/FeatureFlagContext\";\nexport * from \"@splunk/visualization-context/FeatureFlagContext\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { useContext } from 'react';\nimport FeatureFlagContext from '@splunk/visualization-context/FeatureFlagContext';\nimport { LAYOUT_TYPE } from '@splunk/visualization-schemas';\n\nexport const useTrellisFeatureFlagOn = (): boolean => {\n const context = useContext(FeatureFlagContext) as Record<string, unknown>;\n return Boolean(context?.visualizations_enableTrellis);\n};\n\nexport const useTrellisEnabled = (layoutType = LAYOUT_TYPE.Off): boolean => {\n const trellisFeatureEnabled = useTrellisFeatureFlagOn();\n return trellisFeatureEnabled && layoutType === LAYOUT_TYPE.Trellis;\n};\n", "import * as React from 'react';\nimport styled from 'styled-components';\n\nexport const TRELLIS_TITLE_HEIGHT = 28;\n\nconst TrellisTitleText = styled.div`\n margin-left: 10px;\n margin-right: 10px;\n padding-top: 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nconst TrellisTitleDiv = styled.div<{\n fontColor: string;\n backgroundColor: string;\n}>`\n height: ${TRELLIS_TITLE_HEIGHT}px;\n font-size: 14px;\n font-weight: 700;\n color: ${props => props.fontColor};\n background-color: ${props => props.backgroundColor};\n box-shadow: 0 1px ${props => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.\n`;\n\ninterface TrellisTitleProps {\n fontColor: string;\n backgroundColor: string;\n trellisKey: unknown;\n}\n\nexport const TrellisTitle = (props: TrellisTitleProps) => {\n const titleText = String(props.trellisKey).toString();\n return (\n <TrellisTitleDiv\n fontColor={props.fontColor}\n backgroundColor={props.backgroundColor}\n data-test=\"trellis-title\"\n title={titleText}\n >\n <TrellisTitleText>{titleText}</TrellisTitleText>\n </TrellisTitleDiv>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,yBAAc;AACd,IAAO,eAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,iDAAc;AACd,IAAO,uCAAS,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,+BAAc;AACd,IAAO,qBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AA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iD;AAAA,EACnD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS,CAAC;AAAA,EACV,OAAO,CAAC;AAAA;AAAA,EAER,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,+BAA+B;AAAA,EAC/B,qBAAqB;AAAA,EACrB,QAAQ;AAAA,EACR,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,yBAAyB,CAAC;AAC9B;AAEA,SAAS,YAAY;AACrB,SAAS,eAAe;AAGxB,IAAM,kBAA2C,WAAS;AACtD,QAAM,EAAE,UAAU,IAAI;AAEtB,MAAI,CAAC,WAAW;AACZ,WAAO,4CAAC,mBAAQ,aAAS,gBAAE,eAAe,GAAG,OAAM,WAAU;AAAA,EACjE;AAEA,MAAI,CAAC,OAAO,KAAK,SAAS,EAAE,QAAQ;AAChC,WAAO,4CAAC,mBAAQ,aAAS,gBAAE,WAAW,GAAG,OAAM,QAAO;AAAA,EAC1D;AAEA,SAAO,4CAAC,6BAAa,MAAO;AAChC;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,eAAe;AAC/B,IAAO,mBAAQ;",
|
|
6
|
-
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "
|
|
3
|
+
"sources": ["../src/common/Charting.tsx", "esm-externals:lodash", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/visualization-color-palettes", "esm-externals:react", "esm-externals:react-event-listener", "esm-externals:@splunk/visualizations-shared/i18n", "esm-externals:@splunk/charting-bundle", "esm-externals:@splunk/visualization-context/TimezoneContext", "esm-externals:@splunk/visualizations-shared/style", "esm-externals:styled-components", "esm-externals:@splunk/visualizations-shared/Message", "esm-externals:@splunk/themes/useSplunkTheme", "esm-externals:@splunk/visualizations-shared/themeUtils", "../src/common/ChartingApi.ts", "../src/common/hooks/usePrevious.ts", "../src/common/hooks/useEventCallback.tsx", "esm-externals:@splunk/visualizations-shared/numberUtils", "../src/common/utils/dataUtils.ts", "esm-externals:@splunk/visualization-context/FeatureFlagContext", "esm-externals:@splunk/visualization-schemas", "../src/common/hooks/useTrellisEnabled.ts", "../src/common/components/TrellisTitle.tsx"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\nimport { pick, debounce, noop } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport * as React from 'react';\nimport { useContext, useEffect, useRef } from 'react';\nimport EventListener from 'react-event-listener';\nimport '@splunk/visualizations-shared/i18n'; // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions\nimport jsCharting from '@splunk/charting-bundle';\nimport TimezoneContext, { TimezoneContextInterface } from '@splunk/visualization-context/TimezoneContext';\nimport { toDimension } from '@splunk/visualizations-shared/style';\nimport styled from 'styled-components';\nimport Message from '@splunk/visualizations-shared/Message';\nimport useSplunkTheme from '@splunk/themes/useSplunkTheme';\nimport { getChartingThemeKey } from '@splunk/visualizations-shared/themeUtils';\nimport { LAYOUT_TYPE } from '@splunk/visualization-schemas';\nimport { ChartingApiFunctional } from './ChartingApi';\nimport usePrevious from './hooks/usePrevious';\nimport useEventCallback from './hooks/useEventCallback';\nimport { DataSource } from './interfaces';\nimport { calculateDownsamplingThreshold } from './utils/dataUtils';\nimport type { ChartEvent } from './interfaces/ChartEvent';\nimport { useTrellisEnabled } from './hooks/useTrellisEnabled';\nimport { TrellisTitle, TRELLIS_TITLE_HEIGHT } from './components/TrellisTitle';\n\nexport const NO_INPLACE_PROPS = [\n 'chart',\n 'chart.orientation',\n 'layout.splitSeries',\n 'chart.style',\n 'legend.placement',\n];\n\nexport const appendTrellisToPayload = (\n props: ChartingProps,\n payload: Record<string, unknown>\n): Record<string, unknown> => {\n if (props.trellisSplitBy) {\n // eslint-disable-next-line no-param-reassign\n payload['trellis.name'] = props.trellisSplitBy;\n }\n if (props.trellisKey) {\n // eslint-disable-next-line no-param-reassign\n payload['trellis.value'] = props.trellisKey;\n }\n return payload;\n};\n\nexport const changedOptions = (\n curOptions: Record<string, unknown>,\n nextOptions: Record<string, unknown>\n): string[] =>\n Object.keys(curOptions)\n .filter(key => !(key in nextOptions))\n .concat(\n Object.keys(nextOptions).filter(\n key => !(key in curOptions) || curOptions[key] !== nextOptions[key]\n )\n );\n\nexport const canUpdateInPlace = (\n curOptions: Record<string, unknown>,\n nextOptions: Record<string, unknown>\n): boolean => {\n // if either of the options are undefined\n // it cannot update in place.\n if (!curOptions || !nextOptions) {\n return false;\n }\n return (\n !NO_INPLACE_PROPS.some(p => curOptions[p] !== nextOptions[p]) &&\n !changedOptions(curOptions, nextOptions).some(p => p.toLowerCase().endsWith('color'))\n );\n};\n\n// create 'row' payloads from 'rowContext' in the flattened format:\n// row.<fieldname>.value\nexport const updateRowPayload = (\n chartEventRowContext: Record<string, unknown>,\n payload: Record<string, unknown>\n): Record<string, unknown> => {\n Object.keys(chartEventRowContext || {}).forEach(key => {\n // eslint-disable-next-line no-param-reassign\n payload[`${key}.value`] = chartEventRowContext[key];\n });\n\n return payload;\n};\n\nexport interface ContainerProps {\n width: string | number;\n height: string | number;\n}\n\nenum VizChartEventType {\n POINT_CLICK = 'point.click',\n POINT_MOUSE_OUT = 'point.mouseout',\n POINT_MOUSE_OVER = 'point.mouseover',\n LEGEND_CLICK = 'legend.click',\n}\n\n// @TODO(pwied): remove after HC upgrade to 8+\n// .highcharts-a11y-proxy-container rule addresses a HighCharts < 8 bug\n// caused by the accessibility plugin\n// https://github.com/highcharts/highcharts/issues/12883\nconst ChartingContainer = styled.div.attrs((props: ContainerProps) => ({\n 'data-test': 'charting-container',\n width: props.width,\n height: props.height,\n}))`\n & .highcharts-a11y-proxy-container {\n pointer-events: none;\n }\n overflow: hidden;\n position: relative;\n ${props => toDimension(pick(props, ['width', 'height']))};\n`;\n\nexport interface ChartingProps {\n // width in pixel or string, defaults to 100%\n width: string | number;\n // height in pixel or string\n height: string | number;\n // visualization formatting options\n options?: Record<string, any>;\n // charting dataset from jsCharting.extractChartReadyData\n chartData: Record<string, any>;\n // callbacks to trigger event\n onEventTrigger?: (...args: any[]) => void;\n onSelect?: (...args: any[]) => void;\n onClick?: (...args: any[]) => void;\n onPointMouseOver?: (...args: any[]) => void;\n onPointMouseOut?: (...args: any[]) => void;\n // Custom style on visualization\n style?: Record<string, unknown>;\n colorPalette?: Array<string>;\n visualizationApiRef?: (...args: any[]) => void;\n themeKey?: string;\n // The non-downsampled data sources used by this chart. Passed in if downsampling\n // is enabled for this chart.\n originalDataSources?: Record<string, DataSource> | null;\n // Callback for when downsampling threshold changes. Passed in if downsampling\n // is enabled for this chart.\n onDownsamplingThresholdChange?: (threshold: number) => void | null;\n // The xField for this chart if it is an axis chart\n xField?: string;\n // The yFields for this chart if it is an axis chart\n yFields?: string[];\n // The y2Fields for this chart if it is specified and it is an axis chart\n y2Fields?: string[];\n // The additional tooltip fields for this chart if it is specified and it is an axis chart\n additionalTooltipFields?: string[];\n splitByLayout?: LAYOUT_TYPE;\n trellisKey?: string;\n trellisSplitBy?: string;\n backgroundColor?: string;\n defaultFontColor?: string;\n userLocale?: Record<string, any>;\n annotationX?: string[];\n annotationLabel?: string[];\n annotationColor?: string[];\n}\n\nconst Charting: React.FC<ChartingProps> = props => {\n const container = useRef<HTMLDivElement>(null);\n const needsInit = useRef<boolean>(true);\n const chart = useRef<jsCharting>();\n const needsRedraw = useRef<boolean>(true);\n const api = useRef(new ChartingApiFunctional(chart));\n const timezone = useContext<TimezoneContextInterface>(TimezoneContext);\n const selectChartEvent = useRef<ChartEvent<'chartRangeSelect'>>(null);\n const trellisEnabled = useTrellisEnabled(props.splitByLayout);\n\n const computeChartingSize = () => {\n if (container.current) {\n const rect = container.current.getBoundingClientRect();\n return {\n height: rect.height,\n width: rect.width,\n };\n }\n return {};\n };\n const splunkTheme = useSplunkTheme();\n const themeKey = props.themeKey ? props.themeKey : getChartingThemeKey({ splunkThemeV1: splunkTheme });\n const {\n width = '100%',\n height = 250,\n options = {},\n style = {},\n chartData,\n colorPalette = VIZ_CATEGORICAL,\n onClick = noop,\n onSelect = noop,\n onPointMouseOut = noop,\n onPointMouseOver = noop,\n onEventTrigger = noop,\n originalDataSources,\n onDownsamplingThresholdChange,\n xField,\n backgroundColor = '',\n defaultFontColor = '',\n trellisKey,\n additionalTooltipFields,\n } = props;\n const prevOptions = usePrevious(options);\n const prevTimezone = usePrevious(timezone);\n\n const handleClick = (\n chartEvent: ChartEvent<'pointClick' | 'legendClick'>,\n type: VizChartEventType\n ): void => {\n let payload: Partial<ChartEvent<'pointClick' | 'legendClick'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n\n if (type === VizChartEventType.POINT_CLICK) {\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = updateRowPayload(chartEvent.rowContext, payload);\n }\n\n payload = appendTrellisToPayload(props, payload);\n\n onClick({\n type,\n originalEvent: chartEvent,\n payload,\n });\n };\n\n const destroyChart = (): void => {\n if (chart.current) {\n chart.current.destroy();\n chart.current = null;\n }\n needsRedraw.current = true;\n needsInit.current = true;\n };\n\n const enableSearchZoom = chartData?.chartDataOptions?.enableSearchZoom ?? false;\n const recalculateDownsamplingThreshold = React.useCallback(() => {\n if (!onDownsamplingThresholdChange || !xField) {\n return;\n }\n\n const newThreshold = calculateDownsamplingThreshold({\n enableSearchZoom,\n dataSources: originalDataSources,\n width: Number(width),\n selectChartEvent: selectChartEvent.current,\n xField,\n });\n\n if (Number.isFinite(newThreshold)) {\n onDownsamplingThresholdChange(newThreshold);\n }\n }, [enableSearchZoom, originalDataSources, onDownsamplingThresholdChange, width, xField]);\n\n React.useEffect(() => {\n recalculateDownsamplingThreshold();\n }, [recalculateDownsamplingThreshold]);\n\n // useEventCallback is used for these handlers to make sure that they are a stable reference and\n // we always use the latest version of the callback\n // Since chart drawing is debounced, there is a race condition where a stale callback may be called\n // if a prop changes and the event handler is called before the chart redraws. This means that\n // it will use the old callback rather than the newer one, which can lead to inaccurate results\n const handleSelect = useEventCallback((chartEvent: ChartEvent<'chartRangeSelect'>): void => {\n selectChartEvent.current = chartEvent;\n recalculateDownsamplingThreshold();\n const payload = appendTrellisToPayload(\n props,\n pick(chartEvent, 'startXIndex', 'endXIndex', 'startXValue', 'endXValue')\n );\n\n // todo: need change this after breaking all visualizations\n if (onSelect && typeof onSelect === 'function') {\n onSelect({\n type: 'range.select',\n originalEvent: chartEvent,\n payload,\n });\n\n return;\n }\n\n // the chartEvent here is a jQuery event\n onEventTrigger({\n type: 'range.select',\n originalEvent: chartEvent,\n payload,\n });\n });\n\n const handlePointMouseOut = useEventCallback(\n (chartEvent: ChartEvent<'pointMouseOut'>, type: VizChartEventType): void => {\n let payload: Partial<ChartEvent<'pointMouseOut'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey',\n 'tooltipContext'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));\n\n onPointMouseOut({\n type,\n originalEvent: chartEvent,\n payload,\n });\n }\n );\n\n const handlePointMouseOver = useEventCallback(\n (chartEvent: ChartEvent<'pointMouseOver'>, type: VizChartEventType): void => {\n let payload: Partial<ChartEvent<'pointMouseOver'>> = pick(\n chartEvent,\n 'name2',\n 'value2',\n '_span',\n 'modifierKey',\n 'tooltipContext'\n );\n\n payload.name = payload.name2;\n delete payload.name2;\n payload.value = payload.value2;\n delete payload.value2;\n\n payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));\n\n onPointMouseOver({\n type,\n originalEvent: chartEvent,\n payload,\n });\n }\n );\n\n const drawChart = (): void => {\n const updatedOptions = { ...options, shouldColorizeTooltipData: false };\n const computedChartSize = computeChartingSize();\n const computedWidth = computedChartSize.width;\n const computedHeight = computedChartSize.height;\n const serializedTimezone = timezone?.serializedTimezone;\n const ianaTimezone = timezone?.ianaTimezone;\n const utcOffset = timezone?.utcOffset;\n if (!computedWidth || !computedHeight) {\n return;\n }\n if (!chartData || !Object.keys(chartData).length) {\n return;\n }\n\n // splunk-charting layers configuration option updates.\n // when an option is removed it needs to be set to an empty string\n // to override the previous configuration\n if (prevOptions) {\n Object.keys(prevOptions).forEach(key => {\n if (prevOptions[key] && updatedOptions[key] === undefined) {\n updatedOptions[key] = '';\n }\n });\n }\n\n try {\n if (needsInit.current) {\n destroyChart();\n jsCharting.setTheme(themeKey);\n if (colorPalette.length > 0) {\n jsCharting.setColorPalette(colorPalette);\n }\n chart.current = jsCharting.createChart(container.current, {\n ...updatedOptions,\n drilldown: 'all',\n ...(typeof serializedTimezone === 'string' && {\n 'time.serializedTz': serializedTimezone,\n }),\n ...(typeof ianaTimezone === 'string' && {\n 'time.ianaTimezone': ianaTimezone,\n }),\n ...(typeof utcOffset === 'number' && {\n 'time.timezoneOffset': utcOffset,\n }),\n });\n // bind event handlers\n chart.current.on('pointClick', e => {\n handleClick(e, VizChartEventType.POINT_CLICK);\n });\n chart.current.on('pointMouseOver', e => {\n handlePointMouseOver(e, VizChartEventType.POINT_MOUSE_OVER);\n });\n chart.current.on('pointMouseOut', e => {\n handlePointMouseOut(e, VizChartEventType.POINT_MOUSE_OUT);\n });\n chart.current.on('legendClick', e => {\n handleClick(e, VizChartEventType.LEGEND_CLICK);\n });\n chart.current.on('chartRangeSelect', handleSelect);\n }\n if (needsRedraw.current) {\n jsCharting.setTheme(themeKey);\n if (colorPalette.length > 0) {\n jsCharting.setColorPalette(colorPalette);\n }\n const payload = appendTrellisToPayload(props, {\n width,\n height,\n currentTime: new Date().getTime(),\n });\n chart.current.prepareAndDraw(chartData, updatedOptions, () => {\n onEventTrigger({\n type: 'viz.renderedWithData',\n payload,\n });\n });\n }\n if (chart.current) {\n if (\n Math.round(chart.current.height) !== Math.round(computedHeight) ||\n Math.round(chart.current.width) !== Math.round(computedWidth)\n ) {\n chart.current.resize(computedWidth, computedHeight);\n }\n }\n needsInit.current = false;\n needsRedraw.current = false;\n } catch (e) {\n window.console.error('Caught error rendering chart:', e);\n }\n };\n\n const debouncedDrawChart = debounce(drawChart, 5);\n\n const onContainerMount = chartingContainer => {\n container.current = chartingContainer;\n debouncedDrawChart();\n };\n\n const prevTheme = usePrevious(themeKey);\n const prevOnClick = usePrevious(onClick);\n\n useEffect(() => {\n debouncedDrawChart();\n props?.visualizationApiRef?.(api?.current);\n return () => {\n props?.visualizationApiRef?.(null);\n destroyChart();\n };\n }, []);\n\n useEffect(() => {\n // TODO: figure out why re-init is needed for functional components (i.e. PlatformViz) when changing theme\n // seems like redraw doesn't suffice to update the background colors\n if (\n !chart.current ||\n !canUpdateInPlace(prevOptions, options) ||\n // timezone is a simple object so this comparison should be fast\n JSON.stringify(prevTimezone) !== JSON.stringify(timezone) ||\n (!props.themeKey && prevTheme !== themeKey) ||\n prevOnClick !== onClick\n ) {\n needsInit.current = true;\n }\n // need to immediately call drawChart upon an option or chartData change\n // otherwise a noop would occur if the onContainerMount drawChart is re-invoked when dimensions change\n needsRedraw.current = true;\n drawChart();\n }, [\n JSON.stringify(options),\n JSON.stringify(chartData.toJSON()),\n JSON.stringify(chartData.annotations),\n timezone?.ianaTimezone,\n timezone?.utcOffset,\n timezone?.serializedTimezone,\n themeKey,\n onClick,\n additionalTooltipFields,\n ]);\n\n return (\n <>\n {trellisEnabled && (\n <TrellisTitle\n trellisKey={trellisKey}\n backgroundColor={backgroundColor}\n fontColor={defaultFontColor}\n />\n )}\n <ChartingContainer\n style={style}\n ref={onContainerMount}\n width={width}\n height={trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height}\n >\n <EventListener target={window} onResize={debouncedDrawChart} />\n </ChartingContainer>\n </>\n );\n};\n\n// allow for early return in case of empty chartData while still following hook rules\nconst ChartingWrapper: React.FC<ChartingProps> = props => {\n const { chartData } = props;\n\n if (!chartData) {\n return <Message message={_('No DataSource')} level=\"warning\" width=\"100%\" height=\"100%\" />;\n }\n\n if (!Object.keys(chartData).length) {\n return <Message message={_('No Result')} level=\"info\" width=\"100%\" height=\"100%\" />;\n }\n\n return <Charting {...props} />;\n};\n\nexport default ChartingWrapper;\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\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", "\nimport * as defaultImport from \"@splunk/visualization-color-palettes\";\nexport * from \"@splunk/visualization-color-palettes\";\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 \"react-event-listener\";\nexport * from \"react-event-listener\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/i18n\";\nexport * from \"@splunk/visualizations-shared/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/charting-bundle\";\nexport * from \"@splunk/charting-bundle\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-context/TimezoneContext\";\nexport * from \"@splunk/visualization-context/TimezoneContext\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/style\";\nexport * from \"@splunk/visualizations-shared/style\";\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/visualizations-shared/Message\";\nexport * from \"@splunk/visualizations-shared/Message\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/themes/useSplunkTheme\";\nexport * from \"@splunk/themes/useSplunkTheme\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/themeUtils\";\nexport * from \"@splunk/visualizations-shared/themeUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import jsCharting from '@splunk/charting-bundle';\n\ninterface Point {\n /**\n * Valid xValue of the chart\n *\n * @type {string|number}\n * @memberof Point\n */\n xValue?: string | number;\n\n /**\n * Valid seriesName for a chart\n *\n * @type {string}\n * @memberof Point\n */\n seriesName?: string;\n}\n\nexport class ChartingApiFunctional {\n // eslint-disable-next-line no-useless-constructor\n constructor(private chartRef: any) {}\n\n /**\n * Allows users to programmatically highlight a point on the chart\n *\n * @memberof ChartingApiFunctional\n */\n highlight({ xValue, seriesName }: Point = { xValue: '', seriesName: '' }): void {\n this.getChart().highlight(xValue, seriesName);\n }\n\n /**\n * Allows users to programmatically unhighlight all points on the chart\n *\n * @memberof ChartingApiFunctional\n */\n unHighlight(): void {\n this.getChart().unHighlight();\n }\n\n // returns chart object\n getChart(): jsCharting {\n return this.chartRef?.current;\n }\n}\n", "import { useEffect, useRef } from 'react';\n\nexport default function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T>();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n", "import { useRef, useLayoutEffect, useCallback } from 'react';\n\n/**\n * This is an escape hatch for the case where an event handler function depends on some states that changes too often thus the event handle is recreated frequently which causes bugs in some edge cases.\n *\n * For example if an old callback is called, it may not use the most recent props, but the previous props when that callback was created.\n */\n\ntype Fn<ARGS extends any[], R> = (...args: ARGS) => R;\nconst useEventCallback = <A extends any[], R>(fn: Fn<A, R>): Fn<A, R> => {\n const ref = useRef<Fn<A, R>>(fn);\n useLayoutEffect(() => {\n ref.current = fn;\n });\n return useCallback((...args: A): R => ref.current(...args), []);\n};\n\nexport default useEventCallback;\n", "\nimport * as defaultImport from \"@splunk/visualizations-shared/numberUtils\";\nexport * from \"@splunk/visualizations-shared/numberUtils\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "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\n// TODO: utilize this fn in ParallelCoordinates\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 = typeof field === 'string' ? field : field.name;\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\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 = (field as FieldEntry).name ?? 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/visualization-context/FeatureFlagContext\";\nexport * from \"@splunk/visualization-context/FeatureFlagContext\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-schemas\";\nexport * from \"@splunk/visualization-schemas\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import { useContext } from 'react';\nimport FeatureFlagContext from '@splunk/visualization-context/FeatureFlagContext';\nimport { LAYOUT_TYPE } from '@splunk/visualization-schemas';\n\nexport const useTrellisFeatureFlagOn = (): boolean => {\n const context = useContext(FeatureFlagContext) as Record<string, unknown>;\n return Boolean(context?.visualizations_enableTrellis);\n};\n\nexport const useTrellisEnabled = (layoutType = LAYOUT_TYPE.Off): boolean => {\n const trellisFeatureEnabled = useTrellisFeatureFlagOn();\n return trellisFeatureEnabled && layoutType === LAYOUT_TYPE.Trellis;\n};\n", "import * as React from 'react';\nimport styled from 'styled-components';\n\nexport const TRELLIS_TITLE_HEIGHT = 28;\n\nconst TrellisTitleText = styled.div`\n margin-left: 10px;\n margin-right: 10px;\n padding-top: 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nconst TrellisTitleDiv = styled.div<{\n fontColor: string;\n backgroundColor: string;\n}>`\n height: ${TRELLIS_TITLE_HEIGHT}px;\n font-size: 14px;\n font-weight: 700;\n color: ${props => props.fontColor};\n background-color: ${props => props.backgroundColor};\n box-shadow: 0 1px ${props => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.\n`;\n\ninterface TrellisTitleProps {\n fontColor: string;\n backgroundColor: string;\n trellisKey: unknown;\n}\n\nexport const TrellisTitle = (props: TrellisTitleProps) => {\n const titleText = String(props.trellisKey).toString();\n return (\n <TrellisTitleDiv\n fontColor={props.fontColor}\n backgroundColor={props.backgroundColor}\n data-test=\"trellis-title\"\n title={titleText}\n >\n <TrellisTitleText>{titleText}</TrellisTitleText>\n </TrellisTitleDiv>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,IA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AAW;AACZ,WAAO,4CAAC,mBAAQ,aAAS,gBAAE,eAAe,GAAG,OAAM,WAAU,OAAM,QAAO,QAAO,QAAO;AAAA,EAC5F;AAEA,MAAI,CAAC,OAAO,KAAK,SAAS,EAAE,QAAQ;AAChC,WAAO,4CAAC,mBAAQ,aAAS,gBAAE,WAAW,GAAG,OAAM,QAAO,OAAM,QAAO,QAAO,QAAO;AAAA,EACrF;AAEA,SAAO,4CAAC,6BAAa,MAAO;AAChC;AAEA,IAAO,mBAAQ;",
|
|
6
|
+
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "i18n_exports", "i18n_default", "defaultImport", "i18n_exports", "i18n_default", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport", "window", "defaultImport", "defaultImport", "_a"]
|
|
7
7
|
}
|
|
@@ -191,12 +191,12 @@ var MajorTicks = (_a) => {
|
|
|
191
191
|
height,
|
|
192
192
|
startX,
|
|
193
193
|
startY,
|
|
194
|
-
min,
|
|
195
|
-
max,
|
|
196
|
-
majorUnit,
|
|
197
|
-
orientation,
|
|
198
|
-
showLabels,
|
|
199
|
-
usePercentageRange,
|
|
194
|
+
min = 0,
|
|
195
|
+
max = 100,
|
|
196
|
+
majorUnit = "auto",
|
|
197
|
+
orientation = "horizontal",
|
|
198
|
+
showLabels = true,
|
|
199
|
+
usePercentageRange = false,
|
|
200
200
|
majorTickFillColor,
|
|
201
201
|
majorTickStrokeColor
|
|
202
202
|
} = props;
|
|
@@ -281,13 +281,5 @@ MajorTicks.propTypes = {
|
|
|
281
281
|
majorTickFillColor: prop_types_default.string,
|
|
282
282
|
majorTickStrokeColor: prop_types_default.string
|
|
283
283
|
};
|
|
284
|
-
MajorTicks.defaultProps = {
|
|
285
|
-
min: 0,
|
|
286
|
-
max: 100,
|
|
287
|
-
majorUnit: "auto",
|
|
288
|
-
orientation: "horizontal",
|
|
289
|
-
showLabels: true,
|
|
290
|
-
usePercentageRange: false
|
|
291
|
-
};
|
|
292
284
|
var GaugeMajorTicks_default = MajorTicks;
|
|
293
285
|
//# sourceMappingURL=GaugeMajorTicks.js.map
|