victory-histogram 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.
@@ -6968,31 +6968,34 @@ __webpack_require__.r(__webpack_exports__);
6968
6968
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6969
6969
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6970
6970
  /* harmony export */ });
6971
- /* 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");
6972
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6973
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6974
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6975
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6976
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6977
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6971
+ /* 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");
6972
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6973
+ /* 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");
6974
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6975
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6976
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6977
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6978
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6979
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6980
+
6978
6981
 
6979
6982
 
6980
6983
 
6981
6984
 
6982
6985
 
6983
6986
  const defaultProps = {
6984
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6987
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6985
6988
  };
6986
6989
  const VictoryPortal = initialProps => {
6987
6990
  const props = {
6988
6991
  ...defaultProps,
6989
6992
  ...initialProps
6990
6993
  };
6991
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6992
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6994
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6995
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6993
6996
  if (!portalContext) {
6994
6997
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6995
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6998
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6996
6999
  }
6997
7000
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6998
7001
  const {
@@ -7003,15 +7006,15 @@ const VictoryPortal = initialProps => {
7003
7006
  groupComponent,
7004
7007
  standalone: false
7005
7008
  } : {};
7006
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7009
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
7007
7010
  key: childProps.key ?? id
7008
7011
  });
7009
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7010
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7012
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
7013
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7011
7014
  portalContext?.addChild(id, child);
7012
7015
  // eslint-disable-next-line react-hooks/exhaustive-deps
7013
7016
  }, [props.children]);
7014
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7017
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7015
7018
  return () => portalContext?.removeChild(id);
7016
7019
  // eslint-disable-next-line react-hooks/exhaustive-deps
7017
7020
  }, []);
@@ -7182,6 +7185,477 @@ const TSpan = props => {
7182
7185
 
7183
7186
  /***/ }),
7184
7187
 
