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
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
#[allow(unused_imports)]
use serde::Serialize;

/// The data visualized as scatter point or lines on a geographic map is provided either by longitude/latitude pairs in `lon` and `lat` respectively or by geographic location IDs or names in `locations`.
#[derive(Default, Serialize)]
pub struct Scattergeo<'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 = "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 = "lon")]
    #[serde(skip_serializing_if = "Option::is_none")]
    lon: Option<&'a [f64]>,
    #[serde(rename = "lat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    lat: Option<&'a [f64]>,
    #[serde(rename = "locations")]
    #[serde(skip_serializing_if = "Option::is_none")]
    locations: Option<&'a [f64]>,
    #[serde(rename = "locationmode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    locationmode: Option<Locationmode>,
    #[serde(rename = "geojson")]
    #[serde(skip_serializing_if = "Option::is_none")]
    geojson: Option<crate::Any>,
    #[serde(rename = "featureidkey")]
    #[serde(skip_serializing_if = "Option::is_none")]
    featureidkey: Option<&'a str>,
    #[serde(rename = "mode")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    mode: crate::IsEmpty<Mode>,
    #[serde(rename = "text")]
    #[serde(skip_serializing_if = "Option::is_none")]
    text: Option<&'a str>,
    #[serde(rename = "texttemplate")]
    #[serde(skip_serializing_if = "Option::is_none")]
    texttemplate: Option<&'a str>,
    #[serde(rename = "hovertext")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertext: Option<&'a str>,
    #[serde(rename = "textfont")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    textfont: crate::IsEmpty<Textfont<'a>>,
    #[serde(rename = "textposition")]
    #[serde(skip_serializing_if = "Option::is_none")]
    textposition: Option<Textposition>,
    #[serde(rename = "line")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    line: crate::IsEmpty<Line<'a>>,
    #[serde(rename = "connectgaps")]
    #[serde(skip_serializing_if = "Option::is_none")]
    connectgaps: Option<bool>,
    #[serde(rename = "marker")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    marker: crate::IsEmpty<Marker<'a>>,
    #[serde(rename = "fill")]
    #[serde(skip_serializing_if = "Option::is_none")]
    fill: Option<Fill>,
    #[serde(rename = "fillcolor")]
    #[serde(skip_serializing_if = "Option::is_none")]
    fillcolor: 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 = "hoverinfo")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    hoverinfo: crate::IsEmpty<Hoverinfo>,
    #[serde(rename = "hovertemplate")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertemplate: Option<&'a str>,
    #[serde(rename = "geo")]
    #[serde(skip_serializing_if = "Option::is_none")]
    geo: 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 = "lonsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    lonsrc: Option<&'a str>,
    #[serde(rename = "latsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    latsrc: Option<&'a str>,
    #[serde(rename = "locationssrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    locationssrc: Option<&'a str>,
    #[serde(rename = "textsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    textsrc: Option<&'a str>,
    #[serde(rename = "texttemplatesrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    texttemplatesrc: Option<&'a str>,
    #[serde(rename = "hovertextsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertextsrc: Option<&'a str>,
    #[serde(rename = "textpositionsrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    textpositionsrc: Option<&'a str>,
    #[serde(rename = "hoverinfosrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hoverinfosrc: Option<&'a str>,
    #[serde(rename = "hovertemplatesrc")]
    #[serde(skip_serializing_if = "Option::is_none")]
    hovertemplatesrc: Option<&'a str>,
}

