victory 37.1.0 → 37.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # victory
2
2
 
3
+ ## 37.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix victory-native container styles ([`eae3fe5dd`](https://github.com/FormidableLabs/victory/commit/eae3fe5dde175e68e146576655cb2e8054ad6456))
8
+
9
+ ## 37.1.1
10
+
3
11
  ## 37.1.0
4
12
 
5
13
  ### Minor Changes
package/dist/victory.js CHANGED
@@ -16305,6 +16305,432 @@ const Whisker = initialProps => {
16305
16305
 
16306
16306
  /***/ }),
16307
16307
 
16308
+ /***/ "../../victory-core/es/victory-theme/clean.js":
16309
+ /*!****************************************************!*\
16310
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
16311
+ \****************************************************/
16312
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
16313
+
16314
+ "use strict";
16315
+ __webpack_require__.r(__webpack_exports__);
16316
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16317
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
16318
+ /* harmony export */ });
16319
+ // *
16320
+ // * Colors
16321
+ // *
16322
+
16323
+ const gray = {
16324
+ white: "#FFFFFF",
16325
+ "50": "#FAFAFA",
16326
+ "100": "#F2F2F2",
16327
+ "200": "#E8E8E8",
16328
+ "300": "#E0E0E0",
16329
+ "400": "#D1D1D1",
16330
+ "500": "#757575",
16331
+ "600": "#5C5C5C",
16332
+ "700": "#424242",
16333
+ "800": "#333333",
16334
+ "900": "#292929",
16335
+ black: "#0F0F0F"
16336
+ };
16337
+ const yellow = {
16338
+ "100": "#FFEAB6",
16339
+ "300": "#FFD66E",
16340
+ "500": "#FCB400",
16341
+ "900": "#B87503"
16342
+ };
16343
+ const orange = {
16344
+ "100": "#FEE2D5",
16345
+ "300": "#FFA981",
16346
+ "500": "#FF6F2C",
16347
+ "900": "#D74D26"
16348
+ };
16349
+ const red = {
16350
+ "100": "#FFDCE5",
16351
+ "300": "#FF9EB7",
16352
+ "500": "#F82B60",
16353
+ "900": "#BA1E45"
16354
+ };
16355
+ const pink = {
16356
+ "100": "#FFDAF6",
16357
+ "300": "#F99DE2",
16358
+ "500": "#FF08C2",
16359
+ "900": "#B2158B"
16360
+ };
16361
+ const purple = {
16362
+ "100": "#EDE3FE",
16363
+ "300": "#CDB0FF",
16364
+ "500": "#8B46FF",
16365
+ "900": "#6B1CB0"
16366
+ };
16367
+ const blue = {
16368
+ "100": "#CFDFFF",
16369
+ "300": "#9CC7FF",
16370
+ "500": "#2D7FF9",
16371
+ "900": "#2750AE"
16372
+ };
16373
+ const cyan = {
16374
+ "100": "#D0F0FD",
16375
+ "300": "#77D1F3",
16376
+ "500": "#18BFFF",
16377
+ "900": "#0B76B7"
16378
+ };
16379
+ const teal = {
16380
+ "100": "#C2F5E9",
16381
+ "300": "#72DDC3",
16382
+ "500": "#20D9D2",
16383
+ "900": "#06A09B"
16384
+ };
16385
+ const green = {
16386
+ "100": "#D1F7C4",
16387
+ "300": "#93E088",
16388
+ "500": "#20C933",
16389
+ "900": "#338A17"
16390
+ };
16391
+ const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
16392
+ // *
16393
+ // * Typography
16394
+ // *
16395
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
16396
+ const letterSpacing = "normal";
16397
+ const fontSize = 12;
16398
+ // *
16399
+ // * Layout
16400
+ // *
16401
+ const padding = 8;
16402
+ const baseProps = {
16403
+ width: 450,
16404
+ height: 300,
16405
+ padding: 50,
16406
+ colorScale: colors
16407
+ };
16408
+ // *
16409
+ // * Labels
16410
+ // *
16411
+ const baseLabelStyles = {
16412
+ fontFamily: sansSerif,
16413
+ fontSize,
16414
+ fontWeight: 300,
16415
+ letterSpacing,
16416
+ padding,
16417
+ fill: gray["900"],
16418
+ stroke: "transparent"
16419
+ };
16420
+ const centeredLabelStyles = Object.assign({
16421
+ textAnchor: "middle"
16422
+ }, baseLabelStyles);
16423
+
16424
+ // *
16425
+ // * Strokes
16426
+ // *
16427
+ const strokeDasharray = "10, 5";
16428
+ const strokeLinecap = "round";
16429
+ const strokeLinejoin = "round";
16430
+ const borderRadius = 1;
16431
+ // *
16432
+ // * Theme
16433
+ // *
16434
+ const clean = {
16435
+ area: Object.assign({
16436
+ style: {
16437
+ data: {
16438
+ fill: cyan["500"]
16439
+ },
16440
+ labels: baseLabelStyles
16441
+ }
16442
+ }, baseProps),
16443
+ axis: Object.assign({
16444
+ style: {
16445
+ axis: {
16446
+ fill: "transparent",
16447
+ stroke: gray["300"],
16448
+ strokeWidth: 1,
16449
+ strokeLinecap,
16450
+ strokeLinejoin
16451
+ },
16452
+ axisLabel: Object.assign({}, centeredLabelStyles, {
16453
+ padding,
16454
+ stroke: "transparent"
16455
+ }),
16456
+ grid: {
16457
+ fill: "none",
16458
+ stroke: "none",
16459
+ painterEvents: "painted"
16460
+ },
16461
+ ticks: {
16462
+ fill: "transparent",
16463
+ size: 5,
16464
+ stroke: "transparent"
16465
+ },
16466
+ tickLabels: baseLabelStyles
16467
+ }
16468
+ }, baseProps),
16469
+ polarAxis: Object.assign({
16470
+ style: {
16471
+ axis: {
16472
+ stroke: gray["300"]
16473
+ },
16474
+ grid: {
16475
+ stroke: gray["200"],
16476
+ strokeDasharray,
16477
+ strokeLinecap,
16478
+ strokeLinejoin,
16479
+ pointerEvents: "painted"
16480
+ },
16481
+ ticks: {
16482
+ fill: "transparent",
16483
+ size: 5,
16484
+ stroke: gray["200"],
16485
+ strokeWidth: 1,
16486
+ strokeLinecap,
16487
+ strokeLinejoin
16488
+ },
16489
+ tickLabels: baseLabelStyles
16490
+ }
16491
+ }),
16492
+ polarDependentAxis: Object.assign({
16493
+ style: {
16494
+ axis: {
16495
+ stroke: gray["300"]
16496
+ },
16497
+ grid: {
16498
+ stroke: gray["200"],
16499
+ strokeDasharray,
16500
+ strokeLinecap,
16501
+ strokeLinejoin,
16502
+ pointerEvents: "painted"
16503
+ },
16504
+ ticks: {
16505
+ fill: "transparent",
16506
+ size: 5,
16507
+ stroke: gray["200"],
16508
+ strokeWidth: 1,
16509
+ strokeLinecap,
16510
+ strokeLinejoin
16511
+ },
16512
+ tickLabels: baseLabelStyles
16513
+ }
16514
+ }),
16515
+ bar: Object.assign({
16516
+ style: {
16517
+ data: {
16518
+ fill: blue["500"],
16519
+ padding,
16520
+ strokeWidth: 0
16521
+ },
16522
+ labels: baseLabelStyles
16523
+ },
16524
+ cornerRadius: {
16525
+ top: borderRadius
16526
+ }
16527
+ }, baseProps),
16528
+ boxplot: Object.assign({
16529
+ style: {
16530
+ max: {
16531
+ padding,
16532
+ stroke: gray["400"],
16533
+ strokeWidth: 2
16534
+ },
16535
+ maxLabels: Object.assign({}, baseLabelStyles, {
16536
+ padding: 3
16537
+ }),
16538
+ median: {
16539
+ padding,
16540
+ stroke: gray.white,
16541
+ strokeWidth: 2
16542
+ },
16543
+ medianLabels: Object.assign({}, baseLabelStyles, {
16544
+ padding: 3
16545
+ }),
16546
+ min: {
16547
+ padding,
16548
+ stroke: gray["400"],
16549
+ strokeWidth: 2
16550
+ },
16551
+ minLabels: Object.assign({}, baseLabelStyles, {
16552
+ padding: 3
16553
+ }),
16554
+ q1: {
16555
+ padding,
16556
+ fill: teal["500"],
16557
+ rx: borderRadius
16558
+ },
16559
+ q1Labels: Object.assign({}, baseLabelStyles, {
16560
+ padding: 3
16561
+ }),
16562
+ q3: {
16563
+ padding,
16564
+ fill: teal["500"],
16565
+ rx: borderRadius
16566
+ },
16567
+ q3Labels: Object.assign({}, baseLabelStyles, {
16568
+ padding: 3
16569
+ })
16570
+ },
16571
+ boxWidth: 20
16572
+ }, baseProps),
16573
+ candlestick: Object.assign({
16574
+ style: {
16575
+ data: {
16576
+ stroke: gray["300"],
16577
+ strokeWidth: 0,
16578
+ rx: borderRadius
16579
+ },
16580
+ labels: Object.assign({}, baseLabelStyles, {
16581
+ padding: 5
16582
+ })
16583
+ },
16584
+ candleColors: {
16585
+ positive: teal["500"],
16586
+ negative: orange["500"]
16587
+ },
16588
+ wickStrokeWidth: 2
16589
+ }, baseProps),
16590
+ chart: baseProps,
16591
+ errorbar: Object.assign({
16592
+ borderWidth: 8,
16593
+ style: {
16594
+ data: {
16595
+ fill: "transparent",
16596
+ opacity: 1,
16597
+ stroke: gray["700"],
16598
+ strokeWidth: 2,
16599
+ strokeLinecap
16600
+ },
16601
+ labels: baseLabelStyles
16602
+ }
16603
+ }, baseProps),
16604
+ group: Object.assign({
16605
+ colorScale: colors
16606
+ }, baseProps),
16607
+ histogram: Object.assign({
16608
+ style: {
16609
+ data: {
16610
+ fill: cyan["500"],
16611
+ stroke: "transparent",
16612
+ strokeWidth: 0
16613
+ },
16614
+ labels: baseLabelStyles
16615
+ },
16616
+ binSpacing: 4,
16617
+ cornerRadius: {
16618
+ top: borderRadius
16619
+ }
16620
+ }, baseProps),
16621
+ label: baseLabelStyles,
16622
+ legend: {
16623
+ colorScale: colors,
16624
+ gutter: 10,
16625
+ orientation: "vertical",
16626
+ titleOrientation: "top",
16627
+ style: {
16628
+ data: {
16629
+ type: "circle"
16630
+ },
16631
+ labels: {
16632
+ ...baseLabelStyles,
16633
+ fontSize: 14
16634
+ },
16635
+ title: Object.assign({}, baseLabelStyles, {
16636
+ padding,
16637
+ fontSize: 20
16638
+ }),
16639
+ border: {
16640
+ stroke: gray["200"],
16641
+ strokeWidth: 2,
16642
+ padding: 16
16643
+ }
16644
+ }
16645
+ },
16646
+ line: Object.assign({
16647
+ style: {
16648
+ data: {
16649
+ fill: "transparent",
16650
+ opacity: 1,
16651
+ stroke: pink["500"],
16652
+ strokeWidth: 2,
16653
+ strokeLinecap,
16654
+ strokeLinejoin
16655
+ },
16656
+ labels: baseLabelStyles
16657
+ }
16658
+ }, baseProps),
16659
+ pie: Object.assign({
16660
+ style: {
16661
+ data: {
16662
+ padding,
16663
+ stroke: gray.white,
16664
+ strokeWidth: 1
16665
+ },
16666
+ labels: Object.assign({}, baseLabelStyles, {
16667
+ padding: 20
16668
+ })
16669
+ },
16670
+ colorScale: colors,
16671
+ cornerRadius: borderRadius
16672
+ }, baseProps),
16673
+ scatter: Object.assign({
16674
+ style: {
16675
+ data: {
16676
+ fill: purple["500"],
16677
+ opacity: 1,
16678
+ stroke: "transparent",
16679
+ strokeWidth: 0
16680
+ },
16681
+ labels: baseLabelStyles
16682
+ }
16683
+ }, baseProps),
16684
+ stack: Object.assign({
16685
+ colorScale: colors
16686
+ }, baseProps),
16687
+ tooltip: {
16688
+ style: Object.assign({}, baseLabelStyles, {
16689
+ padding: 0,
16690
+ pointerEvents: "none"
16691
+ }),
16692
+ flyoutStyle: {
16693
+ stroke: gray["500"],
16694
+ strokeWidth: 2,
16695
+ fill: gray.white,
16696
+ pointerEvents: "none"
16697
+ },
16698
+ flyoutPadding: {
16699
+ top: 8,
16700
+ bottom: 8,
16701
+ left: 16,
16702
+ right: 16
16703
+ },
16704
+ cornerRadius: borderRadius,
16705
+ pointerLength: 4
16706
+ },
16707
+ voronoi: Object.assign({
16708
+ style: {
16709
+ data: {
16710
+ fill: red["100"],
16711
+ stroke: red["500"],
16712
+ strokeWidth: 2
16713
+ },
16714
+ labels: Object.assign({}, baseLabelStyles, {
16715
+ padding: 5,
16716
+ pointerEvents: "none"
16717
+ }),
16718
+ flyout: {
16719
+ stroke: gray["900"],
16720
+ strokeWidth: 1,
16721
+ fill: gray["100"],
16722
+ pointerEvents: "none"
16723
+ },
16724
+ padding: {
16725
+ left: 2,
16726
+ bottom: 2
16727
+ }
16728
+ }
16729
+ }, baseProps)
16730
+ };
16731
+
16732
+ /***/ }),
16733
+
16308
16734
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
16309
16735
  /*!********************************************************!*\
16310
16736
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -16885,12 +17311,15 @@ __webpack_require__.r(__webpack_exports__);
16885
17311
  /* harmony export */ });