7188
+ /***/ "../../victory-core/es/victory-theme/clean.js":
7189
+ /*!****************************************************!*\
7190
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
7191
+ \****************************************************/
7192
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7193
+
7194
+ "use strict";
7195
+ __webpack_require__.r(__webpack_exports__);
7196
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7197
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
7198
+ /* harmony export */ });
7199
+ // *
7200
+ // * Colors
7201
+ // *
7202
+
7203
+ const gray = {
7204
+ white: "#FFFFFF",
7205
+ "50": "#FAFAFA",
7206
+ "100": "#F2F2F2",
7207
+ "200": "#E8E8E8",
7208
+ "300": "#E0E0E0",
7209
+ "400": "#D1D1D1",
7210
+ "500": "#757575",
7211
+ "600": "#5C5C5C",
7212
+ "700": "#424242",
7213
+ "800": "#333333",
7214
+ "900": "#292929",
7215
+ black: "#0F0F0F"
7216
+ };
7217
+ const yellow = {
7218
+ "100": "#FFEAB6",
7219
+ "300": "#FFD66E",
7220
+ "500": "#FCB400",
7221
+ "900": "#B87503"
7222
+ };
7223
+ const orange = {
7224
+ "100": "#FEE2D5",
7225
+ "300": "#FFA981",
7226
+ "500": "#FF6F2C",
7227
+ "900": "#D74D26"
7228
+ };
7229
+ const red = {
7230
+ "100": "#FFDCE5",
7231
+ "300": "#FF9EB7",
7232
+ "500": "#F82B60",
7233
+ "900": "#BA1E45"
7234
+ };
7235
+ const pink = {
7236
+ "100": "#FFDAF6",
7237
+ "300": "#F99DE2",
7238
+ "500": "#FF08C2",
7239
+ "900": "#B2158B"
7240
+ };
7241
+ const purple = {
7242
+ "100": "#EDE3FE",
7243
+ "300": "#CDB0FF",
7244
+ "500": "#8B46FF",
7245
+ "900": "#6B1CB0"
7246
+ };
7247
+ const blue = {
7248
+ "100": "#CFDFFF",
7249
+ "300": "#9CC7FF",
7250
+ "500": "#2D7FF9",
7251
+ "900": "#2750AE"
7252
+ };
7253
+ const cyan = {
7254
+ "100": "#D0F0FD",
7255
+ "300": "#77D1F3",
7256
+ "500": "#18BFFF",
7257
+ "900": "#0B76B7"
7258
+ };
7259
+ const teal = {
7260
+ "100": "#C2F5E9",
7261
+ "300": "#72DDC3",
7262
+ "500": "#20D9D2",
7263
+ "900": "#06A09B"
7264
+ };
7265
+ const green = {
7266
+ "100": "#D1F7C4",
7267
+ "300": "#93E088",
7268
+ "500": "#20C933",
7269
+ "900": "#338A17"
7270
+ };
7271
+ const colors = {
7272
+ blue: blue["500"],
7273
+ pink: pink["500"],
7274
+ teal: teal["500"],
7275
+ purple: purple["500"],
7276
+ green: green["500"],
7277
+ orange: orange["500"],
7278
+ cyan: cyan["500"],
7279
+ red: red["500"],
7280
+ yellow: yellow["500"]
7281
+ };
7282
+ const colorScale = Object.values(colors);
7283
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
7284
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
7285
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
7286
+ const heatmap = [green["500"], yellow["500"], red["500"]];
7287
+ const redPalette = [red["500"], red["300"], red["100"]];
7288
+ const greenPalette = [green["500"], green["300"], green["100"]];
7289
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
7290
+
7291
+ // *
7292
+ // * Typography
7293
+ // *
7294
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
7295
+ const letterSpacing = "normal";
7296
+ const fontSize = 12;
7297
+ // *
7298
+ // * Layout
7299
+ // *
7300
+ const padding = 8;
7301
+ const baseProps = {
7302
+ width: 450,
7303
+ height: 300,
7304
+ padding: 50,
7305
+ colorScale
7306
+ };
7307
+ // *
7308
+ // * Labels
7309
+ // *
7310
+ const baseLabelStyles = {
7311
+ fontFamily: sansSerif,
7312
+ fontSize,
7313
+ fontWeight: 300,
7314
+ letterSpacing,
7315
+ padding,
7316
+ fill: gray["900"],
7317
+ stroke: "transparent"
7318
+ };
7319
+ const centeredLabelStyles = Object.assign({
7320
+ textAnchor: "middle"
7321
+ }, baseLabelStyles);
7322
+
7323
+ // *
7324
+ // * Strokes
7325
+ // *
7326
+ const strokeDasharray = "10, 5";
7327
+ const strokeLinecap = "round";
7328
+ const strokeLinejoin = "round";
7329
+ const borderRadius = 1;
7330
+ // *
7331
+ // * Theme
7332
+ // *
7333
+ const clean = {
7334
+ palette: {
7335
+ colors,
7336
+ grayscale,
7337
+ qualitative: colorScale,
7338
+ heatmap,
7339
+ warm,
7340
+ cool,
7341
+ red: redPalette,
7342
+ green: greenPalette,
7343
+ blue: bluePalette
7344
+ },
7345
+ area: Object.assign({
7346
+ style: {
7347
+ data: {
7348
+ fill: blue["500"],
7349
+ strokeWidth: 2,
7350
+ fillOpacity: 0.5
7351
+ },
7352
+ labels: baseLabelStyles
7353
+ }
7354
+ }, baseProps),
7355
+ axis: Object.assign({
7356
+ style: {
7357
+ axis: {
7358
+ fill: "transparent",
7359
+ stroke: gray["500"],
7360
+ strokeWidth: 1,
7361
+ strokeLinecap,
7362
+ strokeLinejoin
7363
+ },
7364
+ axisLabel: Object.assign({}, centeredLabelStyles, {
7365
+ padding,
7366
+ stroke: "transparent"
7367
+ }),
7368
+ grid: {
7369
+ fill: "none",
7370
+ stroke: "none",
7371
+ painterEvents: "painted"
7372
+ },
7373
+ ticks: {
7374
+ fill: "transparent",
7375
+ size: 5,
7376
+ stroke: "transparent"
7377
+ },
7378
+ tickLabels: baseLabelStyles
7379
+ }
7380
+ }, baseProps),
7381
+ polarAxis: Object.assign({
7382
+ style: {
7383
+ axis: {
7384
+ stroke: gray["500"]
7385
+ },
7386
+ grid: {
7387
+ stroke: gray["400"],
7388
+ strokeDasharray,
7389
+ strokeLinecap,
7390
+ strokeLinejoin,
7391
+ pointerEvents: "painted"
7392
+ },
7393
+ ticks: {
7394
+ fill: "transparent",
7395
+ size: 5,
7396
+ stroke: gray["400"],
7397
+ strokeWidth: 1,
7398
+ strokeLinecap,
7399
+ strokeLinejoin
7400
+ },
7401
+ tickLabels: baseLabelStyles
7402
+ }
7403
+ }),
7404
+ polarDependentAxis: Object.assign({
7405
+ style: {
7406
+ axis: {
7407
+ stroke: gray["500"]
7408
+ },
7409
+ grid: {
7410
+ stroke: gray["400"],
7411
+ strokeDasharray,
7412
+ strokeLinecap,
7413
+ strokeLinejoin,
7414
+ pointerEvents: "painted"
7415
+ },
7416
+ ticks: {
7417
+ fill: "transparent",
7418
+ size: 5,
7419
+ stroke: gray["300"],
7420
+ strokeWidth: 1,
7421
+ strokeLinecap,
7422
+ strokeLinejoin
7423
+ },
7424
+ tickLabels: baseLabelStyles
7425
+ }
7426
+ }),
7427
+ bar: Object.assign({
7428
+ style: {
7429
+ data: {
7430
+ fill: blue["500"],
7431
+ padding,
7432
+ strokeWidth: 1,
7433
+ fillOpacity: 0.5
7434
+ },
7435
+ labels: baseLabelStyles
7436
+ },
7437
+ cornerRadius: {
7438
+ top: borderRadius
7439
+ }
7440
+ }, baseProps),
7441
+ boxplot: Object.assign({
7442
+ style: {
7443
+ max: {
7444
+ padding,
7445
+ stroke: gray["400"],
7446
+ strokeWidth: 2
7447
+ },
7448
+ maxLabels: Object.assign({}, baseLabelStyles, {
7449
+ padding: 3
7450
+ }),
7451
+ median: {
7452
+ padding,
7453
+ stroke: gray.white,
7454
+ strokeWidth: 2
7455
+ },
7456
+ medianLabels: Object.assign({}, baseLabelStyles, {
7457
+ padding: 3
7458
+ }),
7459
+ min: {
7460
+ padding,
7461
+ stroke: gray["400"],
7462
+ strokeWidth: 2
7463
+ },
7464
+ minLabels: Object.assign({}, baseLabelStyles, {
7465
+ padding: 3
7466
+ }),
7467
+ q1: {
7468
+ padding,
7469
+ fill: teal["500"],
7470
+ rx: borderRadius,
7471
+ strokeWidth: 2
7472
+ },
7473
+ q1Labels: Object.assign({}, baseLabelStyles, {
7474
+ padding: 3
7475
+ }),
7476
+ q3: {
7477
+ padding,
7478
+ fill: cyan["500"],
7479
+ rx: borderRadius
7480
+ },
7481
+ q3Labels: Object.assign({}, baseLabelStyles, {
7482
+ padding: 3
7483
+ })
7484
+ },
7485
+ boxWidth: 20
7486
+ }, baseProps),
7487
+ candlestick: Object.assign({
7488
+ style: {
7489
+ data: {
7490
+ stroke: gray["300"],
7491
+ strokeWidth: 0,
7492
+ rx: borderRadius
7493
+ },
7494
+ labels: Object.assign({}, baseLabelStyles, {
7495
+ padding: 5
7496
+ })
7497
+ },
7498
+ candleColors: {
7499
+ positive: teal["500"],
7500
+ negative: orange["500"]
7501
+ },
7502
+ wickStrokeWidth: 2
7503
+ }, baseProps),
7504
+ chart: baseProps,
7505
+ errorbar: Object.assign({
7506
+ borderWidth: 8,
7507
+ style: {
7508
+ data: {
7509
+ fill: "transparent",
7510
+ opacity: 1,
7511
+ stroke: gray["700"],
7512
+ strokeWidth: 2,
7513
+ strokeLinecap
7514
+ },
7515
+ labels: baseLabelStyles
7516
+ }
7517
+ }, baseProps),
7518
+ group: Object.assign({
7519
+ colorScale
7520
+ }, baseProps),
7521
+ histogram: Object.assign({
7522
+ style: {
7523
+ data: {
7524
+ fill: cyan["500"],
7525
+ fillOpacity: 0.5
7526
+ },
7527
+ labels: baseLabelStyles
7528
+ },
7529
+ binSpacing: 4,
7530
+ cornerRadius: {
7531
+ top: borderRadius
7532
+ }
7533
+ }, baseProps),
7534
+ label: baseLabelStyles,
7535
+ legend: {
7536
+ colorScale,
7537
+ gutter: 24,
7538
+ borderPadding: 10,
7539
+ orientation: "horizontal",
7540
+ titleOrientation: "top",
7541
+ centerTitle: true,
7542
+ style: {
7543
+ data: {
7544
+ type: "circle"
7545
+ },
7546
+ labels: {
7547
+ ...baseLabelStyles,
7548
+ fontSize: 12
7549
+ },
7550
+ title: Object.assign({}, baseLabelStyles, {
7551
+ padding,
7552
+ fontSize: 16
7553
+ }),
7554
+ border: {
7555
+ stroke: gray["200"],
7556
+ strokeWidth: 2,
7557
+ padding: 16
7558
+ }
7559
+ }
7560
+ },
7561
+ line: Object.assign({
7562
+ style: {
7563
+ data: {
7564
+ fill: "transparent",
7565
+ opacity: 1,
7566
+ stroke: blue["500"],
7567
+ strokeWidth: 2,
7568
+ strokeLinecap,
7569
+ strokeLinejoin
7570
+ },
7571
+ labels: baseLabelStyles
7572
+ }
7573
+ }, baseProps),
7574
+ pie: Object.assign({
7575
+ style: {
7576
+ parent: {
7577
+ backgroundColor: gray.white
7578
+ },
7579
+ data: {
7580
+ padding,
7581
+ stroke: gray.white,
7582
+ strokeWidth: 1
7583
+ },
7584
+ labels: {
7585
+ ...baseLabelStyles,
7586
+ padding: 20,
7587
+ fill: gray["600"],
7588
+ fontSize: 10
7589
+ }
7590
+ },
7591
+ colorScale,
7592
+ cornerRadius: borderRadius
7593
+ }, baseProps),
7594
+ scatter: Object.assign({
7595
+ style: {
7596
+ data: {
7597
+ fill: purple["500"],
7598
+ opacity: 1,
7599
+ stroke: "transparent",
7600
+ strokeWidth: 0
7601
+ },
7602
+ labels: {
7603
+ ...baseLabelStyles,
7604
+ padding: 20
7605
+ }
7606
+ }
7607
+ }, baseProps),
7608
+ stack: Object.assign({
7609
+ colorScale
7610
+ }, baseProps),
7611
+ tooltip: {
7612
+ style: Object.assign({}, baseLabelStyles, {
7613
+ padding: 0,
7614
+ pointerEvents: "none"
7615
+ }),
7616
+ flyoutStyle: {
7617
+ stroke: gray["300"],
7618
+ strokeWidth: 2,
7619
+ fill: gray.white,
7620
+ pointerEvents: "none"
7621
+ },
7622
+ flyoutPadding: {
7623
+ top: 8,
7624
+ bottom: 8,
7625
+ left: 16,
7626
+ right: 16
7627
+ },
7628
+ cornerRadius: borderRadius,
7629
+ pointerLength: 4
7630
+ },
7631
+ voronoi: Object.assign({
7632
+ style: {
7633
+ data: {
7634
+ fill: blue["100"],
7635
+ stroke: blue["500"],
7636
+ strokeWidth: 2,
7637
+ opacity: 0.4
7638
+ },
7639
+ labels: Object.assign({}, baseLabelStyles, {
7640
+ padding: 5,
7641
+ pointerEvents: "none"
7642
+ }),
7643
+ flyout: {
7644
+ stroke: gray["900"],
7645
+ strokeWidth: 1,
7646
+ fill: gray["100"],
7647
+ pointerEvents: "none"
7648
+ },
7649
+ padding: {
7650
+ left: 2,
7651
+ bottom: 2
7652
+ }
7653
+ }
7654
+ }, baseProps)
7655
+ };
7656
+
7657
+ /***/ }),
7658
+
7185
7659
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
7186
7660
  /*!********************************************************!*\
7187
7661
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -7196,9 +7670,28 @@ __webpack_require__.r(__webpack_exports__);
7196
7670
  // *
7197
7671
  // * Colors
7198
7672
  // *
7199
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7673
+ const colors = {
7674
+ blue: "#4F7DA1",
7675
+ pink: "#E2A37F",
7676
+ teal: "#00796B",
7677
+ purple: "#DF948A",
7678
+ green: "#8BC34A",
7679
+ orange: "#F4511E",
7680
+ cyan: "#006064",
7681
+ red: "#DF5A49",
7682
+ yellow: "#FFF59D"
7683
+ };
7684
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7200
7685
  const charcoal = "#252525";
7201
7686
  const grey = "#969696";
7687
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7688
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7689
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7690
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7691
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7692
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7693
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7694
+
7202
7695
  // *
7203
7696
  // * Typography
7204
7697
  // *
@@ -7212,7 +7705,7 @@ const baseProps = {
7212
7705
  width: 450,
7213
7706
  height: 300,
7214
7707
  padding: 50,
7215
- colorScale: colors
7708
+ colorScale
7216
7709
  };
7217
7710
  // *
7218
7711
  // * Labels
@@ -7234,6 +7727,17 @@ const centeredLabelStyles = Object.assign({
7234
7727
  const strokeLinecap = "round";
7235
7728
  const strokeLinejoin = "round";
7236
7729
  const grayscale = {
7730
+ palette: {
7731
+ colors,
7732
+ grayscale: colorScale,
7733
+ qualitative,
7734
+ heatmap,
7735
+ warm,
7736
+ cool,
7737
+ red,
7738
+ green,
7739
+ blue
7740
+ },
7237
7741
  area: Object.assign({
7238
7742
  style: {
7239
7743
  data: {
@@ -7348,7 +7852,7 @@ const grayscale = {
7348
7852
  }
7349
7853
  }, baseProps),
7350
7854
  group: Object.assign({
7351
- colorScale: colors
7855
+ colorScale
7352
7856
  }, baseProps),
7353
7857
  histogram: Object.assign({
7354
7858
  style: {
@@ -7361,7 +7865,7 @@ const grayscale = {
7361
7865
  }
7362
7866
  }, baseProps),
7363
7867
  legend: {
7364
- colorScale: colors,
7868
+ colorScale,
7365
7869
  gutter: 10,
7366
7870
  orientation: "vertical",
7367
7871
  titleOrientation: "top",
@@ -7396,7 +7900,7 @@ const grayscale = {
7396
7900
  padding: 20
7397
7901
  })
7398
7902
  },
7399
- colorScale: colors,
7903
+ colorScale,
7400
7904
  width: 400,
7401
7905
  height: 400,
7402
7906
  padding: 50
@@ -7412,7 +7916,7 @@ const grayscale = {
7412
7916
  }
7413
7917
  }, baseProps),
7414
7918
  stack: Object.assign({
7415
- colorScale: colors
7919
+ colorScale
7416
7920
  }, baseProps),
7417
7921
  tooltip: {
7418
7922
  style: Object.assign({}, baseLabelStyles, {
@@ -7472,11 +7976,31 @@ const lime300 = "#DCE775";
7472
7976
  const lightGreen500 = "#8BC34A";
7473
7977
  const teal700 = "#00796B";
7474
7978
  const cyan900 = "#006064";
7475
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7979
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7476
7980
  const blueGrey50 = "#ECEFF1";
7477
7981
  const blueGrey300 = "#90A4AE";
7478
7982
  const blueGrey700 = "#455A64";
7479
7983
  const grey900 = "#212121";
7984
+ const colors = {
7985
+ blue: "#4F7DA1",
7986
+ pink: "#E2A37F",
7987
+ teal: teal700,
7988
+ purple: "#DF948A",
7989
+ green: lightGreen500,
7990
+ orange: deepOrange600,
7991
+ cyan: cyan900,
7992
+ red: "#DF5A49",
7993
+ yellow: yellow200
7994
+ };
7995
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7996
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7997
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7998
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7999
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8000
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8001
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8002
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8003
+
7480
8004
  // *
7481
8005
  // * Typography
7482
8006
  // *
@@ -7514,6 +8038,17 @@ const strokeDasharray = "10, 5";
7514
8038
  const strokeLinecap = "round";
7515
8039
  const strokeLinejoin = "round";
7516
8040
  const material = {
8041
+ palette: {
8042
+ colors,
8043
+ grayscale,
8044
+ qualitative,
8045
+ heatmap,
8046
+ warm,
8047
+ cool,
8048
+ red,
8049
+ green,
8050
+ blue
8051
+ },
7517
8052
  area: Object.assign({
7518
8053
  style: {
7519
8054
  data: {
@@ -7646,7 +8181,7 @@ const material = {
7646
8181
  }
7647
8182
  }, baseProps),
7648
8183
  group: Object.assign({
7649
- colorScale: colors
8184
+ colorScale
7650
8185
  }, baseProps),
7651
8186
  histogram: Object.assign({
7652
8187
  style: {
@@ -7659,7 +8194,7 @@ const material = {
7659
8194
  }
7660
8195
  }, baseProps),
7661
8196
  legend: {
7662
- colorScale: colors,
8197
+ colorScale,
7663
8198
  gutter: 10,
7664
8199
  orientation: "vertical",
7665
8200
  titleOrientation: "top",
@@ -7685,7 +8220,7 @@ const material = {
7685
8220
  }
7686
8221
  }, baseProps),
7687
8222
  pie: Object.assign({
7688
- colorScale: colors,
8223
+ colorScale,
7689
8224
  style: {
7690
8225
  data: {
7691
8226
  padding,
@@ -7709,7 +8244,7 @@ const material = {
7709
8244
  }
7710
8245
  }, baseProps),
7711
8246
  stack: Object.assign({
7712
- colorScale: colors
8247
+ colorScale
7713
8248
  }, baseProps),
7714
8249
  tooltip: {
7715
8250
  style: Object.assign({}, baseLabelStyles, {
@@ -7762,12 +8297,15 @@ __webpack_require__.r(__webpack_exports__);
7762
8297
  /* harmony export */ });