impl<'a> Scattergeo<'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
    }
    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 longitude coordinates (in degrees East).
    ///
    pub fn lon(&mut self, lon: &'a [f64]) -> &mut Self {
        self.lon = Some(lon);
        self
    }
    /// Sets the latitude coordinates (in degrees North).
    ///
    pub fn lat(&mut self, lat: &'a [f64]) -> &mut Self {
        self.lat = Some(lat);
        self
    }
    /// Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info.
    ///
    pub fn locations(&mut self, locations: &'a [f64]) -> &mut Self {
        self.locations = Some(locations);
        self
    }
    /// Determines the set of locations used to match entries in `locations` to regions on the map. Values *ISO-3*, *USA-states*, *country names* correspond to features on the base map and value *geojson-id* corresponds to features from a custom GeoJSON linked to the `geojson` attribute.
    ///
    /// default: `ISO-3`
    pub fn locationmode(&mut self, locationmode: Locationmode) -> &mut Self {
        self.locationmode = Some(locationmode);
        self
    }
    /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type *FeatureCollection* or *Feature* with geometries of type *Polygon* or *MultiPolygon*.
    ///
    pub fn geojson(&mut self, geojson: crate::Any) -> &mut Self {
        self.geojson = Some(geojson);
        self
    }
    /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example *properties.name*.
    ///
    /// default: `id`
    pub fn featureidkey(&mut self, featureidkey: &'a str) -> &mut Self {
        self.featureidkey = Some(featureidkey);
        self
    }
    /// Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is *lines+markers*. Otherwise, *lines*.
    ///
    /// default: `markers`
    pub fn mode(&mut self) -> &mut Mode {
        self.mode.is_empty = false;
        &mut self.mode.data
    }
    /// Sets text elements associated with each (lon,lat) pair or item in `locations`. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) or `locations` coordinates. 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
    }
    /// Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. 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. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `lat`, `lon`, `location` and `text`.
    ///
    /// default: ``
    pub fn texttemplate(&mut self, texttemplate: &'a str) -> &mut Self {
        self.texttemplate = Some(texttemplate);
        self
    }
    /// Sets hover text elements associated with each (lon,lat) pair or item in `locations`. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) or `locations` coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.
    ///
    /// default: ``
    pub fn hovertext(&mut self, hovertext: &'a str) -> &mut Self {
        self.hovertext = Some(hovertext);
        self
    }
    /// Sets the text font.
    ///
    pub fn textfont(&mut self) -> &mut Textfont<'a> {
        self.textfont.is_empty = false;
        &mut self.textfont.data
    }
    /// Sets the positions of the `text` elements with respects to the (x,y) coordinates.
    ///
    /// default: `middle center`
    pub fn textposition(&mut self, textposition: Textposition) -> &mut Self {
        self.textposition = Some(textposition);
        self
    }
    pub fn line(&mut self) -> &mut Line<'a> {
        self.line.is_empty = false;
        &mut self.line.data
    }
    /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.
    ///
    /// default: `false`
    pub fn connectgaps(&mut self, connectgaps: bool) -> &mut Self {
        self.connectgaps = Some(connectgaps);
        self
    }
    pub fn marker(&mut self) -> &mut Marker<'a> {
        self.marker.is_empty = false;
        &mut self.marker.data
    }
    /// Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape.
    ///
    /// default: `none`
    pub fn fill(&mut self, fill: Fill) -> &mut Self {
        self.fill = Some(fill);
        self
    }
    /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
    ///
    pub fn fillcolor(&mut self, fillcolor: &'a str) -> &mut Self {
        self.fillcolor = Some(fillcolor);
        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
    }
    /// 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
    }
    /// 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 a reference between this trace's geospatial coordinates and a geographic map. If *geo* (the default value), the geospatial coordinates refer to `layout.geo`. If *geo2*, the geospatial coordinates refer to `layout.geo2`, and so on.
    ///
    /// default: `geo`
    pub fn geo(&mut self, geo: &'a str) -> &mut Self {
        self.geo = Some(geo);
        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  lon .
    ///
    pub fn lonsrc(&mut self, lonsrc: &'a str) -> &mut Self {
        self.lonsrc = Some(lonsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  lat .
    ///
    pub fn latsrc(&mut self, latsrc: &'a str) -> &mut Self {
        self.latsrc = Some(latsrc);
        self
    }
    /// Sets the source reference on Chart Studio Cloud for  locations .
    ///
    pub fn locationssrc(&mut self, locationssrc: &'a str) -> &mut Self {
        self.locationssrc = Some(locationssrc);
        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  texttemplate .
    ///
    pub fn texttemplatesrc(&mut self, texttemplatesrc: &'a str) -> &mut Self {
        self.texttemplatesrc = Some(texttemplatesrc);
        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  textposition .
    ///
    pub fn textpositionsrc(&mut self, textpositionsrc: &'a str) -> &mut Self {
        self.textpositionsrc = Some(textpositionsrc);
        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  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, 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 Locationmode {
    Iso3,
    UsaStates,
    CountryNames,
    GeojsonId,
}
impl serde::Serialize for Locationmode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Iso3 => serializer.serialize_str("ISO-3"),
            Self::UsaStates => serializer.serialize_str("USA-states"),
            Self::CountryNames => serializer.serialize_str("country names"),
            Self::GeojsonId => serializer.serialize_str("geojson-id"),
        }
    }
}
#[derive(Default)]
pub struct ModeFlags ([u8; 1]);
impl ModeFlags {
    pub fn lines(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 0; }
        else { self.0[0] &= !(1 << 0); }
        self
    }
    pub fn markers(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 1; }
        else { self.0[0] &= !(1 << 1); }
        self
    }
    pub fn text(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 2; }
        else { self.0[0] &= !(1 << 2); }
        self
    }
}
impl serde::Serialize for ModeFlags {
    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("lines");
        }
        if (self.0[0] >> 1) & 0x1 == 1 {
            v.push("markers");
        }
        if (self.0[0] >> 2) & 0x1 == 1 {
            v.push("text");
        }
        serializer.serialize_str(&v.join("+"))
    }
}
pub enum Mode {
    Flags(ModeFlags),
    None,
}
impl serde::Serialize for Mode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::None => serializer.serialize_str("none"),
            Self::Flags(v) => v.serialize(serializer),
        }
    }
}
impl Default for Mode {
    fn default() -> Self {
        Self::Flags(ModeFlags::default())
    }
}
impl Mode {
    pub fn flags(&mut self) -> &mut ModeFlags {
        *self = Self::Flags(ModeFlags::default());
        match self {
            Self::Flags(v) => v,
            _ => unreachable!(),
        }
    }
    pub fn set(&mut self, v: Mode) {
        *self = v;
    }
}

