victory-bar 37.1.1 → 37.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6685,31 +6685,34 @@ __webpack_require__.r(__webpack_exports__);
6685
6685
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6686
6686
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6687
6687
  /* harmony export */ });
6688
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
6689
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6690
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6691
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6692
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6693
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6694
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6688
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
6689
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6690
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
6691
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6692
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6693
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6694
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6695
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6696
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6697
+
6695
6698
 
6696
6699
 
6697
6700
 
6698
6701
 
6699
6702
 
6700
6703
  const defaultProps = {
6701
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6704
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6702
6705
  };
6703
6706
  const VictoryPortal = initialProps => {
6704
6707
  const props = {
6705
6708
  ...defaultProps,
6706
6709
  ...initialProps
6707
6710
  };
6708
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6709
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6711
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6712
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6710
6713
  if (!portalContext) {
6711
6714
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6712
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6715
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6713
6716
  }
6714
6717
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6715
6718
  const {
@@ -6720,15 +6723,15 @@ const VictoryPortal = initialProps => {
6720
6723
  groupComponent,
6721
6724
  standalone: false
6722
6725
  } : {};
6723
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6726
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6724
6727
  key: childProps.key ?? id
6725
6728
  });
6726
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6727
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6729
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6730
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6728
6731
  portalContext?.addChild(id, child);
6729
6732
  // eslint-disable-next-line react-hooks/exhaustive-deps
6730
6733
  }, [props.children]);
6731
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6734
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6732
6735
  return () => portalContext?.removeChild(id);
6733
6736
  // eslint-disable-next-line react-hooks/exhaustive-deps
6734
6737
  }, []);
@@ -6899,6 +6902,477 @@ const TSpan = props => {
6899
6902
 
6900
6903
  /***/ }),
6901
6904
 
