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