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
#[allow(unused_imports)]
use serde::Serialize;

/// Draws sets of triangles with coordinates given by three 1-dimensional arrays in `x`, `y`, `z` and (1) a sets of `i`, `j`, `k` indices (2) Delaunay triangulation or (3) the Alpha-shape algorithm or (4) the Convex-hull algorithm
#[derive(Default, Serialize)]
pub struct Mesh3D<'a> {
    #[serde(rename = "visible")]
    #[serde(skip_serializing_if = "Option::is_none")]
    visible: Option<Visible>,
    #[serde(rename = "legendgroup")]
    #[serde(skip_serializing_if = "Option::is_none")]
    legendgroup: Option<&'a str>,
    #[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 = "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 = "z")]
    #[serde(skip_serializing_if = "Option::is_none")]
    z: Option<&'a [f64]>,
    #[serde(rename = "i")]
    #[serde(skip_serializing_if = "Option::is_none")]
    i: Option<&'a [f64]>,
    #[serde(rename = "j")]
    #[serde(skip_serializing_if = "Option::is_none")]
    j: Option<&'a [f64]>,
    #[serde(rename = "k")]
    #[serde(skip_serializing_if = "Option::is_none")]
    k: 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 = "hovertemplate")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertemplate: Option<&'a str>,
    #[serde(rename = "delaunayaxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    delaunayaxis: Option<Delaunayaxis>,
    #[serde(rename = "alphahull")]
    #[serde(skip_serializing_if = "Option::is_none")]
    alphahull: Option<f64>,
    #[serde(rename = "intensity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    intensity: Option<&'a [f64]>,
    #[serde(rename = "intensitymode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    intensitymode: Option<Intensitymode>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "vertexcolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    vertexcolor: Option<&'a [f64]>,
    #[serde(rename = "facecolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    facecolor: Option<&'a [f64]>,
    #[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<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>,
    #[serde(rename = "flatshading")]
    #[serde(skip_serializing_if = "Option::is_none")]
    flatshading: Option<bool>,
    #[serde(rename = "contour")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    contour: crate::IsEmpty<Contour<'a>>,
    #[serde(rename = "lightposition")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    lightposition: crate::IsEmpty<Lightposition<>>,
    #[serde(rename = "lighting")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    lighting: crate::IsEmpty<Lighting<>>,
    #[serde(rename = "hoverinfo")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    hoverinfo: crate::IsEmpty<Hoverinfo>,
    #[serde(rename = "showlegend")]
    #[serde(skip_serializing_if = "Option::is_none")]
    showlegend: Option<bool>,
    #[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 = "zcalendar")]
    #[serde(skip_serializing_if = "Option::is_none")]
    zcalendar: Option<Zcalendar>,
    #[serde(rename = "scene")]
    #[serde(skip_serializing_if = "Option::is_none")]
    scene: 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 = "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 = "zsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    zsrc: Option<&'a str>,
    #[serde(rename = "isrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    isrc: Option<&'a str>,
    #[serde(rename = "jsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    jsrc: Option<&'a str>,
    #[serde(rename = "ksrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ksrc: 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>,
    #[serde(rename = "intensitysrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    intensitysrc: Option<&'a str>,
    #[serde(rename = "vertexcolorsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    vertexcolorsrc: Option<&'a str>,
    #[serde(rename = "facecolorsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    facecolorsrc: Option<&'a str>,
    #[serde(rename = "hoverinfosrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hoverinfosrc: Option<&'a str>,
}

