@genspectrum/dashboard-components 0.13.7 → 0.14.2

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 (82) hide show
  1. package/custom-elements.json +24 -62
  2. package/dist/{LineageFilterChangedEvent-GedKNGFI.js → LineageFilterChangedEvent-C9dXOxt6.js} +11 -3
  3. package/dist/LineageFilterChangedEvent-C9dXOxt6.js.map +1 -0
  4. package/dist/assets/mutationOverTimeWorker-Dxnxrfe0.js.map +1 -1
  5. package/dist/components.d.ts +40 -50
  6. package/dist/components.js +112 -91
  7. package/dist/components.js.map +1 -1
  8. package/dist/util.d.ts +38 -28
  9. package/dist/util.js +1 -1
  10. package/package.json +2 -2
  11. package/src/lapisApi/lapisApi.ts +1 -1
  12. package/src/operator/FillMissingOperator.spec.ts +1 -1
  13. package/src/operator/GroupByAndSumOperator.spec.ts +1 -1
  14. package/src/operator/GroupByOperator.spec.ts +2 -2
  15. package/src/operator/MapOperator.spec.ts +1 -1
  16. package/src/operator/MockOperator.spec.ts +1 -1
  17. package/src/operator/MockOperator.ts +6 -4
  18. package/src/operator/SortOperator.spec.ts +1 -1
  19. package/src/preact/LapisUrlContext.ts +14 -1
  20. package/src/preact/aggregatedData/aggregate.stories.tsx +4 -4
  21. package/src/preact/aggregatedData/aggregate.tsx +3 -4
  22. package/src/preact/components/csv-download-button.stories.tsx +2 -2
  23. package/src/preact/components/csv-download-button.tsx +1 -1
  24. package/src/preact/components/error-boundary.stories.tsx +5 -5
  25. package/src/preact/components/error-boundary.tsx +14 -3
  26. package/src/preact/components/error-display.stories.tsx +9 -9
  27. package/src/preact/components/fullscreen.tsx +3 -3
  28. package/src/preact/components/info.tsx +1 -1
  29. package/src/preact/components/mutation-type-selector.stories.tsx +1 -1
  30. package/src/preact/components/table.stories.tsx +3 -3
  31. package/src/preact/components/table.tsx +1 -1
  32. package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +34 -20
  33. package/src/preact/dateRangeSelector/computeInitialValues.ts +25 -21
  34. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +107 -46
  35. package/src/preact/dateRangeSelector/date-range-selector.tsx +31 -22
  36. package/src/preact/dateRangeSelector/dateRangeOption.ts +11 -1
  37. package/src/preact/lineageFilter/lineage-filter.stories.tsx +9 -9
  38. package/src/preact/lineageFilter/lineage-filter.tsx +3 -4
  39. package/src/preact/locationFilter/fetchAutocompletionList.ts +1 -1
  40. package/src/preact/locationFilter/location-filter.stories.tsx +9 -9
  41. package/src/preact/locationFilter/location-filter.tsx +4 -4
  42. package/src/preact/map/sequences-by-location.stories.tsx +4 -4
  43. package/src/preact/map/sequences-by-location.tsx +3 -4
  44. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -3
  45. package/src/preact/mutationComparison/mutation-comparison.tsx +4 -4
  46. package/src/preact/mutationFilter/mutation-filter-info.tsx +3 -3
  47. package/src/preact/mutationFilter/mutation-filter.stories.tsx +7 -7
  48. package/src/preact/mutations/getMutationsGridData.ts +1 -1
  49. package/src/preact/mutations/mutations.stories.tsx +3 -3
  50. package/src/preact/mutations/mutations.tsx +4 -4
  51. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +3 -3
  52. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +4 -4
  53. package/src/preact/mutationsOverTime/mutations-over-time.tsx +5 -4
  54. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +4 -4
  55. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  56. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +4 -4
  57. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +4 -4
  58. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +4 -4
  59. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +4 -4
  60. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +4 -4
  61. package/src/preact/shared/floating-ui/hooks.ts +1 -1
  62. package/src/preact/statistic/statistics.stories.tsx +3 -3
  63. package/src/preact/statistic/statistics.tsx +2 -3
  64. package/src/preact/textInput/text-input.stories.tsx +7 -7
  65. package/src/preact/textInput/text-input.tsx +3 -4
  66. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +3 -3
  67. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +4 -4
  68. package/src/utils/map2d.ts +1 -0
  69. package/src/web-components/PreactLitAdapter.tsx +3 -3
  70. package/src/web-components/gs-app.stories.ts +7 -7
  71. package/src/web-components/gs-app.ts +3 -1
  72. package/src/web-components/input/gs-date-range-selector.stories.ts +10 -17
  73. package/src/web-components/input/gs-date-range-selector.tsx +15 -38
  74. package/src/web-components/input/gs-lineage-filter.stories.ts +1 -1
  75. package/src/web-components/input/gs-location-filter.stories.ts +1 -1
  76. package/src/web-components/input/gs-mutation-filter.stories.ts +7 -7
  77. package/src/web-components/input/gs-text-input.stories.ts +3 -3
  78. package/src/web-components/visualization/gs-aggregate.tsx +2 -2
  79. package/standalone-bundle/assets/mutationOverTimeWorker-CmSrq4SZ.js.map +1 -1
  80. package/standalone-bundle/dashboard-components.js +6068 -6055
  81. package/standalone-bundle/dashboard-components.js.map +1 -1
  82. package/dist/LineageFilterChangedEvent-GedKNGFI.js.map +0 -1