6905
+ /***/ "../../victory-core/es/victory-theme/clean.js":
6906
+ /*!****************************************************!*\
6907
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
6908
+ \****************************************************/
6909
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6910
+
6911
+ "use strict";
6912
+ __webpack_require__.r(__webpack_exports__);
6913
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6914
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
6915
+ /* harmony export */ });
6916
+ // *
6917
+ // * Colors
6918
+ // *
6919
+
6920
+ const gray = {
6921
+ white: "#FFFFFF",
6922
+ "50": "#FAFAFA",
6923
+ "100": "#F2F2F2",
6924
+ "200": "#E8E8E8",
6925
+ "300": "#E0E0E0",
6926
+ "400": "#D1D1D1",
6927
+ "500": "#757575",
6928
+ "600": "#5C5C5C",
6929
+ "700": "#424242",
6930
+ "800": "#333333",
6931
+ "900": "#292929",
6932
+ black: "#0F0F0F"
6933
+ };
6934
+ const yellow = {
6935
+ "100": "#FFEAB6",
6936
+ "300": "#FFD66E",
6937
+ "500": "#FCB400",
6938
+ "900": "#B87503"
6939
+ };
6940
+ const orange = {
6941
+ "100": "#FEE2D5",
6942
+ "300": "#FFA981",
6943
+ "500": "#FF6F2C",
6944
+ "900": "#D74D26"
6945
+ };
6946
+ const red = {
6947
+ "100": "#FFDCE5",
6948
+ "300": "#FF9EB7",
6949
+ "500": "#F82B60",
6950
+ "900": "#BA1E45"
6951
+ };
6952
+ const pink = {
6953
+ "100": "#FFDAF6",
6954
+ "300": "#F99DE2",
6955
+ "500": "#FF08C2",
6956
+ "900": "#B2158B"
6957
+ };
6958
+ const purple = {
6959
+ "100": "#EDE3FE",
6960
+ "300": "#CDB0FF",
6961
+ "500": "#8B46FF",
6962
+ "900": "#6B1CB0"
6963
+ };
6964
+ const blue = {
6965
+ "100": "#CFDFFF",
6966
+ "300": "#9CC7FF",
6967
+ "500": "#2D7FF9",
6968
+ "900": "#2750AE"
6969
+ };
6970
+ const cyan = {
6971
+ "100": "#D0F0FD",
6972
+ "300": "#77D1F3",
6973
+ "500": "#18BFFF",
6974
+ "900": "#0B76B7"
6975
+ };
6976
+ const teal = {
6977
+ "100": "#C2F5E9",
6978
+ "300": "#72DDC3",
6979
+ "500": "#20D9D2",
6980
+ "900": "#06A09B"
6981
+ };
6982
+ const green = {
6983
+ "100": "#D1F7C4",
6984
+ "300": "#93E088",
6985
+ "500": "#20C933",
6986
+ "900": "#338A17"
6987
+ };
6988
+ const colors = {
6989
+ blue: blue["500"],
6990
+ pink: pink["500"],
6991
+ teal: teal["500"],
6992
+ purple: purple["500"],
6993
+ green: green["500"],
6994
+ orange: orange["500"],
6995
+ cyan: cyan["500"],
6996
+ red: red["500"],
6997
+ yellow: yellow["500"]
6998
+ };
6999
+ const colorScale = Object.values(colors);
7000
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
7001
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
7002
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
7003
+ const heatmap = [green["500"], yellow["500"], red["500"]];
7004
+ const redPalette = [red["500"], red["300"], red["100"]];
7005
+ const greenPalette = [green["500"], green["300"], green["100"]];
7006
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
7007
+
7008
+ // *
7009
+ // * Typography
7010
+ // *
7011
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
7012
+ const letterSpacing = "normal";
7013
+ const fontSize = 12;
7014
+ // *
7015
+ // * Layout
7016
+ // *
7017
+ const padding = 8;
7018
+ const baseProps = {
7019
+ width: 450,
7020
+ height: 300,
7021
+ padding: 50,
7022
+ colorScale
7023
+ };
7024
+ // *
7025
+ // * Labels
7026
+ // *
7027
+ const baseLabelStyles = {
7028
+ fontFamily: sansSerif,
7029
+ fontSize,
7030
+ fontWeight: 300,
7031
+ letterSpacing,
7032
+ padding,
7033
+ fill: gray["900"],
7034
+ stroke: "transparent"
7035
+ };
7036
+ const centeredLabelStyles = Object.assign({
7037
+ textAnchor: "middle"
7038
+ }, baseLabelStyles);
7039
+
7040
+ // *
7041
+ // * Strokes
7042
+ // *
7043
+ const strokeDasharray = "10, 5";
7044
+ const strokeLinecap = "round";
7045
+ const strokeLinejoin = "round";
7046
+ const borderRadius = 1;
7047
+ // *
7048
+ // * Theme
7049
+ // *
7050
+ const clean = {
7051
+ palette: {
7052
+ colors,
7053
+ grayscale,
7054
+ qualitative: colorScale,
7055
+ heatmap,
7056
+ warm,
7057
+ cool,
7058
+ red: redPalette,
7059
+ green: greenPalette,
7060
+ blue: bluePalette
7061
+ },
7062
+ area: Object.assign({
7063
+ style: {
7064
+ data: {
7065
+ fill: blue["500"],
7066
+ strokeWidth: 2,
7067
+ fillOpacity: 0.5
7068
+ },
7069
+ labels: baseLabelStyles
7070
+ }
7071
+ }, baseProps),
7072
+ axis: Object.assign({
7073
+ style: {
7074
+ axis: {
7075
+ fill: "transparent",
7076
+ stroke: gray["500"],
7077
+ strokeWidth: 1,
7078
+ strokeLinecap,
7079
+ strokeLinejoin
7080
+ },
7081
+ axisLabel: Object.assign({}, centeredLabelStyles, {
7082
+ padding,
7083
+ stroke: "transparent"
7084
+ }),
7085
+ grid: {
7086
+ fill: "none",
7087
+ stroke: "none",
7088
+ painterEvents: "painted"
7089
+ },
7090
+ ticks: {
7091
+ fill: "transparent",
7092
+ size: 5,
7093
+ stroke: "transparent"
7094
+ },
7095
+ tickLabels: baseLabelStyles
7096
+ }
7097
+ }, baseProps),
7098
+ polarAxis: Object.assign({
7099
+ style: {
7100
+ axis: {
7101
+ stroke: gray["500"]
7102
+ },
7103
+ grid: {
7104
+ stroke: gray["400"],
7105
+ strokeDasharray,
7106
+ strokeLinecap,
7107
+ strokeLinejoin,
7108
+ pointerEvents: "painted"
7109
+ },
7110
+ ticks: {
7111
+ fill: "transparent",
7112
+ size: 5,
7113
+ stroke: gray["400"],
7114
+ strokeWidth: 1,
7115
+ strokeLinecap,
7116
+ strokeLinejoin
7117
+ },
7118
+ tickLabels: baseLabelStyles
7119
+ }
7120
+ }),
7121
+ polarDependentAxis: Object.assign({
7122
+ style: {
7123
+ axis: {
7124
+ stroke: gray["500"]
7125
+ },
7126
+ grid: {
7127
+ stroke: gray["400"],
7128
+ strokeDasharray,
7129
+ strokeLinecap,
7130
+ strokeLinejoin,
7131
+ pointerEvents: "painted"
7132
+ },
7133
+ ticks: {
7134
+ fill: "transparent",
7135
+ size: 5,
7136
+ stroke: gray["300"],
7137
+ strokeWidth: 1,
7138
+ strokeLinecap,
7139
+ strokeLinejoin
7140
+ },
7141
+ tickLabels: baseLabelStyles
7142
+ }
7143
+ }),
7144
+ bar: Object.assign({
7145
+ style: {
7146
+ data: {
7147
+ fill: blue["500"],
7148
+ padding,
7149
+ strokeWidth: 1,
7150
+ fillOpacity: 0.5
7151
+ },
7152
+ labels: baseLabelStyles
7153
+ },
7154
+ cornerRadius: {
7155
+ top: borderRadius
7156
+ }
7157
+ }, baseProps),
7158
+ boxplot: Object.assign({
7159
+ style: {
7160
+ max: {
7161
+ padding,
7162
+ stroke: gray["400"],
7163
+ strokeWidth: 2
7164
+ },
7165
+ maxLabels: Object.assign({}, baseLabelStyles, {
7166
+ padding: 3
7167
+ }),
7168
+ median: {
7169
+ padding,
7170
+ stroke: gray.white,
7171
+ strokeWidth: 2
7172
+ },
7173
+ medianLabels: Object.assign({}, baseLabelStyles, {
7174
+ padding: 3
7175
+ }),
7176
+ min: {
7177
+ padding,
7178
+ stroke: gray["400"],
7179
+ strokeWidth: 2
7180
+ },
7181
+ minLabels: Object.assign({}, baseLabelStyles, {
7182
+ padding: 3
7183
+ }),
7184
+ q1: {
7185
+ padding,
7186
+ fill: teal["500"],
7187
+ rx: borderRadius,
7188
+ strokeWidth: 2
7189
+ },
7190
+ q1Labels: Object.assign({}, baseLabelStyles, {
7191
+ padding: 3
7192
+ }),
7193
+ q3: {
7194
+ padding,
7195
+ fill: cyan["500"],
7196
+ rx: borderRadius
7197
+ },
7198
+ q3Labels: Object.assign({}, baseLabelStyles, {
7199
+ padding: 3
7200
+ })
7201
+ },
7202
+ boxWidth: 20
7203
+ }, baseProps),
7204
+ candlestick: Object.assign({
7205
+ style: {
7206
+ data: {
7207
+ stroke: gray["300"],
7208
+ strokeWidth: 0,
7209
+ rx: borderRadius
7210
+ },
7211
+ labels: Object.assign({}, baseLabelStyles, {
7212
+ padding: 5
7213
+ })
7214
+ },
7215
+ candleColors: {
7216
+ positive: teal["500"],
7217
+ negative: orange["500"]
7218
+ },
7219
+ wickStrokeWidth: 2
7220
+ }, baseProps),
7221
+ chart: baseProps,
7222
+ errorbar: Object.assign({
7223
+ borderWidth: 8,
7224
+ style: {
7225
+ data: {
7226
+ fill: "transparent",
7227
+ opacity: 1,
7228
+ stroke: gray["700"],
7229
+ strokeWidth: 2,
7230
+ strokeLinecap
7231
+ },
7232
+ labels: baseLabelStyles
7233
+ }
7234
+ }, baseProps),
7235
+ group: Object.assign({
7236
+ colorScale
7237
+ }, baseProps),
7238
+ histogram: Object.assign({
7239
+ style: {
7240
+ data: {
7241
+ fill: cyan["500"],
7242
+ fillOpacity: 0.5
7243
+ },
7244
+ labels: baseLabelStyles
7245
+ },
7246
+ binSpacing: 4,
7247
+ cornerRadius: {
7248
+ top: borderRadius
7249
+ }
7250
+ }, baseProps),
7251
+ label: baseLabelStyles,
7252
+ legend: {
7253
+ colorScale,
7254
+ gutter: 24,
7255
+ borderPadding: 10,
7256
+ orientation: "horizontal",
7257
+ titleOrientation: "top",
7258
+ centerTitle: true,
7259
+ style: {
7260
+ data: {
7261
+ type: "circle"
7262
+ },
7263
+ labels: {
7264
+ ...baseLabelStyles,
7265
+ fontSize: 12
7266
+ },
7267
+ title: Object.assign({}, baseLabelStyles, {
7268
+ padding,
7269
+ fontSize: 16
7270
+ }),
7271
+ border: {
7272
+ stroke: gray["200"],
7273
+ strokeWidth: 2,
7274
+ padding: 16
7275
+ }
7276
+ }
7277
+ },
7278
+ line: Object.assign({
7279
+ style: {
7280
+ data: {
7281
+ fill: "transparent",
7282
+ opacity: 1,
7283
+ stroke: blue["500"],
7284
+ strokeWidth: 2,
7285
+ strokeLinecap,
7286
+ strokeLinejoin
7287
+ },
7288
+ labels: baseLabelStyles
7289
+ }
7290
+ }, baseProps),
7291
+ pie: Object.assign({
7292
+ style: {
7293
+ parent: {
7294
+ backgroundColor: gray.white
7295
+ },
7296
+ data: {
7297
+ padding,
7298
+ stroke: gray.white,
7299
+ strokeWidth: 1
7300
+ },
7301
+ labels: {
7302
+ ...baseLabelStyles,
7303
+ padding: 20,
7304
+ fill: gray["600"],
7305
+ fontSize: 10
7306
+ }
7307
+ },
7308
+ colorScale,
7309
+ cornerRadius: borderRadius
7310
+ }, baseProps),
7311
+ scatter: Object.assign({
7312
+ style: {
7313
+ data: {
7314
+ fill: purple["500"],
7315
+ opacity: 1,
7316
+ stroke: "transparent",
7317
+ strokeWidth: 0
7318
+ },
7319
+ labels: {
7320
+ ...baseLabelStyles,
7321
+ padding: 20
7322
+ }
7323
+ }
7324
+ }, baseProps),
7325
+ stack: Object.assign({
7326
+ colorScale
7327
+ }, baseProps),
7328
+ tooltip: {
7329
+ style: Object.assign({}, baseLabelStyles, {
7330
+ padding: 0,
7331
+ pointerEvents: "none"
7332
+ }),
7333
+ flyoutStyle: {
7334
+ stroke: gray["300"],
7335
+ strokeWidth: 2,
7336
+ fill: gray.white,
7337
+ pointerEvents: "none"
7338
+ },
7339
+ flyoutPadding: {
7340
+ top: 8,
7341
+ bottom: 8,
7342
+ left: 16,
7343
+ right: 16
7344
+ },
7345
+ cornerRadius: borderRadius,
7346
+ pointerLength: 4
7347
+ },
7348
+ voronoi: Object.assign({
7349
+ style: {
7350
+ data: {
7351
+ fill: blue["100"],
7352
+ stroke: blue["500"],
7353
+ strokeWidth: 2,
7354
+ opacity: 0.4
7355
+ },
7356
+ labels: Object.assign({}, baseLabelStyles, {
7357
+ padding: 5,
7358
+ pointerEvents: "none"
7359
+ }),
7360
+ flyout: {
7361
+ stroke: gray["900"],
7362
+ strokeWidth: 1,
7363
+ fill: gray["100"],
7364
+ pointerEvents: "none"
7365
+ },
7366
+ padding: {
7367
+ left: 2,
7368
+ bottom: 2
7369
+ }
7370
+ }
7371
+ }, baseProps)
7372
+ };
7373
+
7374
+ /***/ }),
7375
+
6902
7376
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
6903
7377
  /*!********************************************************!*\
6904
7378
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -6913,9 +7387,28 @@ __webpack_require__.r(__webpack_exports__);
6913
7387
  // *
6914
7388
  // * Colors
6915
7389
  // *
6916
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7390
+ const colors = {
7391
+ blue: "#4F7DA1",
7392
+ pink: "#E2A37F",
7393
+ teal: "#00796B",
7394
+ purple: "#DF948A",
7395
+ green: "#8BC34A",
7396
+ orange: "#F4511E",
7397
+ cyan: "#006064",
7398
+ red: "#DF5A49",
7399
+ yellow: "#FFF59D"
7400
+ };
7401
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6917
7402
  const charcoal = "#252525";
6918
7403
  const grey = "#969696";
7404
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7405
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7406
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7407
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7408
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7409
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7410
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7411
+
6919
7412
  // *
6920
7413
  // * Typography
6921
7414
  // *
@@ -6929,7 +7422,7 @@ const baseProps = {
6929
7422
  width: 450,
6930
7423
  height: 300,
6931
7424
  padding: 50,
6932
- colorScale: colors
7425
+ colorScale
6933
7426
  };
6934
7427
  // *
6935
7428
  // * Labels
@@ -6951,6 +7444,17 @@ const centeredLabelStyles = Object.assign({
6951
7444
  const strokeLinecap = "round";
6952
7445
  const strokeLinejoin = "round";
6953
7446
  const grayscale = {
7447
+ palette: {
7448
+ colors,
7449
+ grayscale: colorScale,
7450
+ qualitative,
7451
+ heatmap,
7452
+ warm,
7453
+ cool,
7454
+ red,
7455
+ green,
7456
+ blue
7457
+ },
6954
7458
  area: Object.assign({
6955
7459
  style: {
6956
7460
  data: {
@@ -7065,7 +7569,7 @@ const grayscale = {
7065
7569
  }
7066
7570
  }, baseProps),
7067
7571
  group: Object.assign({
7068
- colorScale: colors
7572
+ colorScale
7069
7573
  }, baseProps),
7070
7574
  histogram: Object.assign({
7071
7575
  style: {
@@ -7078,7 +7582,7 @@ const grayscale = {
7078
7582
  }
7079
7583
  }, baseProps),
7080
7584
  legend: {
7081
- colorScale: colors,
7585
+ colorScale,
7082
7586
  gutter: 10,
7083
7587
  orientation: "vertical",
7084
7588
  titleOrientation: "top",
@@ -7113,7 +7617,7 @@ const grayscale = {
7113
7617
  padding: 20
7114
7618
  })
7115
7619
  },
7116
- colorScale: colors,
7620
+ colorScale,
7117
7621
  width: 400,
7118
7622
  height: 400,
7119
7623
  padding: 50
@@ -7129,7 +7633,7 @@ const grayscale = {
7129
7633
  }
7130
7634
  }, baseProps),
7131
7635
  stack: Object.assign({
7132
- colorScale: colors
7636
+ colorScale
7133
7637
  }, baseProps),
7134
7638
  tooltip: {
7135
7639
  style: Object.assign({}, baseLabelStyles, {
@@ -7189,11 +7693,31 @@ const lime300 = "#DCE775";
7189
7693
  const lightGreen500 = "#8BC34A";
7190
7694
  const teal700 = "#00796B";
7191
7695
  const cyan900 = "#006064";
7192
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7696
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7193
7697
  const blueGrey50 = "#ECEFF1";
7194
7698
  const blueGrey300 = "#90A4AE";
7195
7699
  const blueGrey700 = "#455A64";
7196
7700
  const grey900 = "#212121";
7701
+ const colors = {
7702
+ blue: "#4F7DA1",
7703
+ pink: "#E2A37F",
7704
+ teal: teal700,
7705
+ purple: "#DF948A",
7706
+ green: lightGreen500,
7707
+ orange: deepOrange600,
7708
+ cyan: cyan900,
7709
+ red: "#DF5A49",
7710
+ yellow: yellow200
7711
+ };
7712
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7713
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7714
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7715
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7716
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7717
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7718
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7719
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7720
+
7197
7721
  // *
7198
7722
  // * Typography
7199
7723
  // *
@@ -7231,6 +7755,17 @@ const strokeDasharray = "10, 5";
7231
7755
  const strokeLinecap = "round";
7232
7756
  const strokeLinejoin = "round";
7233
7757
  const material = {
7758
+ palette: {
7759
+ colors,
7760
+ grayscale,
7761
+ qualitative,
7762
+ heatmap,
7763
+ warm,
7764
+ cool,
7765
+ red,
7766
+ green,
7767
+ blue
7768
+ },
7234
7769
  area: Object.assign({
7235
7770
  style: {
7236
7771
  data: {
@@ -7363,7 +7898,7 @@ const material = {
7363
7898
  }
7364
7899
  }, baseProps),
7365
7900
  group: Object.assign({
7366
- colorScale: colors
7901
+ colorScale
7367
7902
  }, baseProps),
7368
7903
  histogram: Object.assign({
7369
7904
  style: {
@@ -7376,7 +7911,7 @@ const material = {
7376
7911
  }
7377
7912
  }, baseProps),
7378
7913
  legend: {
7379
- colorScale: colors,
7914
+ colorScale,
7380
7915
  gutter: 10,
7381
7916
  orientation: "vertical",
7382
7917
  titleOrientation: "top",
@@ -7402,7 +7937,7 @@ const material = {
7402
7937
  }
7403
7938
  }, baseProps),
7404
7939
  pie: Object.assign({
7405
- colorScale: colors,
7940
+ colorScale,
7406
7941
  style: {
7407
7942
  data: {
7408
7943
  padding,
@@ -7426,7 +7961,7 @@ const material = {
7426
7961
  }
7427
7962
  }, baseProps),
7428
7963
  stack: Object.assign({
7429
- colorScale: colors
7964
+ colorScale
7430
7965
  }, baseProps),
7431
7966
  tooltip: {
7432
7967
  style: Object.assign({}, baseLabelStyles, {
@@ -7479,12 +8014,15 @@ __webpack_require__.r(__webpack_exports__);
7479
8014
  /* harmony export */ });
