victory-cursor-container 37.1.2 → 37.3.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.
@@ -3763,31 +3763,34 @@ __webpack_require__.r(__webpack_exports__);
3763
3763
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3764
3764
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
3765
3765
  /* harmony export */ });
3766
- /* 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");
3767
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
3768
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
3769
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
3770
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
3771
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
3772
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
3766
+ /* 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");
3767
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
3768
+ /* 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");
3769
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
3770
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
3771
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
3772
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
3773
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
3774
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
3775
+
3773
3776
 
3774
3777
 
3775
3778
 
3776
3779
 
3777
3780
 
3778
3781
  const defaultProps = {
3779
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
3782
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
3780
3783
  };
3781
3784
  const VictoryPortal = initialProps => {
3782
3785
  const props = {
3783
3786
  ...defaultProps,
3784
3787
  ...initialProps
3785
3788
  };
3786
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
3787
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
3789
+ const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
3790
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
3788
3791
  if (!portalContext) {
3789
3792
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
3790
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
3793
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
3791
3794
  }
3792
3795
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
3793
3796
  const {
@@ -3798,15 +3801,15 @@ const VictoryPortal = initialProps => {
3798
3801
  groupComponent,
3799
3802
  standalone: false
3800
3803
  } : {};
3801
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
3804
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
3802
3805
  key: childProps.key ?? id
3803
3806
  });
3804
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
3805
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
3807
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
3808
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
3806
3809
  portalContext?.addChild(id, child);
3807
3810
  // eslint-disable-next-line react-hooks/exhaustive-deps
3808
3811
  }, [props.children]);
3809
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
3812
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
3810
3813
  return () => portalContext?.removeChild(id);
3811
3814
  // eslint-disable-next-line react-hooks/exhaustive-deps
3812
3815
  }, []);
@@ -4050,6 +4053,1128 @@ const TSpan = props => {
4050
4053
 
4051
4054
  /***/ }),
4052
4055
 