/// Sets the text font.
#[derive(Default, Serialize)]
pub struct Textfont<'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> Textfont<'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 Textposition {
    TopLeft,
    TopCenter,
    TopRight,
    MiddleLeft,
    MiddleCenter,
    MiddleRight,
    BottomLeft,
    BottomCenter,
    BottomRight,
}
impl serde::Serialize for Textposition {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::TopLeft => serializer.serialize_str("top left"),
            Self::TopCenter => serializer.serialize_str("top center"),
            Self::TopRight => serializer.serialize_str("top right"),
            Self::MiddleLeft => serializer.serialize_str("middle left"),
            Self::MiddleCenter => serializer.serialize_str("middle center"),
            Self::MiddleRight => serializer.serialize_str("middle right"),
            Self::BottomLeft => serializer.serialize_str("bottom left"),
            Self::BottomCenter => serializer.serialize_str("bottom center"),
            Self::BottomRight => serializer.serialize_str("bottom right"),
        }
    }
}

#[derive(Default, Serialize)]
pub struct Line<'a> {
    #[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>,
    #[serde(rename = "dash")]
    #[serde(skip_serializing_if = "Option::is_none")]
    dash: Option<&'a str>,
}

impl<'a> Line<'a> {
    /// Sets the line color.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
    /// Sets the line width (in px).
    ///
    /// default: `2`
    pub fn width(&mut self, width: f64) -> &mut Self {
        self.width = Some(width);
        self
    }
    /// Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).
    ///
    /// default: `solid`
    pub fn dash(&mut self, dash: &'a str) -> &mut Self {
        self.dash = Some(dash);
        self
    }
}

#[derive(Default, Serialize)]
pub struct Marker<'a> {
    #[serde(rename = "symbol")]
    #[serde(skip_serializing_if = "Option::is_none")]
    symbol: Option<marker::Symbol>,
    #[serde(rename = "opacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    opacity: Option<f64>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
    #[serde(rename = "sizeref")]
    #[serde(skip_serializing_if = "Option::is_none")]
    sizeref: Option<f64>,
    #[serde(rename = "sizemin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    sizemin: Option<f64>,
    #[serde(rename = "sizemode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    sizemode: Option<marker::Sizemode>,
    #[serde(rename = "colorbar")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    colorbar: crate::IsEmpty<marker::Colorbar<'a>>,
    #[serde(rename = "line")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    line: crate::IsEmpty<marker::Line<'a>>,
    #[serde(rename = "gradient")]
    #[serde(skip_serializing_if = "crate::IsEmpty::is_empty")]
    gradient: crate::IsEmpty<marker::Gradient<'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 = "coloraxis")]
    #[serde(skip_serializing_if = "Option::is_none")]
    coloraxis: Option<&'a str>,
}