7480
8015
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
7481
8016
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
8017
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
8018
+
7482
8019
 
7483
8020
 
7484
8021
 
7485
8022
  const VictoryTheme = {
7486
8023
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
7487
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
8024
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
8025
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
7488
8026
  };
7489
8027
 
7490
8028
  /***/ }),
@@ -10285,6 +10823,9 @@ __webpack_require__.r(__webpack_exports__);
10285
10823
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10286
10824
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10287
10825
  /* harmony export */ });
10826
+ /* harmony import */ var _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../victory-theme/victory-theme */ "../../victory-core/es/victory-theme/victory-theme.js");
10827
+
10828
+
10288
10829
  /**
10289
10830
  * Given an object with CSS/SVG transform definitions, return the string value
10290
10831
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10321,20 +10862,37 @@ const toTransformString = function (obj) {
10321
10862
  * of 5 hex string values in that color scale. If no 'name' parameter
10322
10863
  * is given, it will return the Victory default grayscale.
10323
10864
  * @param {String} name The name of the color scale to return (optional).
10865
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10324
10866
  * @returns {Array} An array of 5 hex string values composing a color scale.
10325
10867
  */
10326
- function getColorScale(name) {
10868
+ function getColorScale(name, theme) {
10869
+ if (theme === void 0) {
10870
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10871
+ }
10872
+ const {
10873
+ palette: {
10874
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10875
+ qualitative = [],
10876
+ heatmap = [],
10877
+ warm = [],
10878
+ cool = [],
10879
+ red = [],
10880
+ blue = [],
10881
+ green = []
10882
+ } = {}
10883
+ } = theme;
10327
10884
  const scales = {
10328
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10329
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10330
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10331
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10332
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10333
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10334
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10335
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10885
+ grayscale,
10886
+ qualitative,
10887
+ heatmap,
10888
+ warm,
10889
+ cool,
10890
+ red,
10891
+ blue,
10892
+ green
10336
10893
  };
10337
- return name ? scales[name] : scales.grayscale;
10894
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10895
+ return selectedScale;
10338
10896
  }
10339
10897
 
10340
10898
  /***/ }),
@@ -10361,6 +10919,7 @@ __webpack_require__.r(__webpack_exports__);
10361
10919
  /* eslint-disable no-magic-numbers */
10362
10920
  // Based on measuring specific character widths
10363
10921
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
10922
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
10364
10923
  // prettier-ignore
10365
10924
  const fonts = {
10366
10925
  "American Typewriter": {
@@ -10419,6 +10978,10 @@ const fonts = {
10419
10978
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
10420
10979
  avg: 0.5116447368421051
10421
10980
  },
10981
+ "Inter": {
10982
+ widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
10983
+ avg: 0.5624362664473683
10984
+ },
10422
10985
  "Montserrat": {
10423
10986
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
10424
10987
  avg: 0.571792763157895