impl<'a> Mesh3D<'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
    }
    /// 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 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
    }
    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 X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.
    ///
    pub fn x(&mut self, x: &'a [f64]) -> &mut Self {
        self.x = Some(x);
        self
    }
    /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.
    ///
    pub fn y(&mut self, y: &'a [f64]) -> &mut Self {
        self.y = Some(y);
        self
    }
    /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.
    ///
    pub fn z(&mut self, z: &'a [f64]) -> &mut Self {
        self.z = Some(z);
        self
    }
    /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *first* vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle.
    ///
    pub fn i(&mut self, i: &'a [f64]) -> &mut Self {
        self.i = Some(i);
        self
    }
    /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *second* vertex of a triangle. For example, `{i[m], j[m], k[m]}`  together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle.
    ///
    pub fn j(&mut self, j: &'a [f64]) -> &mut Self {
        self.j = Some(j);
        self
    }
    /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *third* vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet  `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle.
    ///
    pub fn k(&mut self, k: &'a [f64]) -> &mut Self {
        self.k = Some(k);
        self
    }
    /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.
    ///
    /// 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
    }
    /// 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.  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
    }
    /// Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the Delaunay triangulation. It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate Delaunay triangulation.
    ///
    /// default: `z`
    pub fn delaunayaxis(&mut self, delaunayaxis: Delaunayaxis) -> &mut Self {
        self.delaunayaxis = Some(delaunayaxis);
        self
    }
    /// Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. For general use of `mesh3d` it is preferred that `i`, `j`, `k` are supplied. If *-1*, Delaunay triangulation is used, which is mainly suitable if the mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`. In case the `delaunayaxis` intersects the mesh surface at more than one point it will result triangles that are very long in the dimension of `delaunayaxis`. If *>0*, the alpha-shape algorithm is used. In this case, the positive `alphahull` value signals the use of the alpha-shape algorithm, _and_ its value acts as the parameter for the mesh fitting. If *0*,  the convex-hull algorithm is used. It is suitable for convex bodies or if the intention is to enclose the `x`, `y` and `z` point set into a convex hull.
    ///
    /// default: `-1`
    pub fn alphahull(&mut self, alphahull: f64) -> &mut Self {
        self.alphahull = Some(alphahull);
        self
    }
    /// Sets the intensity values for vertices or cells as defined by `intensitymode`. It can be used for plotting fields on meshes.
    ///
    pub fn intensity(&mut self, intensity: &'a [f64]) -> &mut Self {
        self.intensity = Some(intensity);
        self
    }
    /// Determines the source of `intensity` values.
    ///
    /// default: `vertex`
    pub fn intensitymode(&mut self, intensitymode: Intensitymode) -> &mut Self {
        self.intensitymode = Some(intensitymode);
        self
    }
    /// Sets the color of the whole mesh
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Sets the color of each vertex Overrides *color*. While Red, green and blue colors are in the range of 0 and 255; in the case of having vertex color data in RGBA format, the alpha color should be normalized to be between 0 and 1.
    ///
    pub fn vertexcolor(&mut self, vertexcolor: &'a [f64]) -> &mut Self {
        self.vertexcolor = Some(vertexcolor);
        self
    }
    /// Sets the color of each face Overrides *color* and *vertexcolor*.
    ///
    pub fn facecolor(&mut self, facecolor: &'a [f64]) -> &mut Self {
        self.facecolor = Some(facecolor);
        self
    }
    /// Determines whether or not the color domain is computed with respect to the input data (here `intensity`) or the bounds set in `cmin` and `cmax`  Defaults to `false` when `cmin` and `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. Value should have the same units as `intensity` and if set, `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. Value should have the same units as `intensity` and if set, `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 `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as `intensity`. Has no effect when `cauto` is `false`.
    ///
    /// default: `null`
    pub fn cmid(&mut self, cmid: f64) -> &mut Self {
        self.cmid = Some(cmid);
        self
    }
    /// Sets the colorscale. 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`cmin` and `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 `colorscale`. 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. If true, `cmin` will correspond to the last color in the array and `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.
    ///
    /// default: `true`
    pub fn showscale(&mut self, showscale: bool) -> &mut Self {
        self.showscale = Some(showscale);
        self
    }
    pub fn colorbar(&mut self) -> &mut 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 surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change.
    ///
    /// default: `1`
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
    /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections.
    ///
    /// default: `false`
    pub fn flatshading(&mut self, flatshading: bool) -> &mut Self {
        self.flatshading = Some(flatshading);
        self
    }
    pub fn contour(&mut self) -> &mut Contour<'a> {
        self.contour.is_empty = false;
        &mut self.contour.data
    }
    pub fn lightposition(&mut self) -> &mut Lightposition<> {
        self.lightposition.is_empty = false;
        &mut self.lightposition.data
    }
    pub fn lighting(&mut self) -> &mut Lighting<> {
        self.lighting.is_empty = false;
        &mut self.lighting.data
    }
    /// 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
    }
    /// Determines whether or not an item corresponding to this trace is shown in the legend.
    ///
    /// default: `false`
    pub fn showlegend(&mut self, showlegend: bool) -> &mut Self {
        self.showlegend = Some(showlegend);
        self
    }
    /// 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 the calendar system to use with `z` date data.
    ///
    /// default: `gregorian`
    pub fn zcalendar(&mut self, zcalendar: Zcalendar) -> &mut Self {
        self.zcalendar = Some(zcalendar);
        self
    }
    /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If *scene* (the default value), the (x,y,z) coordinates refer to `layout.scene`. If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`, and so on.
    ///
    /// default: `scene`
    pub fn scene(&mut self, scene: &'a str) -> &mut Self {
        self.scene = Some(scene);
        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  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  z .
    ///
    pub fn zsrc(&mut self, zsrc: &'a str) -> &mut Self {
        self.zsrc = Some(zsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  i .
    ///
    pub fn isrc(&mut self, isrc: &'a str) -> &mut Self {
        self.isrc = Some(isrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  j .
    ///
    pub fn jsrc(&mut self, jsrc: &'a str) -> &mut Self {
        self.jsrc = Some(jsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  k .
    ///
    pub fn ksrc(&mut self, ksrc: &'a str) -> &mut Self {
        self.ksrc = Some(ksrc);
        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
    }
    /// Sets the source reference on Chart Studio Cloud for  intensity .
    ///
    pub fn intensitysrc(&mut self, intensitysrc: &'a str) -> &mut Self {
        self.intensitysrc = Some(intensitysrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  vertexcolor .
    ///
    pub fn vertexcolorsrc(&mut self, vertexcolorsrc: &'a str) -> &mut Self {
        self.vertexcolorsrc = Some(vertexcolorsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  facecolor .
    ///
    pub fn facecolorsrc(&mut self, facecolorsrc: &'a str) -> &mut Self {
        self.facecolorsrc = Some(facecolorsrc);
        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
    }
}
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, 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 Delaunayaxis {
    X,
    Y,
    Z,
}
impl serde::Serialize for Delaunayaxis {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::X => serializer.serialize_str("x"),
            Self::Y => serializer.serialize_str("y"),
            Self::Z => serializer.serialize_str("z"),
        }
    }
}
pub enum Intensitymode {
    Vertex,
    Cell,
}
impl serde::Serialize for Intensitymode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Vertex => serializer.serialize_str("vertex"),
            Self::Cell => serializer.serialize_str("cell"),
        }
    }
}

#[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 Contour<'a> {
    #[serde(rename = "show")]
    #[serde(skip_serializing_if = "Option::is_none")]
    show: Option<bool>,
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
    #[serde(rename = "width")]
    #[serde(skip_serializing_if = "Option::is_none")]
    width: Option<f64>,
}

impl<'a> Contour<'a> {
    /// Sets whether or not dynamic contours are shown on hover
    ///
    /// default: `false`
    pub fn show(&mut self, show: bool) -> &mut Self {
        self.show = Some(show);
        self
    }
    /// Sets the color of the contour lines.
    ///
    /// default: `#444`
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Sets the width of the contour lines.
    ///
    /// default: `2`
    pub fn width(&mut self, width: f64) -> &mut Self {
        self.width = Some(width);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Lightposition<> {
    #[serde(rename = "x")]
    #[serde(skip_serializing_if = "Option::is_none")]
    x: Option<f64>,
    #[serde(rename = "y")]
    #[serde(skip_serializing_if = "Option::is_none")]
    y: Option<f64>,
    #[serde(rename = "z")]
    #[serde(skip_serializing_if = "Option::is_none")]
    z: Option<f64>,
}

impl<> Lightposition<> {
    /// Numeric vector, representing the X coordinate for each vertex.
    ///
    /// default: `100000`
    pub fn x(&mut self, x: f64) -> &mut Self {
        self.x = Some(x);
        self
    }
    /// Numeric vector, representing the Y coordinate for each vertex.
    ///
    /// default: `100000`
    pub fn y(&mut self, y: f64) -> &mut Self {
        self.y = Some(y);
        self
    }
    /// Numeric vector, representing the Z coordinate for each vertex.
    ///
    /// default: `0`
    pub fn z(&mut self, z: f64) -> &mut Self {
        self.z = Some(z);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Lighting<> {
    #[serde(rename = "vertexnormalsepsilon")]
    #[serde(skip_serializing_if = "Option::is_none")]
    vertexnormalsepsilon: Option<f64>,
    #[serde(rename = "facenormalsepsilon")]
    #[serde(skip_serializing_if = "Option::is_none")]
    facenormalsepsilon: Option<f64>,
    #[serde(rename = "ambient")]
    #[serde(skip_serializing_if = "Option::is_none")]
    ambient: Option<f64>,
    #[serde(rename = "diffuse")]
    #[serde(skip_serializing_if = "Option::is_none")]
    diffuse: Option<f64>,
    #[serde(rename = "specular")]
    #[serde(skip_serializing_if = "Option::is_none")]
    specular: Option<f64>,
    #[serde(rename = "roughness")]
    #[serde(skip_serializing_if = "Option::is_none")]
    roughness: Option<f64>,
    #[serde(rename = "fresnel")]
    #[serde(skip_serializing_if = "Option::is_none")]
    fresnel: Option<f64>,
}

impl<> Lighting<> {
    /// Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.
    ///
    /// default: `0.000000000001`
    pub fn vertexnormalsepsilon(&mut self, vertexnormalsepsilon: f64) -> &mut Self {
        self.vertexnormalsepsilon = Some(vertexnormalsepsilon);
        self
    }
    /// Epsilon for face normals calculation avoids math issues arising from degenerate geometry.
    ///
    /// default: `0.000001`
    pub fn facenormalsepsilon(&mut self, facenormalsepsilon: f64) -> &mut Self {
        self.facenormalsepsilon = Some(facenormalsepsilon);
        self
    }
    /// Ambient light increases overall color visibility but can wash out the image.
    ///
    /// default: `0.8`
    pub fn ambient(&mut self, ambient: f64) -> &mut Self {
        self.ambient = Some(ambient);
        self
    }
    /// Represents the extent that incident rays are reflected in a range of angles.
    ///
    /// default: `0.8`
    pub fn diffuse(&mut self, diffuse: f64) -> &mut Self {
        self.diffuse = Some(diffuse);
        self
    }
    /// Represents the level that incident rays are reflected in a single direction, causing shine.
    ///
    /// default: `0.05`
    pub fn specular(&mut self, specular: f64) -> &mut Self {
        self.specular = Some(specular);
        self
    }
    /// Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.
    ///
    /// default: `0.5`
    pub fn roughness(&mut self, roughness: f64) -> &mut Self {
        self.roughness = Some(roughness);
        self
    }
    /// Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine.
    ///
    /// default: `0.2`
    pub fn fresnel(&mut self, fresnel: f64) -> &mut Self {
        self.fresnel = Some(fresnel);
        self
    }
}
#[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;
    }
}
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"),
        }
    }
}
pub enum Zcalendar {
    Gregorian,
    Chinese,
    Coptic,
    Discworld,
    Ethiopian,
    Hebrew,
    Islamic,
    Julian,
    Mayan,
    Nanakshahi,
    Nepali,
    Persian,
    Jalali,
    Taiwan,
    Thai,
    Ummalqura,
}
impl serde::Serialize for Zcalendar {
    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"),
        }
    }
}