@genspectrum/dashboard-components 0.16.2 → 0.16.3

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 (40) hide show
  1. package/custom-elements.json +72 -7
  2. package/dist/assets/mutationOverTimeWorker-DJcZmEH9.js.map +1 -0
  3. package/dist/components.d.ts +69 -31
  4. package/dist/components.js +305 -148
  5. package/dist/components.js.map +1 -1
  6. package/dist/style.css +16 -0
  7. package/dist/util.d.ts +31 -31
  8. package/package.json +4 -2
  9. package/src/preact/MutationAnnotationsContext.spec.tsx +58 -0
  10. package/src/preact/MutationAnnotationsContext.tsx +72 -0
  11. package/src/preact/components/annotated-mutation.stories.tsx +163 -0
  12. package/src/preact/components/annotated-mutation.tsx +80 -0
  13. package/src/preact/components/error-display.tsx +9 -9
  14. package/src/preact/components/info.tsx +6 -13
  15. package/src/preact/components/modal.stories.tsx +7 -19
  16. package/src/preact/components/modal.tsx +35 -4
  17. package/src/preact/mutations/mutations-table.tsx +14 -2
  18. package/src/preact/mutations/mutations.stories.tsx +40 -2
  19. package/src/preact/mutations/mutations.tsx +1 -0
  20. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +19 -8
  21. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +34 -5
  22. package/src/preact/mutationsOverTime/mutations-over-time.tsx +13 -1
  23. package/src/preact/sequencesByLocation/sequences-by-location-map.tsx +28 -30
  24. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +6 -1
  25. package/src/web-components/gs-app.spec-d.ts +10 -0
  26. package/src/web-components/gs-app.stories.ts +24 -6
  27. package/src/web-components/gs-app.ts +17 -0
  28. package/src/web-components/mutation-annotations-context.ts +16 -0
  29. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +18 -1
  30. package/src/web-components/visualization/gs-mutations-over-time.tsx +22 -11
  31. package/src/web-components/visualization/gs-mutations.stories.ts +18 -1
  32. package/src/web-components/visualization/gs-mutations.tsx +20 -9
  33. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +11 -1
  34. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +18 -7
  35. package/standalone-bundle/assets/mutationOverTimeWorker-CERZSdcA.js.map +1 -0
  36. package/standalone-bundle/dashboard-components.js +7332 -7202
  37. package/standalone-bundle/dashboard-components.js.map +1 -1
  38. package/standalone-bundle/style.css +1 -1
  39. package/dist/assets/mutationOverTimeWorker-BL50C-yi.js.map +0 -1
  40. package/standalone-bundle/assets/mutationOverTimeWorker-CFB5-Mdk.js.map +0 -1
@@ -97,6 +97,7 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
97
97
  * It makes use of the [Lit Context](https://lit.dev/docs/data/context/) to
98
98
  * - provide the URL to the LAPIS instance to all its children
99
99
  * - fetch the reference genomes from LAPIS and provide it to all its children
100
+ * - distribute the mutation annotations config to its children
100
101
  *
101
102
  * This will show an error message if the reference genome cannot be fetched
102
103
  * (e.g., due to an invalid LAPIS URL).
@@ -112,6 +113,18 @@ export declare class AppComponent extends LitElement {
112
113
  * The URL of the LAPIS instance that all children of this component will use.
113
114
  */
114
115
  lapis: string;
116
+ /**
117
+ * Supply lists of mutations that are especially relevant for the current organism.
118
+ * Whenever other components display mutations, matching mutations will be highlighted by appending the `symbol`.
119
+ * On hover, a tooltip with the `name` and `description` will be shown.
120
+ */
121
+ mutationAnnotations: {
122
+ name: string;
123
+ description: string;
124
+ symbol: string;
125
+ nucleotideMutations: string[];
126
+ aminoAcidMutations: string[];
127
+ }[];
115
128
  /* Excluded from this release type: referenceGenome */
116
129
  /* Excluded from this release type: updateReferenceGenome */
117
130
  render(): TemplateResult<1> | undefined;
@@ -332,6 +345,28 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
332
345
  render(): JSX_2.Element;
333
346
  }
334
347
 
348
+ declare type MutationAnnotations = default_2.infer<typeof mutationAnnotationsSchema>;
349
+
350
+ declare const mutationAnnotationsSchema: default_2.ZodArray<default_2.ZodObject<{
351
+ name: default_2.ZodString;
352
+ description: default_2.ZodString;
353
+ symbol: default_2.ZodString;
354
+ nucleotideMutations: default_2.ZodArray<default_2.ZodString, "many">;
355
+ aminoAcidMutations: default_2.ZodArray<default_2.ZodString, "many">;
356
+ }, "strip", default_2.ZodTypeAny, {
357
+ symbol: string;
358
+ name: string;
359
+ description: string;
360
+ nucleotideMutations: string[];
361
+ aminoAcidMutations: string[];
362
+ }, {
363
+ symbol: string;
364
+ name: string;
365
+ description: string;
366
+ nucleotideMutations: string[];
367
+ aminoAcidMutations: string[];
368
+ }>, "many">;
369
+
335
370
  /**
336
371
  * ## Context
337
372
  *
@@ -567,6 +602,7 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
567
602
  * Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
568
603
  */
569
604
  pageSize: boolean | number;
605
+ /* Excluded from this release type: mutationAnnotations */
570
606
  render(): JSX_2.Element;
571
607
  }
572
608
 
@@ -654,6 +690,7 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
654
690
  min: number;
655
691
  max: number;
656
692
  };
