@splunk/visualizations 27.2.0 → 27.3.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.js +17 -9
- package/Area.js.map +2 -2
- package/Bar.js +17 -9
- package/Bar.js.map +2 -2
- package/Bubble.js +8 -8
- package/Bubble.js.map +2 -2
- package/ChoroplethSvg.js +6 -7
- package/ChoroplethSvg.js.map +2 -2
- package/Column.js +17 -9
- package/Column.js.map +2 -2
- package/Ellipse.js +6 -7
- package/Ellipse.js.map +2 -2
- package/Events.js +24 -24
- package/Events.js.map +3 -3
- package/FillerGauge.js +6 -7
- package/FillerGauge.js.map +2 -2
- package/Image.js +6 -7
- package/Image.js.map +2 -2
- package/Line.js +17 -9
- package/Line.js.map +2 -2
- package/LinkGraph.js +25 -25
- package/LinkGraph.js.map +3 -3
- package/Map.js +6 -7
- package/Map.js.map +2 -2
- package/Markdown.js +6 -7
- package/Markdown.js.map +2 -2
- package/MarkerGauge.js +6 -7
- package/MarkerGauge.js.map +2 -2
- package/ParallelCoordinates.js +6 -7
- package/ParallelCoordinates.js.map +2 -2
- package/Pie.js +8 -8
- package/Pie.js.map +2 -2
- package/Punchcard.js +6 -7
- package/Punchcard.js.map +2 -2
- package/Rectangle.js +6 -7
- package/Rectangle.js.map +2 -2
- package/Sankey.js +11 -11
- package/Sankey.js.map +2 -2
- package/Scatter.js +8 -8
- package/Scatter.js.map +2 -2
- package/SingleValue.js +15 -8
- package/SingleValue.js.map +2 -2
- package/SingleValueIcon.js +15 -8
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.js +15 -8
- package/SingleValueRadial.js.map +2 -2
- package/Table.js +6 -7
- package/Table.js.map +2 -2
- package/Timeline.js +82 -32
- package/Timeline.js.map +4 -4
- package/common/Charting.js +2 -1
- package/common/Charting.js.map +2 -2
- package/common/utils/dataUtils.js +2 -1
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/styleUtils.js +29 -0
- package/common/utils/styleUtils.js.map +7 -0
- package/common/utils/trellisUtils.js +9 -1
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.js +6 -7
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +21 -20
package/Timeline.js
CHANGED
|
@@ -839,7 +839,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
839
839
|
FixSizeItem,
|
|
840
840
|
{
|
|
841
841
|
"data-test": "fix-size-item",
|
|
842
|
-
"data-splunk-visualization-version": "27.
|
|
842
|
+
"data-splunk-visualization-version": "27.3.0 - bd2e687fd",
|
|
843
843
|
width,
|
|
844
844
|
height,
|
|
845
845
|
backgroundColor
|
|
@@ -905,7 +905,7 @@ var Cover = styled_components_default.div`
|
|
|
905
905
|
bottom: 0;
|
|
906
906
|
`;
|
|
907
907
|
var Blocker = styled_components_default.div.attrs({
|
|
908
|
-
"data-splunk-visualization-version": "27.
|
|
908
|
+
"data-splunk-visualization-version": "27.3.0 - bd2e687fd"
|
|
909
909
|
})`
|
|
910
910
|
position: relative;
|
|
911
911
|
width: 100%;
|
|
@@ -1569,11 +1569,9 @@ var withDashboardViz = (opts) => {
|
|
|
1569
1569
|
useAsyncEvaluatedOptions
|
|
1570
1570
|
]);
|
|
1571
1571
|
const evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1572
|
-
|
|
1572
|
+
const clonedEvaluatedOptions = __spreadValues({}, evaluatedOptionsToUse);
|
|
1573
1573
|
if (isTrellisOn) {
|
|
1574
|
-
clonedEvaluatedOptions =
|
|
1575
|
-
backgroundColor: clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1576
|
-
});
|
|
1574
|
+
clonedEvaluatedOptions.backgroundColor = clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor;
|
|
1577
1575
|
}
|
|
1578
1576
|
react_exports.useEffect(() => {
|
|
1579
1577
|
onComputedProps(clonedEvaluatedOptions);
|
|
@@ -1632,7 +1630,8 @@ var withDashboardViz = (opts) => {
|
|
|
1632
1630
|
}));
|
|
1633
1631
|
let dataSourceMetadata = {};
|
|
1634
1632
|
const OptionKey = "paginateDataSourceKey";
|
|
1635
|
-
const
|
|
1633
|
+
const optsKey = (0, lodash_exports.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey];
|
|
1634
|
+
const paginateDataSourceKey = typeof optsKey === "string" ? optsKey : "primary";
|
|
1636
1635
|
if (vizConfig.supports.indexOf("page-and-sort" /* PAGE_AND_SORT */) > -1 && (0, lodash_exports.has)(dataSources, paginateDataSourceKey)) {
|
|
1637
1636
|
const requestParams = (0, lodash_exports.get)(dataSources, [paginateDataSourceKey, "requestParams"], {});
|
|
1638
1637
|
const meta = (0, lodash_exports.get)(dataSources, [paginateDataSourceKey, "meta"], {});
|
|
@@ -1676,14 +1675,26 @@ var withDashboardViz = (opts) => {
|
|
|
1676
1675
|
};
|
|
1677
1676
|
var withDashboardViz_default = withDashboardViz;
|
|
1678
1677
|
|
|
1678
|
+
// esm-externals:@splunk/splunk-utils/config
|
|
1679
|
+
var config_exports = {};
|
|
1680
|
+
__export(config_exports, {
|
|
1681
|
+
default: () => config_default2
|
|
1682
|
+
});
|
|
1683
|
+
var defaultImport30 = __toESM(require("@splunk/splunk-utils/config"));
|
|
1684
|
+
__reExport(config_exports, require("@splunk/splunk-utils/config"));
|
|
1685
|
+
var config_default2 = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
|
|
1686
|
+
|
|
1679
1687
|
// esm-externals:@splunk/themes
|
|
1680
1688
|
var themes_exports = {};
|
|
1681
1689
|
__export(themes_exports, {
|
|
1682
1690
|
default: () => themes_default
|
|
1683
1691
|
});
|
|
1684
|
-
var
|
|
1692
|
+
var defaultImport31 = __toESM(require("@splunk/themes"));
|
|
1685
1693
|
__reExport(themes_exports, require("@splunk/themes"));
|
|
1686
|
-
var themes_default = "default" in
|
|
1694
|
+
var themes_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
|
|
1695
|
+
|
|
1696
|
+
// src/common/utils/styleUtils.ts
|
|
1697
|
+
var VIZ_FONT_FAMILY = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
1687
1698
|
|
|
1688
1699
|
// src/Timeline/PureTimeline/src/utils/timelineUtils.ts
|
|
1689
1700
|
function hexToRgba(hex, opacity = 1) {
|
|
@@ -1813,7 +1824,7 @@ var drawRoundedRect = (ctx, x, y, width, height, radius) => {
|
|
|
1813
1824
|
ctx.fill();
|
|
1814
1825
|
ctx.stroke();
|
|
1815
1826
|
};
|
|
1816
|
-
var truncateText = (text, maxWidth, truncationType, font =
|
|
1827
|
+
var truncateText = (text, maxWidth, truncationType, font = `10px ${VIZ_FONT_FAMILY}`) => {
|
|
1817
1828
|
const canvas = document.createElement("canvas");
|
|
1818
1829
|
const context = canvas.getContext("2d");
|
|
1819
1830
|
if (!context) return text;
|
|
@@ -1919,9 +1930,9 @@ var uplot_react_exports = {};
|
|
|
1919
1930
|
__export(uplot_react_exports, {
|
|
1920
1931
|
default: () => uplot_react_default
|
|
1921
1932
|
});
|
|
1922
|
-
var
|
|
1933
|
+
var defaultImport32 = __toESM(require("uplot-react"));
|
|
1923
1934
|
__reExport(uplot_react_exports, require("uplot-react"));
|
|
1924
|
-
var uplot_react_default = "default" in
|
|
1935
|
+
var uplot_react_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
|
|
1925
1936
|
|
|
1926
1937
|
// src/Timeline/PureTimeline/src/CursorPlugin.tsx
|
|
1927
1938
|
var currentScaleFactor = 1;
|
|
@@ -1980,7 +1991,8 @@ var CursorPlugin = ({
|
|
|
1980
1991
|
setHighlightedEvent,
|
|
1981
1992
|
setHighlightedLane,
|
|
1982
1993
|
handleEventClick,
|
|
1983
|
-
tooltipRef
|
|
1994
|
+
tooltipRef,
|
|
1995
|
+
locale
|
|
1984
1996
|
}) => {
|
|
1985
1997
|
const FIXED_LANE_HEIGHT = 32;
|
|
1986
1998
|
const MIN_BAR_WIDTH = 20;
|
|
@@ -2085,11 +2097,11 @@ var CursorPlugin = ({
|
|
|
2085
2097
|
if (showTooltip) {
|
|
2086
2098
|
const displaySeconds = durationPerTick < 6e4 && event.duration !== 0;
|
|
2087
2099
|
const startTime = new Date(event.start).toLocaleTimeString(
|
|
2088
|
-
|
|
2100
|
+
locale,
|
|
2089
2101
|
tooltipLocaleTimeFormat(displaySeconds)
|
|
2090
2102
|
);
|
|
2091
2103
|
const endTime = new Date(event.end).toLocaleTimeString(
|
|
2092
|
-
|
|
2104
|
+
locale,
|
|
2093
2105
|
tooltipLocaleTimeFormat(displaySeconds)
|
|
2094
2106
|
);
|
|
2095
2107
|
const lane = lanes[cursorSeriesIndex - 1];
|
|
@@ -2241,11 +2253,29 @@ var XAxisPlugin = ({
|
|
|
2241
2253
|
durationPerTick = 0,
|
|
2242
2254
|
numTicks = 0,
|
|
2243
2255
|
backgroundColor = "#0b0c0e",
|
|
2244
|
-
tickInterval = "1d"
|
|
2256
|
+
tickInterval = "1d",
|
|
2257
|
+
isFontLoaded = false,
|
|
2258
|
+
locale = "en-US",
|
|
2259
|
+
setIsFontLoaded
|
|
2245
2260
|
} = {}) => {
|
|
2246
2261
|
const themes3 = (0, themes_exports.useSplunkTheme)();
|
|
2262
|
+
const redrawFont = () => {
|
|
2263
|
+
if (!isFontLoaded) {
|
|
2264
|
+
setIsFontLoaded(true);
|
|
2265
|
+
}
|
|
2266
|
+
};
|
|
2247
2267
|
return {
|
|
2248
2268
|
hooks: {
|
|
2269
|
+
init: () => {
|
|
2270
|
+
if (isSafari()) {
|
|
2271
|
+
document.fonts.ready.then(redrawFont);
|
|
2272
|
+
} else {
|
|
2273
|
+
document.fonts.addEventListener("loadingdone", redrawFont);
|
|
2274
|
+
}
|
|
2275
|
+
return () => {
|
|
2276
|
+
if (!isSafari()) document.fonts.removeEventListener("loadingdone", redrawFont);
|
|
2277
|
+
};
|
|
2278
|
+
},
|
|
2249
2279
|
drawClear: (u) => {
|
|
2250
2280
|
const { ctx } = u;
|
|
2251
2281
|
const dpr = window.devicePixelRatio || 1;
|
|
@@ -2270,17 +2300,17 @@ var XAxisPlugin = ({
|
|
|
2270
2300
|
const labels = ticks.map((tick, index) => {
|
|
2271
2301
|
const labelParts = [];
|
|
2272
2302
|
const date = new Date(tick);
|
|
2273
|
-
const time = tickInterval === "1s" ? date.toLocaleTimeString(
|
|
2303
|
+
const time = tickInterval === "1s" ? date.toLocaleTimeString(locale, {
|
|
2274
2304
|
hour: "numeric",
|
|
2275
2305
|
minute: "2-digit",
|
|
2276
2306
|
second: "2-digit"
|
|
2277
|
-
}) : date.toLocaleTimeString(
|
|
2278
|
-
const day = date.toLocaleDateString(
|
|
2307
|
+
}) : date.toLocaleTimeString(locale, { hour: "numeric", minute: "2-digit" });
|
|
2308
|
+
const day = date.toLocaleDateString(locale, {
|
|
2279
2309
|
weekday: "short",
|
|
2280
2310
|
month: "short",
|
|
2281
2311
|
day: "numeric"
|
|
2282
2312
|
});
|
|
2283
|
-
const month = date.toLocaleDateString(
|
|
2313
|
+
const month = date.toLocaleDateString(locale, {
|
|
2284
2314
|
month: "long"
|
|
2285
2315
|
});
|
|
2286
2316
|
const year = date.getFullYear().toString();
|
|
@@ -2302,7 +2332,7 @@ var XAxisPlugin = ({
|
|
|
2302
2332
|
});
|
|
2303
2333
|
ctx.save();
|
|
2304
2334
|
ctx.scale(dpr, dpr);
|
|
2305
|
-
ctx.font =
|
|
2335
|
+
ctx.font = `10px ${VIZ_FONT_FAMILY}`;
|
|
2306
2336
|
ctx.fillStyle = themes3.contentColorMuted;
|
|
2307
2337
|
ctx.textAlign = "left";
|
|
2308
2338
|
ctx.textBaseline = "top";
|
|
@@ -2371,6 +2401,10 @@ var YAxisLane = styled_components_default.div`
|
|
|
2371
2401
|
background-color: ${({ isEven, backgroundColor }) => isEven ? hexToRgba(backgroundColor) : getAlternateColor(backgroundColor, 0.1)};
|
|
2372
2402
|
box-sizing: border-box;
|
|
2373
2403
|
color: ${({ color }) => `${color}`};
|
|
2404
|
+
cursor: ${({ clickable }) => clickable ? "default" : "inherit"};
|
|
2405
|
+
&:hover {
|
|
2406
|
+
cursor: ${({ clickable }) => clickable ? "pointer" : "inherit"};
|
|
2407
|
+
}
|
|
2374
2408
|
`;
|
|
2375
2409
|
var TimelineYAxis = ({
|
|
2376
2410
|
height,
|
|
@@ -2398,7 +2432,7 @@ var TimelineYAxis = ({
|
|
|
2398
2432
|
lane.toString(),
|
|
2399
2433
|
yAxisLabelWidth - lanePadding,
|
|
2400
2434
|
"ellipsisMiddle",
|
|
2401
|
-
|
|
2435
|
+
`14px ${VIZ_FONT_FAMILY}`
|
|
2402
2436
|
);
|
|
2403
2437
|
return /* @__PURE__ */ react_exports.createElement(
|
|
2404
2438
|
YAxisLane,
|
|
@@ -2409,8 +2443,9 @@ var TimelineYAxis = ({
|
|
|
2409
2443
|
color: laneTextColor,
|
|
2410
2444
|
isEven: (lanes.length - index - 1) % 2 === 0,
|
|
2411
2445
|
backgroundColor,
|
|
2446
|
+
clickable: !!handleLaneClick,
|
|
2412
2447
|
onClick: () => {
|
|
2413
|
-
handleLaneClick(lane);
|
|
2448
|
+
handleLaneClick == null ? void 0 : handleLaneClick(lane);
|
|
2414
2449
|
}
|
|
2415
2450
|
},
|
|
2416
2451
|
truncatedText
|
|
@@ -2555,9 +2590,9 @@ var useSplunkTheme_exports = {};
|
|
|
2555
2590
|
__export(useSplunkTheme_exports, {
|
|
2556
2591
|
default: () => useSplunkTheme_default
|
|
2557
2592
|
});
|
|
2558
|
-
var
|
|
2593
|
+
var defaultImport33 = __toESM(require("@splunk/themes/useSplunkTheme"));
|
|
2559
2594
|
__reExport(useSplunkTheme_exports, require("@splunk/themes/useSplunkTheme"));
|
|
2560
|
-
var useSplunkTheme_default = "default" in
|
|
2595
|
+
var useSplunkTheme_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
|
|
2561
2596
|
|
|
2562
2597
|
// src/Timeline/PureTimeline/src/TimelineTooltip.tsx
|
|
2563
2598
|
var TooltipContainer = styled_components_default.div`
|
|
@@ -2656,9 +2691,9 @@ var uPlot_min_exports = {};
|
|
|
2656
2691
|
__export(uPlot_min_exports, {
|
|
2657
2692
|
default: () => uPlot_min_default
|
|
2658
2693
|
});
|
|
2659
|
-
var
|
|
2694
|
+
var defaultImport34 = __toESM(require("uplot/dist/uPlot.min.css"));
|
|
2660
2695
|
__reExport(uPlot_min_exports, require("uplot/dist/uPlot.min.css"));
|
|
2661
|
-
var uPlot_min_default = "default" in
|
|
2696
|
+
var uPlot_min_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
|
|
2662
2697
|
|
|
2663
2698
|
// src/Timeline/PureTimeline/src/TimelineUplot.tsx
|
|
2664
2699
|
var TimelineUplotContainer = styled_components_default.div`
|
|
@@ -2692,11 +2727,13 @@ var TimelineUplot = ({
|
|
|
2692
2727
|
tickInterval,
|
|
2693
2728
|
handleEventClick,
|
|
2694
2729
|
handleLaneClick,
|
|
2695
|
-
handleLegendClick
|
|
2730
|
+
handleLegendClick,
|
|
2731
|
+
locale
|
|
2696
2732
|
}) => {
|
|
2697
2733
|
const [highlightedCategory, setHighlightedCategory] = react_exports.useState(null);
|
|
2698
2734
|
const [highlightedEvent, setHighlightedEvent] = react_exports.useState(null);
|
|
2699
2735
|
const [highlightedLane, setHighlightedLane] = react_exports.useState(null);
|
|
2736
|
+
const [isFontLoaded, setIsFontLoaded] = react_exports.useState(false);
|
|
2700
2737
|
const tooltipRef = react_exports.useRef({
|
|
2701
2738
|
visible: false,
|
|
2702
2739
|
x: 0,
|
|
@@ -2754,7 +2791,15 @@ var TimelineUplot = ({
|
|
|
2754
2791
|
highlightedCategory,
|
|
2755
2792
|
highlightedEvent
|
|
2756
2793
|
}),
|
|
2757
|
-
XAxisPlugin_default({
|
|
2794
|
+
XAxisPlugin_default({
|
|
2795
|
+
durationPerTick,
|
|
2796
|
+
numTicks,
|
|
2797
|
+
backgroundColor,
|
|
2798
|
+
tickInterval,
|
|
2799
|
+
isFontLoaded,
|
|
2800
|
+
setIsFontLoaded,
|
|
2801
|
+
locale
|
|
2802
|
+
}),
|
|
2758
2803
|
CursorPlugin_default({
|
|
2759
2804
|
laneSeries,
|
|
2760
2805
|
lanes,
|
|
@@ -2764,7 +2809,8 @@ var TimelineUplot = ({
|
|
|
2764
2809
|
setHighlightedEvent,
|
|
2765
2810
|
setHighlightedLane,
|
|
2766
2811
|
handleEventClick,
|
|
2767
|
-
tooltipRef
|
|
2812
|
+
tooltipRef,
|
|
2813
|
+
locale
|
|
2768
2814
|
})
|
|
2769
2815
|
]
|
|
2770
2816
|
};
|
|
@@ -2827,7 +2873,8 @@ var PureTimeline = (_a) => {
|
|
|
2827
2873
|
legendTruncation,
|
|
2828
2874
|
onEventClick,
|
|
2829
2875
|
onLaneClick,
|
|
2830
|
-
onLegendClick
|
|
2876
|
+
onLegendClick,
|
|
2877
|
+
locale
|
|
2831
2878
|
} = props;
|
|
2832
2879
|
const showLegend = (!dataColors || (dataColors == null ? void 0 : dataColors.length) === 0) && (category == null ? void 0 : category.length) > 0 && (legendDisplay === "right" || legendDisplay === "bottom");
|
|
2833
2880
|
const timezone = react_exports.useContext(TimezoneContext_default);
|
|
@@ -2900,7 +2947,8 @@ var PureTimeline = (_a) => {
|
|
|
2900
2947
|
tickInterval,
|
|
2901
2948
|
handleEventClick,
|
|
2902
2949
|
handleLaneClick,
|
|
2903
|
-
handleLegendClick
|
|
2950
|
+
handleLegendClick,
|
|
2951
|
+
locale
|
|
2904
2952
|
}
|
|
2905
2953
|
)
|
|
2906
2954
|
);
|
|
@@ -2925,6 +2973,7 @@ PureTimeline.propTypes = {
|
|
|
2925
2973
|
resultLimit: prop_types_exports.number,
|
|
2926
2974
|
legendDisplay: prop_types_exports.oneOf(["right", "bottom", "off"]),
|
|
2927
2975
|
legendTruncation: prop_types_exports.oneOf(["ellipsisEnd", "ellipsisMiddle", "ellipsisStart", "ellipsisOff"]),
|
|
2976
|
+
locale: prop_types_exports.string,
|
|
2928
2977
|
onEventClick: prop_types_exports.func,
|
|
2929
2978
|
onLegendClick: prop_types_exports.func,
|
|
2930
2979
|
onLaneClick: prop_types_exports.func,
|
|
@@ -2967,6 +3016,7 @@ PureTimeline.defaultProps = {
|
|
|
2967
3016
|
resultLimit: 1e4,
|
|
2968
3017
|
legendDisplay: "off",
|
|
2969
3018
|
legendTruncation: "ellipsisEnd",
|
|
3019
|
+
locale: config_exports.locale || navigator.language || "en-US",
|
|
2970
3020
|
onEventClick: lodash_exports.noop,
|
|
2971
3021
|
onLaneClick: lodash_exports.noop,
|
|
2972
3022
|
onLegendClick: lodash_exports.noop,
|