sag_components 2.0.0-beta70 → 2.0.0-beta71
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/dist/index.esm.js +742 -685
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +741 -684
- package/dist/index.js.map +1 -1
- package/dist/types/components/BrushChart/BrushChart.style.d.ts +38 -0
- package/dist/types/components/BrushChart/Charts/BarLine.d.ts +2 -4
- package/dist/types/components/BrushChart/Charts/InnerBar.d.ts +2 -3
- package/dist/types/components/BrushChart/Charts/SingleChart.d.ts +2 -5
- package/dist/types/utils/CommonFunctions.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1692,6 +1692,12 @@ const getCurrencySign = (currencyTypeToConvert, value) => {
|
|
|
1692
1692
|
currencySign = currencyFormatter.format(Math.abs(value)).substring(0, 1);
|
|
1693
1693
|
return currencySign;
|
|
1694
1694
|
};
|
|
1695
|
+
const getMaxCharsPerLine = len => {
|
|
1696
|
+
if (len <= 20) return 20; // 1‒10 items
|
|
1697
|
+
if (len <= 40) return 15; // 1‒40 items
|
|
1698
|
+
if (len <= 80) return 10; // 41‒80 items
|
|
1699
|
+
return 5; // 81+ items
|
|
1700
|
+
};
|
|
1695
1701
|
const getFormattedUnits = num => {
|
|
1696
1702
|
if (num === undefined || num === null) {
|
|
1697
1703
|
return '';
|
|
@@ -9490,70 +9496,67 @@ const DropdownMain = styled__default["default"].div`
|
|
|
9490
9496
|
`;
|
|
9491
9497
|
|
|
9492
9498
|
/* eslint-disable react/prop-types */
|
|
9493
|
-
const DropdownNew =
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
elementType: elementType
|
|
9555
|
-
}));
|
|
9556
|
-
};
|
|
9499
|
+
const DropdownNew = ({
|
|
9500
|
+
isMulti,
|
|
9501
|
+
label,
|
|
9502
|
+
labelEmptyValue,
|
|
9503
|
+
options,
|
|
9504
|
+
selectedValue,
|
|
9505
|
+
placeHolder,
|
|
9506
|
+
onChange,
|
|
9507
|
+
required,
|
|
9508
|
+
disabled,
|
|
9509
|
+
width,
|
|
9510
|
+
error,
|
|
9511
|
+
errorMessage,
|
|
9512
|
+
labelColor,
|
|
9513
|
+
checkBoxColor,
|
|
9514
|
+
xIconShow,
|
|
9515
|
+
showLabelOnTop,
|
|
9516
|
+
orderBy,
|
|
9517
|
+
elementType
|
|
9518
|
+
}) => /*#__PURE__*/React__default["default"].createElement(DropdownMain, {
|
|
9519
|
+
className: "DropdownMain",
|
|
9520
|
+
width: width
|
|
9521
|
+
}, isMulti ? /*#__PURE__*/React__default["default"].createElement(DropdownMultiNew, {
|
|
9522
|
+
className: "DropdownMultiNew",
|
|
9523
|
+
placeHolder: placeHolder,
|
|
9524
|
+
label: label,
|
|
9525
|
+
labelEmptyValue: labelEmptyValue,
|
|
9526
|
+
labelColor: labelColor,
|
|
9527
|
+
checkBoxColor: checkBoxColor,
|
|
9528
|
+
required: required,
|
|
9529
|
+
options: options,
|
|
9530
|
+
width: width,
|
|
9531
|
+
disabled: disabled,
|
|
9532
|
+
error: error,
|
|
9533
|
+
errorMessage: errorMessage,
|
|
9534
|
+
selectedValue: selectedValue,
|
|
9535
|
+
xIconShow: xIconShow,
|
|
9536
|
+
onChange: onChange,
|
|
9537
|
+
showLabelOnTop: showLabelOnTop,
|
|
9538
|
+
orderBy: orderBy,
|
|
9539
|
+
elementType: elementType
|
|
9540
|
+
}) : /*#__PURE__*/React__default["default"].createElement(DropdownSingleNew, {
|
|
9541
|
+
className: "DropdownSingleNew",
|
|
9542
|
+
placeHolder: placeHolder,
|
|
9543
|
+
label: label,
|
|
9544
|
+
labelEmptyValue: labelEmptyValue,
|
|
9545
|
+
labelColor: labelColor,
|
|
9546
|
+
checkBoxColor: checkBoxColor,
|
|
9547
|
+
required: required,
|
|
9548
|
+
options: options,
|
|
9549
|
+
width: width,
|
|
9550
|
+
disabled: disabled,
|
|
9551
|
+
error: error,
|
|
9552
|
+
errorMessage: errorMessage,
|
|
9553
|
+
selectedValue: selectedValue,
|
|
9554
|
+
xIconShow: xIconShow,
|
|
9555
|
+
onChange: onChange,
|
|
9556
|
+
showLabelOnTop: showLabelOnTop,
|
|
9557
|
+
orderBy: orderBy,
|
|
9558
|
+
elementType: elementType
|
|
9559
|
+
}));
|
|
9557
9560
|
DropdownNew.propTypes = {
|
|
9558
9561
|
placeHolder: PropTypes.string,
|
|
9559
9562
|
label: PropTypes.string,
|
|
@@ -9981,21 +9984,20 @@ const DatePicker = ({
|
|
|
9981
9984
|
};
|
|
9982
9985
|
|
|
9983
9986
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9984
|
-
const RangePicker =
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
} = _ref;
|
|
9987
|
+
const RangePicker = ({
|
|
9988
|
+
label,
|
|
9989
|
+
onChange,
|
|
9990
|
+
borderRadius,
|
|
9991
|
+
required,
|
|
9992
|
+
width,
|
|
9993
|
+
height,
|
|
9994
|
+
placeholder,
|
|
9995
|
+
disabled,
|
|
9996
|
+
borderColor,
|
|
9997
|
+
borderColorFocus,
|
|
9998
|
+
textColor,
|
|
9999
|
+
selectedValue
|
|
10000
|
+
}) => {
|
|
9999
10001
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10000
10002
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10001
10003
|
const [value, setValue] = React$1.useState(''); // Added value state
|
|
@@ -10436,23 +10438,22 @@ const QuarterPopupPicker = ({
|
|
|
10436
10438
|
};
|
|
10437
10439
|
|
|
10438
10440
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10439
|
-
const QuarterPicker =
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
} = _ref;
|
|
10441
|
+
const QuarterPicker = ({
|
|
10442
|
+
availableQuarters,
|
|
10443
|
+
// ["Q1-2024"]
|
|
10444
|
+
label,
|
|
10445
|
+
onChange,
|
|
10446
|
+
borderRadius,
|
|
10447
|
+
required,
|
|
10448
|
+
width,
|
|
10449
|
+
height,
|
|
10450
|
+
placeholder,
|
|
10451
|
+
disabled,
|
|
10452
|
+
borderColor,
|
|
10453
|
+
borderColorFocus,
|
|
10454
|
+
textColor,
|
|
10455
|
+
selectedValue
|
|
10456
|
+
}) => {
|
|
10456
10457
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10457
10458
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10458
10459
|
const [value, setValue] = React$1.useState('');
|
|
@@ -10899,22 +10900,21 @@ const MonthPopupPicker = ({
|
|
|
10899
10900
|
};
|
|
10900
10901
|
|
|
10901
10902
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10902
|
-
const MonthPicker =
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
} = _ref;
|
|
10903
|
+
const MonthPicker = ({
|
|
10904
|
+
availableMonths,
|
|
10905
|
+
label,
|
|
10906
|
+
onChange,
|
|
10907
|
+
borderRadius,
|
|
10908
|
+
required,
|
|
10909
|
+
width,
|
|
10910
|
+
height,
|
|
10911
|
+
placeholder,
|
|
10912
|
+
disabled,
|
|
10913
|
+
borderColor,
|
|
10914
|
+
borderColorFocus,
|
|
10915
|
+
textColor,
|
|
10916
|
+
selectedValue
|
|
10917
|
+
}) => {
|
|
10918
10918
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10919
10919
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10920
10920
|
const [value, setValue] = React$1.useState('');
|
|
@@ -24140,22 +24140,21 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
24140
24140
|
position: absolute;
|
|
24141
24141
|
`;
|
|
24142
24142
|
|
|
24143
|
-
const QuickFilterDropdownSingle =
|
|
24144
|
-
|
|
24145
|
-
|
|
24146
|
-
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
|
|
24150
|
-
|
|
24151
|
-
|
|
24152
|
-
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
|
|
24156
|
-
|
|
24157
|
-
|
|
24158
|
-
} = _ref;
|
|
24143
|
+
const QuickFilterDropdownSingle = ({
|
|
24144
|
+
label,
|
|
24145
|
+
hoverColor,
|
|
24146
|
+
options,
|
|
24147
|
+
selectedValue,
|
|
24148
|
+
placeHolder,
|
|
24149
|
+
onChange,
|
|
24150
|
+
disabled,
|
|
24151
|
+
width,
|
|
24152
|
+
error,
|
|
24153
|
+
errorMessage,
|
|
24154
|
+
xIconShow,
|
|
24155
|
+
labelColor,
|
|
24156
|
+
showLabelOnTop
|
|
24157
|
+
}) => {
|
|
24159
24158
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24160
24159
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24161
24160
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24553,24 +24552,23 @@ const IconContainer$2 = styled__default["default"].div`
|
|
|
24553
24552
|
cursor: pointer;
|
|
24554
24553
|
`;
|
|
24555
24554
|
|
|
24556
|
-
const QuickFilterDropdownMultiSelection =
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24564
|
-
|
|
24565
|
-
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
} = _ref;
|
|
24555
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24556
|
+
label,
|
|
24557
|
+
labelEmptyValue,
|
|
24558
|
+
options,
|
|
24559
|
+
selectedValue,
|
|
24560
|
+
placeHolder,
|
|
24561
|
+
onChange,
|
|
24562
|
+
required,
|
|
24563
|
+
disabled,
|
|
24564
|
+
width,
|
|
24565
|
+
error,
|
|
24566
|
+
errorMessage,
|
|
24567
|
+
labelColor,
|
|
24568
|
+
xIconShow,
|
|
24569
|
+
checkBoxColor,
|
|
24570
|
+
showLabelOnTop
|
|
24571
|
+
}) => {
|
|
24574
24572
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24575
24573
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24576
24574
|
const [inputValue, setInputValue] = React$1.useState('');
|
|
@@ -25184,8 +25182,8 @@ function styleInject(css, ref) {
|
|
|
25184
25182
|
}
|
|
25185
25183
|
}
|
|
25186
25184
|
|
|
25187
|
-
var css_248z = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
|
|
25188
|
-
styleInject(css_248z);
|
|
25185
|
+
var css_248z$1 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
|
|
25186
|
+
styleInject(css_248z$1);
|
|
25189
25187
|
|
|
25190
25188
|
const OneColumnContainer = props => {
|
|
25191
25189
|
const {
|
|
@@ -30312,7 +30310,7 @@ const ChartSubtitle = styled__default["default"].p`
|
|
|
30312
30310
|
color: #484A4C;
|
|
30313
30311
|
margin: 0;
|
|
30314
30312
|
`;
|
|
30315
|
-
const ChartContainer = styled__default["default"].div`
|
|
30313
|
+
const ChartContainer$1 = styled__default["default"].div`
|
|
30316
30314
|
position: relative;
|
|
30317
30315
|
width: 100%;
|
|
30318
30316
|
height: 90%; /* Reduced from 93% to make room for the zoom controls */
|
|
@@ -30920,7 +30918,7 @@ const BubbleChart = _ref => {
|
|
|
30920
30918
|
"data-testid": "chart-title"
|
|
30921
30919
|
}, title), /*#__PURE__*/React__default["default"].createElement(ChartSubtitle, {
|
|
30922
30920
|
"data-testid": "chart-subtitle"
|
|
30923
|
-
}, subtitle)), /*#__PURE__*/React__default["default"].createElement(ChartContainer, {
|
|
30921
|
+
}, subtitle)), /*#__PURE__*/React__default["default"].createElement(ChartContainer$1, {
|
|
30924
30922
|
ref: scatterChartRef,
|
|
30925
30923
|
"data-testid": "chart-container"
|
|
30926
30924
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
@@ -31421,120 +31419,312 @@ const BatteryChart = props => {
|
|
|
31421
31419
|
}))))))), starText !== "" && /*#__PURE__*/React__default["default"].createElement(StarText, null, starText));
|
|
31422
31420
|
};
|
|
31423
31421
|
|
|
31424
|
-
const Container = styled__default["default"].div`
|
|
31425
|
-
width: ${props => props.width};
|
|
31426
|
-
height: ${props => props.height};
|
|
31427
|
-
padding: 15px;
|
|
31428
|
-
display: flex;
|
|
31429
|
-
flex-direction: column;
|
|
31430
|
-
#Segment {
|
|
31431
|
-
width: auto;
|
|
31432
|
-
white-space: nowrap;
|
|
31433
|
-
font-size: 14px;
|
|
31434
|
-
font-weight: 500;
|
|
31435
|
-
font-family: "Poppins"
|
|
31436
|
-
}
|
|
31437
|
-
`;
|
|
31438
|
-
const Title$1 = styled__default["default"].h2`
|
|
31439
|
-
color: #212121;
|
|
31440
|
-
font-family: "Poppins";
|
|
31441
|
-
font-size: 18px;
|
|
31442
|
-
font-style: normal;
|
|
31443
|
-
font-weight: 400;
|
|
31444
|
-
line-height: normal;
|
|
31445
|
-
margin: 0 0 16px 0;
|
|
31446
|
-
`;
|
|
31447
31422
|
styled__default["default"].div`
|
|
31448
|
-
|
|
31449
|
-
|
|
31423
|
+
display: flex;
|
|
31424
|
+
gap: 28px;
|
|
31425
|
+
@media (max-width: 1536px) {
|
|
31426
|
+
gap: 20px;
|
|
31427
|
+
}
|
|
31428
|
+
@media (max-width: 1366px) {
|
|
31429
|
+
gap: 17px;
|
|
31430
|
+
}
|
|
31450
31431
|
`;
|
|
31451
|
-
styled__default["default"].div`
|
|
31452
|
-
|
|
31432
|
+
const ButtonsControlsContainer = styled__default["default"].div`
|
|
31433
|
+
display: flex;
|
|
31434
|
+
font: ${props => props.fontSize?.toString().concat('', 'px Poppins, sans-serif')};
|
|
31435
|
+
margin: 0;
|
|
31436
|
+
--highlight-width: auto;
|
|
31437
|
+
--highlight-x-pos: 0;
|
|
31438
|
+
-webkit-font-smoothing: antialiased;
|
|
31439
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31440
|
+
float: left;
|
|
31441
|
+
|
|
31442
|
+
&:not(:first-of-type) {
|
|
31443
|
+
padding-left: 40px;
|
|
31444
|
+
@media (max-width: 1536px) {
|
|
31445
|
+
padding-left: 35px;
|
|
31446
|
+
}
|
|
31447
|
+
@media (max-width: 1366px) {
|
|
31448
|
+
padding-left: 24px;
|
|
31449
|
+
}
|
|
31450
|
+
}
|
|
31453
31451
|
`;
|
|
31454
|
-
styled__default["default"].div`
|
|
31455
|
-
|
|
31452
|
+
const Controls = styled__default["default"].div`
|
|
31453
|
+
display: inline-flex;
|
|
31454
|
+
justify-content: space-between;
|
|
31455
|
+
background: #f2f2f2;
|
|
31456
|
+
border-radius: ${props => props.controlradius.toString().concat('', 'px')}; //12px
|
|
31457
|
+
// max-width: 500px; //use this to limit max lenght of the control
|
|
31458
|
+
padding: 6px;
|
|
31459
|
+
gap: ${props => props.gap};
|
|
31460
|
+
overflow: hidden;
|
|
31461
|
+
position: relative;
|
|
31462
|
+
&.controls::before {
|
|
31463
|
+
content: "";
|
|
31464
|
+
color: #212121;
|
|
31465
|
+
background: #FFFFFF;
|
|
31466
|
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
|
31467
|
+
border-radius: ${props => props.segmentradius.toString().concat('', 'px')};
|
|
31468
|
+
width: var(--highlight-width);
|
|
31469
|
+
transform: translateX(var(--highlight-x-pos));
|
|
31470
|
+
position: absolute;
|
|
31471
|
+
top: 3px;
|
|
31472
|
+
bottom: 3px;
|
|
31473
|
+
left: 0;
|
|
31474
|
+
z-index: 0;
|
|
31475
|
+
}
|
|
31476
|
+
&.controls.ready::before {
|
|
31477
|
+
transition: transform 0.3s ease, width 0.3s ease;
|
|
31478
|
+
}
|
|
31456
31479
|
`;
|
|
31457
|
-
styled__default["default"].
|
|
31480
|
+
const ControlsInput = styled__default["default"].input`
|
|
31481
|
+
opacity: 0;
|
|
31482
|
+
margin: 0;
|
|
31483
|
+
top: 0;
|
|
31484
|
+
right: 0;
|
|
31485
|
+
bottom: 0;
|
|
31486
|
+
left: 0;
|
|
31487
|
+
position: absolute;
|
|
31488
|
+
width: 100%;
|
|
31489
|
+
cursor: pointer;
|
|
31458
31490
|
height: 100%;
|
|
31459
|
-
display: flex;
|
|
31460
|
-
flex-direction: column;
|
|
31461
|
-
background-color: white;
|
|
31462
|
-
`;
|
|
31463
|
-
const TooltipContainer = styled__default["default"].div`
|
|
31464
|
-
background: white;
|
|
31465
|
-
padding: 10px;
|
|
31466
|
-
border-radius: 5px;
|
|
31467
|
-
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
|
|
31468
|
-
border: 1px solid #ddd;
|
|
31469
|
-
font-family: Poppins, sans-serif;
|
|
31470
|
-
font-weight: 500;
|
|
31471
|
-
font-size: 14px;
|
|
31472
31491
|
`;
|
|
31473
|
-
const
|
|
31474
|
-
|
|
31475
|
-
|
|
31476
|
-
|
|
31492
|
+
const Segment = styled__default["default"].div`
|
|
31493
|
+
/* width: 100%; uncomment for each segment to have matching width */
|
|
31494
|
+
width: 50%;
|
|
31495
|
+
min-width: ${props => props.segmentwidth.toString().concat('', 'px')}; //120px;
|
|
31496
|
+
position: relative;
|
|
31497
|
+
text-align: center;
|
|
31498
|
+
z-index: 1;
|
|
31477
31499
|
`;
|
|
31478
|
-
const
|
|
31479
|
-
|
|
31480
|
-
|
|
31500
|
+
const SegmentLabel = styled__default["default"].label`
|
|
31501
|
+
cursor: pointer;
|
|
31502
|
+
display: block;
|
|
31503
|
+
padding: 0 6px;
|
|
31504
|
+
transition: color 0.5s ease;
|
|
31505
|
+
&.active {
|
|
31506
|
+
color: ${props => props.selectedtextcolor};
|
|
31507
|
+
}
|
|
31508
|
+
&.inactive {
|
|
31509
|
+
color: ${props => props.unselectedtextcolor};
|
|
31510
|
+
}
|
|
31481
31511
|
`;
|
|
31482
31512
|
|
|
31483
|
-
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31487
|
-
|
|
31488
|
-
|
|
31489
|
-
|
|
31490
|
-
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31500
|
-
|
|
31501
|
-
|
|
31502
|
-
|
|
31503
|
-
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31507
|
-
|
|
31508
|
-
|
|
31509
|
-
|
|
31510
|
-
|
|
31511
|
-
|
|
31513
|
+
/* eslint-disable react/require-default-props */
|
|
31514
|
+
|
|
31515
|
+
/* SegmentedButton */
|
|
31516
|
+
const SegmentedButton = props => {
|
|
31517
|
+
const {
|
|
31518
|
+
className,
|
|
31519
|
+
name,
|
|
31520
|
+
options,
|
|
31521
|
+
width,
|
|
31522
|
+
height,
|
|
31523
|
+
controlradius,
|
|
31524
|
+
segmentradius,
|
|
31525
|
+
fontSize,
|
|
31526
|
+
selectedsegmentcolor,
|
|
31527
|
+
selectedtextcolor,
|
|
31528
|
+
unselectedtextcolor,
|
|
31529
|
+
defaultIndex,
|
|
31530
|
+
onClick,
|
|
31531
|
+
gap
|
|
31532
|
+
} = props;
|
|
31533
|
+
const [activeIndex, setActiveIndex] = React$1.useState(defaultIndex);
|
|
31534
|
+
const controlRef = React$1.useRef();
|
|
31535
|
+
const componentReady = React$1.useRef();
|
|
31536
|
+
const optionsRef = options?.map((item, i) => ({
|
|
31537
|
+
...item,
|
|
31538
|
+
id: i,
|
|
31539
|
+
ref: React$1.useRef()
|
|
31540
|
+
}));
|
|
31541
|
+
|
|
31542
|
+
// Determine when the component is "ready"
|
|
31543
|
+
React$1.useEffect(() => {
|
|
31544
|
+
componentReady.current = true;
|
|
31545
|
+
}, []);
|
|
31546
|
+
React$1.useEffect(() => {
|
|
31547
|
+
if (defaultIndex >= 0 && defaultIndex < options?.length) {
|
|
31548
|
+
setActiveIndex(defaultIndex);
|
|
31512
31549
|
}
|
|
31513
|
-
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
|
|
31518
|
-
|
|
31519
|
-
|
|
31520
|
-
|
|
31521
|
-
|
|
31522
|
-
|
|
31523
|
-
|
|
31524
|
-
|
|
31525
|
-
x
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
|
|
31529
|
-
|
|
31530
|
-
|
|
31531
|
-
|
|
31532
|
-
|
|
31533
|
-
|
|
31534
|
-
const data = payload[0]?.payload;
|
|
31535
|
-
if (!data) return null;
|
|
31536
|
-
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales: ${getFormattedValue(data.inc_sales)}${getFormattedUnits(data.inc_sales)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(data.inc_roi)}${getFormattedUnits(data.inc_roi)}`));
|
|
31550
|
+
}, [defaultIndex]);
|
|
31551
|
+
React$1.useEffect(() => {
|
|
31552
|
+
const activeSegmentRef = optionsRef[activeIndex].ref;
|
|
31553
|
+
setTimeout(() => {
|
|
31554
|
+
const {
|
|
31555
|
+
offsetWidth,
|
|
31556
|
+
offsetLeft
|
|
31557
|
+
} = activeSegmentRef.current;
|
|
31558
|
+
const {
|
|
31559
|
+
style
|
|
31560
|
+
} = controlRef.current;
|
|
31561
|
+
style.setProperty("--highlight-width", `${offsetWidth}px`);
|
|
31562
|
+
style.setProperty("--highlight-x-pos", `${offsetLeft}px`);
|
|
31563
|
+
}, 0);
|
|
31564
|
+
}, [activeIndex, controlRef, optionsRef]);
|
|
31565
|
+
const onInputChangeHandler = (value, index) => {
|
|
31566
|
+
setActiveIndex(index);
|
|
31567
|
+
onClick({
|
|
31568
|
+
index,
|
|
31569
|
+
value
|
|
31570
|
+
});
|
|
31537
31571
|
};
|
|
31572
|
+
let segmentwidth = 120;
|
|
31573
|
+
if (options && options.length > 0 && width && width > 0) {
|
|
31574
|
+
segmentwidth = width / options.length;
|
|
31575
|
+
}
|
|
31576
|
+
return /*#__PURE__*/React__default["default"].createElement(ButtonsControlsContainer, {
|
|
31577
|
+
className: className,
|
|
31578
|
+
fontSize: fontSize,
|
|
31579
|
+
ref: controlRef
|
|
31580
|
+
}, /*#__PURE__*/React__default["default"].createElement(Controls, {
|
|
31581
|
+
id: "Controls",
|
|
31582
|
+
selectedsegmentcolor: selectedsegmentcolor,
|
|
31583
|
+
segmentradius: segmentradius,
|
|
31584
|
+
gap: gap,
|
|
31585
|
+
controlradius: controlradius,
|
|
31586
|
+
segmentwidth: segmentwidth,
|
|
31587
|
+
className: `controls ${componentReady.current ? "ready" : "idle"}`
|
|
31588
|
+
}, optionsRef?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(Segment, {
|
|
31589
|
+
id: "Segment",
|
|
31590
|
+
key: item.id,
|
|
31591
|
+
selectedsegmentcolor: selectedsegmentcolor,
|
|
31592
|
+
controlradius: controlradius,
|
|
31593
|
+
segmentwidth: segmentwidth,
|
|
31594
|
+
className: `${activeIndex === i ? "active" : "inactive"}`,
|
|
31595
|
+
ref: item.ref
|
|
31596
|
+
}, /*#__PURE__*/React__default["default"].createElement(ControlsInput, {
|
|
31597
|
+
type: "radio",
|
|
31598
|
+
value: item.value,
|
|
31599
|
+
id: item.id,
|
|
31600
|
+
name: name,
|
|
31601
|
+
onChange: () => onInputChangeHandler(item.value, item.id),
|
|
31602
|
+
checked: i === activeIndex
|
|
31603
|
+
}), /*#__PURE__*/React__default["default"].createElement(SegmentLabel, {
|
|
31604
|
+
id: "SegmentLabel",
|
|
31605
|
+
selectedtextcolor: selectedtextcolor,
|
|
31606
|
+
unselectedtextcolor: unselectedtextcolor,
|
|
31607
|
+
segmentheight: height / 5,
|
|
31608
|
+
className: `${activeIndex === i ? "active" : "inactive"} `,
|
|
31609
|
+
htmlFor: item.value
|
|
31610
|
+
}, item.value)))));
|
|
31611
|
+
};
|
|
31612
|
+
SegmentedButton.propTypes = {
|
|
31613
|
+
name: PropTypes.string,
|
|
31614
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
31615
|
+
value: PropTypes.string
|
|
31616
|
+
})),
|
|
31617
|
+
width: PropTypes.number,
|
|
31618
|
+
height: PropTypes.number,
|
|
31619
|
+
controlradius: PropTypes.number,
|
|
31620
|
+
segmentradius: PropTypes.number,
|
|
31621
|
+
gap: PropTypes.string,
|
|
31622
|
+
fontSize: PropTypes.number,
|
|
31623
|
+
selectedsegmentcolor: PropTypes.string,
|
|
31624
|
+
selectedtextcolor: PropTypes.string,
|
|
31625
|
+
unselectedtextcolor: PropTypes.string,
|
|
31626
|
+
defaultIndex: PropTypes.number,
|
|
31627
|
+
onClick: PropTypes.func
|
|
31628
|
+
};
|
|
31629
|
+
SegmentedButton.defaultProps = {
|
|
31630
|
+
name: "",
|
|
31631
|
+
options: [{
|
|
31632
|
+
value: "4 w"
|
|
31633
|
+
}, {
|
|
31634
|
+
value: "8 w"
|
|
31635
|
+
}, {
|
|
31636
|
+
value: "13 w"
|
|
31637
|
+
}],
|
|
31638
|
+
width: 120,
|
|
31639
|
+
height: 40,
|
|
31640
|
+
controlradius: 8,
|
|
31641
|
+
segmentradius: 8,
|
|
31642
|
+
gap: "0px",
|
|
31643
|
+
fontSize: 14,
|
|
31644
|
+
selectedsegmentcolor: "#3a9df9",
|
|
31645
|
+
selectedtextcolor: "#212121",
|
|
31646
|
+
unselectedtextcolor: "black",
|
|
31647
|
+
defaultIndex: 0,
|
|
31648
|
+
onClick: () => {}
|
|
31649
|
+
};
|
|
31650
|
+
|
|
31651
|
+
const Container = styled__default["default"].div`
|
|
31652
|
+
width: ${props => props.width};
|
|
31653
|
+
height: ${props => props.height};
|
|
31654
|
+
margin: 10px;
|
|
31655
|
+
gap: 10px;
|
|
31656
|
+
display: flex;
|
|
31657
|
+
flex-direction: column;
|
|
31658
|
+
`;
|
|
31659
|
+
const SegmentedContainer = styled__default["default"](SegmentedButton)`
|
|
31660
|
+
height: auto;
|
|
31661
|
+
#Segment {
|
|
31662
|
+
width: auto;
|
|
31663
|
+
white-space: nowrap;
|
|
31664
|
+
font-size: 14px;
|
|
31665
|
+
font-weight: 500;
|
|
31666
|
+
font-family: "Poppins";
|
|
31667
|
+
}
|
|
31668
|
+
`;
|
|
31669
|
+
const ChartContainer = styled__default["default"].div`
|
|
31670
|
+
width: 100%;
|
|
31671
|
+
height: calc(100% - 70px);
|
|
31672
|
+
`;
|
|
31673
|
+
const Title$1 = styled__default["default"].h2`
|
|
31674
|
+
color: #212121;
|
|
31675
|
+
font-family: "Poppins";
|
|
31676
|
+
font-size: 18px;
|
|
31677
|
+
font-style: normal;
|
|
31678
|
+
font-weight: 400;
|
|
31679
|
+
height: 10px;
|
|
31680
|
+
line-height: normal;
|
|
31681
|
+
margin: 0 0 16px 0;
|
|
31682
|
+
`;
|
|
31683
|
+
styled__default["default"].div`
|
|
31684
|
+
font-family: sans-serif;
|
|
31685
|
+
text-align: center;
|
|
31686
|
+
`;
|
|
31687
|
+
styled__default["default"].div`
|
|
31688
|
+
height: 25%;
|
|
31689
|
+
`;
|
|
31690
|
+
styled__default["default"].div`
|
|
31691
|
+
height: 75%;
|
|
31692
|
+
`;
|
|
31693
|
+
styled__default["default"].div`
|
|
31694
|
+
height: 100%;
|
|
31695
|
+
display: flex;
|
|
31696
|
+
flex-direction: column;
|
|
31697
|
+
background-color: white;
|
|
31698
|
+
`;
|
|
31699
|
+
const TooltipContainer = styled__default["default"].div`
|
|
31700
|
+
background: white;
|
|
31701
|
+
padding: 10px;
|
|
31702
|
+
border-radius: 5px;
|
|
31703
|
+
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
|
|
31704
|
+
border: 1px solid #ddd;
|
|
31705
|
+
font-family: Poppins, sans-serif;
|
|
31706
|
+
font-weight: 500;
|
|
31707
|
+
font-size: 14px;
|
|
31708
|
+
`;
|
|
31709
|
+
const TooltipTitle = styled__default["default"].p`
|
|
31710
|
+
font-weight: 700;
|
|
31711
|
+
margin-top: 5px;
|
|
31712
|
+
margin-bottom: 5px;
|
|
31713
|
+
`;
|
|
31714
|
+
const TooltipText = styled__default["default"].p`
|
|
31715
|
+
margin-top: 5px;
|
|
31716
|
+
margin-bottom: 5px;
|
|
31717
|
+
`;
|
|
31718
|
+
|
|
31719
|
+
var css_248z = ".custom-brush .recharts-brush-slide { /* selected area */\r\n fill: #212121;\r\n}\r\n\r\n ";
|
|
31720
|
+
styleInject(css_248z);
|
|
31721
|
+
|
|
31722
|
+
const BarLine = props => {
|
|
31723
|
+
const {
|
|
31724
|
+
brushAreaBarData
|
|
31725
|
+
} = props;
|
|
31726
|
+
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(brushAreaBarData.length);
|
|
31727
|
+
const MAX_LINES = 2;
|
|
31538
31728
|
const chartMargins = {
|
|
31539
31729
|
top: 30,
|
|
31540
31730
|
right: 30,
|
|
@@ -31545,9 +31735,71 @@ const SeparatedLineBarChart = ({
|
|
|
31545
31735
|
top: 30,
|
|
31546
31736
|
right: 30,
|
|
31547
31737
|
left: 20,
|
|
31548
|
-
bottom:
|
|
31738
|
+
bottom: 0
|
|
31549
31739
|
};
|
|
31550
|
-
const
|
|
31740
|
+
const CustomizedTick = /*#__PURE__*/React__default["default"].memo(({
|
|
31741
|
+
x,
|
|
31742
|
+
y,
|
|
31743
|
+
payload
|
|
31744
|
+
}) => {
|
|
31745
|
+
const fullText = payload?.value ?? "";
|
|
31746
|
+
|
|
31747
|
+
/* ── 1. split text into lines that are ≤ MAX_CHARS_PER_LINE ─────────────── */
|
|
31748
|
+
const words = fullText.split(" ");
|
|
31749
|
+
const lines = [];
|
|
31750
|
+
let current = "";
|
|
31751
|
+
words.forEach(w => {
|
|
31752
|
+
// +1 so we count the space that will be added
|
|
31753
|
+
if ((current.length ? current.length + 1 : 0) + w.length > MAX_CHARS_PER_LINE) {
|
|
31754
|
+
lines.push(current.trim());
|
|
31755
|
+
current = w;
|
|
31756
|
+
} else {
|
|
31757
|
+
current += (current ? " " : "") + w;
|
|
31758
|
+
}
|
|
31759
|
+
});
|
|
31760
|
+
if (current) lines.push(current.trim());
|
|
31761
|
+
|
|
31762
|
+
/* ── 2. squash down to two lines & add "..." if necessary ───────────────── */
|
|
31763
|
+
if (lines.length > MAX_LINES) {
|
|
31764
|
+
const firstLine = lines[0]; // keep it as-is
|
|
31765
|
+
// join everything after the first line and truncate
|
|
31766
|
+
let secondLine = lines.slice(1).join(" ");
|
|
31767
|
+
if (secondLine.length > MAX_CHARS_PER_LINE - 3) {
|
|
31768
|
+
secondLine = secondLine.slice(0, MAX_CHARS_PER_LINE - 3).trim();
|
|
31769
|
+
}
|
|
31770
|
+
lines.length = 0;
|
|
31771
|
+
lines.push(firstLine, `${secondLine}…`);
|
|
31772
|
+
}
|
|
31773
|
+
|
|
31774
|
+
/* ── 3. render ──────────────────────────────────────────────────────────── */
|
|
31775
|
+
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31776
|
+
transform: `translate(${x},${y})`
|
|
31777
|
+
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
31778
|
+
textAnchor: "middle",
|
|
31779
|
+
fontFamily: "Poppins",
|
|
31780
|
+
fontSize: 14,
|
|
31781
|
+
fill: "#212121"
|
|
31782
|
+
}, lines.map((line, idx) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31783
|
+
key: idx,
|
|
31784
|
+
x: 0
|
|
31785
|
+
/* first line sits on the baseline (≈ 0.71 em down); every
|
|
31786
|
+
additional line gets another 1.2 em offset */,
|
|
31787
|
+
dy: idx === 0 ? "0.71em" : "1.2em"
|
|
31788
|
+
}, line))));
|
|
31789
|
+
});
|
|
31790
|
+
const CustomTooltip = /*#__PURE__*/React__default["default"].memo(({
|
|
31791
|
+
active,
|
|
31792
|
+
payload
|
|
31793
|
+
}) => {
|
|
31794
|
+
if (!active || !payload?.length) return null;
|
|
31795
|
+
const {
|
|
31796
|
+
label,
|
|
31797
|
+
description,
|
|
31798
|
+
inc_sales,
|
|
31799
|
+
inc_roi
|
|
31800
|
+
} = payload[0].payload;
|
|
31801
|
+
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, label), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, description), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales: ${getFormattedValue(inc_sales)}${getFormattedUnits(inc_sales)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(inc_roi)}${getFormattedUnits(inc_roi)}`));
|
|
31802
|
+
});
|
|
31551
31803
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31552
31804
|
style: {
|
|
31553
31805
|
width: "100%",
|
|
@@ -31561,7 +31813,7 @@ const SeparatedLineBarChart = ({
|
|
|
31561
31813
|
width: "100%",
|
|
31562
31814
|
height: "100%"
|
|
31563
31815
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, {
|
|
31564
|
-
data:
|
|
31816
|
+
data: brushAreaBarData,
|
|
31565
31817
|
margin: chartMargins,
|
|
31566
31818
|
syncId: "composedChart",
|
|
31567
31819
|
syncMethod: "index"
|
|
@@ -31577,7 +31829,8 @@ const SeparatedLineBarChart = ({
|
|
|
31577
31829
|
},
|
|
31578
31830
|
hide: true
|
|
31579
31831
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
31580
|
-
|
|
31832
|
+
type: "number",
|
|
31833
|
+
domain: [0, dataMax => dataMax * 1.3],
|
|
31581
31834
|
hide: true
|
|
31582
31835
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
|
|
31583
31836
|
type: "monotone",
|
|
@@ -31589,15 +31842,13 @@ const SeparatedLineBarChart = ({
|
|
|
31589
31842
|
fill: "#F8CD00"
|
|
31590
31843
|
},
|
|
31591
31844
|
activeDot: false,
|
|
31592
|
-
name: "INC Sales ROI"
|
|
31593
|
-
barCategoryGap: BAR_CATEGORY_GAP,
|
|
31594
|
-
barGap: 0
|
|
31845
|
+
name: "INC Sales ROI"
|
|
31595
31846
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
31596
31847
|
dataKey: "inc_roi",
|
|
31597
31848
|
position: "top",
|
|
31598
31849
|
formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
|
|
31599
31850
|
fill: "#212121",
|
|
31600
|
-
fontSize:
|
|
31851
|
+
fontSize: 15,
|
|
31601
31852
|
fontWeight: "400",
|
|
31602
31853
|
fontFamily: "Poppins"
|
|
31603
31854
|
})), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
@@ -31605,25 +31856,23 @@ const SeparatedLineBarChart = ({
|
|
|
31605
31856
|
height: 30,
|
|
31606
31857
|
stroke: "#212121",
|
|
31607
31858
|
startIndex: 0,
|
|
31608
|
-
endIndex: Math.min(6,
|
|
31859
|
+
endIndex: Math.min(6, brushAreaBarData.length - 1),
|
|
31609
31860
|
y: 330,
|
|
31610
31861
|
travellerWidth: 10,
|
|
31611
31862
|
tickFormatter: (value, index) => index + 1,
|
|
31612
31863
|
hide: true
|
|
31613
31864
|
})))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31614
31865
|
style: {
|
|
31615
|
-
height: "
|
|
31866
|
+
height: "65%"
|
|
31616
31867
|
}
|
|
31617
31868
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
31618
31869
|
width: "100%",
|
|
31619
31870
|
height: "100%"
|
|
31620
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.
|
|
31621
|
-
data:
|
|
31871
|
+
}, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
|
|
31872
|
+
data: brushAreaBarData,
|
|
31622
31873
|
margin: chartMargins2,
|
|
31623
31874
|
syncId: "composedChart",
|
|
31624
|
-
syncMethod: "index"
|
|
31625
|
-
barCategoryGap: BAR_CATEGORY_GAP,
|
|
31626
|
-
barGap: 0
|
|
31875
|
+
syncMethod: "index"
|
|
31627
31876
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
31628
31877
|
strokeDasharray: "3 3",
|
|
31629
31878
|
vertical: false
|
|
@@ -31631,401 +31880,190 @@ const SeparatedLineBarChart = ({
|
|
|
31631
31880
|
dataKey: "label",
|
|
31632
31881
|
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
31633
31882
|
interval: 0,
|
|
31634
|
-
height:
|
|
31883
|
+
height: 50,
|
|
31635
31884
|
tickLine: false
|
|
31636
31885
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
31637
|
-
|
|
31886
|
+
type: "number",
|
|
31887
|
+
domain: [0, dataMax => dataMax * 1.3],
|
|
31638
31888
|
hide: true
|
|
31639
31889
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
31640
|
-
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
31890
|
+
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null),
|
|
31891
|
+
cursor: brushAreaBarData.length > 80
|
|
31641
31892
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31642
31893
|
dataKey: "inc_sales",
|
|
31643
31894
|
fill: "#CCDCDD",
|
|
31644
31895
|
gap: 4,
|
|
31645
|
-
|
|
31646
|
-
barSize: 40,
|
|
31896
|
+
barSize: 53,
|
|
31647
31897
|
name: "INC Sales"
|
|
31648
31898
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
31649
31899
|
dataKey: "inc_sales",
|
|
31650
31900
|
position: "top",
|
|
31651
31901
|
formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
|
|
31652
31902
|
fill: "#212121",
|
|
31653
|
-
fontSize:
|
|
31654
|
-
fontWeight: "400",
|
|
31655
|
-
fontFamily: "Poppins"
|
|
31656
|
-
})), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
31657
|
-
dataKey: "label",
|
|
31658
|
-
height: 30,
|
|
31659
|
-
stroke: "#212121",
|
|
31660
|
-
startIndex: 0,
|
|
31661
|
-
endIndex: Math.min(6, processedData.length - 1),
|
|
31662
|
-
travellerWidth: 10,
|
|
31663
|
-
tickFormatter: (value, index) => index + 1
|
|
31664
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", null)), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
|
|
31665
|
-
width: "100%",
|
|
31666
|
-
height: "40px",
|
|
31667
|
-
legendData: [{
|
|
31668
|
-
iconColor: "#CCDCDD",
|
|
31669
|
-
iconType: "Square",
|
|
31670
|
-
title: "INC Sales"
|
|
31671
|
-
}, {
|
|
31672
|
-
iconColor: "#F8CD00",
|
|
31673
|
-
iconType: "LegendUnionIcon",
|
|
31674
|
-
title: "INC Sales ROI"
|
|
31675
|
-
}]
|
|
31676
|
-
})));
|
|
31677
|
-
};
|
|
31678
|
-
|
|
31679
|
-
function SingleChart({
|
|
31680
|
-
barData,
|
|
31681
|
-
height = 450,
|
|
31682
|
-
width = "100%"
|
|
31683
|
-
}) {
|
|
31684
|
-
const dataWithIndex = barData?.map((item, index) => ({
|
|
31685
|
-
...item,
|
|
31686
|
-
index,
|
|
31687
|
-
shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
|
|
31688
|
-
}));
|
|
31689
|
-
const CustomizedTick = ({
|
|
31690
|
-
x,
|
|
31691
|
-
y,
|
|
31692
|
-
payload
|
|
31693
|
-
}) => {
|
|
31694
|
-
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
31695
|
-
const words = label.split(' ');
|
|
31696
|
-
const chunks = [];
|
|
31697
|
-
let currentChunk = '';
|
|
31698
|
-
words.forEach(word => {
|
|
31699
|
-
if (currentChunk.length + word.length > 15) {
|
|
31700
|
-
chunks.push(currentChunk.trim());
|
|
31701
|
-
currentChunk = word;
|
|
31702
|
-
} else {
|
|
31703
|
-
currentChunk += (currentChunk ? ' ' : '') + word;
|
|
31704
|
-
}
|
|
31705
|
-
});
|
|
31706
|
-
if (currentChunk) {
|
|
31707
|
-
chunks.push(currentChunk.trim());
|
|
31708
|
-
}
|
|
31709
|
-
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31710
|
-
transform: `translate(${x},${y})`
|
|
31711
|
-
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
31712
|
-
x: 0,
|
|
31713
|
-
y: 0,
|
|
31714
|
-
dy: 16,
|
|
31715
|
-
textAnchor: "middle",
|
|
31716
|
-
fill: "#212121",
|
|
31717
|
-
fontSize: 10,
|
|
31718
|
-
fontFamily: "Poppins"
|
|
31719
|
-
}, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31720
|
-
key: i,
|
|
31721
|
-
x: 0,
|
|
31722
|
-
dy: i === 0 ? "0.71em" : "1.2em"
|
|
31723
|
-
}, chunk))));
|
|
31724
|
-
};
|
|
31725
|
-
const CustomTooltip = ({
|
|
31726
|
-
active,
|
|
31727
|
-
payload
|
|
31728
|
-
}) => {
|
|
31729
|
-
if (!active || !payload || !payload.length) return null;
|
|
31730
|
-
const data = payload[0]?.payload;
|
|
31731
|
-
if (!data) return null;
|
|
31732
|
-
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
|
|
31733
|
-
};
|
|
31734
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31735
|
-
style: {
|
|
31736
|
-
width: "100%",
|
|
31737
|
-
height: "100%"
|
|
31738
|
-
}
|
|
31739
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
31740
|
-
width: "100%",
|
|
31741
|
-
height: "95%"
|
|
31742
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
|
|
31743
|
-
data: dataWithIndex,
|
|
31744
|
-
margin: {
|
|
31745
|
-
top: 40,
|
|
31746
|
-
right: 40,
|
|
31747
|
-
left: 20,
|
|
31748
|
-
bottom: 40
|
|
31749
|
-
}
|
|
31750
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
31751
|
-
strokeDasharray: "3 3",
|
|
31752
|
-
vertical: false
|
|
31753
|
-
}), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
|
|
31754
|
-
dataKey: "index",
|
|
31755
|
-
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
31756
|
-
interval: 0,
|
|
31757
|
-
height: 80,
|
|
31758
|
-
padding: {
|
|
31759
|
-
left: 20,
|
|
31760
|
-
right: 20
|
|
31761
|
-
},
|
|
31762
|
-
tickLine: false
|
|
31763
|
-
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
31764
|
-
tickFormatter: v => `$${v / 1000}k`,
|
|
31765
|
-
hide: true
|
|
31766
|
-
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
31767
|
-
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
31768
|
-
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31769
|
-
dataKey: "value",
|
|
31770
|
-
fill: "#CCDCDD",
|
|
31771
|
-
gap: "4px",
|
|
31772
|
-
borderRadius: [4, 4, 0, 8],
|
|
31773
|
-
barSize: 40,
|
|
31774
|
-
name: "INC Sales"
|
|
31775
|
-
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
31776
|
-
dataKey: "value",
|
|
31777
|
-
position: "top",
|
|
31778
|
-
formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
|
|
31779
|
-
fill: "#212121",
|
|
31780
|
-
fontSize: 12,
|
|
31903
|
+
fontSize: 16,
|
|
31781
31904
|
fontWeight: "400",
|
|
31782
31905
|
fontFamily: "Poppins"
|
|
31783
31906
|
})), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
31784
31907
|
height: 30,
|
|
31908
|
+
fill: "#EFEFEF",
|
|
31785
31909
|
travellerWidth: 10,
|
|
31786
31910
|
startIndex: 0,
|
|
31787
|
-
endIndex: Math.min(6,
|
|
31788
|
-
|
|
31911
|
+
endIndex: Math.min(6, brushAreaBarData.length - 1),
|
|
31912
|
+
className: "custom-brush"
|
|
31913
|
+
})))), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
|
|
31789
31914
|
width: "100%",
|
|
31790
|
-
height: "40px",
|
|
31791
|
-
legendData: [{
|
|
31792
|
-
iconColor: "#CCDCDD",
|
|
31793
|
-
iconType: "Square",
|
|
31794
|
-
title: "INC
|
|
31795
|
-
}
|
|
31796
|
-
|
|
31797
|
-
|
|
31798
|
-
|
|
31799
|
-
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
@media (max-width: 1536px) {
|
|
31803
|
-
gap: 20px;
|
|
31804
|
-
}
|
|
31805
|
-
@media (max-width: 1366px) {
|
|
31806
|
-
gap: 17px;
|
|
31807
|
-
}
|
|
31808
|
-
`;
|
|
31809
|
-
const ButtonsControlsContainer = styled__default["default"].div`
|
|
31810
|
-
display: flex;
|
|
31811
|
-
font: ${props => props.fontSize?.toString().concat('', 'px Poppins, sans-serif')};
|
|
31812
|
-
margin: 0;
|
|
31813
|
-
--highlight-width: auto;
|
|
31814
|
-
--highlight-x-pos: 0;
|
|
31815
|
-
-webkit-font-smoothing: antialiased;
|
|
31816
|
-
-moz-osx-font-smoothing: grayscale;
|
|
31817
|
-
float: left;
|
|
31818
|
-
|
|
31819
|
-
&:not(:first-of-type) {
|
|
31820
|
-
padding-left: 40px;
|
|
31821
|
-
@media (max-width: 1536px) {
|
|
31822
|
-
padding-left: 35px;
|
|
31823
|
-
}
|
|
31824
|
-
@media (max-width: 1366px) {
|
|
31825
|
-
padding-left: 24px;
|
|
31826
|
-
}
|
|
31827
|
-
}
|
|
31828
|
-
`;
|
|
31829
|
-
const Controls = styled__default["default"].div`
|
|
31830
|
-
display: inline-flex;
|
|
31831
|
-
justify-content: space-between;
|
|
31832
|
-
background: #f2f2f2;
|
|
31833
|
-
border-radius: ${props => props.controlradius.toString().concat('', 'px')}; //12px
|
|
31834
|
-
// max-width: 500px; //use this to limit max lenght of the control
|
|
31835
|
-
padding: 6px;
|
|
31836
|
-
gap: ${props => props.gap};
|
|
31837
|
-
overflow: hidden;
|
|
31838
|
-
position: relative;
|
|
31839
|
-
&.controls::before {
|
|
31840
|
-
content: "";
|
|
31841
|
-
color: #212121;
|
|
31842
|
-
background: #FFFFFF;
|
|
31843
|
-
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
|
31844
|
-
border-radius: ${props => props.segmentradius.toString().concat('', 'px')};
|
|
31845
|
-
width: var(--highlight-width);
|
|
31846
|
-
transform: translateX(var(--highlight-x-pos));
|
|
31847
|
-
position: absolute;
|
|
31848
|
-
top: 3px;
|
|
31849
|
-
bottom: 3px;
|
|
31850
|
-
left: 0;
|
|
31851
|
-
z-index: 0;
|
|
31852
|
-
}
|
|
31853
|
-
&.controls.ready::before {
|
|
31854
|
-
transition: transform 0.3s ease, width 0.3s ease;
|
|
31855
|
-
}
|
|
31856
|
-
`;
|
|
31857
|
-
const ControlsInput = styled__default["default"].input`
|
|
31858
|
-
opacity: 0;
|
|
31859
|
-
margin: 0;
|
|
31860
|
-
top: 0;
|
|
31861
|
-
right: 0;
|
|
31862
|
-
bottom: 0;
|
|
31863
|
-
left: 0;
|
|
31864
|
-
position: absolute;
|
|
31865
|
-
width: 100%;
|
|
31866
|
-
cursor: pointer;
|
|
31867
|
-
height: 100%;
|
|
31868
|
-
`;
|
|
31869
|
-
const Segment = styled__default["default"].div`
|
|
31870
|
-
/* width: 100%; uncomment for each segment to have matching width */
|
|
31871
|
-
width: 50%;
|
|
31872
|
-
min-width: ${props => props.segmentwidth.toString().concat('', 'px')}; //120px;
|
|
31873
|
-
position: relative;
|
|
31874
|
-
text-align: center;
|
|
31875
|
-
z-index: 1;
|
|
31876
|
-
`;
|
|
31877
|
-
const SegmentLabel = styled__default["default"].label`
|
|
31878
|
-
cursor: pointer;
|
|
31879
|
-
display: block;
|
|
31880
|
-
padding: 0 6px;
|
|
31881
|
-
transition: color 0.5s ease;
|
|
31882
|
-
&.active {
|
|
31883
|
-
color: ${props => props.selectedtextcolor};
|
|
31884
|
-
}
|
|
31885
|
-
&.inactive {
|
|
31886
|
-
color: ${props => props.unselectedtextcolor};
|
|
31887
|
-
}
|
|
31888
|
-
`;
|
|
31889
|
-
|
|
31890
|
-
/* eslint-disable react/require-default-props */
|
|
31915
|
+
height: "40px",
|
|
31916
|
+
legendData: [{
|
|
31917
|
+
iconColor: "#CCDCDD",
|
|
31918
|
+
iconType: "Square",
|
|
31919
|
+
title: "INC Sales"
|
|
31920
|
+
}, {
|
|
31921
|
+
iconColor: "#F8CD00",
|
|
31922
|
+
iconType: "LegendUnionIcon",
|
|
31923
|
+
title: "INC Sales ROI"
|
|
31924
|
+
}]
|
|
31925
|
+
}));
|
|
31926
|
+
};
|
|
31891
31927
|
|
|
31892
|
-
|
|
31893
|
-
const SegmentedButton = props => {
|
|
31928
|
+
const SingleChart = props => {
|
|
31894
31929
|
const {
|
|
31895
|
-
|
|
31896
|
-
options,
|
|
31897
|
-
width,
|
|
31898
|
-
height,
|
|
31899
|
-
controlradius,
|
|
31900
|
-
segmentradius,
|
|
31901
|
-
fontSize,
|
|
31902
|
-
selectedsegmentcolor,
|
|
31903
|
-
selectedtextcolor,
|
|
31904
|
-
unselectedtextcolor,
|
|
31905
|
-
defaultIndex,
|
|
31906
|
-
onClick,
|
|
31907
|
-
gap
|
|
31930
|
+
barData
|
|
31908
31931
|
} = props;
|
|
31909
|
-
const
|
|
31910
|
-
const
|
|
31911
|
-
const
|
|
31912
|
-
const optionsRef = options?.map((item, i) => ({
|
|
31932
|
+
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(barData.length);
|
|
31933
|
+
const MAX_LINES = 2;
|
|
31934
|
+
const dataWithIndex = barData?.map((item, index) => ({
|
|
31913
31935
|
...item,
|
|
31914
|
-
|
|
31915
|
-
|
|
31936
|
+
index,
|
|
31937
|
+
shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
|
|
31916
31938
|
}));
|
|
31939
|
+
const CustomizedTick = /*#__PURE__*/React__default["default"].memo(({
|
|
31940
|
+
x,
|
|
31941
|
+
y,
|
|
31942
|
+
payload
|
|
31943
|
+
}) => {
|
|
31944
|
+
const fullText = payload?.value ?? "";
|
|
31945
|
+
|
|
31946
|
+
/* ── 1. split text into lines that are ≤ MAX_CHARS_PER_LINE ─────────────── */
|
|
31947
|
+
const words = fullText.split(" ");
|
|
31948
|
+
const lines = [];
|
|
31949
|
+
let current = "";
|
|
31950
|
+
words.forEach(w => {
|
|
31951
|
+
// +1 so we count the space that will be added
|
|
31952
|
+
if ((current.length ? current.length + 1 : 0) + w.length > MAX_CHARS_PER_LINE) {
|
|
31953
|
+
lines.push(current.trim());
|
|
31954
|
+
current = w;
|
|
31955
|
+
} else {
|
|
31956
|
+
current += (current ? " " : "") + w;
|
|
31957
|
+
}
|
|
31958
|
+
});
|
|
31959
|
+
if (current) lines.push(current.trim());
|
|
31917
31960
|
|
|
31918
|
-
|
|
31919
|
-
|
|
31920
|
-
|
|
31921
|
-
|
|
31922
|
-
|
|
31923
|
-
|
|
31924
|
-
|
|
31961
|
+
/* ── 2. squash down to two lines & add "..." if necessary ───────────────── */
|
|
31962
|
+
if (lines.length > MAX_LINES) {
|
|
31963
|
+
const firstLine = lines[0]; // keep it as-is
|
|
31964
|
+
// join everything after the first line and truncate
|
|
31965
|
+
let secondLine = lines.slice(1).join(" ");
|
|
31966
|
+
if (secondLine.length > MAX_CHARS_PER_LINE - 3) {
|
|
31967
|
+
secondLine = secondLine.slice(0, MAX_CHARS_PER_LINE - 3).trim();
|
|
31968
|
+
}
|
|
31969
|
+
lines.length = 0;
|
|
31970
|
+
lines.push(firstLine, `${secondLine}…`);
|
|
31925
31971
|
}
|
|
31926
|
-
|
|
31927
|
-
|
|
31928
|
-
|
|
31929
|
-
|
|
31930
|
-
|
|
31931
|
-
|
|
31932
|
-
|
|
31933
|
-
|
|
31934
|
-
|
|
31935
|
-
|
|
31936
|
-
|
|
31937
|
-
|
|
31938
|
-
|
|
31939
|
-
|
|
31940
|
-
|
|
31941
|
-
|
|
31942
|
-
|
|
31943
|
-
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31972
|
+
|
|
31973
|
+
/* ── 3. render ──────────────────────────────────────────────────────────── */
|
|
31974
|
+
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31975
|
+
transform: `translate(${x},${y})`
|
|
31976
|
+
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
31977
|
+
textAnchor: "middle",
|
|
31978
|
+
fontFamily: "Poppins",
|
|
31979
|
+
fontSize: 14,
|
|
31980
|
+
fill: "#212121"
|
|
31981
|
+
}, lines.map((line, idx) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31982
|
+
key: idx,
|
|
31983
|
+
x: 0
|
|
31984
|
+
/* first line sits on the baseline (≈ 0.71 em down); every
|
|
31985
|
+
additional line gets another 1.2 em offset */,
|
|
31986
|
+
dy: idx === 0 ? "0.71em" : "1.2em"
|
|
31987
|
+
}, line))));
|
|
31988
|
+
});
|
|
31989
|
+
const CustomTooltip = ({
|
|
31990
|
+
active,
|
|
31991
|
+
payload
|
|
31992
|
+
}) => {
|
|
31993
|
+
if (!active || !payload || !payload.length) return null;
|
|
31994
|
+
const data = payload[0]?.payload;
|
|
31995
|
+
if (!data) return null;
|
|
31996
|
+
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
|
|
31947
31997
|
};
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
|
|
31951
|
-
|
|
31952
|
-
|
|
31953
|
-
|
|
31954
|
-
|
|
31955
|
-
|
|
31956
|
-
|
|
31957
|
-
|
|
31958
|
-
|
|
31959
|
-
|
|
31960
|
-
|
|
31961
|
-
|
|
31962
|
-
|
|
31963
|
-
|
|
31964
|
-
|
|
31965
|
-
|
|
31966
|
-
|
|
31967
|
-
|
|
31968
|
-
|
|
31969
|
-
|
|
31970
|
-
|
|
31971
|
-
|
|
31972
|
-
|
|
31973
|
-
|
|
31974
|
-
|
|
31975
|
-
|
|
31976
|
-
|
|
31977
|
-
|
|
31978
|
-
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31982
|
-
|
|
31983
|
-
|
|
31984
|
-
|
|
31985
|
-
},
|
|
31986
|
-
|
|
31987
|
-
|
|
31988
|
-
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
31992
|
-
|
|
31993
|
-
|
|
31994
|
-
|
|
31995
|
-
|
|
31996
|
-
|
|
31997
|
-
|
|
31998
|
-
|
|
31999
|
-
|
|
32000
|
-
|
|
32001
|
-
|
|
32002
|
-
|
|
32003
|
-
|
|
32004
|
-
|
|
32005
|
-
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
}
|
|
32009
|
-
value: "8 w"
|
|
32010
|
-
}, {
|
|
32011
|
-
value: "13 w"
|
|
32012
|
-
}],
|
|
32013
|
-
width: 120,
|
|
32014
|
-
height: 40,
|
|
32015
|
-
controlradius: 8,
|
|
32016
|
-
segmentradius: 8,
|
|
32017
|
-
gap: "0px",
|
|
32018
|
-
fontSize: 14,
|
|
32019
|
-
selectedsegmentcolor: "#3a9df9",
|
|
32020
|
-
selectedtextcolor: "#212121",
|
|
32021
|
-
unselectedtextcolor: "black",
|
|
32022
|
-
defaultIndex: 0,
|
|
32023
|
-
onClick: () => {}
|
|
31998
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31999
|
+
style: {
|
|
32000
|
+
width: "100%",
|
|
32001
|
+
height: "100%"
|
|
32002
|
+
}
|
|
32003
|
+
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
32004
|
+
width: "100%",
|
|
32005
|
+
height: "90%"
|
|
32006
|
+
}, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
|
|
32007
|
+
data: dataWithIndex,
|
|
32008
|
+
margin: {
|
|
32009
|
+
top: 40,
|
|
32010
|
+
right: 40,
|
|
32011
|
+
left: 20,
|
|
32012
|
+
bottom: 0
|
|
32013
|
+
}
|
|
32014
|
+
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
32015
|
+
strokeDasharray: "3 3",
|
|
32016
|
+
vertical: false
|
|
32017
|
+
}), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
|
|
32018
|
+
dataKey: "label",
|
|
32019
|
+
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
32020
|
+
interval: 0,
|
|
32021
|
+
height: 50,
|
|
32022
|
+
tickLine: false
|
|
32023
|
+
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
32024
|
+
type: "number",
|
|
32025
|
+
domain: [0, dataMax => dataMax * 1.3],
|
|
32026
|
+
hide: true
|
|
32027
|
+
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
32028
|
+
cursor: barData.length > 80,
|
|
32029
|
+
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
32030
|
+
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
32031
|
+
dataKey: "value",
|
|
32032
|
+
fill: "#CCDCDD",
|
|
32033
|
+
barSize: 53,
|
|
32034
|
+
name: "INC Sales"
|
|
32035
|
+
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
32036
|
+
dataKey: "value",
|
|
32037
|
+
position: "top",
|
|
32038
|
+
formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
|
|
32039
|
+
fill: "#212121",
|
|
32040
|
+
fontSize: 16,
|
|
32041
|
+
fontWeight: "400",
|
|
32042
|
+
fontFamily: "Poppins"
|
|
32043
|
+
})), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
32044
|
+
height: 30,
|
|
32045
|
+
fill: "#EFEFEF",
|
|
32046
|
+
travellerWidth: 10,
|
|
32047
|
+
startIndex: 0,
|
|
32048
|
+
endIndex: Math.min(6, barData.length - 1),
|
|
32049
|
+
className: "custom-brush"
|
|
32050
|
+
}))), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
|
|
32051
|
+
width: "100%",
|
|
32052
|
+
height: "40px",
|
|
32053
|
+
legendData: [{
|
|
32054
|
+
iconColor: "#CCDCDD",
|
|
32055
|
+
iconType: "Square",
|
|
32056
|
+
title: "INC Units"
|
|
32057
|
+
}]
|
|
32058
|
+
}));
|
|
32024
32059
|
};
|
|
32025
32060
|
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32061
|
+
const InnerBar = props => {
|
|
32062
|
+
const {
|
|
32063
|
+
brushInnerBarData
|
|
32064
|
+
} = props;
|
|
32065
|
+
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(brushInnerBarData.length);
|
|
32066
|
+
const MAX_LINES = 2;
|
|
32029
32067
|
const BarWithInner = props => {
|
|
32030
32068
|
const {
|
|
32031
32069
|
x,
|
|
@@ -32050,7 +32088,7 @@ function InnerBarChart({
|
|
|
32050
32088
|
x: x + width / 2,
|
|
32051
32089
|
y: y - 8,
|
|
32052
32090
|
textAnchor: "middle",
|
|
32053
|
-
fontSize:
|
|
32091
|
+
fontSize: 16,
|
|
32054
32092
|
fontWeight: 400,
|
|
32055
32093
|
fontFamily: "Poppins",
|
|
32056
32094
|
fill: "#212121"
|
|
@@ -32066,61 +32104,76 @@ function InnerBarChart({
|
|
|
32066
32104
|
x: x + width / 2,
|
|
32067
32105
|
y: innerY - 6,
|
|
32068
32106
|
textAnchor: "middle",
|
|
32069
|
-
fontSize:
|
|
32107
|
+
fontSize: 16,
|
|
32070
32108
|
fontWeight: 400,
|
|
32071
32109
|
fontFamily: "Poppins",
|
|
32072
32110
|
fill: "#212121"
|
|
32073
32111
|
}, `${getFormattedValue(payload.actual)}${getFormattedUnits(payload.actual)}`));
|
|
32074
32112
|
};
|
|
32075
|
-
const CustomTooltip = ({
|
|
32113
|
+
const CustomTooltip = /*#__PURE__*/React__default["default"].memo(({
|
|
32076
32114
|
active,
|
|
32077
|
-
payload
|
|
32078
|
-
label
|
|
32115
|
+
payload
|
|
32079
32116
|
}) => {
|
|
32080
32117
|
if (!active || !payload || !payload.length) return null;
|
|
32081
|
-
const data = payload[0].payload;
|
|
32082
|
-
const repeaterPercentage = (data.actual / data.total * 100).toFixed(1);
|
|
32083
|
-
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `New Shoppers: ${getFormattedValue(data.total)}${getFormattedUnits(data.total)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `Repeaters: ${getFormattedValue(data.actual)}${getFormattedUnits(data.actual)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
|
|
32084
|
-
};
|
|
32085
|
-
const CustomizedTick = props => {
|
|
32086
32118
|
const {
|
|
32087
|
-
|
|
32088
|
-
|
|
32089
|
-
|
|
32090
|
-
|
|
32091
|
-
|
|
32092
|
-
|
|
32093
|
-
|
|
32094
|
-
|
|
32095
|
-
|
|
32096
|
-
|
|
32097
|
-
|
|
32098
|
-
|
|
32099
|
-
|
|
32100
|
-
|
|
32119
|
+
label,
|
|
32120
|
+
description,
|
|
32121
|
+
total,
|
|
32122
|
+
actual
|
|
32123
|
+
} = payload[0].payload;
|
|
32124
|
+
const repeaterPercentage = (actual / total * 100).toFixed(1);
|
|
32125
|
+
return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, label), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, description), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `New Shoppers: ${getFormattedValue(total)}${getFormattedUnits(total)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `Repeaters: ${getFormattedValue(actual)}${getFormattedUnits(actual)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
|
|
32126
|
+
});
|
|
32127
|
+
const CustomizedTick = /*#__PURE__*/React__default["default"].memo(({
|
|
32128
|
+
x,
|
|
32129
|
+
y,
|
|
32130
|
+
payload
|
|
32131
|
+
}) => {
|
|
32132
|
+
const fullText = payload?.value ?? "";
|
|
32133
|
+
|
|
32134
|
+
/* ── 1. split text into lines that are ≤ MAX_CHARS_PER_LINE ─────────────── */
|
|
32135
|
+
const words = fullText.split(" ");
|
|
32136
|
+
const lines = [];
|
|
32137
|
+
let current = "";
|
|
32138
|
+
words.forEach(w => {
|
|
32139
|
+
// +1 so we count the space that will be added
|
|
32140
|
+
if ((current.length ? current.length + 1 : 0) + w.length > MAX_CHARS_PER_LINE) {
|
|
32141
|
+
lines.push(current.trim());
|
|
32142
|
+
current = w;
|
|
32101
32143
|
} else {
|
|
32102
|
-
|
|
32144
|
+
current += (current ? " " : "") + w;
|
|
32103
32145
|
}
|
|
32104
32146
|
});
|
|
32105
|
-
if (
|
|
32106
|
-
|
|
32147
|
+
if (current) lines.push(current.trim());
|
|
32148
|
+
|
|
32149
|
+
/* ── 2. squash down to two lines & add "..." if necessary ───────────────── */
|
|
32150
|
+
if (lines.length > MAX_LINES) {
|
|
32151
|
+
const firstLine = lines[0]; // keep it as-is
|
|
32152
|
+
// join everything after the first line and truncate
|
|
32153
|
+
let secondLine = lines.slice(1).join(" ");
|
|
32154
|
+
if (secondLine.length > MAX_CHARS_PER_LINE - 3) {
|
|
32155
|
+
secondLine = secondLine.slice(0, MAX_CHARS_PER_LINE - 3).trim();
|
|
32156
|
+
}
|
|
32157
|
+
lines.length = 0;
|
|
32158
|
+
lines.push(firstLine, `${secondLine}…`);
|
|
32107
32159
|
}
|
|
32160
|
+
|
|
32161
|
+
/* ── 3. render ──────────────────────────────────────────────────────────── */
|
|
32108
32162
|
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
32109
32163
|
transform: `translate(${x},${y})`
|
|
32110
32164
|
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
32111
|
-
x: 0,
|
|
32112
|
-
y: 0,
|
|
32113
|
-
dy: 16,
|
|
32114
32165
|
textAnchor: "middle",
|
|
32115
|
-
|
|
32116
|
-
fontSize:
|
|
32117
|
-
|
|
32118
|
-
},
|
|
32119
|
-
key:
|
|
32120
|
-
x: 0
|
|
32121
|
-
|
|
32122
|
-
|
|
32123
|
-
|
|
32166
|
+
fontFamily: "Poppins",
|
|
32167
|
+
fontSize: 14,
|
|
32168
|
+
fill: "#212121"
|
|
32169
|
+
}, lines.map((line, idx) => /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32170
|
+
key: idx,
|
|
32171
|
+
x: 0
|
|
32172
|
+
/* first line sits on the baseline (≈ 0.71 em down); every
|
|
32173
|
+
additional line gets another 1.2 em offset */,
|
|
32174
|
+
dy: idx === 0 ? "0.71em" : "1.2em"
|
|
32175
|
+
}, line))));
|
|
32176
|
+
});
|
|
32124
32177
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
32125
32178
|
style: {
|
|
32126
32179
|
width: "100%",
|
|
@@ -32128,14 +32181,14 @@ function InnerBarChart({
|
|
|
32128
32181
|
}
|
|
32129
32182
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
|
|
32130
32183
|
width: "100%",
|
|
32131
|
-
height: "
|
|
32184
|
+
height: "90%"
|
|
32132
32185
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
|
|
32133
32186
|
data: brushInnerBarData,
|
|
32134
32187
|
margin: {
|
|
32135
32188
|
top: 30,
|
|
32136
|
-
right:
|
|
32189
|
+
right: 20,
|
|
32137
32190
|
left: 20,
|
|
32138
|
-
bottom:
|
|
32191
|
+
bottom: 0
|
|
32139
32192
|
}
|
|
32140
32193
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
32141
32194
|
strokeDasharray: "3 3",
|
|
@@ -32143,23 +32196,27 @@ function InnerBarChart({
|
|
|
32143
32196
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
|
|
32144
32197
|
dataKey: "label",
|
|
32145
32198
|
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
|
|
32146
|
-
height:
|
|
32199
|
+
height: 50,
|
|
32200
|
+
tickLine: false,
|
|
32147
32201
|
interval: 0
|
|
32148
32202
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
32149
32203
|
type: "number",
|
|
32150
|
-
domain: [0,
|
|
32204
|
+
domain: [0, dataMax => dataMax * 1.3],
|
|
32151
32205
|
hide: true
|
|
32152
32206
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
32207
|
+
cursor: brushInnerBarData.length > 80,
|
|
32153
32208
|
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
32154
32209
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
32155
32210
|
dataKey: "total",
|
|
32156
32211
|
shape: /*#__PURE__*/React__default["default"].createElement(BarWithInner, null),
|
|
32157
|
-
barSize:
|
|
32212
|
+
barSize: 55
|
|
32158
32213
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
32159
32214
|
height: 30,
|
|
32215
|
+
fill: "#EFEFEF",
|
|
32160
32216
|
travellerWidth: 10,
|
|
32161
32217
|
startIndex: 0,
|
|
32162
|
-
endIndex: Math.min(6, brushInnerBarData.length - 1)
|
|
32218
|
+
endIndex: Math.min(6, brushInnerBarData.length - 1),
|
|
32219
|
+
className: "custom-brush"
|
|
32163
32220
|
}))), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
|
|
32164
32221
|
width: "100%",
|
|
32165
32222
|
height: "40px",
|
|
@@ -32173,7 +32230,7 @@ function InnerBarChart({
|
|
|
32173
32230
|
title: "Repeaters"
|
|
32174
32231
|
}]
|
|
32175
32232
|
}));
|
|
32176
|
-
}
|
|
32233
|
+
};
|
|
32177
32234
|
|
|
32178
32235
|
const BrushChart = props => {
|
|
32179
32236
|
const {
|
|
@@ -32183,14 +32240,14 @@ const BrushChart = props => {
|
|
|
32183
32240
|
brushBarIncData,
|
|
32184
32241
|
brushBarBasketData,
|
|
32185
32242
|
brushAreaBarData,
|
|
32243
|
+
segmentedbuttonOptions,
|
|
32186
32244
|
title
|
|
32187
32245
|
} = props;
|
|
32188
|
-
const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
|
|
32189
32246
|
const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
|
|
32190
32247
|
return /*#__PURE__*/React__default["default"].createElement(Container, {
|
|
32191
32248
|
height: height,
|
|
32192
32249
|
width: width
|
|
32193
|
-
}, /*#__PURE__*/React__default["default"].createElement(Title$1, null, title), /*#__PURE__*/React__default["default"].createElement(
|
|
32250
|
+
}, /*#__PURE__*/React__default["default"].createElement(Title$1, null, title), /*#__PURE__*/React__default["default"].createElement(SegmentedContainer, {
|
|
32194
32251
|
gap: "8px",
|
|
32195
32252
|
options: segmentedbuttonOptions.map(value => ({
|
|
32196
32253
|
value
|
|
@@ -32201,15 +32258,15 @@ const BrushChart = props => {
|
|
|
32201
32258
|
} = _ref;
|
|
32202
32259
|
return setSelectedOption(value);
|
|
32203
32260
|
}
|
|
32204
|
-
}), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(
|
|
32261
|
+
}), /*#__PURE__*/React__default["default"].createElement(ChartContainer, null, selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBar, {
|
|
32205
32262
|
brushInnerBarData: brushInnerBarData
|
|
32206
|
-
}), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(
|
|
32263
|
+
}), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(BarLine, {
|
|
32207
32264
|
brushAreaBarData: brushAreaBarData
|
|
32208
32265
|
}), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32209
32266
|
barData: brushBarIncData
|
|
32210
32267
|
}), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32211
32268
|
barData: brushBarBasketData
|
|
32212
|
-
}));
|
|
32269
|
+
})));
|
|
32213
32270
|
};
|
|
32214
32271
|
|
|
32215
32272
|
const Overlay = styled__default["default"].div`
|