7763
8298
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
7764
8299
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
8300
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
8301
+
7765
8302
 
7766
8303
 
7767
8304
 
7768
8305
  const VictoryTheme = {
7769
8306
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
7770
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
8307
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
8308
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
7771
8309
  };
7772
8310
 
7773
8311
  /***/ }),
@@ -10568,6 +11106,9 @@ __webpack_require__.r(__webpack_exports__);
10568
11106
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10569
11107
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10570
11108
  /* harmony export */ });
11109
+ /* 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");
11110
+
11111
+
10571
11112
  /**
10572
11113
  * Given an object with CSS/SVG transform definitions, return the string value
10573
11114
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10604,20 +11145,37 @@ const toTransformString = function (obj) {
10604
11145
  * of 5 hex string values in that color scale. If no 'name' parameter
10605
11146
  * is given, it will return the Victory default grayscale.
10606
11147
  * @param {String} name The name of the color scale to return (optional).
11148
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10607
11149
  * @returns {Array} An array of 5 hex string values composing a color scale.
10608
11150
  */
10609
- function getColorScale(name) {
11151
+ function getColorScale(name, theme) {
11152
+ if (theme === void 0) {
11153
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
11154
+ }
11155
+ const {
11156
+ palette: {
11157
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
11158
+ qualitative = [],
11159
+ heatmap = [],
11160
+ warm = [],
11161
+ cool = [],
11162
+ red = [],
11163
+ blue = [],
11164
+ green = []
11165
+ } = {}
11166
+ } = theme;
10610
11167
  const scales = {
10611
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10612
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10613
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10614
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10615
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10616
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10617
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10618
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
11168
+ grayscale,
11169
+ qualitative,
11170
+ heatmap,
11171
+ warm,
11172
+ cool,
11173
+ red,
11174
+ blue,
11175
+ green
10619
11176
  };
10620
- return name ? scales[name] : scales.grayscale;
11177
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
11178
+ return selectedScale;
10621
11179
  }
10622
11180
 
10623
11181
  /***/ }),
@@ -10644,6 +11202,7 @@ __webpack_require__.r(__webpack_exports__);
10644
11202
  /* eslint-disable no-magic-numbers */
10645
11203
  // Based on measuring specific character widths
10646
11204
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
11205
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
10647
11206
  // prettier-ignore
10648
11207
  const fonts = {
10649
11208
  "American Typewriter": {
@@ -10702,6 +11261,10 @@ const fonts = {
10702
11261
  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],
10703
11262
  avg: 0.5116447368421051
10704
11263
  },
11264
+ "Inter": {
11265
+ 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],
11266
+ avg: 0.5624362664473683
11267
+ },
10705
11268
  "Montserrat": {
10706
11269
  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],
10707
11270
  avg: 0.571792763157895