4056
+ /***/ "../../victory-core/es/victory-theme/clean.js":
4057
+ /*!****************************************************!*\
4058
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
4059
+ \****************************************************/
4060
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4061
+
4062
+ "use strict";
4063
+ __webpack_require__.r(__webpack_exports__);
4064
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4065
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
4066
+ /* harmony export */ });
4067
+ // *
4068
+ // * Colors
4069
+ // *
4070
+
4071
+ const gray = {
4072
+ white: "#FFFFFF",
4073
+ "50": "#FAFAFA",
4074
+ "100": "#F2F2F2",
4075
+ "200": "#E8E8E8",
4076
+ "300": "#E0E0E0",
4077
+ "400": "#D1D1D1",
4078
+ "500": "#757575",
4079
+ "600": "#5C5C5C",
4080
+ "700": "#424242",
4081
+ "800": "#333333",
4082
+ "900": "#292929",
4083
+ black: "#0F0F0F"
4084
+ };
4085
+ const yellow = {
4086
+ "100": "#FFEAB6",
4087
+ "300": "#FFD66E",
4088
+ "500": "#FCB400",
4089
+ "900": "#B87503"
4090
+ };
4091
+ const orange = {
4092
+ "100": "#FEE2D5",
4093
+ "300": "#FFA981",
4094
+ "500": "#FF6F2C",
4095
+ "700": "#FF4E1B",
4096
+ "900": "#D74D26"
4097
+ };
4098
+ const red = {
4099
+ "100": "#FFDCE5",
4100
+ "300": "#FF9EB7",
4101
+ "500": "#F82B60",
4102
+ "700": "#D31A3D",
4103
+ "900": "#BA1E45"
4104
+ };
4105
+ const purple = {
4106
+ "100": "#EDE3FE",
4107
+ "300": "#CDB0FF",
4108
+ "500": "#8B46FF",
4109
+ "900": "#6B1CB0"
4110
+ };
4111
+ const blue = {
4112
+ "100": "#CFDFFF",
4113
+ "300": "#9CC7FF",
4114
+ "500": "#2D7FF9",
4115
+ "700": "#0056B3",
4116
+ "900": "#2750AE"
4117
+ };
4118
+ const cyan = {
4119
+ "100": "#D0F0FD",
4120
+ "300": "#77D1F3",
4121
+ "500": "#18BFFF",
4122
+ "900": "#0B76B7"
4123
+ };
4124
+ const teal = {
4125
+ "100": "#C2F5E9",
4126
+ "300": "#72DDC3",
4127
+ "500": "#20D9D2",
4128
+ "900": "#06A09B"
4129
+ };
4130
+ const green = {
4131
+ "100": "#D1F7C4",
4132
+ "300": "#93E088",
4133
+ "500": "#20C933",
4134
+ "700": "#1B9B2A",
4135
+ "900": "#338A17"
4136
+ };
4137
+ const colors = {
4138
+ blue: blue["500"],
4139
+ cyan: cyan["500"],
4140
+ green: green["500"],
4141
+ yellow: yellow["500"],
4142
+ orange: orange["500"],
4143
+ red: red["500"],
4144
+ purple: purple["500"],
4145
+ teal: teal["500"]
4146
+ };
4147
+ const colorScale = Object.values(colors);
4148
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
4149
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
4150
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
4151
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
4152
+ const redPalette = Object.values(red);
4153
+ const greenPalette = Object.values(green);
4154
+ const bluePalette = Object.values(blue);
4155
+ const defaultColor = blue["500"];
4156
+
4157
+ // *
4158
+ // * Typography
4159
+ // *
4160
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
4161
+ const letterSpacing = "normal";
4162
+ const fontSize = 12;
4163
+ // *
4164
+ // * Layout
4165
+ // *
4166
+ const padding = 8;
4167
+ const baseProps = {
4168
+ width: 450,
4169
+ height: 300,
4170
+ padding: 60,
4171
+ colorScale
4172
+ };
4173
+ // *
4174
+ // * Labels
4175
+ // *
4176
+ const baseLabelStyles = {
4177
+ fontFamily: sansSerif,
4178
+ fontSize,
4179
+ fontWeight: 300,
4180
+ letterSpacing,
4181
+ padding,
4182
+ fill: gray["900"],
4183
+ stroke: "transparent"
4184
+ };
4185
+ const centeredLabelStyles = Object.assign({
4186
+ textAnchor: "middle"
4187
+ }, baseLabelStyles);
4188
+
4189
+ // *
4190
+ // * Strokes
4191
+ // *
4192
+ const strokeDasharray = "10, 5";
4193
+ const strokeLinecap = "round";
4194
+ const strokeLinejoin = "round";
4195
+ const borderRadius = 1;
4196
+ // *
4197
+ // * Theme
4198
+ // *
4199
+ const clean = {
4200
+ palette: {
4201
+ colors,
4202
+ grayscale,
4203
+ qualitative: colorScale,
4204
+ heatmap,
4205
+ warm,
4206
+ cool,
4207
+ red: redPalette,
4208
+ green: greenPalette,
4209
+ blue: bluePalette
4210
+ },
4211
+ area: Object.assign({
4212
+ style: {
4213
+ data: {
4214
+ fill: defaultColor,
4215
+ strokeWidth: 2,
4216
+ fillOpacity: 0.5
4217
+ },
4218
+ labels: baseLabelStyles
4219
+ }
4220
+ }, baseProps),
4221
+ axis: Object.assign({
4222
+ style: {
4223
+ axis: {
4224
+ fill: "transparent",
4225
+ stroke: gray["500"],
4226
+ strokeWidth: 1,
4227
+ strokeLinecap,
4228
+ strokeLinejoin
4229
+ },
4230
+ axisLabel: Object.assign({}, centeredLabelStyles, {
4231
+ padding: 35,
4232
+ stroke: "transparent"
4233
+ }),
4234
+ grid: {
4235
+ fill: "none",
4236
+ stroke: "none",
4237
+ painterEvents: "painted"
4238
+ },
4239
+ ticks: {
4240
+ fill: "transparent",
4241
+ size: 5,
4242
+ stroke: "transparent"
4243
+ },
4244
+ tickLabels: baseLabelStyles
4245
+ }
4246
+ }, baseProps),
4247
+ polarAxis: Object.assign({
4248
+ style: {
4249
+ axis: {
4250
+ stroke: gray["500"]
4251
+ },
4252
+ grid: {
4253
+ stroke: gray["400"],
4254
+ strokeDasharray,
4255
+ strokeLinecap,
4256
+ strokeLinejoin,
4257
+ pointerEvents: "painted"
4258
+ },
4259
+ ticks: {
4260
+ fill: "transparent",
4261
+ size: 5,
4262
+ stroke: gray["400"],
4263
+ strokeWidth: 1,
4264
+ strokeLinecap,
4265
+ strokeLinejoin
4266
+ },
4267
+ tickLabels: baseLabelStyles
4268
+ }
4269
+ }),
4270
+ polarDependentAxis: Object.assign({
4271
+ style: {
4272
+ axis: {
4273
+ stroke: gray["500"]
4274
+ },
4275
+ grid: {
4276
+ stroke: gray["400"],
4277
+ strokeDasharray,
4278
+ strokeLinecap,
4279
+ strokeLinejoin,
4280
+ pointerEvents: "painted"
4281
+ },
4282
+ ticks: {
4283
+ fill: "transparent",
4284
+ size: 5,
4285
+ stroke: gray["300"],
4286
+ strokeWidth: 1,
4287
+ strokeLinecap,
4288
+ strokeLinejoin
4289
+ },
4290
+ tickLabels: baseLabelStyles
4291
+ }
4292
+ }),
4293
+ bar: Object.assign({
4294
+ style: {
4295
+ data: {
4296
+ fill: defaultColor,
4297
+ padding,
4298
+ strokeWidth: 1,
4299
+ fillOpacity: 0.5
4300
+ },
4301
+ labels: baseLabelStyles
4302
+ },
4303
+ cornerRadius: {
4304
+ top: borderRadius
4305
+ }
4306
+ }, baseProps),
4307
+ boxplot: Object.assign({
4308
+ style: {
4309
+ max: {
4310
+ padding,
4311
+ stroke: gray["400"],
4312
+ strokeWidth: 2
4313
+ },
4314
+ maxLabels: Object.assign({}, baseLabelStyles, {
4315
+ padding: 3
4316
+ }),
4317
+ median: {
4318
+ padding,
4319
+ stroke: gray.white,
4320
+ strokeWidth: 2
4321
+ },
4322
+ medianLabels: Object.assign({}, baseLabelStyles, {
4323
+ padding: 3
4324
+ }),
4325
+ min: {
4326
+ padding,
4327
+ stroke: gray["400"],
4328
+ strokeWidth: 2
4329
+ },
4330
+ minLabels: Object.assign({}, baseLabelStyles, {
4331
+ padding: 3
4332
+ }),
4333
+ q1: {
4334
+ padding,
4335
+ fill: colorScale[0],
4336
+ rx: borderRadius,
4337
+ strokeWidth: 2
4338
+ },
4339
+ q1Labels: Object.assign({}, baseLabelStyles, {
4340
+ padding: 3
4341
+ }),
4342
+ q3: {
4343
+ padding,
4344
+ fill: colorScale[1],
4345
+ rx: borderRadius
4346
+ },
4347
+ q3Labels: Object.assign({}, baseLabelStyles, {
4348
+ padding: 3
4349
+ })
4350
+ },
4351
+ boxWidth: 20
4352
+ }, baseProps),
4353
+ candlestick: Object.assign({
4354
+ style: {
4355
+ data: {
4356
+ stroke: gray["300"],
4357
+ strokeWidth: 0,
4358
+ rx: borderRadius
4359
+ },
4360
+ labels: Object.assign({}, baseLabelStyles, {
4361
+ padding: 5
4362
+ })
4363
+ },
4364
+ candleColors: {
4365
+ positive: green["500"],
4366
+ negative: red["500"]
4367
+ },
4368
+ wickStrokeWidth: 2
4369
+ }, baseProps),
4370
+ chart: baseProps,
4371
+ errorbar: Object.assign({
4372
+ borderWidth: 8,
4373
+ style: {
4374
+ data: {
4375
+ fill: "transparent",
4376
+ opacity: 1,
4377
+ stroke: gray["700"],
4378
+ strokeWidth: 2,
4379
+ strokeLinecap
4380
+ },
4381
+ labels: baseLabelStyles
4382
+ }
4383
+ }, baseProps),
4384
+ group: Object.assign({
4385
+ colorScale
4386
+ }, baseProps),
4387
+ histogram: Object.assign({
4388
+ style: {
4389
+ data: {
4390
+ fill: cyan["500"],
4391
+ fillOpacity: 0.5
4392
+ },
4393
+ labels: baseLabelStyles
4394
+ },
4395
+ binSpacing: 4,
4396
+ cornerRadius: {
4397
+ top: borderRadius
4398
+ }
4399
+ }, baseProps),
4400
+ label: baseLabelStyles,
4401
+ legend: {
4402
+ colorScale,
4403
+ gutter: 24,
4404
+ borderPadding: 10,
4405
+ orientation: "horizontal",
4406
+ titleOrientation: "top",
4407
+ centerTitle: true,
4408
+ style: {
4409
+ data: {
4410
+ type: "circle"
4411
+ },
4412
+ labels: {
4413
+ ...baseLabelStyles,
4414
+ fontSize: 12
4415
+ },
4416
+ title: Object.assign({}, baseLabelStyles, {
4417
+ padding,
4418
+ fontSize: 16
4419
+ }),
4420
+ border: {
4421
+ stroke: gray["200"],
4422
+ strokeWidth: 2,
4423
+ padding: 16
4424
+ }
4425
+ }
4426
+ },
4427
+ line: Object.assign({
4428
+ style: {
4429
+ data: {
4430
+ fill: "transparent",
4431
+ opacity: 1,
4432
+ stroke: defaultColor,
4433
+ strokeWidth: 2,
4434
+ strokeLinecap,
4435
+ strokeLinejoin
4436
+ },
4437
+ labels: baseLabelStyles
4438
+ }
4439
+ }, baseProps),
4440
+ pie: Object.assign({
4441
+ style: {
4442
+ parent: {
4443
+ backgroundColor: gray.white
4444
+ },
4445
+ data: {
4446
+ padding,
4447
+ stroke: gray.white,
4448
+ strokeWidth: 1
4449
+ },
4450
+ labels: {
4451
+ ...baseLabelStyles,
4452
+ padding: 20,
4453
+ fill: gray["600"],
4454
+ fontSize: 10
4455
+ }
4456
+ },
4457
+ colorScale,
4458
+ cornerRadius: borderRadius
4459
+ }, baseProps),
4460
+ scatter: Object.assign({
4461
+ style: {
4462
+ data: {
4463
+ fill: defaultColor,
4464
+ opacity: 1,
4465
+ stroke: "transparent",
4466
+ strokeWidth: 0
4467
+ },
4468
+ labels: {
4469
+ ...baseLabelStyles,
4470
+ padding: 20
4471
+ }
4472
+ }
4473
+ }, baseProps),
4474
+ stack: Object.assign({
4475
+ colorScale
4476
+ }, baseProps),
4477
+ tooltip: {
4478
+ style: Object.assign({}, baseLabelStyles, {
4479
+ padding: 0,
4480
+ pointerEvents: "none"
4481
+ }),
4482
+ flyoutStyle: {
4483
+ stroke: gray["300"],
4484
+ strokeWidth: 2,
4485
+ fill: gray.white,
4486
+ pointerEvents: "none"
4487
+ },
4488
+ flyoutPadding: {
4489
+ top: 8,
4490
+ bottom: 8,
4491
+ left: 16,
4492
+ right: 16
4493
+ },
4494
+ cornerRadius: borderRadius,
4495
+ pointerLength: 4
4496
+ },
4497
+ voronoi: Object.assign({
4498
+ style: {
4499
+ data: {
4500
+ fill: blue["100"],
4501
+ stroke: defaultColor,
4502
+ strokeWidth: 2
4503
+ },
4504
+ labels: Object.assign({}, baseLabelStyles, {
4505
+ padding: 5,
4506
+ pointerEvents: "none"
4507
+ }),
4508
+ flyout: {
4509
+ stroke: gray["900"],
4510
+ strokeWidth: 1,
4511
+ fill: gray["100"],
4512
+ pointerEvents: "none"
4513
+ },
4514
+ padding: {
4515
+ left: 2,
4516
+ bottom: 2
4517
+ }
4518
+ }
4519
+ }, baseProps)
4520
+ };
4521
+
4522
+ /***/ }),
4523
+
4524
+ /***/ "../../victory-core/es/victory-theme/grayscale.js":
4525
+ /*!********************************************************!*\
4526
+ !*** ../../victory-core/es/victory-theme/grayscale.js ***!
4527
+ \********************************************************/
4528
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4529
+
4530
+ "use strict";
4531
+ __webpack_require__.r(__webpack_exports__);
4532
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4533
+ /* harmony export */ "grayscale": function() { return /* binding */ grayscale; }
4534
+ /* harmony export */ });
4535
+ // *
4536
+ // * Colors
4537
+ // *
4538
+ const colors = {
4539
+ blue: "#4F7DA1",
4540
+ pink: "#E2A37F",
4541
+ teal: "#00796B",
4542
+ purple: "#DF948A",
4543
+ green: "#8BC34A",
4544
+ orange: "#F4511E",
4545
+ cyan: "#006064",
4546
+ red: "#DF5A49",
4547
+ yellow: "#FFF59D"
4548
+ };
4549
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
4550
+ const charcoal = "#252525";
4551
+ const grey = "#969696";
4552
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
4553
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
4554
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
4555
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
4556
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
4557
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
4558
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
4559
+
4560
+ // *
4561
+ // * Typography
4562
+ // *
4563
+ const sansSerif = "'Gill Sans', 'Seravek', 'Trebuchet MS', sans-serif";
4564
+ const letterSpacing = "normal";
4565
+ const fontSize = 14;
4566
+ // *
4567
+ // * Layout
4568
+ // *
4569
+ const baseProps = {
4570
+ width: 450,
4571
+ height: 300,
4572
+ padding: 50,
4573
+ colorScale
4574
+ };
4575
+ // *
4576
+ // * Labels
4577
+ // *
4578
+ const baseLabelStyles = {
4579
+ fontFamily: sansSerif,
4580
+ fontSize,
4581
+ letterSpacing,
4582
+ padding: 10,
4583
+ fill: charcoal,
4584
+ stroke: "transparent"
4585
+ };
4586
+ const centeredLabelStyles = Object.assign({
4587
+ textAnchor: "middle"
4588
+ }, baseLabelStyles);
4589
+ // *
4590
+ // * Strokes
4591
+ // *
4592
+ const strokeLinecap = "round";
4593
+ const strokeLinejoin = "round";
4594
+ const grayscale = {
4595
+ palette: {
4596
+ colors,
4597
+ grayscale: colorScale,
4598
+ qualitative,
4599
+ heatmap,
4600
+ warm,
4601
+ cool,
4602
+ red,
4603
+ green,
4604
+ blue
4605
+ },
4606
+ area: Object.assign({
4607
+ style: {
4608
+ data: {
4609
+ fill: charcoal
4610
+ },
4611
+ labels: baseLabelStyles
4612
+ }
4613
+ }, baseProps),
4614
+ axis: Object.assign({
4615
+ style: {
4616
+ axis: {
4617
+ fill: "transparent",
4618
+ stroke: charcoal,
4619
+ strokeWidth: 1,
4620
+ strokeLinecap,
4621
+ strokeLinejoin
4622
+ },
4623
+ axisLabel: Object.assign({}, centeredLabelStyles, {
4624
+ padding: 25
4625
+ }),
4626
+ grid: {
4627
+ fill: "none",
4628
+ stroke: "none",
4629
+ pointerEvents: "painted"
4630
+ },
4631
+ ticks: {
4632
+ fill: "transparent",
4633
+ size: 1,
4634
+ stroke: "transparent"
4635
+ },
4636
+ tickLabels: baseLabelStyles
4637
+ }
4638
+ }, baseProps),
4639
+ bar: Object.assign({
4640
+ style: {
4641
+ data: {
4642
+ fill: charcoal,
4643
+ padding: 8,
4644
+ strokeWidth: 0
4645
+ },
4646
+ labels: baseLabelStyles
4647
+ }
4648
+ }, baseProps),
4649
+ boxplot: Object.assign({
4650
+ style: {
4651
+ max: {
4652
+ padding: 8,
4653
+ stroke: charcoal,
4654
+ strokeWidth: 1
4655
+ },
4656
+ maxLabels: Object.assign({}, baseLabelStyles, {
4657
+ padding: 3
4658
+ }),
4659
+ median: {
4660
+ padding: 8,
4661
+ stroke: charcoal,
4662
+ strokeWidth: 1
4663
+ },
4664
+ medianLabels: Object.assign({}, baseLabelStyles, {
4665
+ padding: 3
4666
+ }),
4667
+ min: {
4668
+ padding: 8,
4669
+ stroke: charcoal,
4670
+ strokeWidth: 1
4671
+ },
4672
+ minLabels: Object.assign({}, baseLabelStyles, {
4673
+ padding: 3
4674
+ }),
4675
+ q1: {
4676
+ padding: 8,
4677
+ fill: grey
4678
+ },
4679
+ q1Labels: Object.assign({}, baseLabelStyles, {
4680
+ padding: 3
4681
+ }),
4682
+ q3: {
4683
+ padding: 8,
4684
+ fill: grey
4685
+ },
4686
+ q3Labels: Object.assign({}, baseLabelStyles, {
4687
+ padding: 3
4688
+ })
4689
+ },
4690
+ boxWidth: 20
4691
+ }, baseProps),
4692
+ candlestick: Object.assign({
4693
+ style: {
4694
+ data: {
4695
+ stroke: charcoal,
4696
+ strokeWidth: 1
4697
+ },
4698
+ labels: Object.assign({}, baseLabelStyles, {
4699
+ padding: 5
4700
+ })
4701
+ },
4702
+ candleColors: {
4703
+ positive: "#ffffff",
4704
+ negative: charcoal
4705
+ }
4706
+ }, baseProps),
4707
+ chart: baseProps,
4708
+ errorbar: Object.assign({
4709
+ borderWidth: 8,
4710
+ style: {
4711
+ data: {
4712
+ fill: "transparent",
4713
+ stroke: charcoal,
4714
+ strokeWidth: 2
4715
+ },
4716
+ labels: baseLabelStyles
4717
+ }
4718
+ }, baseProps),
4719
+ group: Object.assign({
4720
+ colorScale
4721
+ }, baseProps),
4722
+ histogram: Object.assign({
4723
+ style: {
4724
+ data: {
4725
+ fill: grey,
4726
+ stroke: charcoal,
4727
+ strokeWidth: 2
4728
+ },
4729
+ labels: baseLabelStyles
4730
+ }
4731
+ }, baseProps),
4732
+ legend: {
4733
+ colorScale,
4734
+ gutter: 10,
4735
+ orientation: "vertical",
4736
+ titleOrientation: "top",
4737
+ style: {
4738
+ data: {
4739
+ type: "circle"
4740
+ },
4741
+ labels: baseLabelStyles,
4742
+ title: Object.assign({}, baseLabelStyles, {
4743
+ padding: 5
4744
+ })
4745
+ }
4746
+ },
4747
+ line: Object.assign({
4748
+ style: {
4749
+ data: {
4750
+ fill: "transparent",
4751
+ stroke: charcoal,
4752
+ strokeWidth: 2
4753
+ },
4754
+ labels: baseLabelStyles
4755
+ }
4756
+ }, baseProps),
4757
+ pie: {
4758
+ style: {
4759
+ data: {
4760
+ padding: 10,
4761
+ stroke: "transparent",
4762
+ strokeWidth: 1
4763
+ },
4764
+ labels: Object.assign({}, baseLabelStyles, {
4765
+ padding: 20
4766
+ })
4767
+ },
4768
+ colorScale,
4769
+ width: 400,
4770
+ height: 400,
4771
+ padding: 50
4772
+ },
4773
+ scatter: Object.assign({
4774
+ style: {
4775
+ data: {
4776
+ fill: charcoal,
4777
+ stroke: "transparent",
4778
+ strokeWidth: 0
4779
+ },
4780
+ labels: baseLabelStyles
4781
+ }
4782
+ }, baseProps),
4783
+ stack: Object.assign({
4784
+ colorScale
4785
+ }, baseProps),
4786
+ tooltip: {
4787
+ style: Object.assign({}, baseLabelStyles, {
4788
+ padding: 0,
4789
+ pointerEvents: "none"
4790
+ }),
4791
+ flyoutStyle: {
4792
+ stroke: charcoal,
4793
+ strokeWidth: 1,
4794
+ fill: "#f0f0f0",
4795
+ pointerEvents: "none"
4796
+ },
4797
+ flyoutPadding: 5,
4798
+ cornerRadius: 5,
4799
+ pointerLength: 10
4800
+ },
4801
+ voronoi: Object.assign({
4802
+ style: {
4803
+ data: {
4804
+ fill: "transparent",
4805
+ stroke: "transparent",
4806
+ strokeWidth: 0
4807
+ },
4808
+ labels: Object.assign({}, baseLabelStyles, {
4809
+ padding: 5,
4810
+ pointerEvents: "none"
4811
+ }),
4812
+ flyout: {
4813
+ stroke: charcoal,
4814
+ strokeWidth: 1,
4815
+ fill: "#f0f0f0",
4816
+ pointerEvents: "none"
4817
+ }
4818
+ }
4819
+ }, baseProps)
4820
+ };
4821
+
4822
+ /***/ }),
4823
+
4824
+ /***/ "../../victory-core/es/victory-theme/material.js":
4825
+ /*!*******************************************************!*\
4826
+ !*** ../../victory-core/es/victory-theme/material.js ***!
4827
+ \*******************************************************/
4828
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4829
+
4830
+ "use strict";
4831
+ __webpack_require__.r(__webpack_exports__);
4832
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4833
+ /* harmony export */ "material": function() { return /* binding */ material; }
4834
+ /* harmony export */ });
4835
+ // *
4836
+ // * Colors
4837
+ // *
4838
+ const yellow200 = "#FFF59D";
4839
+ const deepOrange600 = "#F4511E";
4840
+ const lime300 = "#DCE775";
4841
+ const lightGreen500 = "#8BC34A";
4842
+ const teal700 = "#00796B";
4843
+ const cyan900 = "#006064";
4844
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
4845
+ const blueGrey50 = "#ECEFF1";
4846
+ const blueGrey300 = "#90A4AE";
4847
+ const blueGrey700 = "#455A64";
4848
+ const grey900 = "#212121";
4849
+ const colors = {
4850
+ blue: "#4F7DA1",
4851
+ pink: "#E2A37F",
4852
+ teal: teal700,
4853
+ purple: "#DF948A",
4854
+ green: lightGreen500,
4855
+ orange: deepOrange600,
4856
+ cyan: cyan900,
4857
+ red: "#DF5A49",
4858
+ yellow: yellow200
4859
+ };
4860
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
4861
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
4862
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
4863
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
4864
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
4865
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
4866
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
4867
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
4868
+
4869
+ // *
4870
+ // * Typography
4871
+ // *
4872
+ const sansSerif = "'Helvetica Neue', 'Helvetica', sans-serif";
4873
+ const letterSpacing = "normal";
4874
+ const fontSize = 12;
4875
+ // *
4876
+ // * Layout
4877
+ // *
4878
+ const padding = 8;
4879
+ const baseProps = {
4880
+ width: 350,
4881
+ height: 350,
4882
+ padding: 50
4883
+ };
4884
+ // *
4885
+ // * Labels
4886
+ // *
4887
+ const baseLabelStyles = {
4888
+ fontFamily: sansSerif,
4889
+ fontSize,
4890
+ letterSpacing,
4891
+ padding,
4892
+ fill: blueGrey700,
4893
+ stroke: "transparent",
4894
+ strokeWidth: 0
4895
+ };
4896
+ const centeredLabelStyles = Object.assign({
4897
+ textAnchor: "middle"
4898
+ }, baseLabelStyles);
4899
+ // *
4900
+ // * Strokes
4901
+ // *
4902
+ const strokeDasharray = "10, 5";
4903
+ const strokeLinecap = "round";
4904
+ const strokeLinejoin = "round";
4905
+ const material = {
4906
+ palette: {
4907
+ colors,
4908
+ grayscale,
4909
+ qualitative,
4910
+ heatmap,
4911
+ warm,
4912
+ cool,
4913
+ red,
4914
+ green,
4915
+ blue
4916
+ },
4917
+ area: Object.assign({
4918
+ style: {
4919
+ data: {
4920
+ fill: grey900
4921
+ },
4922
+ labels: baseLabelStyles
4923
+ }
4924
+ }, baseProps),
4925
+ axis: Object.assign({
4926
+ style: {
4927
+ axis: {
4928
+ fill: "transparent",
4929
+ stroke: blueGrey300,
4930
+ strokeWidth: 2,
4931
+ strokeLinecap,
4932
+ strokeLinejoin
4933
+ },
4934
+ axisLabel: Object.assign({}, centeredLabelStyles, {
4935
+ padding,
4936
+ stroke: "transparent"
4937
+ }),
4938
+ grid: {
4939
+ fill: "none",
4940
+ stroke: blueGrey50,
4941
+ strokeDasharray,
4942
+ strokeLinecap,
4943
+ strokeLinejoin,
4944
+ pointerEvents: "painted"
4945
+ },
4946
+ ticks: {
4947
+ fill: "transparent",
4948
+ size: 5,
4949
+ stroke: blueGrey300,
4950
+ strokeWidth: 1,
4951
+ strokeLinecap,
4952
+ strokeLinejoin
4953
+ },
4954
+ tickLabels: Object.assign({}, baseLabelStyles, {
4955
+ fill: blueGrey700
4956
+ })
4957
+ }
4958
+ }, baseProps),
4959
+ polarDependentAxis: Object.assign({
4960
+ style: {
4961
+ ticks: {
4962
+ fill: "transparent",
4963
+ size: 1,
4964
+ stroke: "transparent"
4965
+ }
4966
+ }
4967
+ }),
4968
+ bar: Object.assign({
4969
+ style: {
4970
+ data: {
4971
+ fill: blueGrey700,
4972
+ padding,
4973
+ strokeWidth: 0
4974
+ },
4975
+ labels: baseLabelStyles
4976
+ }
4977
+ }, baseProps),
4978
+ boxplot: Object.assign({
4979
+ style: {
4980
+ max: {
4981
+ padding,
4982
+ stroke: blueGrey700,
4983
+ strokeWidth: 1
4984
+ },
4985
+ maxLabels: Object.assign({}, baseLabelStyles, {
4986
+ padding: 3
4987
+ }),
4988
+ median: {
4989
+ padding,
4990
+ stroke: blueGrey700,
4991
+ strokeWidth: 1
4992
+ },
4993
+ medianLabels: Object.assign({}, baseLabelStyles, {
4994
+ padding: 3
4995
+ }),
4996
+ min: {
4997
+ padding,
4998
+ stroke: blueGrey700,
4999
+ strokeWidth: 1
5000
+ },
5001
+ minLabels: Object.assign({}, baseLabelStyles, {
5002
+ padding: 3
5003
+ }),
5004
+ q1: {
5005
+ padding,
5006
+ fill: blueGrey700
5007
+ },
5008
+ q1Labels: Object.assign({}, baseLabelStyles, {
5009
+ padding: 3
5010
+ }),
5011
+ q3: {
5012
+ padding,
5013
+ fill: blueGrey700
5014
+ },
5015
+ q3Labels: Object.assign({}, baseLabelStyles, {
5016
+ padding: 3
5017
+ })
5018
+ },
5019
+ boxWidth: 20
5020
+ }, baseProps),
5021
+ candlestick: Object.assign({
5022
+ style: {
5023
+ data: {
5024
+ stroke: blueGrey700
5025
+ },
5026
+ labels: Object.assign({}, baseLabelStyles, {
5027
+ padding: 5
5028
+ })
5029
+ },
5030
+ candleColors: {
5031
+ positive: "#ffffff",
5032
+ negative: blueGrey700
5033
+ }
5034
+ }, baseProps),
5035
+ chart: baseProps,
5036
+ errorbar: Object.assign({
5037
+ borderWidth: 8,
5038
+ style: {
5039
+ data: {
5040
+ fill: "transparent",
5041
+ opacity: 1,
5042
+ stroke: blueGrey700,
5043
+ strokeWidth: 2
5044
+ },
5045
+ labels: baseLabelStyles
5046
+ }
5047
+ }, baseProps),
5048
+ group: Object.assign({
5049
+ colorScale
5050
+ }, baseProps),
5051
+ histogram: Object.assign({
5052
+ style: {
5053
+ data: {
5054
+ fill: blueGrey700,
5055
+ stroke: grey900,
5056
+ strokeWidth: 2
5057
+ },
5058
+ labels: baseLabelStyles
5059
+ }
5060
+ }, baseProps),
5061
+ legend: {
5062
+ colorScale,
5063
+ gutter: 10,
5064
+ orientation: "vertical",
5065
+ titleOrientation: "top",
5066
+ style: {
5067
+ data: {
5068
+ type: "circle"
5069
+ },
5070
+ labels: baseLabelStyles,
5071
+ title: Object.assign({}, baseLabelStyles, {
5072
+ padding: 5
5073
+ })
5074
+ }
5075
+ },
5076
+ line: Object.assign({
5077
+ style: {
5078
+ data: {
5079
+ fill: "transparent",
5080
+ opacity: 1,
5081
+ stroke: blueGrey700,
5082
+ strokeWidth: 2
5083
+ },
5084
+ labels: baseLabelStyles
5085
+ }
5086
+ }, baseProps),
5087
+ pie: Object.assign({
5088
+ colorScale,
5089
+ style: {
5090
+ data: {
5091
+ padding,
5092
+ stroke: blueGrey50,
5093
+ strokeWidth: 1
5094
+ },
5095
+ labels: Object.assign({}, baseLabelStyles, {
5096
+ padding: 20
5097
+ })
5098
+ }
5099
+ }, baseProps),
5100
+ scatter: Object.assign({
5101
+ style: {
5102
+ data: {
5103
+ fill: blueGrey700,
5104
+ opacity: 1,
5105
+ stroke: "transparent",
5106
+ strokeWidth: 0
5107
+ },
5108
+ labels: baseLabelStyles
5109
+ }
5110
+ }, baseProps),
5111
+ stack: Object.assign({
5112
+ colorScale
5113
+ }, baseProps),
5114
+ tooltip: {
5115
+ style: Object.assign({}, baseLabelStyles, {
5116
+ padding: 0,
5117
+ pointerEvents: "none"
5118
+ }),
5119
+ flyoutStyle: {
5120
+ stroke: grey900,
5121
+ strokeWidth: 1,
5122
+ fill: "#f0f0f0",
5123
+ pointerEvents: "none"
5124
+ },
5125
+ flyoutPadding: 5,
5126
+ cornerRadius: 5,
5127
+ pointerLength: 10
5128
+ },
5129
+ voronoi: Object.assign({
5130
+ style: {
5131
+ data: {
5132
+ fill: "transparent",
5133
+ stroke: "transparent",
5134
+ strokeWidth: 0
5135
+ },
5136
+ labels: Object.assign({}, baseLabelStyles, {
5137
+ padding: 5,
5138
+ pointerEvents: "none"
5139
+ }),
5140
+ flyout: {
5141
+ stroke: grey900,
5142
+ strokeWidth: 1,
5143
+ fill: "#f0f0f0",
5144
+ pointerEvents: "none"
5145
+ }
5146
+ }
5147
+ }, baseProps)
5148
+ };
5149
+
5150
+ /***/ }),
5151
+
5152
+ /***/ "../../victory-core/es/victory-theme/victory-theme.js":
5153
+ /*!************************************************************!*\
5154
+ !*** ../../victory-core/es/victory-theme/victory-theme.js ***!
5155
+ \************************************************************/
5156
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5157
+
5158
+ "use strict";
5159
+ __webpack_require__.r(__webpack_exports__);
5160
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5161
+ /* harmony export */ "VictoryTheme": function() { return /* binding */ VictoryTheme; }
5162
+ /* harmony export */ });
5163
+ /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
5164
+ /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
5165
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
5166
+
5167
+
5168
+
5169
+
5170
+ const VictoryTheme = {
5171
+ grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
5172
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
5173
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
5174
+ };
5175
+
5176
+ /***/ }),
5177
+
4053
5178
  /***/ "../../victory-core/es/victory-util/collection.js":
