@genspectrum/dashboard-components 0.13.6 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/custom-elements.json +41 -79
  2. package/dist/{LineageFilterChangedEvent-GedKNGFI.js → LineageFilterChangedEvent-C9dXOxt6.js} +11 -3
  3. package/dist/LineageFilterChangedEvent-C9dXOxt6.js.map +1 -0
  4. package/dist/components.d.ts +63 -71
  5. package/dist/components.js +440 -312
  6. package/dist/components.js.map +1 -1
  7. package/dist/style.css +20 -5
  8. package/dist/util.d.ts +61 -51
  9. package/dist/util.js +1 -1
  10. package/package.json +1 -1
  11. package/src/preact/LapisUrlContext.ts +14 -1
  12. package/src/preact/aggregatedData/aggregate.stories.tsx +3 -3
  13. package/src/preact/aggregatedData/aggregate.tsx +3 -4
  14. package/src/preact/components/tabs.tsx +3 -5
  15. package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +34 -20
  16. package/src/preact/dateRangeSelector/computeInitialValues.ts +25 -21
  17. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +104 -40
  18. package/src/preact/dateRangeSelector/date-range-selector.tsx +29 -20
  19. package/src/preact/dateRangeSelector/dateRangeOption.ts +11 -1
  20. package/src/preact/lineageFilter/lineage-filter.stories.tsx +3 -3
  21. package/src/preact/lineageFilter/lineage-filter.tsx +3 -4
  22. package/src/preact/locationFilter/location-filter.stories.tsx +3 -3
  23. package/src/preact/locationFilter/location-filter.tsx +4 -4
  24. package/src/preact/map/sequences-by-location.stories.tsx +3 -3
  25. package/src/preact/map/sequences-by-location.tsx +3 -4
  26. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -3
  27. package/src/preact/mutationComparison/mutation-comparison.tsx +4 -4
  28. package/src/preact/mutationFilter/ExampleMutation.tsx +68 -0
  29. package/src/preact/mutationFilter/mutation-filter-info.tsx +179 -112
  30. package/src/preact/mutationFilter/mutation-filter.stories.tsx +5 -5
  31. package/src/preact/mutationFilter/mutation-filter.tsx +10 -5
  32. package/src/preact/mutations/mutations.stories.tsx +3 -3
  33. package/src/preact/mutations/mutations.tsx +4 -4
  34. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +26 -4
  35. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +3 -3
  36. package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
  37. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -3
  38. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  39. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +3 -3
  40. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +4 -4
  41. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -3
  42. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +4 -4
  43. package/src/preact/statistic/statistics.stories.tsx +3 -3
  44. package/src/preact/statistic/statistics.tsx +2 -3
  45. package/src/preact/textInput/text-input.stories.tsx +3 -3
  46. package/src/preact/textInput/text-input.tsx +3 -4
  47. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +5 -9
  48. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +5 -5
  49. package/src/web-components/PreactLitAdapter.tsx +3 -3
  50. package/src/web-components/{app.stories.ts → gs-app.stories.ts} +1 -1
  51. package/src/web-components/{app.ts → gs-app.ts} +5 -3
  52. package/src/web-components/index.ts +1 -1
  53. package/src/web-components/input/gs-date-range-selector.stories.ts +6 -13
  54. package/src/web-components/input/gs-date-range-selector.tsx +15 -38
  55. package/src/web-components/input/gs-lineage-filter.stories.ts +1 -1
  56. package/src/web-components/input/gs-location-filter.stories.ts +1 -1
  57. package/src/web-components/input/gs-mutation-filter.stories.ts +2 -2
  58. package/src/web-components/input/gs-text-input.stories.ts +1 -1
  59. package/src/web-components/visualization/gs-aggregate.stories.ts +1 -1
  60. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +1 -1
  61. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +1 -1
  62. package/src/web-components/visualization/gs-mutations.stories.ts +1 -1
  63. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +1 -1
  64. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +1 -1
  65. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +1 -1
  66. package/src/web-components/visualization/gs-sequences-by-location.stories.ts +1 -1
  67. package/src/web-components/visualization/gs-statistics.stories.ts +1 -1
  68. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +4 -1
  69. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +6 -2
  70. package/standalone-bundle/dashboard-components.js +7016 -6951
  71. package/standalone-bundle/dashboard-components.js.map +1 -1
  72. package/standalone-bundle/style.css +1 -1
  73. package/dist/LineageFilterChangedEvent-GedKNGFI.js.map +0 -1
