td-plots 1.4.1 → 1.5.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/dist/components/Histogram.d.ts +2 -1
- package/dist/components/Utils.d.ts +1 -0
- package/dist/index.esm.js +333 -102
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +333 -102
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
package/dist/index.js
CHANGED
|
@@ -77,6 +77,26 @@ function calculateMean(arr) {
|
|
|
77
77
|
return sum / arr.length;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
// Calculate standard deviation of an array of numbers or dates
|
|
81
|
+
function calculateStandardDeviation(arr) {
|
|
82
|
+
if (arr.length === 0)
|
|
83
|
+
return undefined;
|
|
84
|
+
var mean = calculateMean(arr);
|
|
85
|
+
if (mean === undefined)
|
|
86
|
+
return undefined;
|
|
87
|
+
var sumOfSquares = 0;
|
|
88
|
+
if (isNumberArray(arr)) {
|
|
89
|
+
sumOfSquares = arr.reduce(function (acc, num) { return acc + Math.pow(num - mean, 2); }, 0);
|
|
90
|
+
}
|
|
91
|
+
else if (isDateArray(arr)) {
|
|
92
|
+
sumOfSquares = arr.reduce(function (acc, date) { return acc + Math.pow(date.getTime() - mean, 2); }, 0);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
var variance = sumOfSquares / arr.length;
|
|
98
|
+
return Math.sqrt(variance);
|
|
99
|
+
}
|
|
80
100
|
// Utilities for rounding dates to the nearest day.
|
|
81
101
|
// Helpful for making nice bins
|
|
82
102
|
var roundToNextDay = function (timestamp) {
|
|
@@ -1735,7 +1755,7 @@ const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.one
|
|
|
1735
1755
|
* For using in `sx` prop to sort the breakpoint from low to high.
|
|
1736
1756
|
* Note: this function does not work and will not support multiple units.
|
|
1737
1757
|
* e.g. input: { '@container (min-width:300px)': '1rem', '@container (min-width:40rem)': '2rem' }
|
|
1738
|
-
* output: { '@container (min-width:40rem)': '2rem', '@container (min-width:300px)': '1rem' } // since 40 < 300
|
|
1758
|
+
* output: { '@container (min-width:40rem)': '2rem', '@container (min-width:300px)': '1rem' } // since 40 < 300 even though 40rem > 300px
|
|
1739
1759
|
*/
|
|
1740
1760
|
function sortContainerQueries(theme, css) {
|
|
1741
1761
|
if (!theme.containerQueries) {
|
|
@@ -2760,7 +2780,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
2760
2780
|
styleFunctionSx.filterProps = ['sx'];
|
|
2761
2781
|
|
|
2762
2782
|
/**
|
|
2763
|
-
* @mui/styled-engine v7.2
|
|
2783
|
+
* @mui/styled-engine v7.3.2
|
|
2764
2784
|
*
|
|
2765
2785
|
* @license MIT
|
|
2766
2786
|
* This source code is licensed under the MIT license found in the
|
|
@@ -3707,6 +3727,9 @@ function private_safeAlpha(color, value, warning) {
|
|
|
3707
3727
|
try {
|
|
3708
3728
|
return alpha(color, value);
|
|
3709
3729
|
} catch (error) {
|
|
3730
|
+
if (warning && process.env.NODE_ENV !== 'production') {
|
|
3731
|
+
console.warn(warning);
|
|
3732
|
+
}
|
|
3710
3733
|
return color;
|
|
3711
3734
|
}
|
|
3712
3735
|
}
|
|
@@ -3733,6 +3756,9 @@ function private_safeDarken(color, coefficient, warning) {
|
|
|
3733
3756
|
try {
|
|
3734
3757
|
return darken(color, coefficient);
|
|
3735
3758
|
} catch (error) {
|
|
3759
|
+
if (warning && process.env.NODE_ENV !== 'production') {
|
|
3760
|
+
console.warn(warning);
|
|
3761
|
+
}
|
|
3736
3762
|
return color;
|
|
3737
3763
|
}
|
|
3738
3764
|
}
|
|
@@ -3763,6 +3789,9 @@ function private_safeLighten(color, coefficient, warning) {
|
|
|
3763
3789
|
try {
|
|
3764
3790
|
return lighten(color, coefficient);
|
|
3765
3791
|
} catch (error) {
|
|
3792
|
+
if (warning && process.env.NODE_ENV !== 'production') {
|
|
3793
|
+
console.warn(warning);
|
|
3794
|
+
}
|
|
3766
3795
|
return color;
|
|
3767
3796
|
}
|
|
3768
3797
|
}
|
|
@@ -4018,7 +4047,8 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
4018
4047
|
const {
|
|
4019
4048
|
getSelector = defaultGetSelector,
|
|
4020
4049
|
disableCssColorScheme,
|
|
4021
|
-
colorSchemeSelector: selector
|
|
4050
|
+
colorSchemeSelector: selector,
|
|
4051
|
+
enableContrastVars
|
|
4022
4052
|
} = parserConfig;
|
|
4023
4053
|
// @ts-ignore - ignore components do not exist
|
|
4024
4054
|
const {
|
|
@@ -4156,6 +4186,16 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
4156
4186
|
...finalCss
|
|
4157
4187
|
}), finalCss);
|
|
4158
4188
|
});
|
|
4189
|
+
if (enableContrastVars) {
|
|
4190
|
+
stylesheets.push({
|
|
4191
|
+
':root': {
|
|
4192
|
+
// use double underscore to indicate that these are private variables
|
|
4193
|
+
'--__l-threshold': '0.7',
|
|
4194
|
+
'--__l': 'clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)',
|
|
4195
|
+
'--__a': 'clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)' // 0.87 is the default alpha value for black text.
|
|
4196
|
+
}
|
|
4197
|
+
});
|
|
4198
|
+
}
|
|
4159
4199
|
return stylesheets;
|
|
4160
4200
|
};
|
|
4161
4201
|
return {
|
|
@@ -4341,6 +4381,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
|
4341
4381
|
}
|
|
4342
4382
|
}
|
|
4343
4383
|
}
|
|
4384
|
+
function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
|
|
4385
|
+
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
4386
|
+
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
4387
|
+
if (!intent[direction]) {
|
|
4388
|
+
if (intent.hasOwnProperty(shade)) {
|
|
4389
|
+
intent[direction] = intent[shade];
|
|
4390
|
+
} else if (direction === 'light') {
|
|
4391
|
+
intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
|
|
4392
|
+
} else if (direction === 'dark') {
|
|
4393
|
+
intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4344
4397
|
function getDefaultPrimary(mode = 'light') {
|
|
4345
4398
|
if (mode === 'dark') {
|
|
4346
4399
|
return {
|
|
@@ -4426,11 +4479,17 @@ function getDefaultWarning(mode = 'light') {
|
|
|
4426
4479
|
dark: orange[900]
|
|
4427
4480
|
};
|
|
4428
4481
|
}
|
|
4482
|
+
|
|
4483
|
+
// Use the same name as the experimental CSS `contrast-color` function.
|
|
4484
|
+
function contrastColor(background) {
|
|
4485
|
+
return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
|
|
4486
|
+
}
|
|
4429
4487
|
function createPalette(palette) {
|
|
4430
4488
|
const {
|
|
4431
4489
|
mode = 'light',
|
|
4432
4490
|
contrastThreshold = 3,
|
|
4433
4491
|
tonalOffset = 0.2,
|
|
4492
|
+
colorSpace,
|
|
4434
4493
|
...other
|
|
4435
4494
|
} = palette;
|
|
4436
4495
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
@@ -4444,6 +4503,9 @@ function createPalette(palette) {
|
|
|
4444
4503
|
// Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
|
|
4445
4504
|
// and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
|
|
4446
4505
|
function getContrastText(background) {
|
|
4506
|
+
if (colorSpace) {
|
|
4507
|
+
return contrastColor(background);
|
|
4508
|
+
}
|
|
4447
4509
|
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
4448
4510
|
if (process.env.NODE_ENV !== 'production') {
|
|
4449
4511
|
const contrast = getContrastRatio(background, contrastText);
|
|
@@ -4472,8 +4534,13 @@ function createPalette(palette) {
|
|
|
4472
4534
|
if (typeof color.main !== 'string') {
|
|
4473
4535
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
4474
4536
|
}
|
|
4475
|
-
|
|
4476
|
-
|
|
4537
|
+
if (colorSpace) {
|
|
4538
|
+
mixLightOrDark(colorSpace, color, 'light', lightShade, tonalOffset);
|
|
4539
|
+
mixLightOrDark(colorSpace, color, 'dark', darkShade, tonalOffset);
|
|
4540
|
+
} else {
|
|
4541
|
+
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
4542
|
+
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
|
4543
|
+
}
|
|
4477
4544
|
if (!color.contrastText) {
|
|
4478
4545
|
color.contrastText = getContrastText(color.main);
|
|
4479
4546
|
}
|
|
@@ -4838,6 +4905,58 @@ theme.transitions = createTransitions(theme.transitions || {});
|
|
|
4838
4905
|
export default theme;`;
|
|
4839
4906
|
}
|
|
4840
4907
|
|
|
4908
|
+
function coefficientToPercentage(coefficient) {
|
|
4909
|
+
if (typeof coefficient === 'number') {
|
|
4910
|
+
return `${(coefficient * 100).toFixed(0)}%`;
|
|
4911
|
+
}
|
|
4912
|
+
return `calc((${coefficient}) * 100%)`;
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4915
|
+
// This can be removed when moved to `color-mix()` entirely.
|
|
4916
|
+
const parseAddition = str => {
|
|
4917
|
+
if (!Number.isNaN(+str)) {
|
|
4918
|
+
return +str;
|
|
4919
|
+
}
|
|
4920
|
+
const numbers = str.match(/\d*\.?\d+/g);
|
|
4921
|
+
if (!numbers) {
|
|
4922
|
+
return 0;
|
|
4923
|
+
}
|
|
4924
|
+
let sum = 0;
|
|
4925
|
+
for (let i = 0; i < numbers.length; i += 1) {
|
|
4926
|
+
sum += +numbers[i];
|
|
4927
|
+
}
|
|
4928
|
+
return sum;
|
|
4929
|
+
};
|
|
4930
|
+
function attachColorManipulators(theme) {
|
|
4931
|
+
Object.assign(theme, {
|
|
4932
|
+
alpha(color, coefficient) {
|
|
4933
|
+
const obj = this || theme;
|
|
4934
|
+
if (obj.colorSpace) {
|
|
4935
|
+
return `oklch(from ${color} l c h / ${typeof coefficient === 'string' ? `calc(${coefficient})` : coefficient})`;
|
|
4936
|
+
}
|
|
4937
|
+
if (obj.vars) {
|
|
4938
|
+
// To preserve the behavior of the CSS theme variables
|
|
4939
|
+
// In the future, this could be replaced by `color-mix` (when https://caniuse.com/?search=color-mix reaches 95%).
|
|
4940
|
+
return `rgba(${color.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, 'var(--$1Channel)')} / ${typeof coefficient === 'string' ? `calc(${coefficient})` : coefficient})`;
|
|
4941
|
+
}
|
|
4942
|
+
return alpha(color, parseAddition(coefficient));
|
|
4943
|
+
},
|
|
4944
|
+
lighten(color, coefficient) {
|
|
4945
|
+
const obj = this || theme;
|
|
4946
|
+
if (obj.colorSpace) {
|
|
4947
|
+
return `color-mix(in ${obj.colorSpace}, ${color}, #fff ${coefficientToPercentage(coefficient)})`;
|
|
4948
|
+
}
|
|
4949
|
+
return lighten(color, coefficient);
|
|
4950
|
+
},
|
|
4951
|
+
darken(color, coefficient) {
|
|
4952
|
+
const obj = this || theme;
|
|
4953
|
+
if (obj.colorSpace) {
|
|
4954
|
+
return `color-mix(in ${obj.colorSpace}, ${color}, #000 ${coefficientToPercentage(coefficient)})`;
|
|
4955
|
+
}
|
|
4956
|
+
return darken(color, coefficient);
|
|
4957
|
+
}
|
|
4958
|
+
});
|
|
4959
|
+
}
|
|
4841
4960
|
function createThemeNoVars(options = {}, ...args) {
|
|
4842
4961
|
const {
|
|
4843
4962
|
breakpoints: breakpointsInput,
|
|
@@ -4847,6 +4966,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
4847
4966
|
transitions: transitionsInput = {},
|
|
4848
4967
|
typography: typographyInput = {},
|
|
4849
4968
|
shape: shapeInput,
|
|
4969
|
+
colorSpace,
|
|
4850
4970
|
...other
|
|
4851
4971
|
} = options;
|
|
4852
4972
|
if (options.vars &&
|
|
@@ -4857,7 +4977,10 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
4857
4977
|
// #host-reference
|
|
4858
4978
|
'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : formatMuiErrorMessage(20));
|
|
4859
4979
|
}
|
|
4860
|
-
const palette = createPalette(
|
|
4980
|
+
const palette = createPalette({
|
|
4981
|
+
...paletteInput,
|
|
4982
|
+
colorSpace
|
|
4983
|
+
});
|
|
4861
4984
|
const systemTheme = createTheme$1(options);
|
|
4862
4985
|
let muiTheme = deepmerge(systemTheme, {
|
|
4863
4986
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
@@ -4914,6 +5037,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
4914
5037
|
};
|
|
4915
5038
|
muiTheme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration
|
|
4916
5039
|
|
|
5040
|
+
attachColorManipulators(muiTheme);
|
|
4917
5041
|
return muiTheme;
|
|
4918
5042
|
}
|
|
4919
5043
|
|
|
@@ -4954,9 +5078,14 @@ function createColorScheme(options) {
|
|
|
4954
5078
|
// need to cast to avoid module augmentation test
|
|
4955
5079
|
opacity,
|
|
4956
5080
|
overlays,
|
|
5081
|
+
colorSpace,
|
|
4957
5082
|
...rest
|
|
4958
5083
|
} = options;
|
|
4959
|
-
|
|
5084
|
+
// need to cast because `colorSpace` is considered internal at the moment.
|
|
5085
|
+
const palette = createPalette({
|
|
5086
|
+
...paletteInput,
|
|
5087
|
+
colorSpace
|
|
5088
|
+
});
|
|
4960
5089
|
return {
|
|
4961
5090
|
palette,
|
|
4962
5091
|
opacity: {
|
|
@@ -5082,7 +5211,7 @@ const silent = fn => {
|
|
|
5082
5211
|
return undefined;
|
|
5083
5212
|
};
|
|
5084
5213
|
const createGetCssVar = (cssVarPrefix = 'mui') => createGetCssVar$1(cssVarPrefix);
|
|
5085
|
-
function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
5214
|
+
function attachColorScheme$1(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
|
|
5086
5215
|
if (!scheme) {
|
|
5087
5216
|
return undefined;
|
|
5088
5217
|
}
|
|
@@ -5094,7 +5223,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
5094
5223
|
palette: {
|
|
5095
5224
|
mode,
|
|
5096
5225
|
...scheme?.palette
|
|
5097
|
-
}
|
|
5226
|
+
},
|
|
5227
|
+
colorSpace
|
|
5098
5228
|
});
|
|
5099
5229
|
return undefined;
|
|
5100
5230
|
}
|
|
@@ -5106,7 +5236,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
5106
5236
|
palette: {
|
|
5107
5237
|
mode,
|
|
5108
5238
|
...scheme?.palette
|
|
5109
|
-
}
|
|
5239
|
+
},
|
|
5240
|
+
colorSpace
|
|
5110
5241
|
});
|
|
5111
5242
|
colorSchemes[colorScheme] = {
|
|
5112
5243
|
...scheme,
|
|
@@ -5136,6 +5267,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5136
5267
|
defaultColorScheme: defaultColorSchemeInput,
|
|
5137
5268
|
disableCssColorScheme = false,
|
|
5138
5269
|
cssVarPrefix = 'mui',
|
|
5270
|
+
nativeColor = false,
|
|
5139
5271
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
|
|
5140
5272
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,
|
|
5141
5273
|
rootSelector = ':root',
|
|
@@ -5163,13 +5295,19 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5163
5295
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.` : formatMuiErrorMessage(21, defaultColorScheme));
|
|
5164
5296
|
}
|
|
5165
5297
|
|
|
5298
|
+
// The reason to use `oklch` is that it is the most perceptually uniform color space and widely supported.
|
|
5299
|
+
let colorSpace;
|
|
5300
|
+
if (nativeColor) {
|
|
5301
|
+
colorSpace = 'oklch';
|
|
5302
|
+
}
|
|
5303
|
+
|
|
5166
5304
|
// Create the palette for the default color scheme, either `light`, `dark`, or custom color scheme.
|
|
5167
|
-
const muiTheme = attachColorScheme$1(colorSchemes, defaultScheme, input, defaultColorScheme);
|
|
5305
|
+
const muiTheme = attachColorScheme$1(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
|
|
5168
5306
|
if (builtInLight && !colorSchemes.light) {
|
|
5169
|
-
attachColorScheme$1(colorSchemes, builtInLight, undefined, 'light');
|
|
5307
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInLight, undefined, 'light');
|
|
5170
5308
|
}
|
|
5171
5309
|
if (builtInDark && !colorSchemes.dark) {
|
|
5172
|
-
attachColorScheme$1(colorSchemes, builtInDark, undefined, 'dark');
|
|
5310
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInDark, undefined, 'dark');
|
|
5173
5311
|
}
|
|
5174
5312
|
let theme = {
|
|
5175
5313
|
defaultColorScheme,
|
|
@@ -5203,14 +5341,30 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5203
5341
|
setColor(palette.common, 'background', '#000');
|
|
5204
5342
|
setColor(palette.common, 'onBackground', '#fff');
|
|
5205
5343
|
}
|
|
5344
|
+
function colorMix(method, color, coefficient) {
|
|
5345
|
+
if (colorSpace) {
|
|
5346
|
+
let mixer;
|
|
5347
|
+
if (method === private_safeAlpha) {
|
|
5348
|
+
mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
|
|
5349
|
+
}
|
|
5350
|
+
if (method === private_safeDarken) {
|
|
5351
|
+
mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
|
|
5352
|
+
}
|
|
5353
|
+
if (method === private_safeLighten) {
|
|
5354
|
+
mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
|
|
5355
|
+
}
|
|
5356
|
+
return `color-mix(in ${colorSpace}, ${color}, ${mixer})`;
|
|
5357
|
+
}
|
|
5358
|
+
return method(color, coefficient);
|
|
5359
|
+
}
|
|
5206
5360
|
|
|
5207
5361
|
// assign component variables
|
|
5208
5362
|
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
5209
5363
|
if (palette.mode === 'light') {
|
|
5210
|
-
setColor(palette.Alert, 'errorColor', private_safeDarken
|
|
5211
|
-
setColor(palette.Alert, 'infoColor', private_safeDarken
|
|
5212
|
-
setColor(palette.Alert, 'successColor', private_safeDarken
|
|
5213
|
-
setColor(palette.Alert, 'warningColor', private_safeDarken
|
|
5364
|
+
setColor(palette.Alert, 'errorColor', colorMix(private_safeDarken, palette.error.light, 0.6));
|
|
5365
|
+
setColor(palette.Alert, 'infoColor', colorMix(private_safeDarken, palette.info.light, 0.6));
|
|
5366
|
+
setColor(palette.Alert, 'successColor', colorMix(private_safeDarken, palette.success.light, 0.6));
|
|
5367
|
+
setColor(palette.Alert, 'warningColor', colorMix(private_safeDarken, palette.warning.light, 0.6));
|
|
5214
5368
|
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-main'));
|
|
5215
5369
|
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-main'));
|
|
5216
5370
|
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-main'));
|
|
@@ -5219,10 +5373,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5219
5373
|
setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.main)));
|
|
5220
5374
|
setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.main)));
|
|
5221
5375
|
setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.main)));
|
|
5222
|
-
setColor(palette.Alert, 'errorStandardBg', private_safeLighten
|
|
5223
|
-
setColor(palette.Alert, 'infoStandardBg', private_safeLighten
|
|
5224
|
-
setColor(palette.Alert, 'successStandardBg', private_safeLighten
|
|
5225
|
-
setColor(palette.Alert, 'warningStandardBg', private_safeLighten
|
|
5376
|
+
setColor(palette.Alert, 'errorStandardBg', colorMix(private_safeLighten, palette.error.light, 0.9));
|
|
5377
|
+
setColor(palette.Alert, 'infoStandardBg', colorMix(private_safeLighten, palette.info.light, 0.9));
|
|
5378
|
+
setColor(palette.Alert, 'successStandardBg', colorMix(private_safeLighten, palette.success.light, 0.9));
|
|
5379
|
+
setColor(palette.Alert, 'warningStandardBg', colorMix(private_safeLighten, palette.warning.light, 0.9));
|
|
5226
5380
|
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
|
5227
5381
|
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
|
5228
5382
|
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
|
@@ -5237,41 +5391,42 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5237
5391
|
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
5238
5392
|
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
5239
5393
|
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
5240
|
-
setColor(palette.LinearProgress, 'primaryBg', private_safeLighten
|
|
5241
|
-
setColor(palette.LinearProgress, 'secondaryBg', private_safeLighten
|
|
5242
|
-
setColor(palette.LinearProgress, 'errorBg', private_safeLighten
|
|
5243
|
-
setColor(palette.LinearProgress, 'infoBg', private_safeLighten
|
|
5244
|
-
setColor(palette.LinearProgress, 'successBg', private_safeLighten
|
|
5245
|
-
setColor(palette.LinearProgress, 'warningBg', private_safeLighten
|
|
5246
|
-
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.11)`);
|
|
5247
|
-
setColor(palette.Slider, 'primaryTrack', private_safeLighten
|
|
5248
|
-
setColor(palette.Slider, 'secondaryTrack', private_safeLighten
|
|
5249
|
-
setColor(palette.Slider, 'errorTrack', private_safeLighten
|
|
5250
|
-
setColor(palette.Slider, 'infoTrack', private_safeLighten
|
|
5251
|
-
setColor(palette.Slider, 'successTrack', private_safeLighten
|
|
5252
|
-
setColor(palette.Slider, 'warningTrack', private_safeLighten
|
|
5253
|
-
const snackbarContentBackground =
|
|
5394
|
+
setColor(palette.LinearProgress, 'primaryBg', colorMix(private_safeLighten, palette.primary.main, 0.62));
|
|
5395
|
+
setColor(palette.LinearProgress, 'secondaryBg', colorMix(private_safeLighten, palette.secondary.main, 0.62));
|
|
5396
|
+
setColor(palette.LinearProgress, 'errorBg', colorMix(private_safeLighten, palette.error.main, 0.62));
|
|
5397
|
+
setColor(palette.LinearProgress, 'infoBg', colorMix(private_safeLighten, palette.info.main, 0.62));
|
|
5398
|
+
setColor(palette.LinearProgress, 'successBg', colorMix(private_safeLighten, palette.success.main, 0.62));
|
|
5399
|
+
setColor(palette.LinearProgress, 'warningBg', colorMix(private_safeLighten, palette.warning.main, 0.62));
|
|
5400
|
+
setColor(palette.Skeleton, 'bg', colorSpace ? colorMix(private_safeAlpha, palette.text.primary, 0.11) : `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.11)`);
|
|
5401
|
+
setColor(palette.Slider, 'primaryTrack', colorMix(private_safeLighten, palette.primary.main, 0.62));
|
|
5402
|
+
setColor(palette.Slider, 'secondaryTrack', colorMix(private_safeLighten, palette.secondary.main, 0.62));
|
|
5403
|
+
setColor(palette.Slider, 'errorTrack', colorMix(private_safeLighten, palette.error.main, 0.62));
|
|
5404
|
+
setColor(palette.Slider, 'infoTrack', colorMix(private_safeLighten, palette.info.main, 0.62));
|
|
5405
|
+
setColor(palette.Slider, 'successTrack', colorMix(private_safeLighten, palette.success.main, 0.62));
|
|
5406
|
+
setColor(palette.Slider, 'warningTrack', colorMix(private_safeLighten, palette.warning.main, 0.62));
|
|
5407
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, palette.background.default, 0.6825) // use `0.6825` instead of `0.8` to match the contrast ratio of JS implementation
|
|
5408
|
+
: private_safeEmphasize(palette.background.default, 0.8);
|
|
5254
5409
|
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
5255
|
-
setColor(palette.SnackbarContent, 'color', silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
5410
|
+
setColor(palette.SnackbarContent, 'color', silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
5256
5411
|
setColor(palette.SpeedDialAction, 'fabHoverBg', private_safeEmphasize(palette.background.paper, 0.15));
|
|
5257
5412
|
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-400'));
|
|
5258
5413
|
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-400'));
|
|
5259
5414
|
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-common-white'));
|
|
5260
5415
|
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-100'));
|
|
5261
|
-
setColor(palette.Switch, 'primaryDisabledColor', private_safeLighten
|
|
5262
|
-
setColor(palette.Switch, 'secondaryDisabledColor', private_safeLighten
|
|
5263
|
-
setColor(palette.Switch, 'errorDisabledColor', private_safeLighten
|
|
5264
|
-
setColor(palette.Switch, 'infoDisabledColor', private_safeLighten
|
|
5265
|
-
setColor(palette.Switch, 'successDisabledColor', private_safeLighten
|
|
5266
|
-
setColor(palette.Switch, 'warningDisabledColor', private_safeLighten
|
|
5267
|
-
setColor(palette.TableCell, 'border', private_safeLighten(private_safeAlpha
|
|
5268
|
-
setColor(palette.Tooltip, 'bg', private_safeAlpha
|
|
5416
|
+
setColor(palette.Switch, 'primaryDisabledColor', colorMix(private_safeLighten, palette.primary.main, 0.62));
|
|
5417
|
+
setColor(palette.Switch, 'secondaryDisabledColor', colorMix(private_safeLighten, palette.secondary.main, 0.62));
|
|
5418
|
+
setColor(palette.Switch, 'errorDisabledColor', colorMix(private_safeLighten, palette.error.main, 0.62));
|
|
5419
|
+
setColor(palette.Switch, 'infoDisabledColor', colorMix(private_safeLighten, palette.info.main, 0.62));
|
|
5420
|
+
setColor(palette.Switch, 'successDisabledColor', colorMix(private_safeLighten, palette.success.main, 0.62));
|
|
5421
|
+
setColor(palette.Switch, 'warningDisabledColor', colorMix(private_safeLighten, palette.warning.main, 0.62));
|
|
5422
|
+
setColor(palette.TableCell, 'border', colorMix(private_safeLighten, colorMix(private_safeAlpha, palette.divider, 1), 0.88));
|
|
5423
|
+
setColor(palette.Tooltip, 'bg', colorMix(private_safeAlpha, palette.grey[700], 0.92));
|
|
5269
5424
|
}
|
|
5270
5425
|
if (palette.mode === 'dark') {
|
|
5271
|
-
setColor(palette.Alert, 'errorColor', private_safeLighten
|
|
5272
|
-
setColor(palette.Alert, 'infoColor', private_safeLighten
|
|
5273
|
-
setColor(palette.Alert, 'successColor', private_safeLighten
|
|
5274
|
-
setColor(palette.Alert, 'warningColor', private_safeLighten
|
|
5426
|
+
setColor(palette.Alert, 'errorColor', colorMix(private_safeLighten, palette.error.light, 0.6));
|
|
5427
|
+
setColor(palette.Alert, 'infoColor', colorMix(private_safeLighten, palette.info.light, 0.6));
|
|
5428
|
+
setColor(palette.Alert, 'successColor', colorMix(private_safeLighten, palette.success.light, 0.6));
|
|
5429
|
+
setColor(palette.Alert, 'warningColor', colorMix(private_safeLighten, palette.warning.light, 0.6));
|
|
5275
5430
|
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-dark'));
|
|
5276
5431
|
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-dark'));
|
|
5277
5432
|
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-dark'));
|
|
@@ -5280,10 +5435,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5280
5435
|
setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.dark)));
|
|
5281
5436
|
setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.dark)));
|
|
5282
5437
|
setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.dark)));
|
|
5283
|
-
setColor(palette.Alert, 'errorStandardBg', private_safeDarken
|
|
5284
|
-
setColor(palette.Alert, 'infoStandardBg', private_safeDarken
|
|
5285
|
-
setColor(palette.Alert, 'successStandardBg', private_safeDarken
|
|
5286
|
-
setColor(palette.Alert, 'warningStandardBg', private_safeDarken
|
|
5438
|
+
setColor(palette.Alert, 'errorStandardBg', colorMix(private_safeDarken, palette.error.light, 0.9));
|
|
5439
|
+
setColor(palette.Alert, 'infoStandardBg', colorMix(private_safeDarken, palette.info.light, 0.9));
|
|
5440
|
+
setColor(palette.Alert, 'successStandardBg', colorMix(private_safeDarken, palette.success.light, 0.9));
|
|
5441
|
+
setColor(palette.Alert, 'warningStandardBg', colorMix(private_safeDarken, palette.warning.light, 0.9));
|
|
5287
5442
|
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
|
5288
5443
|
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
|
5289
5444
|
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
|
@@ -5300,35 +5455,36 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5300
5455
|
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
5301
5456
|
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
5302
5457
|
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
5303
|
-
setColor(palette.LinearProgress, 'primaryBg', private_safeDarken
|
|
5304
|
-
setColor(palette.LinearProgress, 'secondaryBg', private_safeDarken
|
|
5305
|
-
setColor(palette.LinearProgress, 'errorBg', private_safeDarken
|
|
5306
|
-
setColor(palette.LinearProgress, 'infoBg', private_safeDarken
|
|
5307
|
-
setColor(palette.LinearProgress, 'successBg', private_safeDarken
|
|
5308
|
-
setColor(palette.LinearProgress, 'warningBg', private_safeDarken
|
|
5309
|
-
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.13)`);
|
|
5310
|
-
setColor(palette.Slider, 'primaryTrack', private_safeDarken
|
|
5311
|
-
setColor(palette.Slider, 'secondaryTrack', private_safeDarken
|
|
5312
|
-
setColor(palette.Slider, 'errorTrack', private_safeDarken
|
|
5313
|
-
setColor(palette.Slider, 'infoTrack', private_safeDarken
|
|
5314
|
-
setColor(palette.Slider, 'successTrack', private_safeDarken
|
|
5315
|
-
setColor(palette.Slider, 'warningTrack', private_safeDarken
|
|
5316
|
-
const snackbarContentBackground =
|
|
5458
|
+
setColor(palette.LinearProgress, 'primaryBg', colorMix(private_safeDarken, palette.primary.main, 0.5));
|
|
5459
|
+
setColor(palette.LinearProgress, 'secondaryBg', colorMix(private_safeDarken, palette.secondary.main, 0.5));
|
|
5460
|
+
setColor(palette.LinearProgress, 'errorBg', colorMix(private_safeDarken, palette.error.main, 0.5));
|
|
5461
|
+
setColor(palette.LinearProgress, 'infoBg', colorMix(private_safeDarken, palette.info.main, 0.5));
|
|
5462
|
+
setColor(palette.LinearProgress, 'successBg', colorMix(private_safeDarken, palette.success.main, 0.5));
|
|
5463
|
+
setColor(palette.LinearProgress, 'warningBg', colorMix(private_safeDarken, palette.warning.main, 0.5));
|
|
5464
|
+
setColor(palette.Skeleton, 'bg', colorSpace ? colorMix(private_safeAlpha, palette.text.primary, 0.13) : `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.13)`);
|
|
5465
|
+
setColor(palette.Slider, 'primaryTrack', colorMix(private_safeDarken, palette.primary.main, 0.5));
|
|
5466
|
+
setColor(palette.Slider, 'secondaryTrack', colorMix(private_safeDarken, palette.secondary.main, 0.5));
|
|
5467
|
+
setColor(palette.Slider, 'errorTrack', colorMix(private_safeDarken, palette.error.main, 0.5));
|
|
5468
|
+
setColor(palette.Slider, 'infoTrack', colorMix(private_safeDarken, palette.info.main, 0.5));
|
|
5469
|
+
setColor(palette.Slider, 'successTrack', colorMix(private_safeDarken, palette.success.main, 0.5));
|
|
5470
|
+
setColor(palette.Slider, 'warningTrack', colorMix(private_safeDarken, palette.warning.main, 0.5));
|
|
5471
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, palette.background.default, 0.985) // use `0.985` instead of `0.98` to match the contrast ratio of JS implementation
|
|
5472
|
+
: private_safeEmphasize(palette.background.default, 0.98);
|
|
5317
5473
|
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
5318
|
-
setColor(palette.SnackbarContent, 'color', silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
5474
|
+
setColor(palette.SnackbarContent, 'color', silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
5319
5475
|
setColor(palette.SpeedDialAction, 'fabHoverBg', private_safeEmphasize(palette.background.paper, 0.15));
|
|
5320
5476
|
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-600'));
|
|
5321
5477
|
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-600'));
|
|
5322
5478
|
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-grey-300'));
|
|
5323
5479
|
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-600'));
|
|
5324
|
-
setColor(palette.Switch, 'primaryDisabledColor', private_safeDarken
|
|
5325
|
-
setColor(palette.Switch, 'secondaryDisabledColor', private_safeDarken
|
|
5326
|
-
setColor(palette.Switch, 'errorDisabledColor', private_safeDarken
|
|
5327
|
-
setColor(palette.Switch, 'infoDisabledColor', private_safeDarken
|
|
5328
|
-
setColor(palette.Switch, 'successDisabledColor', private_safeDarken
|
|
5329
|
-
setColor(palette.Switch, 'warningDisabledColor', private_safeDarken
|
|
5330
|
-
setColor(palette.TableCell, 'border', private_safeDarken(private_safeAlpha
|
|
5331
|
-
setColor(palette.Tooltip, 'bg', private_safeAlpha
|
|
5480
|
+
setColor(palette.Switch, 'primaryDisabledColor', colorMix(private_safeDarken, palette.primary.main, 0.55));
|
|
5481
|
+
setColor(palette.Switch, 'secondaryDisabledColor', colorMix(private_safeDarken, palette.secondary.main, 0.55));
|
|
5482
|
+
setColor(palette.Switch, 'errorDisabledColor', colorMix(private_safeDarken, palette.error.main, 0.55));
|
|
5483
|
+
setColor(palette.Switch, 'infoDisabledColor', colorMix(private_safeDarken, palette.info.main, 0.55));
|
|
5484
|
+
setColor(palette.Switch, 'successDisabledColor', colorMix(private_safeDarken, palette.success.main, 0.55));
|
|
5485
|
+
setColor(palette.Switch, 'warningDisabledColor', colorMix(private_safeDarken, palette.warning.main, 0.55));
|
|
5486
|
+
setColor(palette.TableCell, 'border', colorMix(private_safeDarken, colorMix(private_safeAlpha, palette.divider, 1), 0.68));
|
|
5487
|
+
setColor(palette.Tooltip, 'bg', colorMix(private_safeAlpha, palette.grey[700], 0.92));
|
|
5332
5488
|
}
|
|
5333
5489
|
|
|
5334
5490
|
// MUI X - DataGrid needs this token.
|
|
@@ -5380,7 +5536,8 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
5380
5536
|
prefix: cssVarPrefix,
|
|
5381
5537
|
disableCssColorScheme,
|
|
5382
5538
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
|
|
5383
|
-
getSelector: defaultGetSelector(theme)
|
|
5539
|
+
getSelector: defaultGetSelector(theme),
|
|
5540
|
+
enableContrastVars: nativeColor
|
|
5384
5541
|
};
|
|
5385
5542
|
const {
|
|
5386
5543
|
vars,
|
|
@@ -5871,12 +6028,12 @@ var Loading = function () {
|
|
|
5871
6028
|
|
|
5872
6029
|
var Plot$2 = React.lazy(function () { return import('react-plotly.js'); });
|
|
5873
6030
|
var HistogramPlot = function (props) {
|
|
5874
|
-
var _a, _b;
|
|
5875
|
-
var data = props.data, title = props.title, xAxisTitle = props.xAxisTitle,
|
|
6031
|
+
var _a, _b, _c, _d;
|
|
6032
|
+
var data = props.data, title = props.title, xAxisTitle = props.xAxisTitle, _e = props.barColor, barColor = _e === void 0 ? 'rgb(72, 72, 74)' : _e, _f = props.unselectedBarColor, unselectedBarColor = _f === void 0 ? 'rgba(203, 195, 195, 0.88)' : _f, _g = props.selectorsColor, selectorsColor = _g === void 0 ? 'black' : _g, containerStyleOverrides = props.containerStyleOverrides, _h = props.unselectedData, unselectedData = _h === void 0 ? [] : _h, _j = props.handleClickOrSelection, handleClickOrSelection = _j === void 0 ? function () { } : _j, _k = props.onDeselect, onDeselect = _k === void 0 ? function () { } : _k, plotId = props.plotId, _l = props.selectByBin, selectByBin = _l === void 0 ? false : _l, dateTickFormat = props.dateTickFormat, binSizeOverride = props.binSizeOverride, _m = props.statsAnnotations, statsAnnotations = _m === void 0 ? ['mean'] : _m;
|
|
5876
6033
|
// Ref for plot container
|
|
5877
6034
|
var containerRef = React.useRef(null);
|
|
5878
6035
|
// Track any selections made in this plot so we can style the selection box.
|
|
5879
|
-
var
|
|
6036
|
+
var _o = React.useState(null), selectedRange = _o[0], setSelectedRange = _o[1];
|
|
5880
6037
|
// If all the data becomes selected, we should forget any old selections.
|
|
5881
6038
|
React.useEffect(function () {
|
|
5882
6039
|
if (unselectedData.length === 0) {
|
|
@@ -5888,7 +6045,7 @@ var HistogramPlot = function (props) {
|
|
|
5888
6045
|
// Plotly determines "nice" bins which consequently means it internally decides the axis range. We need
|
|
5889
6046
|
// to access that information once the plot has been initialized so that we can prevent the
|
|
5890
6047
|
// axis range from changing during interaction. Dates use strings.
|
|
5891
|
-
var
|
|
6048
|
+
var _p = React.useState(undefined), fixedXAxisRange = _p[0], setFixedXAxisRange = _p[1];
|
|
5892
6049
|
// Once the plot is drawn, record the initial axis range so we can keep it fixed.
|
|
5893
6050
|
// figure should be Readonly<Plotly.Figure> but react-plotly.js doesn't expose that type, so we use any.
|
|
5894
6051
|
var handlePlotUpdate = function (figure, graphDiv) {
|
|
@@ -6057,8 +6214,9 @@ var HistogramPlot = function (props) {
|
|
|
6057
6214
|
}, [selectedRange, unselectedData]);
|
|
6058
6215
|
// Calculate the mean of the selected data using normalized data
|
|
6059
6216
|
var meanValue = (_a = calculateMean(data)) !== null && _a !== void 0 ? _a : 0; // Default to 0 if no data
|
|
6217
|
+
var stdevValue = (_b = calculateStandardDeviation(data)) !== null && _b !== void 0 ? _b : 0;
|
|
6060
6218
|
var meanLineRadius = 0.01; // distance from the top of the y axis to the top/bottom end of the mean line
|
|
6061
|
-
var meanLine = (
|
|
6219
|
+
var meanLine = (statsAnnotations.includes('mean') && data.length > 0) ? [{
|
|
6062
6220
|
type: 'line',
|
|
6063
6221
|
x0: meanValue,
|
|
6064
6222
|
y0: 1 - meanLineRadius,
|
|
@@ -6072,8 +6230,8 @@ var HistogramPlot = function (props) {
|
|
|
6072
6230
|
}] : [];
|
|
6073
6231
|
// Draw mean line for all data
|
|
6074
6232
|
var allData = tslib.__spreadArray(tslib.__spreadArray([], data, true), unselectedData, true);
|
|
6075
|
-
var allDataMeanValue = (
|
|
6076
|
-
var allDataMeanLine = (
|
|
6233
|
+
var allDataMeanValue = (_c = calculateMean(allData)) !== null && _c !== void 0 ? _c : 0;
|
|
6234
|
+
var allDataMeanLine = (statsAnnotations.includes('mean') && unselectedData.length > 0 && data.length > 0) ? [{
|
|
6077
6235
|
type: 'line',
|
|
6078
6236
|
x0: allDataMeanValue,
|
|
6079
6237
|
y0: 1 - meanLineRadius,
|
|
@@ -6085,6 +6243,61 @@ var HistogramPlot = function (props) {
|
|
|
6085
6243
|
width: 1.5,
|
|
6086
6244
|
}
|
|
6087
6245
|
}] : [];
|
|
6246
|
+
var stdevLines = (statsAnnotations.includes('stdev') && data.length > 0) ? [{
|
|
6247
|
+
type: 'line',
|
|
6248
|
+
x0: meanValue - stdevValue,
|
|
6249
|
+
y0: 1 - meanLineRadius,
|
|
6250
|
+
x1: meanValue - stdevValue,
|
|
6251
|
+
yref: 'paper',
|
|
6252
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6253
|
+
line: {
|
|
6254
|
+
color: barColor,
|
|
6255
|
+
width: 1.5,
|
|
6256
|
+
dash: 'dot',
|
|
6257
|
+
}
|
|
6258
|
+
},
|
|
6259
|
+
{
|
|
6260
|
+
type: 'line',
|
|
6261
|
+
x0: meanValue + stdevValue,
|
|
6262
|
+
y0: 1 - meanLineRadius,
|
|
6263
|
+
x1: meanValue + stdevValue,
|
|
6264
|
+
yref: 'paper',
|
|
6265
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6266
|
+
line: {
|
|
6267
|
+
color: barColor,
|
|
6268
|
+
width: 1.5,
|
|
6269
|
+
dash: 'dot',
|
|
6270
|
+
}
|
|
6271
|
+
}]
|
|
6272
|
+
: [];
|
|
6273
|
+
var allDataStdevValue = (_d = calculateStandardDeviation(allData)) !== null && _d !== void 0 ? _d : 0;
|
|
6274
|
+
var allDataStdevLines = (statsAnnotations.includes('stdev') && unselectedData.length > 0 && data.length > 0) ? [{
|
|
6275
|
+
type: 'line',
|
|
6276
|
+
x0: allDataMeanValue - allDataStdevValue,
|
|
6277
|
+
y0: 1 - meanLineRadius,
|
|
6278
|
+
x1: allDataMeanValue - allDataStdevValue,
|
|
6279
|
+
yref: 'paper',
|
|
6280
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6281
|
+
line: {
|
|
6282
|
+
color: unselectedBarColor,
|
|
6283
|
+
width: 1.5,
|
|
6284
|
+
dash: 'dot',
|
|
6285
|
+
}
|
|
6286
|
+
},
|
|
6287
|
+
{
|
|
6288
|
+
type: 'line',
|
|
6289
|
+
x0: allDataMeanValue + allDataStdevValue,
|
|
6290
|
+
y0: 1 - meanLineRadius,
|
|
6291
|
+
x1: allDataMeanValue + allDataStdevValue,
|
|
6292
|
+
yref: 'paper',
|
|
6293
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6294
|
+
line: {
|
|
6295
|
+
color: unselectedBarColor,
|
|
6296
|
+
width: 1.5,
|
|
6297
|
+
dash: 'dot',
|
|
6298
|
+
}
|
|
6299
|
+
}]
|
|
6300
|
+
: [];
|
|
6088
6301
|
// If binSizeOverride is provided, use it to set the bin size and range explicitly.
|
|
6089
6302
|
// Plotly does a better job of setting bins and ending them at nice numbers, so only use
|
|
6090
6303
|
// this prop when necessary.
|
|
@@ -6120,6 +6333,40 @@ var HistogramPlot = function (props) {
|
|
|
6120
6333
|
},
|
|
6121
6334
|
hovertemplate: '[%{x})<br>Count: %{y}<extra></extra>', // Custom hover text
|
|
6122
6335
|
};
|
|
6336
|
+
var meanAnnotation = (statsAnnotations.includes('mean') && meanLine && data.length > 0) ? [{
|
|
6337
|
+
x: meanValue,
|
|
6338
|
+
y: 1 + meanLineRadius + 0.04, // Position above the mean line. Value set with respect to the paper coordinates.
|
|
6339
|
+
yref: 'paper',
|
|
6340
|
+
text: "<span style=\"font-weight:300\">AVG </span><span style=\"font-weight:600\">".concat(isDateArray(data) ? new Date(meanValue).toLocaleDateString('en-US', {
|
|
6341
|
+
month: '2-digit',
|
|
6342
|
+
day: '2-digit',
|
|
6343
|
+
year: '2-digit'
|
|
6344
|
+
}) : meanValue.toFixed(2), "</span>"),
|
|
6345
|
+
xanchor: 'center',
|
|
6346
|
+
yanchor: 'bottom',
|
|
6347
|
+
showarrow: false,
|
|
6348
|
+
font: {
|
|
6349
|
+
color: barColor,
|
|
6350
|
+
size: 12,
|
|
6351
|
+
},
|
|
6352
|
+
}] : [];
|
|
6353
|
+
var stdevAnnotation = (statsAnnotations.includes('stdev') && stdevLines && data.length > 0) ? [{
|
|
6354
|
+
x: meanValue, // Draw above the mean annotation
|
|
6355
|
+
y: 1 + meanLineRadius + (statsAnnotations.includes('mean') ? 0.11 : 0.04),
|
|
6356
|
+
yref: 'paper',
|
|
6357
|
+
text: "<span style=\"font-weight:300\">\u03C3 </span><span style=\"font-weight:600\">±".concat(isDateArray(data) ? new Date(stdevValue).toLocaleDateString('en-US', {
|
|
6358
|
+
month: '2-digit',
|
|
6359
|
+
day: '2-digit',
|
|
6360
|
+
year: '2-digit'
|
|
6361
|
+
}) : stdevValue.toFixed(2), "</span>"),
|
|
6362
|
+
xanchor: 'center',
|
|
6363
|
+
yanchor: 'bottom',
|
|
6364
|
+
showarrow: false,
|
|
6365
|
+
font: {
|
|
6366
|
+
color: barColor,
|
|
6367
|
+
size: 12,
|
|
6368
|
+
},
|
|
6369
|
+
}] : [];
|
|
6123
6370
|
var plotlyData = [
|
|
6124
6371
|
{
|
|
6125
6372
|
x: data,
|
|
@@ -6152,7 +6399,7 @@ var HistogramPlot = function (props) {
|
|
|
6152
6399
|
margin: {
|
|
6153
6400
|
l: 50,
|
|
6154
6401
|
r: 35, // Balance between ensuring the mean annotation doesn't get cut off and having too much margin.
|
|
6155
|
-
t: title ?
|
|
6402
|
+
t: 40 + (title ? 50 : 0), // Add extra top margin if there is a title
|
|
6156
6403
|
b: 50,
|
|
6157
6404
|
pad: 4
|
|
6158
6405
|
},
|
|
@@ -6198,24 +6445,8 @@ var HistogramPlot = function (props) {
|
|
|
6198
6445
|
bargap: 0.03, // Gap between bars
|
|
6199
6446
|
dragmode: 'select', // Enable drag to select
|
|
6200
6447
|
selectdirection: 'h', // User can select in horizontal direction only
|
|
6201
|
-
shapes: tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([], allDataMeanLine, true), meanLine, true), selectedRangeBox, true), // Add the mean line and selection box
|
|
6202
|
-
annotations: (
|
|
6203
|
-
x: meanValue,
|
|
6204
|
-
y: 1 + meanLineRadius + 0.04, // Position above the mean line. Value set with respect to the paper coordinates.
|
|
6205
|
-
yref: 'paper',
|
|
6206
|
-
text: "<span style=\"font-weight:300\">AVG </span><span style=\"font-weight:600\">".concat(isDateArray(data) ? new Date(meanValue).toLocaleDateString('en-US', {
|
|
6207
|
-
month: '2-digit',
|
|
6208
|
-
day: '2-digit',
|
|
6209
|
-
year: '2-digit'
|
|
6210
|
-
}) : meanValue.toFixed(2), "</span>"),
|
|
6211
|
-
xanchor: 'center',
|
|
6212
|
-
yanchor: 'bottom',
|
|
6213
|
-
showarrow: false,
|
|
6214
|
-
font: {
|
|
6215
|
-
color: barColor,
|
|
6216
|
-
size: 12,
|
|
6217
|
-
},
|
|
6218
|
-
}] : [],
|
|
6448
|
+
shapes: tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([], allDataMeanLine, true), meanLine, true), selectedRangeBox, true), stdevLines, true), allDataStdevLines, true), // Add the mean line and selection box
|
|
6449
|
+
annotations: tslib.__spreadArray(tslib.__spreadArray([], meanAnnotation, true), stdevAnnotation, true)
|
|
6219
6450
|
};
|
|
6220
6451
|
var config = {
|
|
6221
6452
|
responsive: true, // Make the plot responsive
|