1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
#[allow(unused_imports)]
use serde::Serialize;

/// The sample data from which statistics are computed is set in `x` for vertically spanning histograms and in `y` for horizontally spanning histograms. Binning options are set `xbins` and `ybins` respectively if no aggregation data is provided.
#[derive(Default, Serialize)]
pub struct Histogram<'a> {
    #[serde(rename = "visible")]
    #[serde(skip_serializing_if = "Option::is_none")]
    visible: Option<Visible>,
    #[serde(rename = "showlegend")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showlegend: Option<bool>,
    #[serde(rename = "legendgroup")]
    #[serde(skip_serializing_if = "Option::is_none")]
    legendgroup: Option<&'a str>,
    #[serde(rename = "opacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    opacity: Option<f64>,
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    name: Option<&'a str>,
    #[serde(rename = "uid")]
    #[serde(skip_serializing_if = "Option::is_none")]
    uid: Option<&'a str>,
    #[serde(rename = "ids")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ids: Option<&'a [&'a str]>,
    #[serde(rename = "meta")]
    #[serde(skip_serializing_if = "Option::is_none")]
    meta: Option<crate::Any>,
    #[serde(rename = "selectedpoints")]
    #[serde(skip_serializing_if = "Option::is_none")]
    selectedpoints: Option<crate::Any>,
    #[serde(rename = "hoverinfo")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    hoverinfo: crate::IsEmpty<Hoverinfo>,
    #[serde(rename = "hoverlabel")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    hoverlabel: crate::IsEmpty<Hoverlabel<'a>>,
    #[serde(rename = "stream")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    stream: crate::IsEmpty<Stream<'a>>,
    #[serde(rename = "uirevision")]
    #[serde(skip_serializing_if = "Option::is_none")]
    uirevision: Option<crate::Any>,
    #[serde(rename = "x")]
    #[serde(skip_serializing_if = "Option::is_none")]
    x: Option<&'a [f64]>,
    #[serde(rename = "y")]
    #[serde(skip_serializing_if = "Option::is_none")]
    y: Option<&'a [f64]>,
    #[serde(rename = "text")]
    #[serde(skip_serializing_if = "Option::is_none")]
    text: Option<&'a str>,
    #[serde(rename = "hovertext")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertext: Option<&'a str>,
    #[serde(rename = "orientation")]
    #[serde(skip_serializing_if = "Option::is_none")]
    orientation: Option<Orientation>,
    #[serde(rename = "histfunc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    histfunc: Option<Histfunc>,
    #[serde(rename = "histnorm")]
    #[serde(skip_serializing_if = "Option::is_none")]
    histnorm: Option<Histnorm>,
    #[serde(rename = "cumulative")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    cumulative: crate::IsEmpty<Cumulative<>>,
    #[serde(rename = "nbinsx")]
    #[serde(skip_serializing_if = "Option::is_none")]
    nbinsx: Option<u64>,
    #[serde(rename = "xbins")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    xbins: crate::IsEmpty<Xbins<>>,
    #[serde(rename = "nbinsy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    nbinsy: Option<u64>,
    #[serde(rename = "ybins")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    ybins: crate::IsEmpty<Ybins<>>,
    #[serde(rename = "autobinx")]
    #[serde(skip_serializing_if = "Option::is_none")]
    autobinx: Option<bool>,
    #[serde(rename = "autobiny")]
    #[serde(skip_serializing_if = "Option::is_none")]
    autobiny: Option<bool>,
    #[serde(rename = "bingroup")]
    #[serde(skip_serializing_if = "Option::is_none")]
    bingroup: Option<&'a str>,
    #[serde(rename = "hovertemplate")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertemplate: Option<&'a str>,
    #[serde(rename = "marker")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    marker: crate::IsEmpty<Marker<'a>>,
    #[serde(rename = "offsetgroup")]
    #[serde(skip_serializing_if = "Option::is_none")]
    offsetgroup: Option<&'a str>,
    #[serde(rename = "alignmentgroup")]
    #[serde(skip_serializing_if = "Option::is_none")]
    alignmentgroup: Option<&'a str>,
    #[serde(rename = "selected")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    selected: crate::IsEmpty<Selected<'a>>,
    #[serde(rename = "unselected")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    unselected: crate::IsEmpty<Unselected<'a>>,
    #[serde(rename = "error_x")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    error_x: crate::IsEmpty<ErrorX<'a>>,
    #[serde(rename = "error_y")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    error_y: crate::IsEmpty<ErrorY<'a>>,
    #[serde(rename = "xcalendar")]
    #[serde(skip_serializing_if = "Option::is_none")]
    xcalendar: Option<Xcalendar>,
    #[serde(rename = "ycalendar")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ycalendar: Option<Ycalendar>,
    #[serde(rename = "xaxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    xaxis: Option<&'a str>,
    #[serde(rename = "yaxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    yaxis: Option<&'a str>,
    #[serde(rename = "idssrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    idssrc: Option<&'a str>,
    #[serde(rename = "customdatasrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    customdatasrc: Option<&'a str>,
    #[serde(rename = "metasrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    metasrc: Option<&'a str>,
    #[serde(rename = "hoverinfosrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hoverinfosrc: Option<&'a str>,
    #[serde(rename = "xsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    xsrc: Option<&'a str>,
    #[serde(rename = "ysrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ysrc: Option<&'a str>,
    #[serde(rename = "textsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    textsrc: Option<&'a str>,
    #[serde(rename = "hovertextsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertextsrc: Option<&'a str>,
    #[serde(rename = "hovertemplatesrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertemplatesrc: Option<&'a str>,
}