@@ -109,7 +109,7 @@ declare const aggregateViewSchema: default_2.ZodUnion<[default_2.ZodLiteral<"tab
109
109
  *
110
110
  * This component does __not__ use a shadow DOM. Children of this component will be rendered directly in the light DOM.
111
111
  */
112
- export declare class App extends LitElement {
112
+ export declare class AppComponent extends LitElement {
113
113
  /**
114
114
  * Required.
115
115
  *
@@ -162,14 +162,17 @@ export declare class App extends LitElement {
162
162
  * Contains the selected dateRangeOption or when users select custom values it contains the selected dates.
163
163
  *
164
164
  * Use this event, when you want to control this component in your JS application.
165
+ * You can supply the `detail` of this event to the `value` attribute of this component.
165
166
  */
166
167
  export declare class DateRangeSelectorComponent extends PreactLitAdapter {
167
168
  /**
168
169
  * An array of date range options that the select field should provide.
169
- * The `label` will be shown to the user, and it will be available as `initialValue`.
170
+ * The `label` will be shown to the user, and it will be available as `value`.
170
171
  * The dates must be in the format `YYYY-MM-DD`.
171
172
  *
172
173
  * If dateFrom or dateTo is not set, the component will default to the `earliestDate` or the current date.
174
+ *
175
+ * We provide some options in `dateRangeOptionPresets` for convenience.
173
176
  */
174
177
  dateRangeOptions: {
175
178
  label: string;
@@ -181,28 +184,19 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
181
184
  */
182
185
  earliestDate: string;
183
186
  /**
184
- * The initial value to use for this date range selector.
185
- * Must be a valid label from the `dateRangeOptions`.
186
- *
187
- * If the value is not set, the component will default to the range `earliestDate` until today.
188
- *
189
- * It will be overwritten if `initialDateFrom` or `initialDateTo` is set.
187
+ * The value to use for this date range selector.
188
+ * - If it is a string, then it must be a valid label from the `dateRangeOptions`.
189
+ * - If it is an object, then it accepts dates in the format `YYYY-MM-DD` for the keys `dateFrom` and `dateTo`.
190
+ * Keys that are not set will default to the `earliestDate` or the current date respectively.
191
+ * - If the attribute is not set, the component will default to the range `earliestDate` until today.
190
192
  *
191
- * We provide some options in `dateRangeOptionPresets` for convenience.
192
- */
193
- initialValue: string | undefined;
194
- /**
195
- * A date string in the format `YYYY-MM-DD`.
196
- * If set, the date range selector will be initialized with the given date (overwriting `initialValue` to `custom`).
197
- * If `initialDateTo` is set, but this is unset, it will default to `earliestDate`.
193
+ * The `detail` of the `gs-date-range-option-changed` event can be used for this attribute,
194
+ * if you want to control this component in your JS application.
198
195
  */
199
- initialDateFrom: string | undefined;
200
- /**
201
- * A date string in the format `YYYY-MM-DD`.
202
- * If set, the date range selector will be initialized with the given date (overwriting `initialValue` to `custom`).
203
- * If `initialDateFrom` is set, but this is unset, it will default to the current date.
204
- */
205
- initialDateTo: string | undefined;
196
+ value: string | {
197
+ dateFrom?: string;
198
+ dateTo?: string;
199
+ } | undefined;
206
200
  /**
207
201
  * The width of the component.
208
202
  *
@@ -1319,8 +1313,6 @@ export declare class WastewaterMutationsOverTimeComponent extends PreactLitAdapt
1319
1313
  height: string;
1320
1314
  /**
1321
1315
  * The maximum number of grid rows to display.
1322
- *
1323
- * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
1324
1316
  */
1325
1317
  maxNumberOfGridRows: number;
1326
1318
  render(): JSX_2.Element;
@@ -1338,7 +1330,7 @@ declare global {
1338
1330
 
1339
1331
  declare global {
1340
1332
  interface HTMLElementTagNameMap {
1341
- 'gs-app': App;
1333
+ 'gs-app': AppComponent;
1342
1334
  }
1343
1335
  }
1344
1336
 
@@ -1354,7 +1346,11 @@ declare global {
1354
1346
 
1355
1347
  declare global {
1356
1348
  interface HTMLElementTagNameMap {
1357
- 'gs-mutation-comparison-component': MutationComparisonComponent;
1349
+ 'gs-date-range-selector': DateRangeSelectorComponent;
1350
+ }
1351
+ interface HTMLElementEventMap {
1352
+ 'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
1353
+ 'gs-date-range-option-changed': DateRangeOptionChangedEvent;
1358
1354
  }
1359
1355
  }
1360
1356
 
@@ -1362,7 +1358,7 @@ declare global {
1362
1358
  declare global {
1363
1359
  namespace JSX {
1364
1360
  interface IntrinsicElements {
1365
- 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1361
+ 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1366
1362
  }
1367
1363
  }
1368
1364
  }
@@ -1370,7 +1366,10 @@ declare global {
1370
1366
 
1371
1367
  declare global {
1372
1368
  interface HTMLElementTagNameMap {
1373
- 'gs-mutations-component': MutationsComponent;
1369
+ 'gs-text-input': TextInputComponent;
1370
+ }
1371
+ interface HTMLElementEventMap {
1372
+ 'gs-text-input-changed': TextInputChangedEvent;
1374
1373
  }
1375
1374
  }
1376
1375
 
@@ -1378,7 +1377,7 @@ declare global {
1378
1377
  declare global {
1379
1378
  namespace JSX {
1380
1379
  interface IntrinsicElements {
1381
- 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1380
+ 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1382
1381
  }
1383
1382
  }
1384
1383
  }
@@ -1386,7 +1385,10 @@ declare global {
1386
1385
 
1387
1386
  declare global {
1388
1387
  interface HTMLElementTagNameMap {
1389
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1388
+ 'gs-location-filter': LocationFilterComponent;
1389
+ }
1390
+ interface HTMLElementEventMap {
1391
+ 'gs-location-changed': LocationChangedEvent;
1390
1392
  }
1391
1393
  }
1392
1394
 
@@ -1394,7 +1396,7 @@ declare global {
1394
1396
  declare global {
1395
1397
  namespace JSX {
1396
1398
  interface IntrinsicElements {
1397
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1399
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1398
1400
  }
1399
1401
  }
1400
1402
  }
@@ -1402,7 +1404,10 @@ declare global {
1402
1404
 
1403
1405
  declare global {
1404
1406
  interface HTMLElementTagNameMap {
1405
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1407
+ 'gs-lineage-filter': LineageFilterComponent;
1408
+ }
1409
+ interface HTMLElementEventMap {
1410
+ 'gs-lineage-filter-changed': LineageFilterChangedEvent;
1406
1411
  }
1407
1412
  }
1408
1413
 
@@ -1410,7 +1415,7 @@ declare global {
1410
1415
  declare global {
1411
1416
  namespace JSX {
1412
1417
  interface IntrinsicElements {
1413
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1418
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1414
1419
  }
1415
1420
  }
1416
1421
  }
@@ -1418,7 +1423,10 @@ declare global {
1418
1423
 
1419
1424
  declare global {
1420
1425
  interface HTMLElementTagNameMap {
1421
- 'gs-aggregate': AggregateComponent;
1426
+ 'gs-mutation-filter': MutationFilterComponent;
1427
+ }
1428
+ interface HTMLElementEventMap {
1429
+ 'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
1422
1430
  }
1423
1431
  }
1424
1432
 
@@ -1426,7 +1434,7 @@ declare global {
1426
1434
  declare global {
1427
1435
  namespace JSX {
1428
1436
  interface IntrinsicElements {
1429
- 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1437
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1430
1438
  }
1431
1439
  }
1432
1440
  }
@@ -1434,7 +1442,7 @@ declare global {
1434
1442
 
1435
1443
  declare global {
1436
1444
  interface HTMLElementTagNameMap {
1437
- 'gs-mutations-over-time': MutationsOverTimeComponent;
1445
+ 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1438
1446
  }
1439
1447
  }
1440
1448
 
@@ -1442,7 +1450,7 @@ declare global {
1442
1450
  declare global {
1443
1451
  namespace JSX {
1444
1452
  interface IntrinsicElements {
1445
- 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1453
+ 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1446
1454
  }
1447
1455
  }
1448
1456
  }
@@ -1450,7 +1458,7 @@ declare global {
1450
1458
 
1451
1459
  declare global {
1452
1460
  interface HTMLElementTagNameMap {
1453
- 'gs-sequences-by-location': SequencesByLocationComponent;
1461
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1454
1462
  }
1455
1463
  }
1456
1464
 
@@ -1458,7 +1466,7 @@ declare global {
1458
1466
  declare global {
1459
1467
  namespace JSX {
1460
1468
  interface IntrinsicElements {
1461
- 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1469
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1462
1470
  }
1463
1471
  }
1464
1472
  }
@@ -1466,7 +1474,7 @@ declare global {
1466
1474
 
1467
1475
  declare global {
1468
1476
  interface HTMLElementTagNameMap {
1469
- 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1477
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1470
1478
  }
1471
1479
  }
1472
1480
 
@@ -1474,7 +1482,7 @@ declare global {
1474
1482
  declare global {
1475
1483
  namespace JSX {
1476
1484
  interface IntrinsicElements {
1477
- 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1485
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1478
1486
  }
1479
1487
  }
1480
1488
  }
@@ -1482,7 +1490,7 @@ declare global {
1482
1490
 
1483
1491
  declare global {
1484
1492
  interface HTMLElementTagNameMap {
1485
- 'gs-statistics': StatisticsComponent;
1493
+ 'gs-mutations-component': MutationsComponent;
1486
1494
  }
1487
1495
  }
1488
1496
 
@@ -1490,7 +1498,7 @@ declare global {
1490
1498
  declare global {
1491
1499
  namespace JSX {
1492
1500
  interface IntrinsicElements {
1493
- 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1501
+ 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1494
1502
  }
1495
1503
  }
1496
1504
  }
@@ -1498,7 +1506,7 @@ declare global {
1498
1506
 
1499
1507
  declare global {
1500
1508
  interface HTMLElementTagNameMap {
1501
- 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1509
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1502
1510
  }
1503
1511
  }
1504
1512
 
@@ -1506,7 +1514,7 @@ declare global {
1506
1514
  declare global {
1507
1515
  namespace JSX {
1508
1516
  interface IntrinsicElements {
1509
- 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1517
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1510
1518
  }
1511
1519
  }
1512
1520
  }
@@ -1514,11 +1522,7 @@ declare global {
1514
1522
 
1515
1523
  declare global {
1516
1524
  interface HTMLElementTagNameMap {
1517
- 'gs-date-range-selector': DateRangeSelectorComponent;
1518
- }
1519
- interface HTMLElementEventMap {
1520
- 'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
1521
- 'gs-date-range-option-changed': DateRangeOptionChangedEvent;
1525
+ 'gs-aggregate': AggregateComponent;
1522
1526
  }
1523
1527
  }
1524
1528
 
@@ -1526,7 +1530,7 @@ declare global {
1526
1530
  declare global {
1527
1531
  namespace JSX {
1528
1532
  interface IntrinsicElements {
1529
- 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1533
+ 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1530
1534
  }
1531
1535
  }
1532
1536
  }
@@ -1534,10 +1538,7 @@ declare global {
1534
1538
 
1535
1539
  declare global {
1536
1540
  interface HTMLElementTagNameMap {
1537
- 'gs-location-filter': LocationFilterComponent;
1538
- }
1539
- interface HTMLElementEventMap {
1540
- 'gs-location-changed': LocationChangedEvent;
1541
+ 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1541
1542
  }
1542
1543
  }
1543
1544
 
@@ -1545,7 +1546,7 @@ declare global {
1545
1546
  declare global {
1546
1547
  namespace JSX {
1547
1548
  interface IntrinsicElements {
1548
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1549
+ 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1549
1550
  }
1550
1551
  }
1551
1552
  }
@@ -1553,10 +1554,7 @@ declare global {
1553
1554
 
1554
1555
  declare global {
1555
1556
  interface HTMLElementTagNameMap {
1556
- 'gs-text-input': TextInputComponent;
1557
- }
1558
- interface HTMLElementEventMap {
1559
- 'gs-text-input-changed': TextInputChangedEvent;
1557
+ 'gs-mutations-over-time': MutationsOverTimeComponent;
1560
1558
  }
1561
1559
  }
1562
1560
 
@@ -1564,7 +1562,7 @@ declare global {
1564
1562
  declare global {
1565
1563
  namespace JSX {
1566
1564
  interface IntrinsicElements {
1567
- 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1565
+ 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1568
1566
  }
1569
1567
  }
1570
1568
  }
@@ -1572,10 +1570,7 @@ declare global {
1572
1570
 
1573
1571
  declare global {
1574
1572
  interface HTMLElementTagNameMap {
1575
- 'gs-lineage-filter': LineageFilterComponent;
1576
- }
1577
- interface HTMLElementEventMap {
1578
- 'gs-lineage-filter-changed': LineageFilterChangedEvent;
1573
+ 'gs-sequences-by-location': SequencesByLocationComponent;
1579
1574
  }
1580
1575
  }
1581
1576
 
@@ -1583,7 +1578,7 @@ declare global {
1583
1578
  declare global {
1584
1579
  namespace JSX {
1585
1580
  interface IntrinsicElements {
1586
- 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1581
+ 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1587
1582
  }
1588
1583
  }
1589
1584
  }
@@ -1591,10 +1586,7 @@ declare global {
1591
1586
 
1592
1587
  declare global {
1593
1588
  interface HTMLElementTagNameMap {
1594
- 'gs-mutation-filter': MutationFilterComponent;
1595
- }
1596
- interface HTMLElementEventMap {
1597
- 'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
1589
+ 'gs-statistics': StatisticsComponent;
1598
1590
  }
1599
1591
  }
1600
1592
 
@@ -1602,7 +1594,7 @@ declare global {
1602
1594
  declare global {
1603
1595
  namespace JSX {
1604
1596
  interface IntrinsicElements {
1605
- 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1597
+ 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1606
1598
  }
1607
1599
  }
1608
1600
  }