693
+ /* Excluded from this release type: mutationAnnotations */
657
694
  render(): JSX_2.Element;
658
695
  }
659
696
 
@@ -1328,6 +1365,7 @@ export declare class WastewaterMutationsOverTimeComponent extends PreactLitAdapt
1328
1365
  * The maximum number of grid rows to display.
1329
1366
  */
1330
1367
  maxNumberOfGridRows: number;
1368
+ /* Excluded from this release type: mutationAnnotations */
1331
1369
  render(): JSX_2.Element;
1332
1370
  }
1333
1371
 
@@ -1391,7 +1429,7 @@ declare global {
1391
1429
 
1392
1430
  declare global {
1393
1431
  interface HTMLElementTagNameMap {
1394
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1432
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1395
1433
  }
1396
1434
  }
1397
1435
 
@@ -1399,7 +1437,7 @@ declare global {
1399
1437
  declare global {
1400
1438
  namespace JSX {
1401
1439
  interface IntrinsicElements {
1402
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1440
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1403
1441
  }
1404
1442
  }
1405
1443
  }
@@ -1407,7 +1445,7 @@ declare global {
1407
1445
 
1408
1446
  declare global {
1409
1447
  interface HTMLElementTagNameMap {
1410
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1448
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1411
1449
  }
1412
1450
  }
1413
1451
 
@@ -1415,7 +1453,7 @@ declare global {
1415
1453
  declare global {
1416
1454
  namespace JSX {
1417
1455
  interface IntrinsicElements {
1418
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1456
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1419
1457
  }
1420
1458
  }
1421
1459
  }
@@ -1437,6 +1475,22 @@ declare global {
1437
1475
  }
1438
1476
 
1439
1477
 
1478
+ declare global {
1479
+ interface HTMLElementTagNameMap {
1480
+ 'gs-mutations-over-time': MutationsOverTimeComponent;
1481
+ }
1482
+ }
1483
+
1484
+
1485
+ declare global {
1486
+ namespace JSX {
1487
+ interface IntrinsicElements {
1488
+ 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1489
+ }
1490
+ }
1491
+ }
1492
+
1493
+
1440
1494
  declare global {
1441
1495
  interface HTMLElementTagNameMap {
1442
1496
  'gs-aggregate': AggregateComponent;
@@ -1455,7 +1509,7 @@ declare global {
1455
1509
 
1456
1510
  declare global {
1457
1511
  interface HTMLElementTagNameMap {
1458
- 'gs-mutations-over-time': MutationsOverTimeComponent;
1512
+ 'gs-statistics': StatisticsComponent;
1459
1513
  }
1460
1514
  }
1461
1515
 
@@ -1463,7 +1517,7 @@ declare global {
1463
1517
  declare global {
1464
1518
  namespace JSX {
1465
1519
  interface IntrinsicElements {
1466
- 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1520
+ 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1467
1521
  }
1468
1522
  }
1469
1523
  }
@@ -1471,7 +1525,10 @@ declare global {
1471
1525
 
1472
1526
  declare global {
1473
1527
  interface HTMLElementTagNameMap {
1474
- 'gs-sequences-by-location': SequencesByLocationComponent;
1528
+ 'gs-location-filter': LocationFilterComponent;
1529
+ }
1530
+ interface HTMLElementEventMap {
1531
+ 'gs-location-changed': LocationChangedEvent;
1475
1532
  }
1476
1533
  }
1477
1534
 
@@ -1479,7 +1536,7 @@ declare global {
1479
1536
  declare global {
1480
1537
  namespace JSX {
1481
1538
  interface IntrinsicElements {
1482
- 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1539
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1483
1540
  }
1484
1541
  }
1485
1542
  }
@@ -1487,7 +1544,7 @@ declare global {
1487
1544
 
1488
1545
  declare global {
1489
1546
  interface HTMLElementTagNameMap {
1490
- 'gs-statistics': StatisticsComponent;
1547
+ 'gs-sequences-by-location': SequencesByLocationComponent;
1491
1548
  }
1492
1549
  }
1493
1550
 
@@ -1495,7 +1552,7 @@ declare global {
1495
1552
  declare global {
1496
1553
  namespace JSX {
1497
1554
  interface IntrinsicElements {
1498
- 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1555
+ 'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1499
1556
  }
1500
1557
  }
1501
1558
  }
@@ -1503,10 +1560,7 @@ declare global {
1503
1560
 
1504
1561
  declare global {
1505
1562
  interface HTMLElementTagNameMap {
1506
- 'gs-location-filter': LocationFilterComponent;
1507
- }
1508
- interface HTMLElementEventMap {
1509
- 'gs-location-changed': LocationChangedEvent;
1563
+ 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1510
1564
  }
1511
1565
  }
1512
1566
 
@@ -1514,7 +1568,7 @@ declare global {
1514
1568
  declare global {
1515
1569
  namespace JSX {
1516
1570
  interface IntrinsicElements {
1517
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1571
+ 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1518
1572
  }
1519
1573
  }
1520
1574
  }
@@ -1597,22 +1651,6 @@ declare global {
1597
1651
  }
1598
1652
 
1599
1653
 
1600
- declare global {
1601
- interface HTMLElementTagNameMap {
1602
- 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1603
- }
1604
- }
1605
-
1606
-
1607
- declare global {
1608
- namespace JSX {
1609
- interface IntrinsicElements {
1610
- 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1611
- }
1612
- }
1613
- }
1614
-
1615
-
1616
1654
  declare module 'chart.js' {
1617
1655
  interface CartesianScaleTypeRegistry {
1618
1656
  logit: {