@splunk/visualizations 27.5.0 → 28.0.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 +19 -21
- package/Area.config.js.map +3 -3
- package/Area.js +54 -32
- package/Area.js.map +3 -3
- package/Bar.config.js +18 -21
- package/Bar.config.js.map +3 -3
- package/Bar.js +48 -31
- package/Bar.js.map +3 -3
- package/Bubble.config.js +39 -44
- package/Bubble.config.js.map +4 -4
- package/Bubble.js +69 -51
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +35 -7
- package/ChoroplethSvg.config.js +47 -43
- package/ChoroplethSvg.config.js.map +4 -4
- package/ChoroplethSvg.js +72 -45
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +15 -20
- package/Column.config.js.map +3 -3
- package/Column.js +42 -29
- package/Column.js.map +3 -3
- package/Ellipse.config.js +16 -7
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +45 -19
- package/Ellipse.js.map +2 -2
- package/Events.config.js +38 -27
- package/Events.config.js.map +4 -4
- package/Events.js +113 -97
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +9 -9
- package/FillerGauge.config.js +20 -13
- package/FillerGauge.config.js.map +3 -3
- package/FillerGauge.js +76 -27
- package/FillerGauge.js.map +4 -4
- package/Image.config.js +5 -6
- package/Image.config.js.map +2 -2
- package/Image.js +29 -14
- package/Image.js.map +2 -2
- package/Line.config.js +15 -20
- package/Line.config.js.map +3 -3
- package/Line.js +50 -31
- package/Line.js.map +3 -3
- package/LinkGraph.config.js +39 -46
- package/LinkGraph.config.js.map +3 -3
- package/LinkGraph.js +70 -50
- package/LinkGraph.js.map +3 -3
- package/MIGRATION.md +169 -40
- package/Map.config.js +36 -13
- package/Map.config.js.map +4 -4
- package/Map.js +170 -105
- package/Map.js.map +4 -4
- package/Markdown.config.js +4 -5
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +117 -72
- package/Markdown.js.map +3 -3
- package/MarkerGauge.config.js +14 -12
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +107 -69
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.config.js +14 -12
- package/ParallelCoordinates.config.js.map +3 -3
- package/ParallelCoordinates.js +113 -59
- package/ParallelCoordinates.js.map +3 -3
- package/Pie.config.js +51 -38
- package/Pie.config.js.map +4 -4
- package/Pie.js +109 -85
- package/Pie.js.map +4 -4
- package/Punchcard.config.js +36 -34
- package/Punchcard.config.js.map +4 -4
- package/Punchcard.js +153 -87
- package/Punchcard.js.map +4 -4
- package/README.internal.md +15 -15
- package/README.md +10 -10
- package/Rectangle.config.js +16 -7
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +45 -19
- package/Rectangle.js.map +2 -2
- package/Sankey.config.js +69 -17
- package/Sankey.config.js.map +4 -4
- package/Sankey.js +178 -49
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +37 -42
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +70 -53
- package/Scatter.js.map +3 -3
- package/SingleValue.config.js +32 -18
- package/SingleValue.config.js.map +4 -4
- package/SingleValue.js +237 -93
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +1 -0
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon.config.js +22 -11
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +84 -28
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.config.js +34 -23
- package/SingleValueRadial.config.js.map +3 -3
- package/SingleValueRadial.js +89 -48
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +153 -49
- package/SparkLine.js.map +2 -2
- package/Table.config.js +71 -51
- package/Table.config.js.map +3 -3
- package/Table.js +282 -145
- package/Table.js.map +3 -3
- package/Timeline.config.js +36 -34
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +67 -59
- package/Timeline.js.map +4 -4
- package/common/Charting.js +1 -0
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.js +1 -0
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +7 -2
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/EventsDoc.js +31 -5
- package/common/EventsDoc.js.map +4 -4
- package/common/GaugeMajorTicks.js +4 -1
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +31 -3
- package/common/GaugeValueMarker.js.map +4 -4
- package/common/OptionsDoc.js +4 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +66 -50
- package/common/OverviewDoc.js.map +4 -4
- package/common/SplunkVisualization.js +1 -0
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +1 -0
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemedDefaults.js +67 -0
- package/common/ThemedDefaults.js.map +7 -0
- package/common/ThemesDoc.js +6 -9
- package/common/ThemesDoc.js.map +2 -2
- package/common/chartingUtils.js +1 -0
- package/common/chartingUtils.js.map +2 -2
- package/common/docUtils.js +6 -1
- package/common/docUtils.js.map +2 -2
- package/common/gaugeUtils.js +6 -1
- package/common/gaugeUtils.js.map +2 -2
- package/common/shapeUtils.js +6 -4
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/configUtils.js +4 -5
- package/common/utils/configUtils.js.map +2 -2
- package/common/utils/dataUtils.js +1 -0
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +1 -0
- package/common/utils/featureFlagUtils.js.map +1 -1
- package/common/utils/hocUtils.js +1 -0
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/mapUtils.js +35 -22
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/singleValueUtils.js +8 -2
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/styleUtils.js +1 -0
- package/common/utils/styleUtils.js.map +1 -1
- package/common/utils/testHelper.js +1 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +1 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +1 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +25 -8
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +37 -35
package/Punchcard.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright © 2020 Splunk Inc.
|
|
2
2
|
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
3
|
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
"use strict";
|
|
4
5
|
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __defProps = Object.defineProperties;
|
|
@@ -125,41 +126,21 @@ var defaultImport6 = __toESM(require("@splunk/visualization-icons/placeholders")
|
|
|
125
126
|
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
126
127
|
var placeholders_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
127
128
|
|
|
128
|
-
// esm-externals:@splunk/themes/pick
|
|
129
|
-
var pick_exports = {};
|
|
130
|
-
__export(pick_exports, {
|
|
131
|
-
default: () => pick_default
|
|
132
|
-
});
|
|
133
|
-
var defaultImport7 = __toESM(require("@splunk/themes/pick"));
|
|
134
|
-
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
135
|
-
var pick_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
136
|
-
|
|
137
|
-
// esm-externals:@splunk/themes/variables
|
|
138
|
-
var variables_exports = {};
|
|
139
|
-
__export(variables_exports, {
|
|
140
|
-
default: () => variables_default
|
|
141
|
-
});
|
|
142
|
-
var defaultImport8 = __toESM(require("@splunk/themes/variables"));
|
|
143
|
-
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
144
|
-
var variables_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
145
|
-
|
|
146
129
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
147
130
|
var configUtils_exports = {};
|
|
148
131
|
__export(configUtils_exports, {
|
|
149
132
|
default: () => configUtils_default
|
|
150
133
|
});
|
|
151
|
-
var
|
|
134
|
+
var defaultImport7 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
152
135
|
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
153
|
-
var configUtils_default = "default" in
|
|
136
|
+
var configUtils_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
154
137
|
|
|
155
138
|
// src/common/utils/configUtils.ts
|
|
156
139
|
function enhanceConfig(vizConfig) {
|
|
157
140
|
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
158
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
159
|
-
(config3)
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
);
|
|
141
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map((config3) => {
|
|
142
|
+
return __spreadProps(__spreadValues({}, config3), { open: config3.open || false });
|
|
143
|
+
});
|
|
163
144
|
return enhancedConfig;
|
|
164
145
|
}
|
|
165
146
|
|
|
@@ -181,6 +162,33 @@ var background = ({
|
|
|
181
162
|
];
|
|
182
163
|
var BackgroundColor_default = background;
|
|
183
164
|
|
|
165
|
+
// esm-externals:@splunk/themes/pick
|
|
166
|
+
var pick_exports = {};
|
|
167
|
+
__export(pick_exports, {
|
|
168
|
+
default: () => pick_default
|
|
169
|
+
});
|
|
170
|
+
var defaultImport8 = __toESM(require("@splunk/themes/pick"));
|
|
171
|
+
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
172
|
+
var pick_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
173
|
+
|
|
174
|
+
// esm-externals:@splunk/themes/variables
|
|
175
|
+
var variables_exports = {};
|
|
176
|
+
__export(variables_exports, {
|
|
177
|
+
default: () => variables_default
|
|
178
|
+
});
|
|
179
|
+
var defaultImport9 = __toESM(require("@splunk/themes/variables"));
|
|
180
|
+
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
181
|
+
var variables_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
182
|
+
|
|
183
|
+
// src/common/ThemedDefaults.tsx
|
|
184
|
+
var defaultBackgroundColor = (props) => pick_default({
|
|
185
|
+
enterprise: {
|
|
186
|
+
dark: variables_default.black(props),
|
|
187
|
+
light: variables_default.white(props)
|
|
188
|
+
},
|
|
189
|
+
prisma: variables_default.backgroundColorSection(props)
|
|
190
|
+
})(props);
|
|
191
|
+
|
|
184
192
|
// src/Punchcard/config.ts
|
|
185
193
|
var dataContract = {
|
|
186
194
|
requiredDataSources: [
|
|
@@ -210,13 +218,7 @@ var defaultContext = {
|
|
|
210
218
|
}
|
|
211
219
|
};
|
|
212
220
|
var themes = {
|
|
213
|
-
defaultBackgroundColor
|
|
214
|
-
enterprise: {
|
|
215
|
-
dark: variables_default.black(props),
|
|
216
|
-
light: variables_default.backgroundColor(props)
|
|
217
|
-
},
|
|
218
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
219
|
-
})(props)
|
|
221
|
+
defaultBackgroundColor
|
|
220
222
|
};
|
|
221
223
|
var editorConfig = [
|
|
222
224
|
{
|
|
@@ -726,9 +728,14 @@ var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
|
726
728
|
position: relative;
|
|
727
729
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor}};
|
|
728
730
|
`;
|
|
729
|
-
var FixSizeItem = styled_components_default.div.attrs(
|
|
730
|
-
|
|
731
|
-
|
|
731
|
+
var FixSizeItem = styled_components_default.div.attrs(
|
|
732
|
+
({
|
|
733
|
+
width,
|
|
734
|
+
height
|
|
735
|
+
}) => ({
|
|
736
|
+
style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
|
|
737
|
+
})
|
|
738
|
+
)`
|
|
732
739
|
position: relative;
|
|
733
740
|
flex-direction: column;
|
|
734
741
|
flex: 1;
|
|
@@ -762,7 +769,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
762
769
|
FixSizeItem,
|
|
763
770
|
{
|
|
764
771
|
"data-test": "fix-size-item",
|
|
765
|
-
"data-splunk-visualization-version": "
|
|
772
|
+
"data-splunk-visualization-version": "28.0.0 - 0c5f07712",
|
|
766
773
|
width,
|
|
767
774
|
height,
|
|
768
775
|
backgroundColor
|
|
@@ -828,7 +835,7 @@ var Cover = styled_components_default.div`
|
|
|
828
835
|
bottom: 0;
|
|
829
836
|
`;
|
|
830
837
|
var Blocker = styled_components_default.div.attrs({
|
|
831
|
-
"data-splunk-visualization-version": "
|
|
838
|
+
"data-splunk-visualization-version": "28.0.0 - 0c5f07712"
|
|
832
839
|
})`
|
|
833
840
|
position: relative;
|
|
834
841
|
width: 100%;
|
|
@@ -1197,7 +1204,12 @@ var useGetXAndYFields = ({
|
|
|
1197
1204
|
y2Fields: options.y2 ? "> y2 | getField()" : void 0,
|
|
1198
1205
|
fieldTypes: "> primary | getType()"
|
|
1199
1206
|
};
|
|
1200
|
-
const {
|
|
1207
|
+
const {
|
|
1208
|
+
xField = "",
|
|
1209
|
+
yFields = [],
|
|
1210
|
+
y2Fields = [],
|
|
1211
|
+
fieldTypes
|
|
1212
|
+
} = Options_exports.Options.evaluate(
|
|
1201
1213
|
{ options: optionsToEvaluate, context },
|
|
1202
1214
|
dataSourcesWithOnlyOnePoint,
|
|
1203
1215
|
() => {
|
|
@@ -1478,7 +1490,9 @@ var withDashboardViz = (opts) => {
|
|
|
1478
1490
|
return result;
|
|
1479
1491
|
}
|
|
1480
1492
|
} catch (e) {
|
|
1481
|
-
|
|
1493
|
+
if (e instanceof Error) {
|
|
1494
|
+
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
1495
|
+
}
|
|
1482
1496
|
return {};
|
|
1483
1497
|
}
|
|
1484
1498
|
return {};
|
|
@@ -1537,7 +1551,11 @@ var withDashboardViz = (opts) => {
|
|
|
1537
1551
|
if (ev && ev.payload) {
|
|
1538
1552
|
payload = ev.payload;
|
|
1539
1553
|
}
|
|
1540
|
-
return onEventTrigger({
|
|
1554
|
+
return onEventTrigger({
|
|
1555
|
+
originalEvent: ev,
|
|
1556
|
+
payload,
|
|
1557
|
+
type: eventName
|
|
1558
|
+
});
|
|
1541
1559
|
};
|
|
1542
1560
|
if (parentKeys) {
|
|
1543
1561
|
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
@@ -1917,6 +1935,30 @@ var getElementToFocus = ({
|
|
|
1917
1935
|
}
|
|
1918
1936
|
return newEl;
|
|
1919
1937
|
};
|
|
1938
|
+
function calculateLuminance(fg, bg) {
|
|
1939
|
+
const hexToRgb = (hex) => {
|
|
1940
|
+
const clean = hex == null ? void 0 : hex.replace("#", "");
|
|
1941
|
+
const r2 = parseInt(clean.slice(0, 2), 16);
|
|
1942
|
+
const g2 = parseInt(clean.slice(2, 4), 16);
|
|
1943
|
+
const b2 = parseInt(clean.slice(4, 6), 16);
|
|
1944
|
+
const a = clean.length === 8 ? parseInt(clean.slice(6, 8), 16) / 255 : 1;
|
|
1945
|
+
return { r: r2, g: g2, b: b2, a };
|
|
1946
|
+
};
|
|
1947
|
+
const { r: fr, g: fgG, b: fb, a: opacity } = hexToRgb(fg);
|
|
1948
|
+
const { r: br, g: bgG, b: bb } = hexToRgb(bg);
|
|
1949
|
+
const blendChannel = (bgC, fgC) => Math.round(bgC * (1 - opacity) + fgC * opacity);
|
|
1950
|
+
const r = blendChannel(br, fr);
|
|
1951
|
+
const g = blendChannel(bgG, fgG);
|
|
1952
|
+
const b = blendChannel(bb, fb);
|
|
1953
|
+
const linearize = (c) => {
|
|
1954
|
+
const x = c / 255;
|
|
1955
|
+
return x <= 0.03928 ? x / 12.92 : __pow((x + 0.055) / 1.055, 2.4);
|
|
1956
|
+
};
|
|
1957
|
+
const R = linearize(r);
|
|
1958
|
+
const G = linearize(g);
|
|
1959
|
+
const B = linearize(b);
|
|
1960
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1961
|
+
}
|
|
1920
1962
|
|
|
1921
1963
|
// esm-externals:lodash/findIndex
|
|
1922
1964
|
var findIndex_exports = {};
|
|
@@ -1972,9 +2014,25 @@ var TIME_RANGES = {
|
|
|
1972
2014
|
],
|
|
1973
2015
|
wday: [
|
|
1974
2016
|
{ monday: true, mon: true, "mon.": true },
|
|
1975
|
-
{
|
|
2017
|
+
{
|
|
2018
|
+
tuesday: true,
|
|
2019
|
+
tu: true,
|
|
2020
|
+
"tu.": true,
|
|
2021
|
+
tue: true,
|
|
2022
|
+
"tue.": true,
|
|
2023
|
+
tues: true,
|
|
2024
|
+
"tues.": true
|
|
2025
|
+
},
|
|
1976
2026
|
{ wednesday: true, wed: true, "wed.": true },
|
|
1977
|
-
{
|
|
2027
|
+
{
|
|
2028
|
+
thursday: true,
|
|
2029
|
+
th: true,
|
|
2030
|
+
"th.": true,
|
|
2031
|
+
thur: true,
|
|
2032
|
+
"thur.": true,
|
|
2033
|
+
thurs: true,
|
|
2034
|
+
"thurs.": true
|
|
2035
|
+
},
|
|
1978
2036
|
{ friday: true, fri: true, "fri.": true },
|
|
1979
2037
|
{ saturday: true, sat: true, "sat.": true },
|
|
1980
2038
|
{ sunday: true, sun: true, "sun.": true }
|
|
@@ -2083,11 +2141,7 @@ var sortAxis = (axis) => {
|
|
|
2083
2141
|
var AxisLabelText = styled_components_default.text`
|
|
2084
2142
|
cursor: pointer;
|
|
2085
2143
|
dominant-baseline: middle;
|
|
2086
|
-
fill: ${
|
|
2087
|
-
/* was previously named textColor in themeReg */
|
|
2088
|
-
enterprise: variables_default.textColor,
|
|
2089
|
-
prisma: variables_default.contentColorDefault
|
|
2090
|
-
})};
|
|
2144
|
+
fill: ${variables_default.contentColorDefault};
|
|
2091
2145
|
font-size: 12px;
|
|
2092
2146
|
text-anchor: ${(props) => props.orientation === "horizontal" /* HORIZONTAL */ ? "middle" : "start"};
|
|
2093
2147
|
opacity: ${(props) => props.muted ? 0.15 : 1};
|
|
@@ -2159,18 +2213,18 @@ PunchcardAxis.propTypes = propTypes3;
|
|
|
2159
2213
|
PunchcardAxis.defaultProps = defaultProps;
|
|
2160
2214
|
var PunchcardAxis_default = PunchcardAxis;
|
|
2161
2215
|
|
|
2216
|
+
// esm-externals:@splunk/themes
|
|
2217
|
+
var themes_exports = {};
|
|
2218
|
+
__export(themes_exports, {
|
|
2219
|
+
default: () => themes_default
|
|
2220
|
+
});
|
|
2221
|
+
var defaultImport37 = __toESM(require("@splunk/themes"));
|
|
2222
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
2223
|
+
var themes_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
2224
|
+
|
|
2162
2225
|
// src/Punchcard/PurePunchcard/src/PunchcardBubble.tsx
|
|
2163
2226
|
var BubbleCircle = styled_components_default.circle`
|
|
2164
|
-
fill: ${(props) => props.outline ?
|
|
2165
|
-
// bubbleTextColor
|
|
2166
|
-
enterprise: {
|
|
2167
|
-
light: variables_default.white,
|
|
2168
|
-
// equal to enterpriseDark.textColor
|
|
2169
|
-
dark: variables_default.contentColorInverted
|
|
2170
|
-
// enterprise.textColor
|
|
2171
|
-
},
|
|
2172
|
-
prisma: variables_default.contentColorActive
|
|
2173
|
-
})(props) : props.color};
|
|
2227
|
+
fill: ${(props) => props.outline ? themes_exports.variables.contentColorActive : props.color};
|
|
2174
2228
|
fill-opacity: 1;
|
|
2175
2229
|
opacity: ${(props) => props.hover ? 0 : props.fillOpacity};
|
|
2176
2230
|
stroke: ${(props) => props.outline ? props.color : "none"};
|
|
@@ -2197,17 +2251,7 @@ var BubbleGroup = styled_components_default.g`
|
|
|
2197
2251
|
var BubbleLabelText = styled_components_default.text`
|
|
2198
2252
|
dominant-baseline: middle;
|
|
2199
2253
|
opacity: ${(props) => props.displayLabel ? 1 : 0};
|
|
2200
|
-
fill: ${(props) => props.hover || props.outline ?
|
|
2201
|
-
// bubbleAltTextColor
|
|
2202
|
-
enterprise: variables_default.textColor,
|
|
2203
|
-
prisma: variables_default.contentColorActive
|
|
2204
|
-
})(props) : pick_default({
|
|
2205
|
-
enterprise: {
|
|
2206
|
-
dark: variables_default.textColor,
|
|
2207
|
-
light: variables_default.white
|
|
2208
|
-
},
|
|
2209
|
-
prisma: variables_default.contentColorActive
|
|
2210
|
-
})(props)};
|
|
2254
|
+
fill: ${(props) => props.hover || props.outline ? themes_exports.variables.contentColorActive : props.textColor};
|
|
2211
2255
|
font-size: ${(props) => props.hover ? "12px" : "10px"};
|
|
2212
2256
|
font-weight: ${(props) => props.hover ? 500 : "normal"};
|
|
2213
2257
|
text-anchor: middle;
|
|
@@ -2215,6 +2259,7 @@ var BubbleLabelText = styled_components_default.text`
|
|
|
2215
2259
|
var MIN_BUBBLE_SIZE_TO_DISPLAY_LABEL = 13;
|
|
2216
2260
|
var MAX_DISPLAYABLE_VALUE = 99499999999999;
|
|
2217
2261
|
var VALUE_OVERFLOW_TEXT = "99T+";
|
|
2262
|
+
var WCAG_LUMINANCE_THRESHOLD = 0.182;
|
|
2218
2263
|
var PunchcardBubble = (props) => {
|
|
2219
2264
|
const {
|
|
2220
2265
|
showBubbleLabel,
|
|
@@ -2231,16 +2276,22 @@ var PunchcardBubble = (props) => {
|
|
|
2231
2276
|
r,
|
|
2232
2277
|
handlePointClick,
|
|
2233
2278
|
accessibleLabel,
|
|
2234
|
-
tabindex
|
|
2279
|
+
tabindex,
|
|
2280
|
+
backgroundColor
|
|
2235
2281
|
} = props;
|
|
2236
2282
|
const outline = value < 0;
|
|
2237
2283
|
const showPulsateBubble = pulsate && !muted && !hover;
|
|
2238
2284
|
const displayLabel = hover || showBubbleLabel && r >= MIN_BUBBLE_SIZE_TO_DISPLAY_LABEL;
|
|
2239
2285
|
const hasData = !!value;
|
|
2286
|
+
let bubbleTextColor = themes_exports.variables.black;
|
|
2240
2287
|
let bubbleLabelValueText = value <= MAX_DISPLAYABLE_VALUE ? (0, numberUtils_exports.formatNumber)(value, 0, { useTrendUnits: true }) : VALUE_OVERFLOW_TEXT;
|
|
2241
2288
|
if (hover) {
|
|
2242
2289
|
bubbleLabelValueText = (0, numberUtils_exports.formatNumber)(value, 2);
|
|
2243
2290
|
}
|
|
2291
|
+
if (color && backgroundColor) {
|
|
2292
|
+
const luminance = calculateLuminance(color, backgroundColor) || 0;
|
|
2293
|
+
bubbleTextColor = luminance > WCAG_LUMINANCE_THRESHOLD ? themes_exports.variables.black : themes_exports.variables.white;
|
|
2294
|
+
}
|
|
2244
2295
|
return /* @__PURE__ */ react_exports.createElement(
|
|
2245
2296
|
BubbleGroup,
|
|
2246
2297
|
{
|
|
@@ -2274,7 +2325,8 @@ var PunchcardBubble = (props) => {
|
|
|
2274
2325
|
hover,
|
|
2275
2326
|
outline,
|
|
2276
2327
|
displayLabel,
|
|
2277
|
-
"aria-label": accessibleLabel
|
|
2328
|
+
"aria-label": accessibleLabel,
|
|
2329
|
+
textColor: bubbleTextColor
|
|
2278
2330
|
},
|
|
2279
2331
|
hasData ? bubbleLabelValueText : (0, i18n_exports._)("Null")
|
|
2280
2332
|
)
|
|
@@ -2282,6 +2334,7 @@ var PunchcardBubble = (props) => {
|
|
|
2282
2334
|
};
|
|
2283
2335
|
var propTypes4 = {
|
|
2284
2336
|
showBubbleLabel: prop_types_exports.bool,
|
|
2337
|
+
backgroundColor: prop_types_exports.string,
|
|
2285
2338
|
color: prop_types_exports.string,
|
|
2286
2339
|
cx: prop_types_exports.number,
|
|
2287
2340
|
cy: prop_types_exports.number,
|
|
@@ -2299,6 +2352,7 @@ var propTypes4 = {
|
|
|
2299
2352
|
};
|
|
2300
2353
|
var defaultProps2 = {
|
|
2301
2354
|
showBubbleLabel: true,
|
|
2355
|
+
backgroundColor: null,
|
|
2302
2356
|
color: "#46D3BB",
|
|
2303
2357
|
cx: 0,
|
|
2304
2358
|
cy: 0,
|
|
@@ -2325,6 +2379,7 @@ var PunchcardBubble_default = PunchcardBubble;
|
|
|
2325
2379
|
var PunchcardRow = (props) => {
|
|
2326
2380
|
const {
|
|
2327
2381
|
showBubbleLabels,
|
|
2382
|
+
backgroundColor,
|
|
2328
2383
|
category,
|
|
2329
2384
|
colors,
|
|
2330
2385
|
handleMouseEnter,
|
|
@@ -2351,7 +2406,11 @@ var PunchcardRow = (props) => {
|
|
|
2351
2406
|
const cx = xScale(xValue);
|
|
2352
2407
|
const r = radiusValues[index];
|
|
2353
2408
|
const fillOpacity = opacities[index];
|
|
2354
|
-
const hover = isSomethingSelected({
|
|
2409
|
+
const hover = isSomethingSelected({
|
|
2410
|
+
selectedX,
|
|
2411
|
+
selectedY,
|
|
2412
|
+
selectedCategory
|
|
2413
|
+
}) && isBubbleSelected({
|
|
2355
2414
|
selectedX,
|
|
2356
2415
|
selectedY,
|
|
2357
2416
|
selectedCategory,
|
|
@@ -2359,14 +2418,24 @@ var PunchcardRow = (props) => {
|
|
|
2359
2418
|
yValue,
|
|
2360
2419
|
categoryValue
|
|
2361
2420
|
});
|
|
2362
|
-
const muted = isSomethingSelected({
|
|
2421
|
+
const muted = isSomethingSelected({
|
|
2422
|
+
selectedX,
|
|
2423
|
+
selectedY,
|
|
2424
|
+
selectedCategory
|
|
2425
|
+
}) && !hover;
|
|
2363
2426
|
const showBubbleLabel = showBubbleLabels === "all" /* ALL */ || showBubbleLabels === "max" /* MAX */ && maxSizeValue === sizeValue;
|
|
2364
|
-
const accessibleLabel = getBubbleAccessibleName({
|
|
2427
|
+
const accessibleLabel = getBubbleAccessibleName({
|
|
2428
|
+
categoryValue,
|
|
2429
|
+
xValue,
|
|
2430
|
+
yValue,
|
|
2431
|
+
sizeValue
|
|
2432
|
+
});
|
|
2365
2433
|
return /* @__PURE__ */ react_exports.createElement(
|
|
2366
2434
|
PunchcardBubble_default,
|
|
2367
2435
|
{
|
|
2368
2436
|
key: `${xValue}-${yValue}-${sizeValue}-${categoryValue}`,
|
|
2369
2437
|
showBubbleLabel,
|
|
2438
|
+
backgroundColor,
|
|
2370
2439
|
color: colorValue,
|
|
2371
2440
|
cx,
|
|
2372
2441
|
cy: yPosition,
|
|
@@ -2389,6 +2458,7 @@ var PunchcardRow = (props) => {
|
|
|
2389
2458
|
};
|
|
2390
2459
|
var propTypes5 = {
|
|
2391
2460
|
showBubbleLabels: prop_types_exports.oneOf(Object.values(BUBBLE_LABELS_TYPES)),
|
|
2461
|
+
backgroundColor: prop_types_exports.string,
|
|
2392
2462
|
category: prop_types_exports.arrayOf(prop_types_exports.string),
|
|
2393
2463
|
colors: prop_types_exports.arrayOf(prop_types_exports.string),
|
|
2394
2464
|
handleMouseEnter: prop_types_exports.func,
|
|
@@ -2409,6 +2479,7 @@ var propTypes5 = {
|
|
|
2409
2479
|
handlePointClick: prop_types_exports.func
|
|
2410
2480
|
};
|
|
2411
2481
|
var defaultProps3 = {
|
|
2482
|
+
backgroundColor: null,
|
|
2412
2483
|
showBubbleLabels: null,
|
|
2413
2484
|
category: null,
|
|
2414
2485
|
colors: null,
|
|
@@ -2441,6 +2512,7 @@ var PunchcardRow_default = (0, styled_components_exports.withTheme)(PunchcardRow
|
|
|
2441
2512
|
var PunchcardChartArea = (props) => {
|
|
2442
2513
|
const {
|
|
2443
2514
|
showBubbleLabels,
|
|
2515
|
+
backgroundColor,
|
|
2444
2516
|
bubbleRowScale,
|
|
2445
2517
|
bubbleScale,
|
|
2446
2518
|
category,
|
|
@@ -2520,13 +2592,15 @@ var PunchcardChartArea = (props) => {
|
|
|
2520
2592
|
yIndex: index,
|
|
2521
2593
|
yPosition,
|
|
2522
2594
|
yValue: row,
|
|
2523
|
-
handlePointClick
|
|
2595
|
+
handlePointClick,
|
|
2596
|
+
backgroundColor
|
|
2524
2597
|
}
|
|
2525
2598
|
);
|
|
2526
2599
|
}));
|
|
2527
2600
|
};
|
|
2528
2601
|
var propTypes6 = {
|
|
2529
2602
|
showBubbleLabels: prop_types_exports.oneOf(Object.values(BUBBLE_LABELS_TYPES)),
|
|
2603
|
+
backgroundColor: prop_types_exports.string,
|
|
2530
2604
|
bubbleRowScale: prop_types_exports.oneOf(Object.values(BUBBLE_ROW_SCALE_TYPES)),
|
|
2531
2605
|
bubbleScale: prop_types_exports.oneOf(Object.values(BUBBLE_SCALE_TYPES)),
|
|
2532
2606
|
category: prop_types_exports.arrayOf(prop_types_exports.string),
|
|
@@ -2556,6 +2630,7 @@ var propTypes6 = {
|
|
|
2556
2630
|
};
|
|
2557
2631
|
var defaultProps4 = {
|
|
2558
2632
|
showBubbleLabels: "all" /* ALL */,
|
|
2633
|
+
backgroundColor: null,
|
|
2559
2634
|
bubbleRowScale: "row" /* ROW */,
|
|
2560
2635
|
bubbleScale: "area" /* AREA */,
|
|
2561
2636
|
category: null,
|
|
@@ -2615,11 +2690,7 @@ var LegendIcon = styled_components_default.rect`
|
|
|
2615
2690
|
`;
|
|
2616
2691
|
var LegendText = styled_components_default.text`
|
|
2617
2692
|
dominant-baseline: middle;
|
|
2618
|
-
fill: ${
|
|
2619
|
-
/* was previously named textColor in themeReg */
|
|
2620
|
-
enterprise: variables_default.textColor,
|
|
2621
|
-
prisma: variables_default.contentColorDefault
|
|
2622
|
-
})};
|
|
2693
|
+
fill: ${variables_default.contentColorDefault};
|
|
2623
2694
|
font-size: 12px;
|
|
2624
2695
|
`;
|
|
2625
2696
|
var PunchcardLegend = (props) => {
|
|
@@ -2705,13 +2776,7 @@ var PunchcardLegend_default = PunchcardLegend;
|
|
|
2705
2776
|
|
|
2706
2777
|
// src/Punchcard/PurePunchcard/src/PunchcardGridLines.tsx
|
|
2707
2778
|
var GridLine = styled_components_default.line`
|
|
2708
|
-
stroke: ${
|
|
2709
|
-
enterprise: {
|
|
2710
|
-
light: variables_default.gray96,
|
|
2711
|
-
dark: variables_default.gray25
|
|
2712
|
-
},
|
|
2713
|
-
prisma: variables_default.interactiveColorBackgroundDisabled
|
|
2714
|
-
})};
|
|
2779
|
+
stroke: ${variables_default.borderColorWeak};
|
|
2715
2780
|
stroke-width: 1px;
|
|
2716
2781
|
`;
|
|
2717
2782
|
var PunchcardGridLines = (props) => {
|
|
@@ -3021,7 +3086,8 @@ var Punchcard = (props) => {
|
|
|
3021
3086
|
xScale: xPositionScale,
|
|
3022
3087
|
y,
|
|
3023
3088
|
yScale: yPositionScale,
|
|
3024
|
-
handlePointClick
|
|
3089
|
+
handlePointClick,
|
|
3090
|
+
backgroundColor
|
|
3025
3091
|
}
|
|
3026
3092
|
), /* @__PURE__ */ react_exports.createElement("filter", { id: GRAYSCALE_FILTER_ID }, /* @__PURE__ */ react_exports.createElement(
|
|
3027
3093
|
"feColorMatrix",
|