impl<'a> Histogram<'a> {
    /// Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
    ///
    /// default: `true`
    pub fn visible(&mut self, visible: Visible) -> &mut Self {
        self.visible = Some(visible);
        self
    }
    /// Determines whether or not an item corresponding to this trace is shown in the legend.
    ///
    /// default: `true`
    pub fn showlegend(&mut self, showlegend: bool) -> &mut Self {
        self.showlegend = Some(showlegend);
        self
    }
    /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.
    ///
    /// default: ``
    pub fn legendgroup(&mut self, legendgroup: &'a str) -> &mut Self {
        self.legendgroup = Some(legendgroup);
        self
    }
    /// Sets the opacity of the trace.
    ///
    /// default: `1`
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
    /// Sets the trace name. The trace name appear as the legend item and on hover.
    ///
    pub fn name(&mut self, name: &'a str) -> &mut Self {
        self.name = Some(name);
        self
    }
    /// Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
    ///
    pub fn uid(&mut self, uid: &'a str) -> &mut Self {
        self.uid = Some(uid);
        self
    }
    /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
    ///
    pub fn ids(&mut self, ids: &'a [&'a str]) -> &mut Self {
        self.ids = Some(ids);
        self
    }
    /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index.
    ///
    pub fn meta(&mut self, meta: crate::Any) -> &mut Self {
        self.meta = Some(meta);
        self
    }
    /// Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect.
    ///
    pub fn selectedpoints(&mut self, selectedpoints: crate::Any) -> &mut Self {
        self.selectedpoints = Some(selectedpoints);
        self
    }
    /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.
    ///
    /// default: `all`
    pub fn hoverinfo(&mut self) -> &mut Hoverinfo {
        self.hoverinfo.is_empty = false;
        &mut self.hoverinfo.data
    }
    pub fn hoverlabel(&mut self) -> &mut Hoverlabel<'a> {
        self.hoverlabel.is_empty = false;
        &mut self.hoverlabel.data
    }
    pub fn stream(&mut self) -> &mut Stream<'a> {
        self.stream.is_empty = false;
        &mut self.stream.data
    }
    /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves.
    ///
    pub fn uirevision(&mut self, uirevision: crate::Any) -> &mut Self {
        self.uirevision = Some(uirevision);
        self
    }
    /// Sets the sample data to be binned on the x axis.
    ///
    pub fn x(&mut self, x: &'a [f64]) -> &mut Self {
        self.x = Some(x);
        self
    }
    /// Sets the sample data to be binned on the y axis.
    ///
    pub fn y(&mut self, y: &'a [f64]) -> &mut Self {
        self.y = Some(y);
        self
    }
    /// Sets hover text elements associated with each bar. If a single string, the same string appears over all bars. If an array of string, the items are mapped in order to the this trace's coordinates.
    ///
    /// default: ``
    pub fn text(&mut self, text: &'a str) -> &mut Self {
        self.text = Some(text);
        self
    }
    /// Same as `text`.
    ///
    /// default: ``
    pub fn hovertext(&mut self, hovertext: &'a str) -> &mut Self {
        self.hovertext = Some(hovertext);
        self
    }
    /// Sets the orientation of the bars. With *v* (*h*), the value of the each bar spans along the vertical (horizontal).
    ///
    pub fn orientation(&mut self, orientation: Orientation) -> &mut Self {
        self.orientation = Some(orientation);
        self
    }
    /// Specifies the binning function used for this histogram trace. If *count*, the histogram values are computed by counting the number of values lying inside each bin. If *sum*, *avg*, *min*, *max*, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.
    ///
    /// default: `count`
    pub fn histfunc(&mut self, histfunc: Histfunc) -> &mut Self {
        self.histfunc = Some(histfunc);
        self
    }
    /// Specifies the type of normalization used for this histogram trace. If **, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If *percent* / *probability*, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If *density*, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If *probability density*, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).
    ///
    /// default: ``
    pub fn histnorm(&mut self, histnorm: Histnorm) -> &mut Self {
        self.histnorm = Some(histnorm);
        self
    }
    pub fn cumulative(&mut self) -> &mut Cumulative<> {
        self.cumulative.is_empty = false;
        &mut self.cumulative.data
    }
    /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided.
    ///
    /// default: `0`
    pub fn nbinsx(&mut self, nbinsx: u64) -> &mut Self {
        self.nbinsx = Some(nbinsx);
        self
    }
    pub fn xbins(&mut self) -> &mut Xbins<> {
        self.xbins.is_empty = false;
        &mut self.xbins.data
    }
    /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided.
    ///
    /// default: `0`
    pub fn nbinsy(&mut self, nbinsy: u64) -> &mut Self {
        self.nbinsy = Some(nbinsy);
        self
    }
    pub fn ybins(&mut self) -> &mut Ybins<> {
        self.ybins.is_empty = false;
        &mut self.ybins.data
    }
    /// Obsolete: since v1.42 each bin attribute is auto-determined separately and `autobinx` is not needed. However, we accept `autobinx: true` or `false` and will update `xbins` accordingly before deleting `autobinx` from the trace.
    ///
    /// default: `null`
    pub fn autobinx(&mut self, autobinx: bool) -> &mut Self {
        self.autobinx = Some(autobinx);
        self
    }
    /// Obsolete: since v1.42 each bin attribute is auto-determined separately and `autobiny` is not needed. However, we accept `autobiny: true` or `false` and will update `ybins` accordingly before deleting `autobiny` from the trace.
    ///
    /// default: `null`
    pub fn autobiny(&mut self, autobiny: bool) -> &mut Self {
        self.autobiny = Some(autobiny);
        self
    }
    /// Set a group of histogram traces which will have compatible bin settings. Note that traces on the same subplot and with the same *orientation* under `barmode` *stack*, *relative* and *group* are forced into the same bingroup, Using `bingroup`, traces under `barmode` *overlay* and on different axes (of the same axis type) can have compatible bin settings. Note that histogram and histogram2d* trace can share the same `bingroup`
    ///
    /// default: ``
    pub fn bingroup(&mut self, bingroup: &'a str) -> &mut Self {
        self.bingroup = Some(bingroup);
        self
    }
    /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `binNumber` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`.
    ///
    /// default: ``
    pub fn hovertemplate(&mut self, hovertemplate: &'a str) -> &mut Self {
        self.hovertemplate = Some(hovertemplate);
        self
    }
    pub fn marker(&mut self) -> &mut Marker<'a> {
        self.marker.is_empty = false;
        &mut self.marker.data
    }
    /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up.
    ///
    /// default: ``
    pub fn offsetgroup(&mut self, offsetgroup: &'a str) -> &mut Self {
        self.offsetgroup = Some(offsetgroup);
        self
    }
    /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently.
    ///
    /// default: ``
    pub fn alignmentgroup(&mut self, alignmentgroup: &'a str) -> &mut Self {
        self.alignmentgroup = Some(alignmentgroup);
        self
    }
    pub fn selected(&mut self) -> &mut Selected<'a> {
        self.selected.is_empty = false;
        &mut self.selected.data
    }
    pub fn unselected(&mut self) -> &mut Unselected<'a> {
        self.unselected.is_empty = false;
        &mut self.unselected.data
    }
    pub fn error_x(&mut self) -> &mut ErrorX<'a> {
        self.error_x.is_empty = false;
        &mut self.error_x.data
    }
    pub fn error_y(&mut self) -> &mut ErrorY<'a> {
        self.error_y.is_empty = false;
        &mut self.error_y.data
    }
    /// Sets the calendar system to use with `x` date data.
    ///
    /// default: `gregorian`
    pub fn xcalendar(&mut self, xcalendar: Xcalendar) -> &mut Self {
        self.xcalendar = Some(xcalendar);
        self
    }
    /// Sets the calendar system to use with `y` date data.
    ///
    /// default: `gregorian`
    pub fn ycalendar(&mut self, ycalendar: Ycalendar) -> &mut Self {
        self.ycalendar = Some(ycalendar);
        self
    }
    /// Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.
    ///
    /// default: `x`
    pub fn xaxis(&mut self, xaxis: &'a str) -> &mut Self {
        self.xaxis = Some(xaxis);
        self
    }
    /// Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.yaxis2`, and so on.
    ///
    /// default: `y`
    pub fn yaxis(&mut self, yaxis: &'a str) -> &mut Self {
        self.yaxis = Some(yaxis);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  ids .
    ///
    pub fn idssrc(&mut self, idssrc: &'a str) -> &mut Self {
        self.idssrc = Some(idssrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  customdata .
    ///
    pub fn customdatasrc(&mut self, customdatasrc: &'a str) -> &mut Self {
        self.customdatasrc = Some(customdatasrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  meta .
    ///
    pub fn metasrc(&mut self, metasrc: &'a str) -> &mut Self {
        self.metasrc = Some(metasrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  hoverinfo .
    ///
    pub fn hoverinfosrc(&mut self, hoverinfosrc: &'a str) -> &mut Self {
        self.hoverinfosrc = Some(hoverinfosrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  x .
    ///
    pub fn xsrc(&mut self, xsrc: &'a str) -> &mut Self {
        self.xsrc = Some(xsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  y .
    ///
    pub fn ysrc(&mut self, ysrc: &'a str) -> &mut Self {
        self.ysrc = Some(ysrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  text .
    ///
    pub fn textsrc(&mut self, textsrc: &'a str) -> &mut Self {
        self.textsrc = Some(textsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  hovertext .
    ///
    pub fn hovertextsrc(&mut self, hovertextsrc: &'a str) -> &mut Self {
        self.hovertextsrc = Some(hovertextsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  hovertemplate .
    ///
    pub fn hovertemplatesrc(&mut self, hovertemplatesrc: &'a str) -> &mut Self {
        self.hovertemplatesrc = Some(hovertemplatesrc);
        self
    }
}
pub enum Visible {
    True,
    False,
    Legendonly,
}
impl serde::Serialize for Visible {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::True => serializer.serialize_bool(true),
            Self::False => serializer.serialize_bool(false),
            Self::Legendonly => serializer.serialize_str("legendonly"),
        }
    }
}
#[derive(Default)]
pub struct HoverinfoFlags ([u8; 1]);
impl HoverinfoFlags {
    pub fn x(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 0; }
        else { self.0[0] &= !(1 << 0); }
        self
    }
    pub fn y(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 1; }
        else { self.0[0] &= !(1 << 1); }
        self
    }
    pub fn z(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 2; }
        else { self.0[0] &= !(1 << 2); }
        self
    }
    pub fn text(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 3; }
        else { self.0[0] &= !(1 << 3); }
        self
    }
    pub fn name(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 4; }
        else { self.0[0] &= !(1 << 4); }
        self
    }
}
impl serde::Serialize for HoverinfoFlags {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        #[allow(unused_mut)]
        let mut v: Vec<&str> = Vec::new();
        if (self.0[0] >> 0) & 0x1 == 1 {
            v.push("x");
        }
        if (self.0[0] >> 1) & 0x1 == 1 {
            v.push("y");
        }
        if (self.0[0] >> 2) & 0x1 == 1 {
            v.push("z");
        }
        if (self.0[0] >> 3) & 0x1 == 1 {
            v.push("text");
        }
        if (self.0[0] >> 4) & 0x1 == 1 {
            v.push("name");
        }
        serializer.serialize_str(&v.join("+"))
    }
}
pub enum Hoverinfo {
    Flags(HoverinfoFlags),
    All,
    None,
    Skip,
}
impl serde::Serialize for Hoverinfo {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::All => serializer.serialize_str("all"),
            Self::None => serializer.serialize_str("none"),
            Self::Skip => serializer.serialize_str("skip"),
            Self::Flags(v) => v.serialize(serializer),
        }
    }
}
impl Default for Hoverinfo {
    fn default() -> Self {
        Self::Flags(HoverinfoFlags::default())
    }
}
impl Hoverinfo {
    pub fn flags(&mut self) -> &mut HoverinfoFlags {
        *self = Self::Flags(HoverinfoFlags::default());
        match self {
            Self::Flags(v) => v,
            _ => unreachable!(),
        }
    }
    pub fn set(&mut self, v: Hoverinfo) {
        *self = v;
    }
}

#[derive(Default, Serialize)]
pub struct Hoverlabel<'a> {
    #[serde(rename = "bgcolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    bgcolor: Option<&'a str>,
    #[serde(rename = "bordercolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    bordercolor: Option<&'a str>,
    #[serde(rename = "font")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    font: crate::IsEmpty<hoverlabel::Font<'a>>,
    #[serde(rename = "align")]
    #[serde(skip_serializing_if = "Option::is_none")]
    align: Option<hoverlabel::Align>,
    #[serde(rename = "namelength")]
    #[serde(skip_serializing_if = "Option::is_none")]
    namelength: Option<u64>,
}

impl<'a> Hoverlabel<'a> {
    /// Sets the background color of the hover labels for this trace
    ///
    pub fn bgcolor(&mut self, bgcolor: &'a str) -> &mut Self {
        self.bgcolor = Some(bgcolor);
        self
    }
    /// Sets the border color of the hover labels for this trace.
    ///
    pub fn bordercolor(&mut self, bordercolor: &'a str) -> &mut Self {
        self.bordercolor = Some(bordercolor);
        self
    }
    /// Sets the font used in hover labels.
    ///
    pub fn font(&mut self) -> &mut hoverlabel::Font<'a> {
        self.font.is_empty = false;
        &mut self.font.data
    }
    /// Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines
    ///
    /// default: `auto`
    pub fn align(&mut self, align: hoverlabel::Align) -> &mut Self {
        self.align = Some(align);
        self
    }
    /// Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.
    ///
    /// default: `15`
    pub fn namelength(&mut self, namelength: u64) -> &mut Self {
        self.namelength = Some(namelength);
        self
    }
}
pub mod hoverlabel {
#[allow(unused_imports)]
use serde::Serialize;

/// Sets the font used in hover labels.
#[derive(Default, Serialize)]
pub struct Font<'a> {
    #[serde(rename = "family")]
    #[serde(skip_serializing_if = "Option::is_none")]
    family: Option<&'a str>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Font<'a> {
    /// HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.
    ///
    pub fn family(&mut self, family: &'a str) -> &mut Self {
        self.family = Some(family);
        self
    }
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        self
    }
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
pub enum Align {
    Left,
    Right,
    Auto,
}
impl serde::Serialize for Align {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Left => serializer.serialize_str("left"),
            Self::Right => serializer.serialize_str("right"),
            Self::Auto => serializer.serialize_str("auto"),
        }
    }
}
}

#[derive(Default, Serialize)]
pub struct Stream<'a> {
    #[serde(rename = "token")]
    #[serde(skip_serializing_if = "Option::is_none")]
    token: Option<&'a str>,
    #[serde(rename = "maxpoints")]
    #[serde(skip_serializing_if = "Option::is_none")]
    maxpoints: Option<f64>,
}

impl<'a> Stream<'a> {
    /// The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
    ///
    pub fn token(&mut self, token: &'a str) -> &mut Self {
        self.token = Some(token);
        self
    }
    /// Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.
    ///
    /// default: `500`
    pub fn maxpoints(&mut self, maxpoints: f64) -> &mut Self {
        self.maxpoints = Some(maxpoints);
        self
    }
}
pub enum Orientation {
    V,
    H,
}
impl serde::Serialize for Orientation {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::V => serializer.serialize_str("v"),
            Self::H => serializer.serialize_str("h"),
        }
    }
}
pub enum Histfunc {
    Count,
    Sum,
    Avg,
    Min,
    Max,
}
impl serde::Serialize for Histfunc {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Count => serializer.serialize_str("count"),
            Self::Sum => serializer.serialize_str("sum"),
            Self::Avg => serializer.serialize_str("avg"),
            Self::Min => serializer.serialize_str("min"),
            Self::Max => serializer.serialize_str("max"),
        }
    }
}
pub enum Histnorm {
    Percent,
    Probability,
    Density,
    ProbabilityDensity,
}
impl serde::Serialize for Histnorm {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Percent => serializer.serialize_str("percent"),
            Self::Probability => serializer.serialize_str("probability"),
            Self::Density => serializer.serialize_str("density"),
            Self::ProbabilityDensity => serializer.serialize_str("probability density"),
        }
    }
}