impl<'a> Marker<'a> {
    /// Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.
    ///
    /// default: `circle`
    pub fn symbol(&mut self, symbol: marker::Symbol) -> &mut Self {
        self.symbol = Some(symbol);
        self
    }
    /// Sets the marker opacity.
    ///
    pub fn opacity(&mut self, opacity: f64) -> &mut Self {
        self.opacity = Some(opacity);
        self
    }
    /// Sets the marker size (in px).
    ///
    /// default: `6`
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        self
    }
    /// Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.
    ///
    /// default: `1`
    pub fn sizeref(&mut self, sizeref: f64) -> &mut Self {
        self.sizeref = Some(sizeref);
        self
    }
    /// Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.
    ///
    /// default: `0`
    pub fn sizemin(&mut self, sizemin: f64) -> &mut Self {
        self.sizemin = Some(sizemin);
        self
    }
    /// Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.
    ///
    /// default: `diameter`
    pub fn sizemode(&mut self, sizemode: marker::Sizemode) -> &mut Self {
        self.sizemode = Some(sizemode);
        self
    }
    pub fn colorbar(&mut self) -> &mut marker::Colorbar<'a> {
        self.colorbar.is_empty = false;
        &mut self.colorbar.data
    }
    pub fn line(&mut self) -> &mut marker::Line<'a> {
        self.line.is_empty = false;
        &mut self.line.data
    }
    pub fn gradient(&mut self) -> &mut marker::Gradient<'a> {
        self.gradient.is_empty = false;
        &mut self.gradient.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
    }
    /// 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
    }
}
pub mod marker {
#[allow(unused_imports)]
use serde::Serialize;
pub enum Symbol {
    Num0,
    Circle,
    Num100,
    CircleOpen,
    Num200,
    CircleDot,
    Num300,
    CircleOpenDot,
    Num1,
    Square,
    Num101,
    SquareOpen,
    Num201,
    SquareDot,
    Num301,
    SquareOpenDot,
    Num2,
    Diamond,
    Num102,
    DiamondOpen,
    Num202,
    DiamondDot,
    Num302,
    DiamondOpenDot,
    Num3,
    Cross,
    Num103,
    CrossOpen,
    Num203,
    CrossDot,
    Num303,
    CrossOpenDot,
    Num4,
    X,
    Num104,
    XOpen,
    Num204,
    XDot,
    Num304,
    XOpenDot,
    Num5,
    TriangleUp,
    Num105,
    TriangleUpOpen,
    Num205,
    TriangleUpDot,
    Num305,
    TriangleUpOpenDot,
    Num6,
    TriangleDown,
    Num106,
    TriangleDownOpen,
    Num206,
    TriangleDownDot,
    Num306,
    TriangleDownOpenDot,
    Num7,
    TriangleLeft,
    Num107,
    TriangleLeftOpen,
    Num207,
    TriangleLeftDot,
    Num307,
    TriangleLeftOpenDot,
    Num8,
    TriangleRight,
    Num108,
    TriangleRightOpen,
    Num208,
    TriangleRightDot,
    Num308,
    TriangleRightOpenDot,
    Num9,
    TriangleNe,
    Num109,
    TriangleNeOpen,
    Num209,
    TriangleNeDot,
    Num309,
    TriangleNeOpenDot,
    Num10,
    TriangleSe,
    Num110,
    TriangleSeOpen,
    Num210,
    TriangleSeDot,
    Num310,
    TriangleSeOpenDot,
    Num11,
    TriangleSw,
    Num111,
    TriangleSwOpen,
    Num211,
    TriangleSwDot,
    Num311,
    TriangleSwOpenDot,
    Num12,
    TriangleNw,
    Num112,
    TriangleNwOpen,
    Num212,
    TriangleNwDot,
    Num312,
    TriangleNwOpenDot,
    Num13,
    Pentagon,
    Num113,
    PentagonOpen,
    Num213,
    PentagonDot,
    Num313,
    PentagonOpenDot,
    Num14,
    Hexagon,
    Num114,
    HexagonOpen,
    Num214,
    HexagonDot,
    Num314,
    HexagonOpenDot,
    Num15,
    Hexagon2,
    Num115,
    Hexagon2Open,
    Num215,
    Hexagon2Dot,
    Num315,
    Hexagon2OpenDot,
    Num16,
    Octagon,
    Num116,
    OctagonOpen,
    Num216,
    OctagonDot,
    Num316,
    OctagonOpenDot,
    Num17,
    Star,
    Num117,
    StarOpen,
    Num217,
    StarDot,
    Num317,
    StarOpenDot,
    Num18,
    Hexagram,
    Num118,
    HexagramOpen,
    Num218,
    HexagramDot,
    Num318,
    HexagramOpenDot,
    Num19,
    StarTriangleUp,
    Num119,
    StarTriangleUpOpen,
    Num219,
    StarTriangleUpDot,
    Num319,
    StarTriangleUpOpenDot,
    Num20,
    StarTriangleDown,
    Num120,
    StarTriangleDownOpen,
    Num220,
    StarTriangleDownDot,
    Num320,
    StarTriangleDownOpenDot,
    Num21,
    StarSquare,
    Num121,
    StarSquareOpen,
    Num221,
    StarSquareDot,
    Num321,
    StarSquareOpenDot,
    Num22,
    StarDiamond,
    Num122,
    StarDiamondOpen,
    Num222,
    StarDiamondDot,
    Num322,
    StarDiamondOpenDot,
    Num23,
    DiamondTall,
    Num123,
    DiamondTallOpen,
    Num223,
    DiamondTallDot,
    Num323,
    DiamondTallOpenDot,
    Num24,
    DiamondWide,
    Num124,
    DiamondWideOpen,
    Num224,
    DiamondWideDot,
    Num324,
    DiamondWideOpenDot,
    Num25,
    Hourglass,
    Num125,
    HourglassOpen,
    Num26,
    Bowtie,
    Num126,
    BowtieOpen,
    Num27,
    CircleCross,
    Num127,
    CircleCrossOpen,
    Num28,
    CircleX,
    Num128,
    CircleXOpen,
    Num29,
    SquareCross,
    Num129,
    SquareCrossOpen,
    Num30,
    SquareX,
    Num130,
    SquareXOpen,
    Num31,
    DiamondCross,
    Num131,
    DiamondCrossOpen,
    Num32,
    DiamondX,
    Num132,
    DiamondXOpen,
    Num33,
    CrossThin,
    Num133,
    CrossThinOpen,
    Num34,
    XThin,
    Num134,
    XThinOpen,
    Num35,
    Asterisk,
    Num135,
    AsteriskOpen,
    Num36,
    Hash,
    Num136,
    HashOpen,
    Num236,
    HashDot,
    Num336,
    HashOpenDot,
    Num37,
    YUp,
    Num137,
    YUpOpen,
    Num38,
    YDown,
    Num138,
    YDownOpen,
    Num39,
    YLeft,
    Num139,
    YLeftOpen,
    Num40,
    YRight,
    Num140,
    YRightOpen,
    Num41,
    LineEw,
    Num141,
    LineEwOpen,
    Num42,
    LineNs,
    Num142,
    LineNsOpen,
    Num43,
    LineNe,
    Num143,
    LineNeOpen,
    Num44,
    LineNw,
    Num144,
    LineNwOpen,
}
impl serde::Serialize for Symbol {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Num0 => serializer.serialize_u64(0),
            Self::Circle => serializer.serialize_str("circle"),
            Self::Num100 => serializer.serialize_u64(100),
            Self::CircleOpen => serializer.serialize_str("circle-open"),
            Self::Num200 => serializer.serialize_u64(200),
            Self::CircleDot => serializer.serialize_str("circle-dot"),
            Self::Num300 => serializer.serialize_u64(300),
            Self::CircleOpenDot => serializer.serialize_str("circle-open-dot"),
            Self::Num1 => serializer.serialize_u64(1),
            Self::Square => serializer.serialize_str("square"),
            Self::Num101 => serializer.serialize_u64(101),
            Self::SquareOpen => serializer.serialize_str("square-open"),
            Self::Num201 => serializer.serialize_u64(201),
            Self::SquareDot => serializer.serialize_str("square-dot"),
            Self::Num301 => serializer.serialize_u64(301),
            Self::SquareOpenDot => serializer.serialize_str("square-open-dot"),
            Self::Num2 => serializer.serialize_u64(2),
            Self::Diamond => serializer.serialize_str("diamond"),
            Self::Num102 => serializer.serialize_u64(102),
            Self::DiamondOpen => serializer.serialize_str("diamond-open"),
            Self::Num202 => serializer.serialize_u64(202),
            Self::DiamondDot => serializer.serialize_str("diamond-dot"),
            Self::Num302 => serializer.serialize_u64(302),
            Self::DiamondOpenDot => serializer.serialize_str("diamond-open-dot"),
            Self::Num3 => serializer.serialize_u64(3),
            Self::Cross => serializer.serialize_str("cross"),
            Self::Num103 => serializer.serialize_u64(103),
            Self::CrossOpen => serializer.serialize_str("cross-open"),
            Self::Num203 => serializer.serialize_u64(203),
            Self::CrossDot => serializer.serialize_str("cross-dot"),
            Self::Num303 => serializer.serialize_u64(303),
            Self::CrossOpenDot => serializer.serialize_str("cross-open-dot"),
            Self::Num4 => serializer.serialize_u64(4),
            Self::X => serializer.serialize_str("x"),
            Self::Num104 => serializer.serialize_u64(104),
            Self::XOpen => serializer.serialize_str("x-open"),
            Self::Num204 => serializer.serialize_u64(204),
            Self::XDot => serializer.serialize_str("x-dot"),
            Self::Num304 => serializer.serialize_u64(304),
            Self::XOpenDot => serializer.serialize_str("x-open-dot"),
            Self::Num5 => serializer.serialize_u64(5),
            Self::TriangleUp => serializer.serialize_str("triangle-up"),
            Self::Num105 => serializer.serialize_u64(105),
            Self::TriangleUpOpen => serializer.serialize_str("triangle-up-open"),
            Self::Num205 => serializer.serialize_u64(205),
            Self::TriangleUpDot => serializer.serialize_str("triangle-up-dot"),
            Self::Num305 => serializer.serialize_u64(305),
            Self::TriangleUpOpenDot => serializer.serialize_str("triangle-up-open-dot"),
            Self::Num6 => serializer.serialize_u64(6),
            Self::TriangleDown => serializer.serialize_str("triangle-down"),
            Self::Num106 => serializer.serialize_u64(106),
            Self::TriangleDownOpen => serializer.serialize_str("triangle-down-open"),
            Self::Num206 => serializer.serialize_u64(206),
            Self::TriangleDownDot => serializer.serialize_str("triangle-down-dot"),
            Self::Num306 => serializer.serialize_u64(306),
            Self::TriangleDownOpenDot => serializer.serialize_str("triangle-down-open-dot"),
            Self::Num7 => serializer.serialize_u64(7),
            Self::TriangleLeft => serializer.serialize_str("triangle-left"),
            Self::Num107 => serializer.serialize_u64(107),
            Self::TriangleLeftOpen => serializer.serialize_str("triangle-left-open"),
            Self::Num207 => serializer.serialize_u64(207),
            Self::TriangleLeftDot => serializer.serialize_str("triangle-left-dot"),
            Self::Num307 => serializer.serialize_u64(307),
            Self::TriangleLeftOpenDot => serializer.serialize_str("triangle-left-open-dot"),
            Self::Num8 => serializer.serialize_u64(8),
            Self::TriangleRight => serializer.serialize_str("triangle-right"),
            Self::Num108 => serializer.serialize_u64(108),
            Self::TriangleRightOpen => serializer.serialize_str("triangle-right-open"),
            Self::Num208 => serializer.serialize_u64(208),
            Self::TriangleRightDot => serializer.serialize_str("triangle-right-dot"),
            Self::Num308 => serializer.serialize_u64(308),
            Self::TriangleRightOpenDot => serializer.serialize_str("triangle-right-open-dot"),
            Self::Num9 => serializer.serialize_u64(9),
            Self::TriangleNe => serializer.serialize_str("triangle-ne"),
            Self::Num109 => serializer.serialize_u64(109),
            Self::TriangleNeOpen => serializer.serialize_str("triangle-ne-open"),
            Self::Num209 => serializer.serialize_u64(209),
            Self::TriangleNeDot => serializer.serialize_str("triangle-ne-dot"),
            Self::Num309 => serializer.serialize_u64(309),
            Self::TriangleNeOpenDot => serializer.serialize_str("triangle-ne-open-dot"),
            Self::Num10 => serializer.serialize_u64(10),
            Self::TriangleSe => serializer.serialize_str("triangle-se"),
            Self::Num110 => serializer.serialize_u64(110),
            Self::TriangleSeOpen => serializer.serialize_str("triangle-se-open"),
            Self::Num210 => serializer.serialize_u64(210),
            Self::TriangleSeDot => serializer.serialize_str("triangle-se-dot"),
            Self::Num310 => serializer.serialize_u64(310),
            Self::TriangleSeOpenDot => serializer.serialize_str("triangle-se-open-dot"),
            Self::Num11 => serializer.serialize_u64(11),
            Self::TriangleSw => serializer.serialize_str("triangle-sw"),
            Self::Num111 => serializer.serialize_u64(111),
            Self::TriangleSwOpen => serializer.serialize_str("triangle-sw-open"),
            Self::Num211 => serializer.serialize_u64(211),
            Self::TriangleSwDot => serializer.serialize_str("triangle-sw-dot"),
            Self::Num311 => serializer.serialize_u64(311),
            Self::TriangleSwOpenDot => serializer.serialize_str("triangle-sw-open-dot"),
            Self::Num12 => serializer.serialize_u64(12),
            Self::TriangleNw => serializer.serialize_str("triangle-nw"),
            Self::Num112 => serializer.serialize_u64(112),
            Self::TriangleNwOpen => serializer.serialize_str("triangle-nw-open"),
            Self::Num212 => serializer.serialize_u64(212),
            Self::TriangleNwDot => serializer.serialize_str("triangle-nw-dot"),
            Self::Num312 => serializer.serialize_u64(312),
            Self::TriangleNwOpenDot => serializer.serialize_str("triangle-nw-open-dot"),
            Self::Num13 => serializer.serialize_u64(13),
            Self::Pentagon => serializer.serialize_str("pentagon"),
            Self::Num113 => serializer.serialize_u64(113),
            Self::PentagonOpen => serializer.serialize_str("pentagon-open"),
            Self::Num213 => serializer.serialize_u64(213),
            Self::PentagonDot => serializer.serialize_str("pentagon-dot"),
            Self::Num313 => serializer.serialize_u64(313),
            Self::PentagonOpenDot => serializer.serialize_str("pentagon-open-dot"),
            Self::Num14 => serializer.serialize_u64(14),
            Self::Hexagon => serializer.serialize_str("hexagon"),
            Self::Num114 => serializer.serialize_u64(114),
            Self::HexagonOpen => serializer.serialize_str("hexagon-open"),
            Self::Num214 => serializer.serialize_u64(214),
            Self::HexagonDot => serializer.serialize_str("hexagon-dot"),
            Self::Num314 => serializer.serialize_u64(314),
            Self::HexagonOpenDot => serializer.serialize_str("hexagon-open-dot"),
            Self::Num15 => serializer.serialize_u64(15),
            Self::Hexagon2 => serializer.serialize_str("hexagon2"),
            Self::Num115 => serializer.serialize_u64(115),
            Self::Hexagon2Open => serializer.serialize_str("hexagon2-open"),
            Self::Num215 => serializer.serialize_u64(215),
            Self::Hexagon2Dot => serializer.serialize_str("hexagon2-dot"),
            Self::Num315 => serializer.serialize_u64(315),
            Self::Hexagon2OpenDot => serializer.serialize_str("hexagon2-open-dot"),
            Self::Num16 => serializer.serialize_u64(16),
            Self::Octagon => serializer.serialize_str("octagon"),
            Self::Num116 => serializer.serialize_u64(116),
            Self::OctagonOpen => serializer.serialize_str("octagon-open"),
            Self::Num216 => serializer.serialize_u64(216),
            Self::OctagonDot => serializer.serialize_str("octagon-dot"),
            Self::Num316 => serializer.serialize_u64(316),
            Self::OctagonOpenDot => serializer.serialize_str("octagon-open-dot"),
            Self::Num17 => serializer.serialize_u64(17),
            Self::Star => serializer.serialize_str("star"),
            Self::Num117 => serializer.serialize_u64(117),
            Self::StarOpen => serializer.serialize_str("star-open"),
            Self::Num217 => serializer.serialize_u64(217),
            Self::StarDot => serializer.serialize_str("star-dot"),
            Self::Num317 => serializer.serialize_u64(317),
            Self::StarOpenDot => serializer.serialize_str("star-open-dot"),
            Self::Num18 => serializer.serialize_u64(18),
            Self::Hexagram => serializer.serialize_str("hexagram"),
            Self::Num118 => serializer.serialize_u64(118),
            Self::HexagramOpen => serializer.serialize_str("hexagram-open"),
            Self::Num218 => serializer.serialize_u64(218),
            Self::HexagramDot => serializer.serialize_str("hexagram-dot"),
            Self::Num318 => serializer.serialize_u64(318),
            Self::HexagramOpenDot => serializer.serialize_str("hexagram-open-dot"),
            Self::Num19 => serializer.serialize_u64(19),
            Self::StarTriangleUp => serializer.serialize_str("star-triangle-up"),
            Self::Num119 => serializer.serialize_u64(119),
            Self::StarTriangleUpOpen => serializer.serialize_str("star-triangle-up-open"),
            Self::Num219 => serializer.serialize_u64(219),
            Self::StarTriangleUpDot => serializer.serialize_str("star-triangle-up-dot"),
            Self::Num319 => serializer.serialize_u64(319),
            Self::StarTriangleUpOpenDot => serializer.serialize_str("star-triangle-up-open-dot"),
            Self::Num20 => serializer.serialize_u64(20),
            Self::StarTriangleDown => serializer.serialize_str("star-triangle-down"),
            Self::Num120 => serializer.serialize_u64(120),
            Self::StarTriangleDownOpen => serializer.serialize_str("star-triangle-down-open"),
            Self::Num220 => serializer.serialize_u64(220),
            Self::StarTriangleDownDot => serializer.serialize_str("star-triangle-down-dot"),
            Self::Num320 => serializer.serialize_u64(320),
            Self::StarTriangleDownOpenDot => serializer.serialize_str("star-triangle-down-open-dot"),
            Self::Num21 => serializer.serialize_u64(21),
            Self::StarSquare => serializer.serialize_str("star-square"),
            Self::Num121 => serializer.serialize_u64(121),
            Self::StarSquareOpen => serializer.serialize_str("star-square-open"),
            Self::Num221 => serializer.serialize_u64(221),
            Self::StarSquareDot => serializer.serialize_str("star-square-dot"),
            Self::Num321 => serializer.serialize_u64(321),
            Self::StarSquareOpenDot => serializer.serialize_str("star-square-open-dot"),
            Self::Num22 => serializer.serialize_u64(22),
            Self::StarDiamond => serializer.serialize_str("star-diamond"),
            Self::Num122 => serializer.serialize_u64(122),
            Self::StarDiamondOpen => serializer.serialize_str("star-diamond-open"),
            Self::Num222 => serializer.serialize_u64(222),
            Self::StarDiamondDot => serializer.serialize_str("star-diamond-dot"),
            Self::Num322 => serializer.serialize_u64(322),
            Self::StarDiamondOpenDot => serializer.serialize_str("star-diamond-open-dot"),
            Self::Num23 => serializer.serialize_u64(23),
            Self::DiamondTall => serializer.serialize_str("diamond-tall"),
            Self::Num123 => serializer.serialize_u64(123),
            Self::DiamondTallOpen => serializer.serialize_str("diamond-tall-open"),
            Self::Num223 => serializer.serialize_u64(223),
            Self::DiamondTallDot => serializer.serialize_str("diamond-tall-dot"),
            Self::Num323 => serializer.serialize_u64(323),
            Self::DiamondTallOpenDot => serializer.serialize_str("diamond-tall-open-dot"),
            Self::Num24 => serializer.serialize_u64(24),
            Self::DiamondWide => serializer.serialize_str("diamond-wide"),
            Self::Num124 => serializer.serialize_u64(124),
            Self::DiamondWideOpen => serializer.serialize_str("diamond-wide-open"),
            Self::Num224 => serializer.serialize_u64(224),
            Self::DiamondWideDot => serializer.serialize_str("diamond-wide-dot"),
            Self::Num324 => serializer.serialize_u64(324),
            Self::DiamondWideOpenDot => serializer.serialize_str("diamond-wide-open-dot"),
            Self::Num25 => serializer.serialize_u64(25),
            Self::Hourglass => serializer.serialize_str("hourglass"),
            Self::Num125 => serializer.serialize_u64(125),
            Self::HourglassOpen => serializer.serialize_str("hourglass-open"),
            Self::Num26 => serializer.serialize_u64(26),
            Self::Bowtie => serializer.serialize_str("bowtie"),
            Self::Num126 => serializer.serialize_u64(126),
            Self::BowtieOpen => serializer.serialize_str("bowtie-open"),
            Self::Num27 => serializer.serialize_u64(27),
            Self::CircleCross => serializer.serialize_str("circle-cross"),
            Self::Num127 => serializer.serialize_u64(127),
            Self::CircleCrossOpen => serializer.serialize_str("circle-cross-open"),
            Self::Num28 => serializer.serialize_u64(28),
            Self::CircleX => serializer.serialize_str("circle-x"),
            Self::Num128 => serializer.serialize_u64(128),
            Self::CircleXOpen => serializer.serialize_str("circle-x-open"),
            Self::Num29 => serializer.serialize_u64(29),
            Self::SquareCross => serializer.serialize_str("square-cross"),
            Self::Num129 => serializer.serialize_u64(129),
            Self::SquareCrossOpen => serializer.serialize_str("square-cross-open"),
            Self::Num30 => serializer.serialize_u64(30),
            Self::SquareX => serializer.serialize_str("square-x"),
            Self::Num130 => serializer.serialize_u64(130),
            Self::SquareXOpen => serializer.serialize_str("square-x-open"),
            Self::Num31 => serializer.serialize_u64(31),
            Self::DiamondCross => serializer.serialize_str("diamond-cross"),
            Self::Num131 => serializer.serialize_u64(131),
            Self::DiamondCrossOpen => serializer.serialize_str("diamond-cross-open"),
            Self::Num32 => serializer.serialize_u64(32),
            Self::DiamondX => serializer.serialize_str("diamond-x"),
            Self::Num132 => serializer.serialize_u64(132),
            Self::DiamondXOpen => serializer.serialize_str("diamond-x-open"),
            Self::Num33 => serializer.serialize_u64(33),
            Self::CrossThin => serializer.serialize_str("cross-thin"),
            Self::Num133 => serializer.serialize_u64(133),
            Self::CrossThinOpen => serializer.serialize_str("cross-thin-open"),
            Self::Num34 => serializer.serialize_u64(34),
            Self::XThin => serializer.serialize_str("x-thin"),
            Self::Num134 => serializer.serialize_u64(134),
            Self::XThinOpen => serializer.serialize_str("x-thin-open"),
            Self::Num35 => serializer.serialize_u64(35),
            Self::Asterisk => serializer.serialize_str("asterisk"),
            Self::Num135 => serializer.serialize_u64(135),
            Self::AsteriskOpen => serializer.serialize_str("asterisk-open"),
            Self::Num36 => serializer.serialize_u64(36),
            Self::Hash => serializer.serialize_str("hash"),
            Self::Num136 => serializer.serialize_u64(136),
            Self::HashOpen => serializer.serialize_str("hash-open"),
            Self::Num236 => serializer.serialize_u64(236),
            Self::HashDot => serializer.serialize_str("hash-dot"),
            Self::Num336 => serializer.serialize_u64(336),
            Self::HashOpenDot => serializer.serialize_str("hash-open-dot"),
            Self::Num37 => serializer.serialize_u64(37),
            Self::YUp => serializer.serialize_str("y-up"),
            Self::Num137 => serializer.serialize_u64(137),
            Self::YUpOpen => serializer.serialize_str("y-up-open"),
            Self::Num38 => serializer.serialize_u64(38),
            Self::YDown => serializer.serialize_str("y-down"),
            Self::Num138 => serializer.serialize_u64(138),
            Self::YDownOpen => serializer.serialize_str("y-down-open"),
            Self::Num39 => serializer.serialize_u64(39),
            Self::YLeft => serializer.serialize_str("y-left"),
            Self::Num139 => serializer.serialize_u64(139),
            Self::YLeftOpen => serializer.serialize_str("y-left-open"),
            Self::Num40 => serializer.serialize_u64(40),
            Self::YRight => serializer.serialize_str("y-right"),
            Self::Num140 => serializer.serialize_u64(140),
            Self::YRightOpen => serializer.serialize_str("y-right-open"),
            Self::Num41 => serializer.serialize_u64(41),
            Self::LineEw => serializer.serialize_str("line-ew"),
            Self::Num141 => serializer.serialize_u64(141),
            Self::LineEwOpen => serializer.serialize_str("line-ew-open"),
            Self::Num42 => serializer.serialize_u64(42),
            Self::LineNs => serializer.serialize_str("line-ns"),
            Self::Num142 => serializer.serialize_u64(142),
            Self::LineNsOpen => serializer.serialize_str("line-ns-open"),
            Self::Num43 => serializer.serialize_u64(43),
            Self::LineNe => serializer.serialize_str("line-ne"),
            Self::Num143 => serializer.serialize_u64(143),
            Self::LineNeOpen => serializer.serialize_str("line-ne-open"),
            Self::Num44 => serializer.serialize_u64(44),
            Self::LineNw => serializer.serialize_str("line-nw"),
            Self::Num144 => serializer.serialize_u64(144),
            Self::LineNwOpen => serializer.serialize_str("line-nw-open"),
        }
    }
}
pub enum Sizemode {
    Diameter,
    Area,
}
impl serde::Serialize for Sizemode {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::Diameter => serializer.serialize_str("diameter"),
            Self::Area => serializer.serialize_str("area"),
        }
    }
}

