victory-stack 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.
- package/CHANGELOG.md +8 -0
- package/dist/victory-stack.js +279 -154
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.js +4 -1
- package/lib/helper-methods.js +4 -1
- package/package.json +3 -3
- package/src/helper-methods.tsx +7 -1
package/dist/victory-stack.js
CHANGED
|
@@ -253,10 +253,13 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
253
253
|
} = newCalculatedProps;
|
|
254
254
|
const childProps = getChildProps(props, newCalculatedProps);
|
|
255
255
|
const parentName = props.name || "stack";
|
|
256
|
+
const {
|
|
257
|
+
theme
|
|
258
|
+
} = props;
|
|
256
259
|
return children.map((child, index) => {
|
|
257
260
|
const role = child.type && child.type.role;
|
|
258
261
|
const data = datasets[index];
|
|
259
|
-
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps);
|
|
262
|
+
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
|
|
260
263
|
const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
261
264
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
262
265
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, Object.assign({
|
|
@@ -5338,20 +5341,16 @@ const orange = {
|
|
|
5338
5341
|
"100": "#FEE2D5",
|
|
5339
5342
|
"300": "#FFA981",
|
|
5340
5343
|
"500": "#FF6F2C",
|
|
5344
|
+
"700": "#FF4E1B",
|
|
5341
5345
|
"900": "#D74D26"
|
|
5342
5346
|
};
|
|
5343
5347
|
const red = {
|
|
5344
5348
|
"100": "#FFDCE5",
|
|
5345
5349
|
"300": "#FF9EB7",
|
|
5346
5350
|
"500": "#F82B60",
|
|
5351
|
+
"700": "#D31A3D",
|
|
5347
5352
|
"900": "#BA1E45"
|
|
5348
5353
|
};
|
|
5349
|
-
const pink = {
|
|
5350
|
-
"100": "#FFDAF6",
|
|
5351
|
-
"300": "#F99DE2",
|
|
5352
|
-
"500": "#FF08C2",
|
|
5353
|
-
"900": "#B2158B"
|
|
5354
|
-
};
|
|
5355
5354
|
const purple = {
|
|
5356
5355
|
"100": "#EDE3FE",
|
|
5357
5356
|
"300": "#CDB0FF",
|
|
@@ -5362,6 +5361,7 @@ const blue = {
|
|
|
5362
5361
|
"100": "#CFDFFF",
|
|
5363
5362
|
"300": "#9CC7FF",
|
|
5364
5363
|
"500": "#2D7FF9",
|
|
5364
|
+
"700": "#0056B3",
|
|
5365
5365
|
"900": "#2750AE"
|
|
5366
5366
|
};
|
|
5367
5367
|
const cyan = {
|
|
@@ -5380,9 +5380,29 @@ const green = {
|
|
|
5380
5380
|
"100": "#D1F7C4",
|
|
5381
5381
|
"300": "#93E088",
|
|
5382
5382
|
"500": "#20C933",
|
|
5383
|
+
"700": "#1B9B2A",
|
|
5383
5384
|
"900": "#338A17"
|
|
5384
5385
|
};
|
|
5385
|
-
const colors =
|
|
5386
|
+
const colors = {
|
|
5387
|
+
blue: blue["500"],
|
|
5388
|
+
cyan: cyan["500"],
|
|
5389
|
+
green: green["500"],
|
|
5390
|
+
yellow: yellow["500"],
|
|
5391
|
+
orange: orange["500"],
|
|
5392
|
+
red: red["500"],
|
|
5393
|
+
purple: purple["500"],
|
|
5394
|
+
teal: teal["500"]
|
|
5395
|
+
};
|
|
5396
|
+
const colorScale = Object.values(colors);
|
|
5397
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
5398
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
5399
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
5400
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
5401
|
+
const redPalette = Object.values(red);
|
|
5402
|
+
const greenPalette = Object.values(green);
|
|
5403
|
+
const bluePalette = Object.values(blue);
|
|
5404
|
+
const defaultColor = blue["500"];
|
|
5405
|
+
|
|
5386
5406
|
// *
|
|
5387
5407
|
// * Typography
|
|
5388
5408
|
// *
|
|
@@ -5396,8 +5416,8 @@ const padding = 8;
|
|
|
5396
5416
|
const baseProps = {
|
|
5397
5417
|
width: 450,
|
|
5398
5418
|
height: 300,
|
|
5399
|
-
padding:
|
|
5400
|
-
colorScale
|
|
5419
|
+
padding: 60,
|
|
5420
|
+
colorScale
|
|
5401
5421
|
};
|
|
5402
5422
|
// *
|
|
5403
5423
|
// * Labels
|
|
@@ -5426,10 +5446,23 @@ const borderRadius = 1;
|
|
|
5426
5446
|
// * Theme
|
|
5427
5447
|
// *
|
|
5428
5448
|
const clean = {
|
|
5449
|
+
palette: {
|
|
5450
|
+
colors,
|
|
5451
|
+
grayscale,
|
|
5452
|
+
qualitative: colorScale,
|
|
5453
|
+
heatmap,
|
|
5454
|
+
warm,
|
|
5455
|
+
cool,
|
|
5456
|
+
red: redPalette,
|
|
5457
|
+
green: greenPalette,
|
|
5458
|
+
blue: bluePalette
|
|
5459
|
+
},
|
|
5429
5460
|
area: Object.assign({
|
|
5430
5461
|
style: {
|
|
5431
5462
|
data: {
|
|
5432
|
-
fill:
|
|
5463
|
+
fill: defaultColor,
|
|
5464
|
+
strokeWidth: 2,
|
|
5465
|
+
fillOpacity: 0.5
|
|
5433
5466
|
},
|
|
5434
5467
|
labels: baseLabelStyles
|
|
5435
5468
|
}
|
|
@@ -5438,13 +5471,13 @@ const clean = {
|
|
|
5438
5471
|
style: {
|
|
5439
5472
|
axis: {
|
|
5440
5473
|
fill: "transparent",
|
|
5441
|
-
stroke: gray["
|
|
5474
|
+
stroke: gray["500"],
|
|
5442
5475
|
strokeWidth: 1,
|
|
5443
5476
|
strokeLinecap,
|
|
5444
5477
|
strokeLinejoin
|
|
5445
5478
|
},
|
|
5446
5479
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
5447
|
-
padding,
|
|
5480
|
+
padding: 35,
|
|
5448
5481
|
stroke: "transparent"
|
|
5449
5482
|
}),
|
|
5450
5483
|
grid: {
|
|
@@ -5463,10 +5496,10 @@ const clean = {
|
|
|
5463
5496
|
polarAxis: Object.assign({
|
|
5464
5497
|
style: {
|
|
5465
5498
|
axis: {
|
|
5466
|
-
stroke: gray["
|
|
5499
|
+
stroke: gray["500"]
|
|
5467
5500
|
},
|
|
5468
5501
|
grid: {
|
|
5469
|
-
stroke: gray["
|
|
5502
|
+
stroke: gray["400"],
|
|
5470
5503
|
strokeDasharray,
|
|
5471
5504
|
strokeLinecap,
|
|
5472
5505
|
strokeLinejoin,
|
|
@@ -5475,7 +5508,7 @@ const clean = {
|
|
|
5475
5508
|
ticks: {
|
|
5476
5509
|
fill: "transparent",
|
|
5477
5510
|
size: 5,
|
|
5478
|
-
stroke: gray["
|
|
5511
|
+
stroke: gray["400"],
|
|
5479
5512
|
strokeWidth: 1,
|
|
5480
5513
|
strokeLinecap,
|
|
5481
5514
|
strokeLinejoin
|
|
@@ -5486,10 +5519,10 @@ const clean = {
|
|
|
5486
5519
|
polarDependentAxis: Object.assign({
|
|
5487
5520
|
style: {
|
|
5488
5521
|
axis: {
|
|
5489
|
-
stroke: gray["
|
|
5522
|
+
stroke: gray["500"]
|
|
5490
5523
|
},
|
|
5491
5524
|
grid: {
|
|
5492
|
-
stroke: gray["
|
|
5525
|
+
stroke: gray["400"],
|
|
5493
5526
|
strokeDasharray,
|
|
5494
5527
|
strokeLinecap,
|
|
5495
5528
|
strokeLinejoin,
|
|
@@ -5498,7 +5531,7 @@ const clean = {
|
|
|
5498
5531
|
ticks: {
|
|
5499
5532
|
fill: "transparent",
|
|
5500
5533
|
size: 5,
|
|
5501
|
-
stroke: gray["
|
|
5534
|
+
stroke: gray["300"],
|
|
5502
5535
|
strokeWidth: 1,
|
|
5503
5536
|
strokeLinecap,
|
|
5504
5537
|
strokeLinejoin
|
|
@@ -5509,9 +5542,10 @@ const clean = {
|
|
|
5509
5542
|
bar: Object.assign({
|
|
5510
5543
|
style: {
|
|
5511
5544
|
data: {
|
|
5512
|
-
fill:
|
|
5545
|
+
fill: defaultColor,
|
|
5513
5546
|
padding,
|
|
5514
|
-
strokeWidth:
|
|
5547
|
+
strokeWidth: 1,
|
|
5548
|
+
fillOpacity: 0.5
|
|
5515
5549
|
},
|
|
5516
5550
|
labels: baseLabelStyles
|
|
5517
5551
|
},
|
|
@@ -5547,15 +5581,16 @@ const clean = {
|
|
|
5547
5581
|
}),
|
|
5548
5582
|
q1: {
|
|
5549
5583
|
padding,
|
|
5550
|
-
fill:
|
|
5551
|
-
rx: borderRadius
|
|
5584
|
+
fill: colorScale[0],
|
|
5585
|
+
rx: borderRadius,
|
|
5586
|
+
strokeWidth: 2
|
|
5552
5587
|
},
|
|
5553
5588
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
5554
5589
|
padding: 3
|
|
5555
5590
|
}),
|
|
5556
5591
|
q3: {
|
|
5557
5592
|
padding,
|
|
5558
|
-
fill:
|
|
5593
|
+
fill: colorScale[1],
|
|
5559
5594
|
rx: borderRadius
|
|
5560
5595
|
},
|
|
5561
5596
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -5576,8 +5611,8 @@ const clean = {
|
|
|
5576
5611
|
})
|
|
5577
5612
|
},
|
|
5578
5613
|
candleColors: {
|
|
5579
|
-
positive:
|
|
5580
|
-
negative:
|
|
5614
|
+
positive: green["500"],
|
|
5615
|
+
negative: red["500"]
|
|
5581
5616
|
},
|
|
5582
5617
|
wickStrokeWidth: 2
|
|
5583
5618
|
}, baseProps),
|
|
@@ -5596,14 +5631,13 @@ const clean = {
|
|
|
5596
5631
|
}
|
|
5597
5632
|
}, baseProps),
|
|
5598
5633
|
group: Object.assign({
|
|
5599
|
-
colorScale
|
|
5634
|
+
colorScale
|
|
5600
5635
|
}, baseProps),
|
|
5601
5636
|
histogram: Object.assign({
|
|
5602
5637
|
style: {
|
|
5603
5638
|
data: {
|
|
5604
5639
|
fill: cyan["500"],
|
|
5605
|
-
|
|
5606
|
-
strokeWidth: 0
|
|
5640
|
+
fillOpacity: 0.5
|
|
5607
5641
|
},
|
|
5608
5642
|
labels: baseLabelStyles
|
|
5609
5643
|
},
|
|
@@ -5614,21 +5648,23 @@ const clean = {
|
|
|
5614
5648
|
}, baseProps),
|
|
5615
5649
|
label: baseLabelStyles,
|
|
5616
5650
|
legend: {
|
|
5617
|
-
colorScale
|
|
5618
|
-
gutter:
|
|
5619
|
-
|
|
5651
|
+
colorScale,
|
|
5652
|
+
gutter: 24,
|
|
5653
|
+
borderPadding: 10,
|
|
5654
|
+
orientation: "horizontal",
|
|
5620
5655
|
titleOrientation: "top",
|
|
5656
|
+
centerTitle: true,
|
|
5621
5657
|
style: {
|
|
5622
5658
|
data: {
|
|
5623
5659
|
type: "circle"
|
|
5624
5660
|
},
|
|
5625
5661
|
labels: {
|
|
5626
5662
|
...baseLabelStyles,
|
|
5627
|
-
fontSize:
|
|
5663
|
+
fontSize: 12
|
|
5628
5664
|
},
|
|
5629
5665
|
title: Object.assign({}, baseLabelStyles, {
|
|
5630
5666
|
padding,
|
|
5631
|
-
fontSize:
|
|
5667
|
+
fontSize: 16
|
|
5632
5668
|
}),
|
|
5633
5669
|
border: {
|
|
5634
5670
|
stroke: gray["200"],
|
|
@@ -5642,7 +5678,7 @@ const clean = {
|
|
|
5642
5678
|
data: {
|
|
5643
5679
|
fill: "transparent",
|
|
5644
5680
|
opacity: 1,
|
|
5645
|
-
stroke:
|
|
5681
|
+
stroke: defaultColor,
|
|
5646
5682
|
strokeWidth: 2,
|
|
5647
5683
|
strokeLinecap,
|
|
5648
5684
|
strokeLinejoin
|
|
@@ -5652,31 +5688,40 @@ const clean = {
|
|
|
5652
5688
|
}, baseProps),
|
|
5653
5689
|
pie: Object.assign({
|
|
5654
5690
|
style: {
|
|
5691
|
+
parent: {
|
|
5692
|
+
backgroundColor: gray.white
|
|
5693
|
+
},
|
|
5655
5694
|
data: {
|
|
5656
5695
|
padding,
|
|
5657
5696
|
stroke: gray.white,
|
|
5658
5697
|
strokeWidth: 1
|
|
5659
5698
|
},
|
|
5660
|
-
labels:
|
|
5661
|
-
|
|
5662
|
-
|
|
5699
|
+
labels: {
|
|
5700
|
+
...baseLabelStyles,
|
|
5701
|
+
padding: 20,
|
|
5702
|
+
fill: gray["600"],
|
|
5703
|
+
fontSize: 10
|
|
5704
|
+
}
|
|
5663
5705
|
},
|
|
5664
|
-
colorScale
|
|
5706
|
+
colorScale,
|
|
5665
5707
|
cornerRadius: borderRadius
|
|
5666
5708
|
}, baseProps),
|
|
5667
5709
|
scatter: Object.assign({
|
|
5668
5710
|
style: {
|
|
5669
5711
|
data: {
|
|
5670
|
-
fill:
|
|
5712
|
+
fill: defaultColor,
|
|
5671
5713
|
opacity: 1,
|
|
5672
5714
|
stroke: "transparent",
|
|
5673
5715
|
strokeWidth: 0
|
|
5674
5716
|
},
|
|
5675
|
-
labels:
|
|
5717
|
+
labels: {
|
|
5718
|
+
...baseLabelStyles,
|
|
5719
|
+
padding: 20
|
|
5720
|
+
}
|
|
5676
5721
|
}
|
|
5677
5722
|
}, baseProps),
|
|
5678
5723
|
stack: Object.assign({
|
|
5679
|
-
colorScale
|
|
5724
|
+
colorScale
|
|
5680
5725
|
}, baseProps),
|
|
5681
5726
|
tooltip: {
|
|
5682
5727
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -5684,7 +5729,7 @@ const clean = {
|
|
|
5684
5729
|
pointerEvents: "none"
|
|
5685
5730
|
}),
|
|
5686
5731
|
flyoutStyle: {
|
|
5687
|
-
stroke: gray["
|
|
5732
|
+
stroke: gray["300"],
|
|
5688
5733
|
strokeWidth: 2,
|
|
5689
5734
|
fill: gray.white,
|
|
5690
5735
|
pointerEvents: "none"
|
|
@@ -5701,8 +5746,8 @@ const clean = {
|
|
|
5701
5746
|
voronoi: Object.assign({
|
|
5702
5747
|
style: {
|
|
5703
5748
|
data: {
|
|
5704
|
-
fill:
|
|
5705
|
-
stroke:
|
|
5749
|
+
fill: blue["100"],
|
|
5750
|
+
stroke: defaultColor,
|
|
5706
5751
|
strokeWidth: 2
|
|
5707
5752
|
},
|
|
5708
5753
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -5739,9 +5784,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5739
5784
|
// *
|
|
5740
5785
|
// * Colors
|
|
5741
5786
|
// *
|
|
5742
|
-
const colors =
|
|
5787
|
+
const colors = {
|
|
5788
|
+
blue: "#4F7DA1",
|
|
5789
|
+
pink: "#E2A37F",
|
|
5790
|
+
teal: "#00796B",
|
|
5791
|
+
purple: "#DF948A",
|
|
5792
|
+
green: "#8BC34A",
|
|
5793
|
+
orange: "#F4511E",
|
|
5794
|
+
cyan: "#006064",
|
|
5795
|
+
red: "#DF5A49",
|
|
5796
|
+
yellow: "#FFF59D"
|
|
5797
|
+
};
|
|
5798
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
5743
5799
|
const charcoal = "#252525";
|
|
5744
5800
|
const grey = "#969696";
|
|
5801
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
5802
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
5803
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
5804
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
5805
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
5806
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
5807
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
5808
|
+
|
|
5745
5809
|
// *
|
|
5746
5810
|
// * Typography
|
|
5747
5811
|
// *
|
|
@@ -5755,7 +5819,7 @@ const baseProps = {
|
|
|
5755
5819
|
width: 450,
|
|
5756
5820
|
height: 300,
|
|
5757
5821
|
padding: 50,
|
|
5758
|
-
colorScale
|
|
5822
|
+
colorScale
|
|
5759
5823
|
};
|
|
5760
5824
|
// *
|
|
5761
5825
|
// * Labels
|
|
@@ -5777,6 +5841,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
5777
5841
|
const strokeLinecap = "round";
|
|
5778
5842
|
const strokeLinejoin = "round";
|
|
5779
5843
|
const grayscale = {
|
|
5844
|
+
palette: {
|
|
5845
|
+
colors,
|
|
5846
|
+
grayscale: colorScale,
|
|
5847
|
+
qualitative,
|
|
5848
|
+
heatmap,
|
|
5849
|
+
warm,
|
|
5850
|
+
cool,
|
|
5851
|
+
red,
|
|
5852
|
+
green,
|
|
5853
|
+
blue
|
|
5854
|
+
},
|
|
5780
5855
|
area: Object.assign({
|
|
5781
5856
|
style: {
|
|
5782
5857
|
data: {
|
|
@@ -5891,7 +5966,7 @@ const grayscale = {
|
|
|
5891
5966
|
}
|
|
5892
5967
|
}, baseProps),
|
|
5893
5968
|
group: Object.assign({
|
|
5894
|
-
colorScale
|
|
5969
|
+
colorScale
|
|
5895
5970
|
}, baseProps),
|
|
5896
5971
|
histogram: Object.assign({
|
|
5897
5972
|
style: {
|
|
@@ -5904,7 +5979,7 @@ const grayscale = {
|
|
|
5904
5979
|
}
|
|
5905
5980
|
}, baseProps),
|
|
5906
5981
|
legend: {
|
|
5907
|
-
colorScale
|
|
5982
|
+
colorScale,
|
|
5908
5983
|
gutter: 10,
|
|
5909
5984
|
orientation: "vertical",
|
|
5910
5985
|
titleOrientation: "top",
|
|
@@ -5939,7 +6014,7 @@ const grayscale = {
|
|
|
5939
6014
|
padding: 20
|
|
5940
6015
|
})
|
|
5941
6016
|
},
|
|
5942
|
-
colorScale
|
|
6017
|
+
colorScale,
|
|
5943
6018
|
width: 400,
|
|
5944
6019
|
height: 400,
|
|
5945
6020
|
padding: 50
|
|
@@ -5955,7 +6030,7 @@ const grayscale = {
|
|
|
5955
6030
|
}
|
|
5956
6031
|
}, baseProps),
|
|
5957
6032
|
stack: Object.assign({
|
|
5958
|
-
colorScale
|
|
6033
|
+
colorScale
|
|
5959
6034
|
}, baseProps),
|
|
5960
6035
|
tooltip: {
|
|
5961
6036
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6015,11 +6090,31 @@ const lime300 = "#DCE775";
|
|
|
6015
6090
|
const lightGreen500 = "#8BC34A";
|
|
6016
6091
|
const teal700 = "#00796B";
|
|
6017
6092
|
const cyan900 = "#006064";
|
|
6018
|
-
const
|
|
6093
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
6019
6094
|
const blueGrey50 = "#ECEFF1";
|
|
6020
6095
|
const blueGrey300 = "#90A4AE";
|
|
6021
6096
|
const blueGrey700 = "#455A64";
|
|
6022
6097
|
const grey900 = "#212121";
|
|
6098
|
+
const colors = {
|
|
6099
|
+
blue: "#4F7DA1",
|
|
6100
|
+
pink: "#E2A37F",
|
|
6101
|
+
teal: teal700,
|
|
6102
|
+
purple: "#DF948A",
|
|
6103
|
+
green: lightGreen500,
|
|
6104
|
+
orange: deepOrange600,
|
|
6105
|
+
cyan: cyan900,
|
|
6106
|
+
red: "#DF5A49",
|
|
6107
|
+
yellow: yellow200
|
|
6108
|
+
};
|
|
6109
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
6110
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6111
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6112
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6113
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
6114
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
6115
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
6116
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
6117
|
+
|
|
6023
6118
|
// *
|
|
6024
6119
|
// * Typography
|
|
6025
6120
|
// *
|
|
@@ -6057,6 +6152,17 @@ const strokeDasharray = "10, 5";
|
|
|
6057
6152
|
const strokeLinecap = "round";
|
|
6058
6153
|
const strokeLinejoin = "round";
|
|
6059
6154
|
const material = {
|
|
6155
|
+
palette: {
|
|
6156
|
+
colors,
|
|
6157
|
+
grayscale,
|
|
6158
|
+
qualitative,
|
|
6159
|
+
heatmap,
|
|
6160
|
+
warm,
|
|
6161
|
+
cool,
|
|
6162
|
+
red,
|
|
6163
|
+
green,
|
|
6164
|
+
blue
|
|
6165
|
+
},
|
|
6060
6166
|
area: Object.assign({
|
|
6061
6167
|
style: {
|
|
6062
6168
|
data: {
|
|
@@ -6189,7 +6295,7 @@ const material = {
|
|
|
6189
6295
|
}
|
|
6190
6296
|
}, baseProps),
|
|
6191
6297
|
group: Object.assign({
|
|
6192
|
-
colorScale
|
|
6298
|
+
colorScale
|
|
6193
6299
|
}, baseProps),
|
|
6194
6300
|
histogram: Object.assign({
|
|
6195
6301
|
style: {
|
|
@@ -6202,7 +6308,7 @@ const material = {
|
|
|
6202
6308
|
}
|
|
6203
6309
|
}, baseProps),
|
|
6204
6310
|
legend: {
|
|
6205
|
-
colorScale
|
|
6311
|
+
colorScale,
|
|
6206
6312
|
gutter: 10,
|
|
6207
6313
|
orientation: "vertical",
|
|
6208
6314
|
titleOrientation: "top",
|
|
@@ -6228,7 +6334,7 @@ const material = {
|
|
|
6228
6334
|
}
|
|
6229
6335
|
}, baseProps),
|
|
6230
6336
|
pie: Object.assign({
|
|
6231
|
-
colorScale
|
|
6337
|
+
colorScale,
|
|
6232
6338
|
style: {
|
|
6233
6339
|
data: {
|
|
6234
6340
|
padding,
|
|
@@ -6252,7 +6358,7 @@ const material = {
|
|
|
6252
6358
|
}
|
|
6253
6359
|
}, baseProps),
|
|
6254
6360
|
stack: Object.assign({
|
|
6255
|
-
colorScale
|
|
6361
|
+
colorScale
|
|
6256
6362
|
}, baseProps),
|
|
6257
6363
|
tooltip: {
|
|
6258
6364
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8875,6 +8981,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8875
8981
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
8876
8982
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
8877
8983
|
/* harmony export */ });
|
|
8984
|
+
/* 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");
|
|
8985
|
+
|
|
8986
|
+
|
|
8878
8987
|
/**
|
|
8879
8988
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
8880
8989
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -8911,20 +9020,37 @@ const toTransformString = function (obj) {
|
|
|
8911
9020
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
8912
9021
|
* is given, it will return the Victory default grayscale.
|
|
8913
9022
|
* @param {String} name The name of the color scale to return (optional).
|
|
9023
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
8914
9024
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
8915
9025
|
*/
|
|
8916
|
-
function getColorScale(name) {
|
|
9026
|
+
function getColorScale(name, theme) {
|
|
9027
|
+
if (theme === void 0) {
|
|
9028
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
9029
|
+
}
|
|
9030
|
+
const {
|
|
9031
|
+
palette: {
|
|
9032
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
9033
|
+
qualitative = [],
|
|
9034
|
+
heatmap = [],
|
|
9035
|
+
warm = [],
|
|
9036
|
+
cool = [],
|
|
9037
|
+
red = [],
|
|
9038
|
+
blue = [],
|
|
9039
|
+
green = []
|
|
9040
|
+
} = {}
|
|
9041
|
+
} = theme;
|
|
8917
9042
|
const scales = {
|
|
8918
|
-
grayscale
|
|
8919
|
-
qualitative
|
|
8920
|
-
heatmap
|
|
8921
|
-
warm
|
|
8922
|
-
cool
|
|
8923
|
-
red
|
|
8924
|
-
blue
|
|
8925
|
-
green
|
|
9043
|
+
grayscale,
|
|
9044
|
+
qualitative,
|
|
9045
|
+
heatmap,
|
|
9046
|
+
warm,
|
|
9047
|
+
cool,
|
|
9048
|
+
red,
|
|
9049
|
+
blue,
|
|
9050
|
+
green
|
|
8926
9051
|
};
|
|
8927
|
-
|
|
9052
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
9053
|
+
return selectedScale;
|
|
8928
9054
|
}
|
|
8929
9055
|
|
|
8930
9056
|
/***/ }),
|
|
@@ -9550,34 +9676,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9550
9676
|
/* harmony export */ "getDomain": function() { return /* binding */ getDomain; },
|
|
9551
9677
|
/* harmony export */ "getDomainFromChildren": function() { return /* binding */ getDomainFromChildren; },
|
|
9552
9678
|
/* harmony export */ "getScale": function() { return /* binding */ getScale; },
|
|
9553
|
-
/* harmony export */ "getStringsFromCategories": function() { return /* binding */ getStringsFromCategories; },
|
|
9554
9679
|
/* harmony export */ "getStringsFromChildren": function() { return /* binding */ getStringsFromChildren; },
|
|
9680
|
+
/* harmony export */ "getStringsFromChildrenCategories": function() { return /* binding */ getStringsFromChildrenCategories; },
|
|
9555
9681
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
9556
9682
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
9557
9683
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
9558
9684
|
/* harmony export */ });
|
|
9559
|
-
/* harmony import */ var
|
|
9560
|
-
/* harmony import */ var
|
|
9561
|
-
/* harmony import */ var
|
|
9562
|
-
/* harmony import */ var
|
|
9563
|
-
/* harmony import */ var
|
|
9564
|
-
/* harmony import */ var
|
|
9565
|
-
/* harmony import */ var
|
|
9566
|
-
/* harmony import */ var
|
|
9567
|
-
/* harmony import */ var
|
|
9568
|
-
/* harmony import */ var
|
|
9569
|
-
/* harmony import */ var
|
|
9570
|
-
/* harmony import */ var
|
|
9571
|
-
/* harmony import */ var
|
|
9572
|
-
/* harmony import */ var
|
|
9573
|
-
/* harmony import */ var
|
|
9574
|
-
/* harmony import */ var
|
|
9575
|
-
/* harmony import */ var
|
|
9576
|
-
/* harmony import */ var
|
|
9577
|
-
/* harmony import */ var
|
|
9578
|
-
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
9579
|
-
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
9580
|
-
|
|
9685
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqBy.js");
|
|
9686
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__);
|
|
9687
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
9688
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
9689
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
9690
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
9691
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
9692
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_3__);
|
|
9693
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
9694
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
9695
|
+
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
9696
|
+
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
9697
|
+
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
9698
|
+
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
9699
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
|
|
9700
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
9701
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9702
|
+
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
9703
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
9581
9704
|
|
|
9582
9705
|
|
|
9583
9706
|
|
|
@@ -9606,7 +9729,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
9606
9729
|
return child.type && child.type.role === "histogram";
|
|
9607
9730
|
});
|
|
9608
9731
|
if (someChildrenAreHistograms && !allChildrenAreHistograms) {
|
|
9609
|
-
|
|
9732
|
+
_log__WEBPACK_IMPORTED_MODULE_5__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
|
|
9610
9733
|
}
|
|
9611
9734
|
|
|
9612
9735
|
// if we are stacking histograms, we need to generate explicit bins
|
|
@@ -9619,7 +9742,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
9619
9742
|
// if we have explicit bins then we don't need to calculate them
|
|
9620
9743
|
if (!Array.isArray(childBins)) {
|
|
9621
9744
|
const combinedData = children.reduce((memo, child) => {
|
|
9622
|
-
const xAccessor =
|
|
9745
|
+
const xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_6__.createAccessor(child.props.x || "x");
|
|
9623
9746
|
return memo.concat(child.props.data.map(datum => ({
|
|
9624
9747
|
x: xAccessor(datum)
|
|
9625
9748
|
})));
|
|
@@ -9662,7 +9785,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9662
9785
|
maxDomain
|
|
9663
9786
|
};
|
|
9664
9787
|
let stack = 0;
|
|
9665
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9788
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9666
9789
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
9667
9790
|
children,
|
|
9668
9791
|
props,
|
|
@@ -9673,13 +9796,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9673
9796
|
const childProps = Object.assign({}, child.props, parentProps);
|
|
9674
9797
|
let childData;
|
|
9675
9798
|
let childElement = child;
|
|
9676
|
-
if (!
|
|
9799
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
9677
9800
|
return null;
|
|
9678
|
-
} else if (child.type &&
|
|
9679
|
-
childElement = parent ? /*#__PURE__*/
|
|
9801
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
9802
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, parent.props) : child;
|
|
9680
9803
|
childData = childElement.type.getData(childProps);
|
|
9681
9804
|
} else {
|
|
9682
|
-
childData =
|
|
9805
|
+
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
9683
9806
|
}
|
|
9684
9807
|
stack += 1;
|
|
9685
9808
|
return childData.map((datum, index) => Object.assign({
|
|
@@ -9688,23 +9811,23 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9688
9811
|
}, datum));
|
|
9689
9812
|
};
|
|
9690
9813
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
9691
|
-
const combine = (memo, val) => memo.concat(
|
|
9692
|
-
const datasets =
|
|
9814
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "_group"));
|
|
9815
|
+
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
9693
9816
|
const group = stacked ? "_group" : "_stack";
|
|
9694
|
-
return Object.values(
|
|
9817
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(datasets, group));
|
|
9695
9818
|
}
|
|
9696
9819
|
function getData(props, childComponents) {
|
|
9697
9820
|
if (props.data) {
|
|
9698
|
-
return
|
|
9821
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
9699
9822
|
}
|
|
9700
|
-
return getDataFromChildren(props, childComponents ||
|
|
9823
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children));
|
|
9701
9824
|
}
|
|
9702
9825
|
function getWidth(props, groupLength, seriesLength) {
|
|
9703
9826
|
const {
|
|
9704
9827
|
datasets,
|
|
9705
9828
|
horizontal
|
|
9706
9829
|
} = props;
|
|
9707
|
-
const range = horizontal ?
|
|
9830
|
+
const range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x");
|
|
9708
9831
|
const extent = Math.abs(range[1] - range[0]);
|
|
9709
9832
|
const seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
9710
9833
|
const groupLengthValue = groupLength || datasets.length;
|
|
@@ -9750,8 +9873,8 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
9750
9873
|
}
|
|
9751
9874
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
9752
9875
|
// eslint-disable-line max-statements, complexity, max-len
|
|
9753
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9754
|
-
const parentData = props.data ?
|
|
9876
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9877
|
+
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
9755
9878
|
const {
|
|
9756
9879
|
polar,
|
|
9757
9880
|
startAngle,
|
|
@@ -9775,65 +9898,67 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
9775
9898
|
}) : baseParentProps;
|
|
9776
9899
|
const iteratee = child => {
|
|
9777
9900
|
const sharedProps = Object.assign({}, child.props, parentProps);
|
|
9778
|
-
if (!
|
|
9901
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
9779
9902
|
return null;
|
|
9780
|
-
} else if (child.type &&
|
|
9903
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getDomain)) {
|
|
9781
9904
|
return child.props && child.type.getDomain(sharedProps, axis);
|
|
9782
9905
|
}
|
|
9783
|
-
return
|
|
9906
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.getDomain(sharedProps, axis);
|
|
9784
9907
|
};
|
|
9785
|
-
const childDomains =
|
|
9786
|
-
const min = childDomains.length === 0 ? 0 :
|
|
9787
|
-
const max = childDomains.length === 0 ? 1 :
|
|
9908
|
+
const childDomains = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props);
|
|
9909
|
+
const min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue(childDomains);
|
|
9910
|
+
const max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue(childDomains);
|
|
9788
9911
|
return [min, max];
|
|
9789
9912
|
}
|
|
9790
9913
|
function getDomain(props, axis, childComponents) {
|
|
9791
|
-
const children = childComponents ||
|
|
9792
|
-
const propsDomain =
|
|
9914
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9915
|
+
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
9793
9916
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
9794
9917
|
let domain;
|
|
9795
9918
|
if (propsDomain) {
|
|
9796
9919
|
domain = propsDomain;
|
|
9797
9920
|
} else {
|
|
9798
|
-
const minDomain =
|
|
9799
|
-
const maxDomain =
|
|
9800
|
-
const dataset = (props.data || props.y) &&
|
|
9801
|
-
const dataDomain = dataset ?
|
|
9921
|
+
const minDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMinFromProps(props, axis);
|
|
9922
|
+
const maxDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMaxFromProps(props, axis);
|
|
9923
|
+
const dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
9924
|
+
const dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromData(props, axis, dataset) : [];
|
|
9802
9925
|
const childDomain = getDomainFromChildren(props, axis, children);
|
|
9803
|
-
const min = minDomain ||
|
|
9804
|
-
const max = maxDomain ||
|
|
9805
|
-
domain =
|
|
9926
|
+
const min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue([...dataDomain, ...childDomain]);
|
|
9927
|
+
const max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue([...dataDomain, ...childDomain]);
|
|
9928
|
+
domain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromMinMax(min, max);
|
|
9806
9929
|
}
|
|
9807
|
-
return
|
|
9930
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.formatDomain(domain, Object.assign({
|
|
9808
9931
|
domainPadding
|
|
9809
9932
|
}, props), axis);
|
|
9810
9933
|
}
|
|
9811
9934
|
function getScale(props, axis, childComponents) {
|
|
9812
9935
|
if (props.data) {
|
|
9813
|
-
return
|
|
9936
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
9814
9937
|
}
|
|
9815
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9938
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9816
9939
|
const iteratee = child => {
|
|
9817
9940
|
const sharedProps = Object.assign({}, child.props, {
|
|
9818
9941
|
horizontal: props.horizontal
|
|
9819
9942
|
});
|
|
9820
|
-
return
|
|
9943
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleType(sharedProps, axis);
|
|
9821
9944
|
};
|
|
9822
|
-
const childScale =
|
|
9945
|
+
const childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()(_helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props));
|
|
9823
9946
|
|
|
9824
9947
|
// default to linear scale if more than one uniq scale type is given by children
|
|
9825
|
-
return childScale.length > 1 ?
|
|
9948
|
+
return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName(childScale[0]);
|
|
9826
9949
|
}
|
|
9827
9950
|
function getAllEvents(props) {
|
|
9828
9951
|
const components = ["groupComponent", "containerComponent", "labelComponent"];
|
|
9829
|
-
const componentEvents =
|
|
9952
|
+
const componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
9830
9953
|
let events = props.events;
|
|
9831
9954
|
if (Array.isArray(componentEvents)) {
|
|
9832
9955
|
events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
|
|
9833
9956
|
}
|
|
9834
9957
|
return events || [];
|
|
9835
9958
|
}
|
|
9836
|
-
|
|
9959
|
+
|
|
9960
|
+
// eslint-disable-next-line max-params
|
|
9961
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
9837
9962
|
// check for styles first
|
|
9838
9963
|
const {
|
|
9839
9964
|
style
|
|
@@ -9850,14 +9975,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
9850
9975
|
if (!colorScale && !color) {
|
|
9851
9976
|
return undefined;
|
|
9852
9977
|
}
|
|
9853
|
-
const colors = Array.isArray(colorScale) ? colorScale :
|
|
9978
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_12__.getColorScale(colorScale, theme);
|
|
9854
9979
|
return color || colors[index % colors.length];
|
|
9855
9980
|
}
|
|
9856
9981
|
function getStyle(theme, style, role) {
|
|
9857
9982
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
9858
|
-
return
|
|
9983
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.getStyles(style, defaultStyle);
|
|
9859
9984
|
}
|
|
9860
|
-
|
|
9985
|
+
|
|
9986
|
+
// eslint-disable-next-line max-params
|
|
9987
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
9861
9988
|
const {
|
|
9862
9989
|
style,
|
|
9863
9990
|
role
|
|
@@ -9867,7 +9994,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
9867
9994
|
return childStyle;
|
|
9868
9995
|
}
|
|
9869
9996
|
const childRole = child.type && child.type.role;
|
|
9870
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
9997
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
9871
9998
|
const defaultColor = childRole === "line" ? {
|
|
9872
9999
|
fill: "none",
|
|
9873
10000
|
stroke: defaultFill
|
|
@@ -9877,8 +10004,8 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
9877
10004
|
const dataWidth = role === "stack" ? {} : {
|
|
9878
10005
|
width: getWidth(calculatedProps)
|
|
9879
10006
|
};
|
|
9880
|
-
const dataStyle =
|
|
9881
|
-
const labelsStyle =
|
|
10007
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
10008
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.labels, style.labels);
|
|
9882
10009
|
return {
|
|
9883
10010
|
...childStyle,
|
|
9884
10011
|
parent: style.parent,
|
|
@@ -9886,28 +10013,26 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
9886
10013
|
labels: labelsStyle
|
|
9887
10014
|
};
|
|
9888
10015
|
}
|
|
9889
|
-
function
|
|
10016
|
+
function getStringsFromChildrenCategories(childComponents, axis) {
|
|
9890
10017
|
const iteratee = child => {
|
|
9891
|
-
|
|
9892
|
-
if (!_domain__WEBPACK_IMPORTED_MODULE_9__.isDomainComponent(child) || !childProps.categories) {
|
|
10018
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
9893
10019
|
return null;
|
|
9894
10020
|
}
|
|
9895
|
-
const
|
|
9896
|
-
|
|
9897
|
-
return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_10__.removeUndefined(categoryStrings) : [];
|
|
10021
|
+
const childProps = child.props || {};
|
|
10022
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(childProps, axis);
|
|
9898
10023
|
};
|
|
9899
|
-
return
|
|
10024
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee);
|
|
9900
10025
|
}
|
|
9901
10026
|
function getStringsFromData(childComponents) {
|
|
9902
10027
|
const iteratee = child => {
|
|
9903
10028
|
const childProps = child.props || {};
|
|
9904
10029
|
let data;
|
|
9905
|
-
if (!
|
|
10030
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
9906
10031
|
return null;
|
|
9907
|
-
} else if (child.type &&
|
|
10032
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
9908
10033
|
data = child.type.getData(childProps);
|
|
9909
10034
|
} else {
|
|
9910
|
-
data =
|
|
10035
|
+
data = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
9911
10036
|
}
|
|
9912
10037
|
return data.map(d => ({
|
|
9913
10038
|
x: d.xName,
|
|
@@ -9926,28 +10051,28 @@ function getStringsFromData(childComponents) {
|
|
|
9926
10051
|
y: y !== undefined ? memo.y.concat(y) : memo.y
|
|
9927
10052
|
};
|
|
9928
10053
|
};
|
|
9929
|
-
return
|
|
10054
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
|
|
9930
10055
|
}
|
|
9931
10056
|
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
9932
|
-
const categories =
|
|
9933
|
-
const axisComponent =
|
|
9934
|
-
const axisStrings = axisComponent ?
|
|
9935
|
-
const categoryStrings = categories
|
|
9936
|
-
return
|
|
10057
|
+
const categories = _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, axis);
|
|
10058
|
+
const axisComponent = _axis__WEBPACK_IMPORTED_MODULE_13__.getAxisComponent(childComponents, axis);
|
|
10059
|
+
const axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromAxes(axisComponent.props, axis) : [];
|
|
10060
|
+
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
|
|
10061
|
+
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
9937
10062
|
}
|
|
9938
10063
|
function getStringsFromChildren(props, childComponents) {
|
|
9939
|
-
const children = childComponents ||
|
|
10064
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9940
10065
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
9941
10066
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
9942
10067
|
const dataStrings = getStringsFromData(children);
|
|
9943
10068
|
return {
|
|
9944
|
-
x:
|
|
9945
|
-
y:
|
|
10069
|
+
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...xStrings, ...dataStrings.x].flat()),
|
|
10070
|
+
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...yStrings, ...dataStrings.y].flat())
|
|
9946
10071
|
};
|
|
9947
10072
|
}
|
|
9948
10073
|
function getCategories(props, childComponents, allStrings) {
|
|
9949
|
-
const xPropCategories = props.categories &&
|
|
9950
|
-
const yPropCategories = props.categories &&
|
|
10074
|
+
const xPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "x");
|
|
10075
|
+
const yPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "y");
|
|
9951
10076
|
const fallbackRequired = !xPropCategories || !yPropCategories;
|
|
9952
10077
|
const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
|
|
9953
10078
|
const xCategories = xPropCategories || fallbackProps.x;
|