#[derive(Default, Serialize)]
pub struct Cumulative<> {
    #[serde(rename = "enabled")]
    #[serde(skip_serializing_if = "Option::is_none")]
    enabled: Option<bool>,
    #[serde(rename = "direction")]
    #[serde(skip_serializing_if = "Option::is_none")]
    direction: Option<cumulative::Direction>,
    #[serde(rename = "currentbin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    currentbin: Option<cumulative::Currentbin>,
}

impl<> Cumulative<> {
    /// If true, display the cumulative distribution by summing the binned values. Use the `direction` and `centralbin` attributes to tune the accumulation method. Note: in this mode, the *density* `histnorm` settings behave the same as their equivalents without *density*: ** and *density* both rise to the number of data points, and *probability* and *probability density* both rise to the number of sample points.
    ///
    /// default: `false`
    pub fn enabled(&mut self, enabled: bool) -> &mut Self {
        self.enabled = Some(enabled);
        self
    }
    /// Only applies if cumulative is enabled. If *increasing* (default) we sum all prior bins, so the result increases from left to right. If *decreasing* we sum later bins so the result decreases from left to right.
    ///
    /// default: `increasing`
    pub fn direction(&mut self, direction: cumulative::Direction) -> &mut Self {
        self.direction = Some(direction);
        self
    }
    /// Only applies if cumulative is enabled. Sets whether the current bin is included, excluded, or has half of its value included in the current cumulative value. *include* is the default for compatibility with various other tools, however it introduces a half-bin bias to the results. *exclude* makes the opposite half-bin bias, and *half* removes it.
    ///
    /// default: `include`
    pub fn currentbin(&mut self, currentbin: cumulative::Currentbin) -> &mut Self {
        self.currentbin = Some(currentbin);
        self
    }
}
pub mod cumulative {
#[allow(unused_imports)]
use serde::Serialize;
pub enum Direction {
    Increasing,
    Decreasing,
}
impl serde::Serialize for Direction {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Increasing => serializer.serialize_str("increasing"),
            Self::Decreasing => serializer.serialize_str("decreasing"),
        }
    }
}
pub enum Currentbin {
    Include,
    Exclude,
    Half,
}
impl serde::Serialize for Currentbin {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Include => serializer.serialize_str("include"),
            Self::Exclude => serializer.serialize_str("exclude"),
            Self::Half => serializer.serialize_str("half"),
        }
    }
}
}