@@ -45,7 +45,7 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
45
45
  /**
46
46
  * A list of tabs with views that this component should provide.
47
47
  */
48
- views: AggregateView[];
48
+ views: ('table' | 'bar')[];
49
49
  /**
50
50
  * The filter to apply to the data.
51
51
  * It must be a valid LAPIS filter object.
@@ -89,10 +89,6 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
89
89
  render(): JSX_2.Element;
90
90
  }
91
91
 
92
- declare type AggregateView = default_2.infer<typeof aggregateViewSchema>;
93
-
94
- declare const aggregateViewSchema: default_2.ZodUnion<[default_2.ZodLiteral<"table">, default_2.ZodLiteral<"bar">]>;
95
-
96
92
  /**
97
93
  * ## Context
98
94
  *
@@ -162,14 +158,17 @@ export declare class AppComponent extends LitElement {
162
158
  * Contains the selected dateRangeOption or when users select custom values it contains the selected dates.
163
159
  *
164
160
  * Use this event, when you want to control this component in your JS application.
161
+ * You can supply the `detail` of this event to the `value` attribute of this component.
165
162
  */
166
163
  export declare class DateRangeSelectorComponent extends PreactLitAdapter {
167
164
  /**
168
165
  * 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`.
166
+ * The `label` will be shown to the user, and it will be available as `value`.
170
167
  * The dates must be in the format `YYYY-MM-DD`.
171
168
  *
172
169
  * If dateFrom or dateTo is not set, the component will default to the `earliestDate` or the current date.
170
+ *
171
+ * We provide some options in `dateRangeOptionPresets` for convenience.
173
172
  */
174
173
  dateRangeOptions: {
175
174
  label: string;
@@ -181,28 +180,19 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
181
180
  */
182
181
  earliestDate: string;
183
182
  /**
184
- * The initial value to use for this date range selector.
185
- * Must be a valid label from the `dateRangeOptions`.
183
+ * The value to use for this date range selector.
184
+ * - If it is a string, then it must be a valid label from the `dateRangeOptions`.
185
+ * - If it is an object, then it accepts dates in the format `YYYY-MM-DD` for the keys `dateFrom` and `dateTo`.
186
+ * Keys that are not set will default to the `earliestDate` or the current date respectively.
187
+ * - If the attribute is not set, the component will default to the range `earliestDate` until today.
186
188
  *
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.
190
- *
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`.
198
- */
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.
189
+ * The `detail` of the `gs-date-range-option-changed` event can be used for this attribute,
190
+ * if you want to control this component in your JS application.
204
191
  */
205
- initialDateTo: string | undefined;
192
+ value: string | {
193
+ dateFrom?: string;
194
+ dateTo?: string;
195
+ } | undefined;
206
196
  /**
207
197
  * The width of the component.
208
198
  *
@@ -1352,7 +1342,7 @@ declare global {
1352
1342
 
1353
1343
  declare global {
1354
1344
  interface HTMLElementTagNameMap {
1355
- 'gs-mutation-comparison-component': MutationComparisonComponent;
1345
+ 'gs-mutations-component': MutationsComponent;
1356
1346
  }
1357
1347
  }
1358
1348
 
@@ -1360,7 +1350,7 @@ declare global {
1360
1350
  declare global {
1361
1351
  namespace JSX {
1362
1352
  interface IntrinsicElements {
1363
- 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1353
+ 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1364
1354
  }
1365
1355
  }
1366
1356
  }
@@ -1368,7 +1358,7 @@ declare global {
1368
1358
 
1369
1359
  declare global {
1370
1360
  interface HTMLElementTagNameMap {
1371
- 'gs-mutations-component': MutationsComponent;
1361
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1372
1362
  }
1373
1363
  }
1374
1364
 
@@ -1376,7 +1366,7 @@ declare global {
1376
1366
  declare global {
1377
1367
  namespace JSX {
1378
1368
  interface IntrinsicElements {
1379
- 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1369
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1380
1370
  }
1381
1371
  }
1382
1372
  }
@@ -1416,7 +1406,7 @@ declare global {
1416
1406
 
1417
1407
  declare global {
1418
1408
  interface HTMLElementTagNameMap {
1419
- 'gs-aggregate': AggregateComponent;
1409
+ 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1420
1410
  }
1421
1411
  }
1422
1412
 
@@ -1424,7 +1414,7 @@ declare global {
1424
1414
  declare global {
1425
1415
  namespace JSX {
1426
1416
  interface IntrinsicElements {
1427
- 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1417
+ 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1428
1418
  }
1429
1419
  }
1430
1420
  }
@@ -1432,7 +1422,7 @@ declare global {
1432
1422
 
1433
1423
  declare global {
1434
1424
  interface HTMLElementTagNameMap {
1435
- 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1425
+ 'gs-aggregate': AggregateComponent;
1436
1426
  }
1437
1427
  }
1438
1428
 
@@ -1440,7 +1430,7 @@ declare global {
1440
1430
  declare global {
1441
1431
  namespace JSX {
1442
1432
  interface IntrinsicElements {
1443
- 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1433
+ 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1444
1434
  }
1445
1435
  }
1446
1436
  }
@@ -1464,7 +1454,7 @@ declare global {
1464
1454
 
1465
1455
  declare global {
1466
1456
  interface HTMLElementTagNameMap {
1467
- 'gs-statistics': StatisticsComponent;
1457
+ 'gs-sequences-by-location': SequencesByLocationComponent;
1468
1458
  }
1469
1459
  }
1470
1460
 
@@ -1472,7 +1462,7 @@ declare global {
1472
1462
  declare global {
1473
1463
  namespace JSX {
1474
1464
  interface IntrinsicElements {
1475
- 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1465
+ 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1476
1466
  }
1477
1467
  }
1478
1468
  }
@@ -1480,7 +1470,7 @@ declare global {
1480
1470
 
1481
1471
  declare global {
1482
1472
  interface HTMLElementTagNameMap {
1483
- 'gs-sequences-by-location': SequencesByLocationComponent;
1473
+ 'gs-statistics': StatisticsComponent;
1484
1474
  }
1485
1475
  }
1486
1476
 
@@ -1488,7 +1478,7 @@ declare global {
1488
1478
  declare global {
1489
1479
  namespace JSX {
1490
1480
  interface IntrinsicElements {
1491
- 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1481
+ 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1492
1482
  }
1493
1483
  }
1494
1484
  }
@@ -1532,10 +1522,10 @@ declare global {
1532
1522
 
1533
1523
  declare global {
1534
1524
  interface HTMLElementTagNameMap {
1535
- 'gs-location-filter': LocationFilterComponent;
1525
+ 'gs-text-input': TextInputComponent;
1536
1526
  }
1537
1527
  interface HTMLElementEventMap {
1538
- 'gs-location-changed': LocationChangedEvent;
1528
+ 'gs-text-input-changed': TextInputChangedEvent;
1539
1529
  }
1540
1530
  }
1541
1531
 
@@ -1543,7 +1533,7 @@ declare global {
1543
1533
  declare global {
1544
1534
  namespace JSX {
1545
1535
  interface IntrinsicElements {
1546
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1536
+ 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1547
1537
  }
1548
1538
  }
1549
1539
  }
@@ -1551,10 +1541,10 @@ declare global {
1551
1541
 
1552
1542
  declare global {
1553
1543
  interface HTMLElementTagNameMap {
1554
- 'gs-mutation-filter': MutationFilterComponent;
1544
+ 'gs-location-filter': LocationFilterComponent;
1555
1545
  }
1556
1546
  interface HTMLElementEventMap {
1557
- 'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
1547
+ 'gs-location-changed': LocationChangedEvent;
1558
1548
  }
1559
1549
  }
1560
1550
 
@@ -1562,7 +1552,7 @@ declare global {
1562
1552
  declare global {
1563
1553
  namespace JSX {
1564
1554
  interface IntrinsicElements {
1565
- 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1555
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1566
1556
  }
1567
1557
  }
1568
1558
  }
@@ -1570,10 +1560,10 @@ declare global {
1570
1560
 
1571
1561
  declare global {
1572
1562
  interface HTMLElementTagNameMap {
1573
- 'gs-text-input': TextInputComponent;
1563
+ 'gs-lineage-filter': LineageFilterComponent;
1574
1564
  }
1575
1565
  interface HTMLElementEventMap {
1576
- 'gs-text-input-changed': TextInputChangedEvent;
1566
+ 'gs-lineage-filter-changed': LineageFilterChangedEvent;
1577
1567
  }
1578
1568
  }
1579
1569
 
@@ -1581,7 +1571,7 @@ declare global {
1581
1571
  declare global {
1582
1572
  namespace JSX {
1583
1573
  interface IntrinsicElements {
1584
- 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1574
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1585
1575
  }
1586
1576
  }
1587
1577
  }
@@ -1589,10 +1579,10 @@ declare global {
1589
1579
 
1590
1580
  declare global {
1591
1581
  interface HTMLElementTagNameMap {
1592
- 'gs-lineage-filter': LineageFilterComponent;
1582
+ 'gs-mutation-filter': MutationFilterComponent;
1593
1583
  }
1594
1584
  interface HTMLElementEventMap {
1595
- 'gs-lineage-filter-changed': LineageFilterChangedEvent;
1585
+ 'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
1596
1586
  }
1597
1587
  }
1598
1588
 
@@ -1600,7 +1590,7 @@ declare global {
1600
1590
  declare global {
1601
1591
  namespace JSX {
1602
1592
  interface IntrinsicElements {
1603
- 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1593
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1604
1594
  }
1605
1595
  }
1606
1596
  }