16886
17312
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
16887
17313
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
17314
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
17315
+
16888
17316
 
16889
17317
 
16890
17318
 
16891
17319
  const VictoryTheme = {
16892
17320
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
16893
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
17321
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
17322
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
16894
17323
  };
16895
17324
 
16896
17325
  /***/ }),
@@ -20853,6 +21282,7 @@ __webpack_require__.r(__webpack_exports__);
20853
21282
  /* eslint-disable no-magic-numbers */
20854
21283
  // Based on measuring specific character widths
20855
21284
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
21285
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
20856
21286
  // prettier-ignore
20857
21287
  const fonts = {
20858
21288
  "American Typewriter": {
@@ -20911,6 +21341,10 @@ const fonts = {
20911
21341
  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],
20912
21342
  avg: 0.5116447368421051
20913
21343
  },
21344
+ "Inter": {
21345
+ 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],
21346
+ avg: 0.5624362664473683
21347
+ },
20914
21348
  "Montserrat": {
20915
21349
  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],
20916
21350
  avg: 0.571792763157895
@@ -29684,8 +30118,8 @@ const RawZoomHelpers = {
29684
30118
  const [from, to] = currentDomain;
29685
30119
  const range = Math.abs(to - from);
29686
30120
  const diff = range - range * factor;
29687
- const newMin = Number(from) + diff * percent;
29688
- const newMax = Number(to) - diff * (1 - percent);
30121
+ const newMin = Number(from) + diff * Math.max(percent, 0);
30122
+ const newMax = Number(to) - diff * Math.max(1 - percent, 0);
29689
30123
  return [Math.min(newMin, newMax), Math.max(newMin, newMax)];
29690
30124
  },
29691
30125
  getMinimumDomain(point, props, axis) {