#[derive(Default, Serialize)]
pub struct Xbins<> {
    #[serde(rename = "start")]
    #[serde(skip_serializing_if = "Option::is_none")]
    start: Option<crate::Any>,
    #[serde(rename = "end")]
    #[serde(skip_serializing_if = "Option::is_none")]
    end: Option<crate::Any>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<crate::Any>,
}

impl<> Xbins<> {
    /// Sets the starting value for the x axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. If multiple non-overlaying histograms share a subplot, the first explicit `start` is used exactly and all others are shifted down (if necessary) to differ from that one by an integer number of bins.
    ///
    pub fn start(&mut self, start: crate::Any) -> &mut Self {
        self.start = Some(start);
        self
    }
    /// Sets the end value for the x axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers.
    ///
    pub fn end(&mut self, end: crate::Any) -> &mut Self {
        self.end = Some(end);
        self
    }
    /// Sets the size of each x axis bin. Default behavior: If `nbinsx` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsx` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or *M<n>* for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). If multiple non-overlaying histograms share a subplot, the first explicit `size` is used and all others discarded. If no `size` is provided,the sample data from all traces is combined to determine `size` as described above.
    ///
    pub fn size(&mut self, size: crate::Any) -> &mut Self {
        self.size = Some(size);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Ybins<> {
    #[serde(rename = "start")]
    #[serde(skip_serializing_if = "Option::is_none")]
    start: Option<crate::Any>,
    #[serde(rename = "end")]
    #[serde(skip_serializing_if = "Option::is_none")]
    end: Option<crate::Any>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<crate::Any>,
}

impl<> Ybins<> {
    /// Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. If multiple non-overlaying histograms share a subplot, the first explicit `start` is used exactly and all others are shifted down (if necessary) to differ from that one by an integer number of bins.
    ///
    pub fn start(&mut self, start: crate::Any) -> &mut Self {
        self.start = Some(start);
        self
    }
    /// Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers.
    ///
    pub fn end(&mut self, end: crate::Any) -> &mut Self {
        self.end = Some(end);
        self
    }
    /// Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or *M<n>* for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). If multiple non-overlaying histograms share a subplot, the first explicit `size` is used and all others discarded. If no `size` is provided,the sample data from all traces is combined to determine `size` as described above.
    ///
    pub fn size(&mut self, size: crate::Any) -> &mut Self {
        self.size = Some(size);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Marker<'a> {
    #[serde(rename = "line")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    line: crate::IsEmpty<marker::Line<'a>>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "cauto")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cauto: Option<bool>,
    #[serde(rename = "cmin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmin: Option<f64>,
    #[serde(rename = "cmax")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmax: Option<f64>,
    #[serde(rename = "cmid")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmid: Option<f64>,
    #[serde(rename = "colorscale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    colorscale: Option<crate::ColorScale<'a>>,
    #[serde(rename = "autocolorscale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    autocolorscale: Option<bool>,
    #[serde(rename = "reversescale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    reversescale: Option<bool>,
    #[serde(rename = "showscale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showscale: Option<bool>,
    #[serde(rename = "colorbar")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    colorbar: crate::IsEmpty<marker::Colorbar<'a>>,
    #[serde(rename = "coloraxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    coloraxis: Option<&'a str>,
    #[serde(rename = "opacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    opacity: Option<f64>,
}

impl<'a> Marker<'a> {
    pub fn line(&mut self) -> &mut marker::Line<'a> {
        self.line.is_empty = false;
        &mut self.line.data
    }
    /// Sets themarkercolor. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax`  Has an effect only if in `marker.color`is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.
    ///
    /// default: `true`
    pub fn cauto(&mut self, cauto: bool) -> &mut Self {
        self.cauto = Some(cauto);
        self
    }
    /// Sets the lower bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.
    ///
    /// default: `null`
    pub fn cmin(&mut self, cmin: f64) -> &mut Self {
        self.cmin = Some(cmin);
        self
    }
    /// Sets the upper bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.
    ///
    /// default: `null`
    pub fn cmax(&mut self, cmax: f64) -> &mut Self {
        self.cmax = Some(cmax);
        self
    }
    /// Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.
    ///
    /// default: `null`
    pub fn cmid(&mut self, cmid: f64) -> &mut Self {
        self.cmid = Some(cmid);
        self
    }
    /// Sets the colorscale. Has an effect only if in `marker.color`is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.
    ///
    /// default: `null`
    pub fn colorscale(&mut self, colorscale: crate::ColorScale<'a>) -> &mut Self {
        self.colorscale = Some(colorscale);
        self
    }
    /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default  palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.
    ///
    /// default: `true`
    pub fn autocolorscale(&mut self, autocolorscale: bool) -> &mut Self {
        self.autocolorscale = Some(autocolorscale);
        self
    }
    /// Reverses the color mapping if true. Has an effect only if in `marker.color`is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.
    ///
    /// default: `false`
    pub fn reversescale(&mut self, reversescale: bool) -> &mut Self {
        self.reversescale = Some(reversescale);
        self
    }
    /// Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color`is set to a numerical array.
    ///
    /// default: `false`
    pub fn showscale(&mut self, showscale: bool) -> &mut Self {
        self.showscale = Some(showscale);
        self
    }
    pub fn colorbar(&mut self) -> &mut marker::Colorbar<'a> {
        self.colorbar.is_empty = false;
        &mut self.colorbar.data
    }
    /// Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.
    ///
    /// default: `null`
    pub fn coloraxis(&mut self, coloraxis: &'a str) -> &mut Self {
        self.coloraxis = Some(coloraxis);
        self
    }
    /// Sets the opacity of the bars.
    ///
    /// default: `1`
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
}
pub mod marker {
#[allow(unused_imports)]
use serde::Serialize;

#[derive(Default, Serialize)]
pub struct Line<'a> {
    #[serde(rename = "width")]
    #[serde(skip_serializing_if = "Option::is_none")]
    width: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "cauto")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cauto: Option<bool>,
    #[serde(rename = "cmin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmin: Option<f64>,
    #[serde(rename = "cmax")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmax: Option<f64>,
    #[serde(rename = "cmid")]
    #[serde(skip_serializing_if = "Option::is_none")]
    cmid: Option<f64>,
    #[serde(rename = "colorscale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    colorscale: Option<crate::ColorScale<'a>>,
    #[serde(rename = "autocolorscale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    autocolorscale: Option<bool>,
    #[serde(rename = "reversescale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    reversescale: Option<bool>,
    #[serde(rename = "coloraxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    coloraxis: Option<&'a str>,
}