4054
5179
  /*!********************************************************!*\
4055
5180
  !*** ../../victory-core/es/victory-util/collection.js ***!
@@ -5024,6 +6149,9 @@ __webpack_require__.r(__webpack_exports__);
5024
6149
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
5025
6150
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
5026
6151
  /* harmony export */ });
6152
+ /* 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");
6153
+
6154
+
5027
6155
  /**
5028
6156
  * Given an object with CSS/SVG transform definitions, return the string value
5029
6157
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -5060,20 +6188,37 @@ const toTransformString = function (obj) {
5060
6188
  * of 5 hex string values in that color scale. If no 'name' parameter
5061
6189
  * is given, it will return the Victory default grayscale.
5062
6190
  * @param {String} name The name of the color scale to return (optional).
6191
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
5063
6192
  * @returns {Array} An array of 5 hex string values composing a color scale.
5064
6193
  */
5065
- function getColorScale(name) {
6194
+ function getColorScale(name, theme) {
6195
+ if (theme === void 0) {
6196
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
6197
+ }
6198
+ const {
6199
+ palette: {
6200
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
6201
+ qualitative = [],
6202
+ heatmap = [],
6203
+ warm = [],
6204
+ cool = [],
6205
+ red = [],
6206
+ blue = [],
6207
+ green = []
6208
+ } = {}
6209
+ } = theme;
5066
6210
  const scales = {
5067
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
5068
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
5069
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
5070
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
5071
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
5072
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
5073
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
5074
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
6211
+ grayscale,
6212
+ qualitative,
6213
+ heatmap,
6214
+ warm,
6215
+ cool,
6216
+ red,
6217
+ blue,
6218
+ green
5075
6219
  };
5076
- return name ? scales[name] : scales.grayscale;
6220
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
6221
+ return selectedScale;
5077
6222
  }
5078
6223
 
5079
6224
  /***/ }),