#[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 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.
    ///
    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 Gradient<'a> {
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    color: Option<&'a str>,
}

impl<'a> Gradient<'a> {
    /// Sets the final color of the gradient fill: the center color for radial, the right for horizontal, or the bottom for vertical.
    ///
    pub fn color(&mut self, color: &'a str) -> &mut Self {
        self.color = Some(color);
        self
    }
}
}
pub enum Fill {
    None,
    Toself,
}
impl serde::Serialize for Fill {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            Self::None => serializer.serialize_str("none"),
            Self::Toself => serializer.serialize_str("toself"),
        }
    }
}

#[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>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
}

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
    }
    /// Sets the marker size of selected points.
    ///
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        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>,
    #[serde(rename = "size")]
    #[serde(skip_serializing_if = "Option::is_none")]
    size: Option<f64>,
}

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
    }
    /// Sets the marker size of unselected points, applied only when a selection exists.
    ///
    pub fn size(&mut self, size: f64) -> &mut Self {
        self.size = Some(size);
        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)]
pub struct HoverinfoFlags ([u8; 1]);
impl HoverinfoFlags {
    pub fn lon(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 0; }
        else { self.0[0] &= !(1 << 0); }
        self
    }
    pub fn lat(&mut self, v: bool) -> &mut Self {
        if v { self.0[0] |= 1 << 1; }
        else { self.0[0] &= !(1 << 1); }
        self
    }
    pub fn location(&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("lon");
        }
        if (self.0[0] >> 1) & 0x1 == 1 {
            v.push("lat");
        }
        if (self.0[0] >> 2) & 0x1 == 1 {
            v.push("location");
        }
        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;
    }
}