impl<'a> Line<'a> {
    /// Sets the width (in px) of the lines bounding the marker points.
    ///
    /// default: `0`
    pub fn width(&mut self, width: f64) -> &mut Self {
        self.width = Some(width);
        self
    }
    /// Sets themarker.linecolor. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.line.cmin` and `marker.line.cmax` if set.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Determines whether or not the color domain is computed with respect to the input data (here in `marker.line.color`) or the bounds set in `marker.line.cmin` and `marker.line.cmax`  Has an effect only if in `marker.line.color`is set to a numerical array. Defaults to `false` when `marker.line.cmin` and `marker.line.cmax` are set by the user.
    ///
    /// default: `true`
    pub fn cauto(&mut self, cauto: bool) -> &mut Self {
        self.cauto = Some(cauto);
        self
    }
    /// Sets the lower bound of the color domain. Has an effect only if in `marker.line.color`is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmax` must be set as well.
    ///
    /// default: `null`
    pub fn cmin(&mut self, cmin: f64) -> &mut Self {
        self.cmin = Some(cmin);
        self
    }
    /// Sets the upper bound of the color domain. Has an effect only if in `marker.line.color`is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmin` must be set as well.
    ///
    /// default: `null`
    pub fn cmax(&mut self, cmax: f64) -> &mut Self {
        self.cmax = Some(cmax);
        self
    }
    /// Sets the mid-point of the color domain by scaling `marker.line.cmin` and/or `marker.line.cmax` to be equidistant to this point. Has an effect only if in `marker.line.color`is set to a numerical array. Value should have the same units as in `marker.line.color`. Has no effect when `marker.line.cauto` is `false`.
    ///
    /// default: `null`
    pub fn cmid(&mut self, cmid: f64) -> &mut Self {
        self.cmid = Some(cmid);
        self
    }
    /// Sets the colorscale. Has an effect only if in `marker.line.color`is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`marker.line.cmin` and `marker.line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.
    ///
    /// default: `null`
    pub fn colorscale(&mut self, colorscale: crate::ColorScale<'a>) -> &mut Self {
        self.colorscale = Some(colorscale);
        self
    }
    /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. Has an effect only if in `marker.line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default  palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.
    ///
    /// default: `true`
    pub fn autocolorscale(&mut self, autocolorscale: bool) -> &mut Self {
        self.autocolorscale = Some(autocolorscale);
        self
    }
    /// Reverses the color mapping if true. Has an effect only if in `marker.line.color`is set to a numerical array. If true, `marker.line.cmin` will correspond to the last color in the array and `marker.line.cmax` will correspond to the first color.
    ///
    /// default: `false`
    pub fn reversescale(&mut self, reversescale: bool) -> &mut Self {
        self.reversescale = Some(reversescale);
        self
    }
    /// Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.
    ///
    /// default: `null`
    pub fn coloraxis(&mut self, coloraxis: &'a str) -> &mut Self {
        self.coloraxis = Some(coloraxis);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Colorbar<'a> {
    #[serde(rename = "thicknessmode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    thicknessmode: Option<colorbar::Thicknessmode>,
    #[serde(rename = "thickness")]
    #[serde(skip_serializing_if = "Option::is_none")]
    thickness: Option<f64>,
    #[serde(rename = "lenmode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    lenmode: Option<colorbar::Lenmode>,
    #[serde(rename = "len")]
    #[serde(skip_serializing_if = "Option::is_none")]
    len: Option<f64>,
    #[serde(rename = "x")]
    #[serde(skip_serializing_if = "Option::is_none")]
    x: Option<f64>,
    #[serde(rename = "xanchor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    xanchor: Option<colorbar::Xanchor>,
    #[serde(rename = "xpad")]
    #[serde(skip_serializing_if = "Option::is_none")]
    xpad: Option<f64>,
    #[serde(rename = "y")]
    #[serde(skip_serializing_if = "Option::is_none")]
    y: Option<f64>,
    #[serde(rename = "yanchor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    yanchor: Option<colorbar::Yanchor>,
    #[serde(rename = "ypad")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ypad: Option<f64>,
    #[serde(rename = "outlinecolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    outlinecolor: Option<&'a str>,
    #[serde(rename = "outlinewidth")]
    #[serde(skip_serializing_if = "Option::is_none")]
    outlinewidth: Option<f64>,
    #[serde(rename = "bordercolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    bordercolor: Option<&'a str>,
    #[serde(rename = "borderwidth")]
    #[serde(skip_serializing_if = "Option::is_none")]
    borderwidth: Option<f64>,
    #[serde(rename = "bgcolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    bgcolor: Option<&'a str>,
    #[serde(rename = "tickmode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickmode: Option<colorbar::Tickmode>,
    #[serde(rename = "nticks")]
    #[serde(skip_serializing_if = "Option::is_none")]
    nticks: Option<u64>,
    #[serde(rename = "tick0")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tick_0: Option<crate::Any>,
    #[serde(rename = "dtick")]
    #[serde(skip_serializing_if = "Option::is_none")]
    dtick: Option<crate::Any>,
    #[serde(rename = "tickvals")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickvals: Option<&'a [f64]>,
    #[serde(rename = "ticktext")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ticktext: Option<&'a [&'a str]>,
    #[serde(rename = "ticks")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ticks: Option<colorbar::Ticks>,
    #[serde(rename = "ticklen")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ticklen: Option<f64>,
    #[serde(rename = "tickwidth")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickwidth: Option<f64>,
    #[serde(rename = "tickcolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickcolor: Option<&'a str>,
    #[serde(rename = "showticklabels")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showticklabels: Option<bool>,
    #[serde(rename = "tickfont")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    tickfont: crate::IsEmpty<colorbar::Tickfont<'a>>,
    #[serde(rename = "tickangle")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickangle: Option<crate::Angle>,
    #[serde(rename = "tickformat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickformat: Option<&'a str>,
    #[serde(rename = "tickprefix")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tickprefix: Option<&'a str>,
    #[serde(rename = "showtickprefix")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showtickprefix: Option<colorbar::Showtickprefix>,
    #[serde(rename = "ticksuffix")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ticksuffix: Option<&'a str>,
    #[serde(rename = "showticksuffix")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showticksuffix: Option<colorbar::Showticksuffix>,
    #[serde(rename = "separatethousands")]
    #[serde(skip_serializing_if = "Option::is_none")]
    separatethousands: Option<bool>,
    #[serde(rename = "exponentformat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    exponentformat: Option<colorbar::Exponentformat>,
    #[serde(rename = "showexponent")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showexponent: Option<colorbar::Showexponent>,
    #[serde(rename = "title")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    title: crate::IsEmpty<colorbar::Title<'a>>,
}

impl<'a> Colorbar<'a> {
    /// Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.
    ///
    /// default: `pixels`
    pub fn thicknessmode(&mut self, thicknessmode: colorbar::Thicknessmode) -> &mut Self {
        self.thicknessmode = Some(thicknessmode);
        self
    }
    /// Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.
    ///
    /// default: `30`
    pub fn thickness(&mut self, thickness: f64) -> &mut Self {
        self.thickness = Some(thickness);
        self
    }
    /// Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.
    ///
    /// default: `fraction`
    pub fn lenmode(&mut self, lenmode: colorbar::Lenmode) -> &mut Self {
        self.lenmode = Some(lenmode);
        self
    }
    /// Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.
    ///
    /// default: `1`
    pub fn len(&mut self, len: f64) -> &mut Self {
        self.len = Some(len);
        self
    }
    /// Sets the x position of the color bar (in plot fraction).
    ///
    /// default: `1.02`
    pub fn x(&mut self, x: f64) -> &mut Self {
        self.x = Some(x);
        self
    }
    /// Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.
    ///
    /// default: `left`
    pub fn xanchor(&mut self, xanchor: colorbar::Xanchor) -> &mut Self {
        self.xanchor = Some(xanchor);
        self
    }
    /// Sets the amount of padding (in px) along the x direction.
    ///
    /// default: `10`
    pub fn xpad(&mut self, xpad: f64) -> &mut Self {
        self.xpad = Some(xpad);
        self
    }
    /// Sets the y position of the color bar (in plot fraction).
    ///
    /// default: `0.5`
    pub fn y(&mut self, y: f64) -> &mut Self {
        self.y = Some(y);
        self
    }
    /// Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.
    ///
    /// default: `middle`
    pub fn yanchor(&mut self, yanchor: colorbar::Yanchor) -> &mut Self {
        self.yanchor = Some(yanchor);
        self
    }
    /// Sets the amount of padding (in px) along the y direction.
    ///
    /// default: `10`
    pub fn ypad(&mut self, ypad: f64) -> &mut Self {
        self.ypad = Some(ypad);
        self
    }
    /// Sets the axis line color.
    ///
    /// default: `#444`
    pub fn outlinecolor(&mut self, outlinecolor: &'a str) -> &mut Self {
        self.outlinecolor = Some(outlinecolor);
        self
    }
    /// Sets the width (in px) of the axis line.
    ///
    /// default: `1`
    pub fn outlinewidth(&mut self, outlinewidth: f64) -> &mut Self {
        self.outlinewidth = Some(outlinewidth);
        self
    }
    /// Sets the axis line color.
    ///
    /// default: `#444`
    pub fn bordercolor(&mut self, bordercolor: &'a str) -> &mut Self {
        self.bordercolor = Some(bordercolor);
        self
    }
    /// Sets the width (in px) or the border enclosing this color bar.
    ///
    /// default: `0`
    pub fn borderwidth(&mut self, borderwidth: f64) -> &mut Self {
        self.borderwidth = Some(borderwidth);
        self
    }
    /// Sets the color of padded area.
    ///
    /// default: `rgba(0,0,0,0)`
    pub fn bgcolor(&mut self, bgcolor: &'a str) -> &mut Self {
        self.bgcolor = Some(bgcolor);
        self
    }
    /// Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).
    ///
    pub fn tickmode(&mut self, tickmode: colorbar::Tickmode) -> &mut Self {
        self.tickmode = Some(tickmode);
        self
    }
    /// Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.
    ///
    /// default: `0`
    pub fn nticks(&mut self, nticks: u64) -> &mut Self {
        self.nticks = Some(nticks);
        self
    }
    /// Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`=*L<f>* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.
    ///
    pub fn tick_0(&mut self, tick_0: crate::Any) -> &mut Self {
        self.tick_0 = Some(tick_0);
        self
    }
    /// Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. *log* has several special values; *L<f>*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0. *date* also has special values *M<n>* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*
    ///
    pub fn dtick(&mut self, dtick: crate::Any) -> &mut Self {
        self.dtick = Some(dtick);
        self
    }
    /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.
    ///
    pub fn tickvals(&mut self, tickvals: &'a [f64]) -> &mut Self {
        self.tickvals = Some(tickvals);
        self
    }
    /// Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `tickvals`.
    ///
    pub fn ticktext(&mut self, ticktext: &'a [&'a str]) -> &mut Self {
        self.ticktext = Some(ticktext);
        self
    }
    /// Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.
    ///
    /// default: ``
    pub fn ticks(&mut self, ticks: colorbar::Ticks) -> &mut Self {
        self.ticks = Some(ticks);
        self
    }
    /// Sets the tick length (in px).
    ///
    /// default: `5`
    pub fn ticklen(&mut self, ticklen: f64) -> &mut Self {
        self.ticklen = Some(ticklen);
        self
    }
    /// Sets the tick width (in px).
    ///
    /// default: `1`
    pub fn tickwidth(&mut self, tickwidth: f64) -> &mut Self {
        self.tickwidth = Some(tickwidth);
        self
    }
    /// Sets the tick color.
    ///
    /// default: `#444`
    pub fn tickcolor(&mut self, tickcolor: &'a str) -> &mut Self {
        self.tickcolor = Some(tickcolor);
        self
    }
    /// Determines whether or not the tick labels are drawn.
    ///
    /// default: `true`
    pub fn showticklabels(&mut self, showticklabels: bool) -> &mut Self {
        self.showticklabels = Some(showticklabels);
        self
    }
    /// Sets the color bar's tick label font
    ///
    pub fn tickfont(&mut self) -> &mut colorbar::Tickfont<'a> {
        self.tickfont.is_empty = false;
        &mut self.tickfont.data
    }
    /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.
    ///
    /// default: `auto`
    pub fn tickangle(&mut self, tickangle: crate::Angle) -> &mut Self {
        self.tickangle = Some(tickangle);
        self
    }
    /// Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format And for dates see: https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*
    ///
    /// default: ``
    pub fn tickformat(&mut self, tickformat: &'a str) -> &mut Self {
        self.tickformat = Some(tickformat);
        self
    }
    /// Sets a tick label prefix.
    ///
    /// default: ``
    pub fn tickprefix(&mut self, tickprefix: &'a str) -> &mut Self {
        self.tickprefix = Some(tickprefix);
        self
    }
    /// If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.
    ///
    /// default: `all`
    pub fn showtickprefix(&mut self, showtickprefix: colorbar::Showtickprefix) -> &mut Self {
        self.showtickprefix = Some(showtickprefix);
        self
    }
    /// Sets a tick label suffix.
    ///
    /// default: ``
    pub fn ticksuffix(&mut self, ticksuffix: &'a str) -> &mut Self {
        self.ticksuffix = Some(ticksuffix);
        self
    }
    /// Same as `showtickprefix` but for tick suffixes.
    ///
    /// default: `all`
    pub fn showticksuffix(&mut self, showticksuffix: colorbar::Showticksuffix) -> &mut Self {
        self.showticksuffix = Some(showticksuffix);
        self
    }
    /// If "true", even 4-digit integers are separated
    ///
    /// default: `false`
    pub fn separatethousands(&mut self, separatethousands: bool) -> &mut Self {
        self.separatethousands = Some(separatethousands);
        self
    }
    /// Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.
    ///
    /// default: `B`
    pub fn exponentformat(&mut self, exponentformat: colorbar::Exponentformat) -> &mut Self {
        self.exponentformat = Some(exponentformat);
        self
    }
    /// If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.
    ///
    /// default: `all`
    pub fn showexponent(&mut self, showexponent: colorbar::Showexponent) -> &mut Self {
        self.showexponent = Some(showexponent);
        self
    }
    pub fn title(&mut self) -> &mut colorbar::Title<'a> {
        self.title.is_empty = false;
        &mut self.title.data
    }
}
pub mod colorbar {
#[allow(unused_imports)]
use serde::Serialize;
pub enum Thicknessmode {
    Fraction,
    Pixels,
}
impl serde::Serialize for Thicknessmode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Fraction => serializer.serialize_str("fraction"),
            Self::Pixels => serializer.serialize_str("pixels"),
        }
    }
}
pub enum Lenmode {
    Fraction,
    Pixels,
}
impl serde::Serialize for Lenmode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Fraction => serializer.serialize_str("fraction"),
            Self::Pixels => serializer.serialize_str("pixels"),
        }
    }
}
pub enum Xanchor {
    Left,
    Center,
    Right,
}
impl serde::Serialize for Xanchor {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Left => serializer.serialize_str("left"),
            Self::Center => serializer.serialize_str("center"),
            Self::Right => serializer.serialize_str("right"),
        }
    }
}
pub enum Yanchor {
    Top,
    Middle,
    Bottom,
}
impl serde::Serialize for Yanchor {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Top => serializer.serialize_str("top"),
            Self::Middle => serializer.serialize_str("middle"),
            Self::Bottom => serializer.serialize_str("bottom"),
        }
    }
}
pub enum Tickmode {
    Auto,
    Linear,
    Array,
}
impl serde::Serialize for Tickmode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Auto => serializer.serialize_str("auto"),
            Self::Linear => serializer.serialize_str("linear"),
            Self::Array => serializer.serialize_str("array"),
        }
    }
}
pub enum Ticks {
    Outside,
    Inside,
}
impl serde::Serialize for Ticks {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Outside => serializer.serialize_str("outside"),
            Self::Inside => serializer.serialize_str("inside"),
        }
    }
}

/// Sets the color bar's tick label font
#[derive(Default, Serialize)]
pub struct Tickfont<'a> {
    #[serde(rename = "family")]
    #[serde(skip_serializing_if = "Option::is_none")]
    family: Option<&'a str>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Tickfont<'a> {
    /// HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.
    ///
    pub fn family(&mut self, family: &'a str) -> &mut Self {
        self.family = Some(family);
        self
    }
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        self
    }
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
pub enum Showtickprefix {
    All,
    First,
    Last,
    None,
}
impl serde::Serialize for Showtickprefix {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::All => serializer.serialize_str("all"),
            Self::First => serializer.serialize_str("first"),
            Self::Last => serializer.serialize_str("last"),
            Self::None => serializer.serialize_str("none"),
        }
    }
}
pub enum Showticksuffix {
    All,
    First,
    Last,
    None,
}
impl serde::Serialize for Showticksuffix {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::All => serializer.serialize_str("all"),
            Self::First => serializer.serialize_str("first"),
            Self::Last => serializer.serialize_str("last"),
            Self::None => serializer.serialize_str("none"),
        }
    }
}
pub enum Exponentformat {
    None,
    SmallE,
    BigE,
    Power,
    Si,
    B,
}
impl serde::Serialize for Exponentformat {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::None => serializer.serialize_str("none"),
            Self::SmallE => serializer.serialize_str("e"),
            Self::BigE => serializer.serialize_str("E"),
            Self::Power => serializer.serialize_str("power"),
            Self::Si => serializer.serialize_str("SI"),
            Self::B => serializer.serialize_str("B"),
        }
    }
}
pub enum Showexponent {
    All,
    First,
    Last,
    None,
}
impl serde::Serialize for Showexponent {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::All => serializer.serialize_str("all"),
            Self::First => serializer.serialize_str("first"),
            Self::Last => serializer.serialize_str("last"),
            Self::None => serializer.serialize_str("none"),
        }
    }
}

#[derive(Default, Serialize)]
pub struct Title<'a> {
    #[serde(rename = "text")]
    #[serde(skip_serializing_if = "Option::is_none")]
    text: Option<&'a str>,
    #[serde(rename = "font")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    font: crate::IsEmpty<title::Font<'a>>,
    #[serde(rename = "side")]
    #[serde(skip_serializing_if = "Option::is_none")]
    side: Option<title::Side>,
}

impl<'a> Title<'a> {
    /// Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated.
    ///
    pub fn text(&mut self, text: &'a str) -> &mut Self {
        self.text = Some(text);
        self
    }
    /// Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute.
    ///
    pub fn font(&mut self) -> &mut title::Font<'a> {
        self.font.is_empty = false;
        &mut self.font.data
    }
    /// Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute.
    ///
    /// default: `top`
    pub fn side(&mut self, side: title::Side) -> &mut Self {
        self.side = Some(side);
        self
    }
}
pub mod title {
#[allow(unused_imports)]
use serde::Serialize;

/// Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute.
#[derive(Default, Serialize)]
pub struct Font<'a> {
    #[serde(rename = "family")]
    #[serde(skip_serializing_if = "Option::is_none")]
    family: Option<&'a str>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Font<'a> {
    /// HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.
    ///
    pub fn family(&mut self, family: &'a str) -> &mut Self {
        self.family = Some(family);
        self
    }
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        self
    }
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
pub enum Side {
    Right,
    Top,
    Bottom,
}
impl serde::Serialize for Side {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Right => serializer.serialize_str("right"),
            Self::Top => serializer.serialize_str("top"),
            Self::Bottom => serializer.serialize_str("bottom"),
        }
    }
}
}
}
}

#[derive(Default, Serialize)]
pub struct Selected<'a> {
    #[serde(rename = "marker")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    marker: crate::IsEmpty<selected::Marker<'a>>,
    #[serde(rename = "textfont")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    textfont: crate::IsEmpty<selected::Textfont<'a>>,
}

impl<'a> Selected<'a> {
    pub fn marker(&mut self) -> &mut selected::Marker<'a> {
        self.marker.is_empty = false;
        &mut self.marker.data
    }
    pub fn textfont(&mut self) -> &mut selected::Textfont<'a> {
        self.textfont.is_empty = false;
        &mut self.textfont.data
    }
}
pub mod selected {
#[allow(unused_imports)]
use serde::Serialize;

#[derive(Default, Serialize)]
pub struct Marker<'a> {
    #[serde(rename = "opacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    opacity: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Marker<'a> {
    /// Sets the marker opacity of selected points.
    ///
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
    /// Sets the marker color of selected points.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Textfont<'a> {
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Textfont<'a> {
    /// Sets the text font color of selected points.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
}

#[derive(Default, Serialize)]
pub struct Unselected<'a> {
    #[serde(rename = "marker")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    marker: crate::IsEmpty<unselected::Marker<'a>>,
    #[serde(rename = "textfont")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    textfont: crate::IsEmpty<unselected::Textfont<'a>>,
}

impl<'a> Unselected<'a> {
    pub fn marker(&mut self) -> &mut unselected::Marker<'a> {
        self.marker.is_empty = false;
        &mut self.marker.data
    }
    pub fn textfont(&mut self) -> &mut unselected::Textfont<'a> {
        self.textfont.is_empty = false;
        &mut self.textfont.data
    }
}
pub mod unselected {
#[allow(unused_imports)]
use serde::Serialize;

#[derive(Default, Serialize)]
pub struct Marker<'a> {
    #[serde(rename = "opacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    opacity: Option<f64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Marker<'a> {
    /// Sets the marker opacity of unselected points, applied only when a selection exists.
    ///
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
    /// Sets the marker color of unselected points, applied only when a selection exists.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Textfont<'a> {
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Textfont<'a> {
    /// Sets the text font color of unselected points, applied only when a selection exists.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
}

#[derive(Default, Serialize)]
pub struct ErrorX<'a> {
    #[serde(rename = "visible")]
    #[serde(skip_serializing_if = "Option::is_none")]
    visible: Option<bool>,
    #[serde(rename = "symmetric")]
    #[serde(skip_serializing_if = "Option::is_none")]
    symmetric: Option<bool>,
    #[serde(rename = "array")]
    #[serde(skip_serializing_if = "Option::is_none")]
    array: Option<&'a [f64]>,
    #[serde(rename = "arrayminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    arrayminus: Option<&'a [f64]>,
    #[serde(rename = "value")]
    #[serde(skip_serializing_if = "Option::is_none")]
    value: Option<f64>,
    #[serde(rename = "valueminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    valueminus: Option<f64>,
    #[serde(rename = "traceref")]
    #[serde(skip_serializing_if = "Option::is_none")]
    traceref: Option<u64>,
    #[serde(rename = "tracerefminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tracerefminus: Option<u64>,
    #[serde(rename = "copy_ystyle")]
    #[serde(skip_serializing_if = "Option::is_none")]
    copy_ystyle: Option<bool>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "thickness")]
    #[serde(skip_serializing_if = "Option::is_none")]
    thickness: Option<f64>,
    #[serde(rename = "width")]
    #[serde(skip_serializing_if = "Option::is_none")]
    width: Option<f64>,
}

impl<'a> ErrorX<'a> {
    /// Determines whether or not this set of error bars is visible.
    ///
    pub fn visible(&mut self, visible: bool) -> &mut Self {
        self.visible = Some(visible);
        self
    }
    /// Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.
    ///
    pub fn symmetric(&mut self, symmetric: bool) -> &mut Self {
        self.symmetric = Some(symmetric);
        self
    }
    /// Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.
    ///
    pub fn array(&mut self, array: &'a [f64]) -> &mut Self {
        self.array = Some(array);
        self
    }
    /// Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.
    ///
    pub fn arrayminus(&mut self, arrayminus: &'a [f64]) -> &mut Self {
        self.arrayminus = Some(arrayminus);
        self
    }
    /// Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.
    ///
    /// default: `10`
    pub fn value(&mut self, value: f64) -> &mut Self {
        self.value = Some(value);
        self
    }
    /// Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars
    ///
    /// default: `10`
    pub fn valueminus(&mut self, valueminus: f64) -> &mut Self {
        self.valueminus = Some(valueminus);
        self
    }
    /// default: `0`
    pub fn traceref(&mut self, traceref: u64) -> &mut Self {
        self.traceref = Some(traceref);
        self
    }
    /// default: `0`
    pub fn tracerefminus(&mut self, tracerefminus: u64) -> &mut Self {
        self.tracerefminus = Some(tracerefminus);
        self
    }
    pub fn copy_ystyle(&mut self, copy_ystyle: bool) -> &mut Self {
        self.copy_ystyle = Some(copy_ystyle);
        self
    }
    /// Sets the stoke color of the error bars.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Sets the thickness (in px) of the error bars.
    ///
    /// default: `2`
    pub fn thickness(&mut self, thickness: f64) -> &mut Self {
        self.thickness = Some(thickness);
        self
    }
    /// Sets the width (in px) of the cross-bar at both ends of the error bars.
    ///
    pub fn width(&mut self, width: f64) -> &mut Self {
        self.width = Some(width);
        self
    }
}

#[derive(Default, Serialize)]
pub struct ErrorY<'a> {
    #[serde(rename = "visible")]
    #[serde(skip_serializing_if = "Option::is_none")]
    visible: Option<bool>,
    #[serde(rename = "symmetric")]
    #[serde(skip_serializing_if = "Option::is_none")]
    symmetric: Option<bool>,
    #[serde(rename = "array")]
    #[serde(skip_serializing_if = "Option::is_none")]
    array: Option<&'a [f64]>,
    #[serde(rename = "arrayminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    arrayminus: Option<&'a [f64]>,
    #[serde(rename = "value")]
    #[serde(skip_serializing_if = "Option::is_none")]
    value: Option<f64>,
    #[serde(rename = "valueminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    valueminus: Option<f64>,
    #[serde(rename = "traceref")]
    #[serde(skip_serializing_if = "Option::is_none")]
    traceref: Option<u64>,
    #[serde(rename = "tracerefminus")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tracerefminus: Option<u64>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "thickness")]
    #[serde(skip_serializing_if = "Option::is_none")]
    thickness: Option<f64>,
    #[serde(rename = "width")]
    #[serde(skip_serializing_if = "Option::is_none")]
    width: Option<f64>,
}

impl<'a> ErrorY<'a> {
    /// Determines whether or not this set of error bars is visible.
    ///
    pub fn visible(&mut self, visible: bool) -> &mut Self {
        self.visible = Some(visible);
        self
    }
    /// Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.
    ///
    pub fn symmetric(&mut self, symmetric: bool) -> &mut Self {
        self.symmetric = Some(symmetric);
        self
    }
    /// Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.
    ///
    pub fn array(&mut self, array: &'a [f64]) -> &mut Self {
        self.array = Some(array);
        self
    }
    /// Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.
    ///
    pub fn arrayminus(&mut self, arrayminus: &'a [f64]) -> &mut Self {
        self.arrayminus = Some(arrayminus);
        self
    }
    /// Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.
    ///
    /// default: `10`
    pub fn value(&mut self, value: f64) -> &mut Self {
        self.value = Some(value);
        self
    }
    /// Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars
    ///
    /// default: `10`
    pub fn valueminus(&mut self, valueminus: f64) -> &mut Self {
        self.valueminus = Some(valueminus);
        self
    }
    /// default: `0`
    pub fn traceref(&mut self, traceref: u64) -> &mut Self {
        self.traceref = Some(traceref);
        self
    }
    /// default: `0`
    pub fn tracerefminus(&mut self, tracerefminus: u64) -> &mut Self {
        self.tracerefminus = Some(tracerefminus);
        self
    }
    /// Sets the stoke color of the error bars.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Sets the thickness (in px) of the error bars.
    ///
    /// default: `2`
    pub fn thickness(&mut self, thickness: f64) -> &mut Self {
        self.thickness = Some(thickness);
        self
    }
    /// Sets the width (in px) of the cross-bar at both ends of the error bars.
    ///
    pub fn width(&mut self, width: f64) -> &mut Self {
        self.width = Some(width);
        self
    }
}
pub enum Xcalendar {
    Gregorian,
    Chinese,
    Coptic,
    Discworld,
    Ethiopian,
    Hebrew,
    Islamic,
    Julian,
    Mayan,
    Nanakshahi,
    Nepali,
    Persian,
    Jalali,
    Taiwan,
    Thai,
    Ummalqura,
}
impl serde::Serialize for Xcalendar {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Gregorian => serializer.serialize_str("gregorian"),
            Self::Chinese => serializer.serialize_str("chinese"),
            Self::Coptic => serializer.serialize_str("coptic"),
            Self::Discworld => serializer.serialize_str("discworld"),
            Self::Ethiopian => serializer.serialize_str("ethiopian"),
            Self::Hebrew => serializer.serialize_str("hebrew"),
            Self::Islamic => serializer.serialize_str("islamic"),
            Self::Julian => serializer.serialize_str("julian"),
            Self::Mayan => serializer.serialize_str("mayan"),
            Self::Nanakshahi => serializer.serialize_str("nanakshahi"),
            Self::Nepali => serializer.serialize_str("nepali"),
            Self::Persian => serializer.serialize_str("persian"),
            Self::Jalali => serializer.serialize_str("jalali"),
            Self::Taiwan => serializer.serialize_str("taiwan"),
            Self::Thai => serializer.serialize_str("thai"),
            Self::Ummalqura => serializer.serialize_str("ummalqura"),
        }
    }
}
pub enum Ycalendar {
    Gregorian,
    Chinese,
    Coptic,
    Discworld,
    Ethiopian,
    Hebrew,
    Islamic,
    Julian,
    Mayan,
    Nanakshahi,
    Nepali,
    Persian,
    Jalali,
    Taiwan,
    Thai,
    Ummalqura,
}
impl serde::Serialize for Ycalendar {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Gregorian => serializer.serialize_str("gregorian"),
            Self::Chinese => serializer.serialize_str("chinese"),
            Self::Coptic => serializer.serialize_str("coptic"),
            Self::Discworld => serializer.serialize_str("discworld"),
            Self::Ethiopian => serializer.serialize_str("ethiopian"),
            Self::Hebrew => serializer.serialize_str("hebrew"),
            Self::Islamic => serializer.serialize_str("islamic"),
            Self::Julian => serializer.serialize_str("julian"),
            Self::Mayan => serializer.serialize_str("mayan"),
            Self::Nanakshahi => serializer.serialize_str("nanakshahi"),
            Self::Nepali => serializer.serialize_str("nepali"),
            Self::Persian => serializer.serialize_str("persian"),
            Self::Jalali => serializer.serialize_str("jalali"),
            Self::Taiwan => serializer.serialize_str("taiwan"),
            Self::Thai => serializer.serialize_str("thai"),
            Self::Ummalqura => serializer.serialize_str("ummalqura"),
        }
    }
}