@genspectrum/dashboard-components 1.4.0 → 1.6.0

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 (41) hide show
  1. package/custom-elements.json +134 -7
  2. package/dist/assets/{mutationOverTimeWorker-CQxrFo53.js.map → mutationOverTimeWorker-BmB6BvVM.js.map} +1 -1
  3. package/dist/components.d.ts +52 -11
  4. package/dist/components.js +189 -45
  5. package/dist/components.js.map +1 -1
  6. package/dist/util.d.ts +11 -11
  7. package/package.json +1 -1
  8. package/src/preact/lineageFilter/lineage-filter.stories.tsx +24 -0
  9. package/src/preact/lineageFilter/lineage-filter.tsx +13 -2
  10. package/src/preact/locationFilter/location-filter.stories.tsx +24 -0
  11. package/src/preact/locationFilter/location-filter.tsx +19 -3
  12. package/src/preact/mutationFilter/mutation-filter-info.tsx +2 -2
  13. package/src/preact/mutationFilter/mutation-filter.stories.tsx +71 -1
  14. package/src/preact/mutationFilter/mutation-filter.tsx +65 -24
  15. package/src/preact/mutationsOverTime/__mockData__/withGaps.ts +352 -0
  16. package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +38 -0
  17. package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +10 -0
  18. package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +2 -0
  19. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +35 -0
  20. package/src/preact/mutationsOverTime/mutations-over-time.tsx +28 -4
  21. package/src/preact/textFilter/text-filter.stories.tsx +29 -4
  22. package/src/preact/textFilter/text-filter.tsx +13 -2
  23. package/src/query/queryMutationsOverTime.ts +37 -4
  24. package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +122 -0
  25. package/src/utils/map2d.spec.ts +30 -0
  26. package/src/utils/map2d.ts +14 -1
  27. package/src/utils/mutations.spec.ts +13 -0
  28. package/src/utils/mutations.ts +3 -3
  29. package/src/web-components/input/gs-lineage-filter.stories.ts +7 -0
  30. package/src/web-components/input/gs-lineage-filter.tsx +8 -0
  31. package/src/web-components/input/gs-location-filter.stories.ts +7 -0
  32. package/src/web-components/input/gs-location-filter.tsx +9 -1
  33. package/src/web-components/input/gs-mutation-filter.stories.ts +29 -1
  34. package/src/web-components/input/gs-mutation-filter.tsx +29 -2
  35. package/src/web-components/input/gs-text-filter.stories.ts +7 -0
  36. package/src/web-components/input/gs-text-filter.tsx +8 -0
  37. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +14 -1
  38. package/src/web-components/visualization/gs-mutations-over-time.tsx +8 -0
  39. package/standalone-bundle/assets/{mutationOverTimeWorker-CDACUs6w.js.map → mutationOverTimeWorker-B_xP8pIC.js.map} +1 -1
  40. package/standalone-bundle/dashboard-components.js +3666 -3553
  41. package/standalone-bundle/dashboard-components.js.map +1 -1
@@ -319,6 +319,11 @@ export declare class LineageFilterComponent extends PreactLitAdapter {
319
319
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
320
320
  */
321
321
  width: string;
322
+ /**
323
+ * Whether to hide counts behind lineage options in the drop down selection.
324
+ * Defaults to false.
325
+ */
326
+ hideCounts: boolean | undefined;
322
327
  render(): JSX_2.Element;
323
328
  }
324
329
 
@@ -381,6 +386,11 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
381
386
  * The placeholder text to display in the input field, if it is empty.
382
387
  */
383
388
  placeholderText: string | undefined;
389
+ /**
390
+ * Whether to hide counts behind location options in the drop down selection.
391
+ * Defaults to false.
392
+ */
393
+ hideCounts: boolean | undefined;
384
394
  render(): JSX_2.Element;
385
395
  }
386
396
 
@@ -527,6 +537,11 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
527
537
  *
528
538
  * Examples: `ins_S:614:G`, `ins_614:G`
529
539
  *
540
+ * ### Enabled mutation types
541
+ *
542
+ * After parsing, the entered mutation/insertion also has to match the enabled mutation types,
543
+ * which are configured with the `enabledMutationTypes` attribute.
544
+ *
530
545
  * @fires {CustomEvent<{
531
546
  * nucleotideMutations: string[],
532
547
  * aminoAcidMutations: string[],
@@ -555,6 +570,18 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
555
570
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
556
571
  */
557
572
  width: string;
573
+ /**
574
+ * Which mutation types this input will accept.
575
+ * Any (or all) of the following can be given in a list:
576
+ *
577
+ * - `nucleotideMutations`
578
+ * - `nucleotideInsertions`
579
+ * - `aminoAcidMutations`
580
+ * - `aminoAcidInsertions`
581
+ *
582
+ * By default or if none are given, all types are accepted.
583
+ */
584
+ enabledMutationTypes: MutationType[] | undefined;
558
585
  render(): JSX_2.Element;
559
586
  }
560
587
 
@@ -753,6 +780,11 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
753
780
  min: number;
754
781
  max: number;
755
782
  };
783
+ /**
784
+ * If true, date ranges with no data will be hidden initially; if false, not.
785
+ * Can be switched with a button in the toolbar.
786
+ */
787
+ hideGaps: boolean;
756
788
  /**
757
789
  * Whether to use the mutationsOverTime endpoint from LAPIS.
758
790
  * If true, use the endpoint, if false, compute component data as before.
@@ -767,6 +799,10 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
767
799
  render(): JSX_2.Element;
768
800
  }
769
801
 
802
+ declare type MutationType = default_2.infer<typeof mutationTypeSchema>;
803
+
804
+ declare const mutationTypeSchema: default_2.ZodEnum<["nucleotideMutations", "aminoAcidMutations", "nucleotideInsertions", "aminoAcidInsertions"]>;
805
+
770
806
  /**
771
807
  *
772
808
  * ## Context
@@ -1484,6 +1520,11 @@ export declare class TextFilterComponent extends PreactLitAdapter {
1484
1520
  * The placeholder text to display in the input field.
1485
1521
  */
1486
1522
  placeholderText: string | undefined;
1523
+ /**
1524
+ * Whether to hide counts behind options in the drop down selection.
1525
+ * Defaults to false.
1526
+ */
1527
+ hideCounts: boolean | undefined;
1487
1528
  /**
1488
1529
  * The width of the component.
1489
1530
  *
@@ -1601,7 +1642,7 @@ declare global {
1601
1642
 
1602
1643
  declare global {
1603
1644
  interface HTMLElementTagNameMap {
1604
- 'gs-genome-data-viewer': GenomeDataViewerComponent;
1645
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1605
1646
  }
1606
1647
  }
1607
1648
 
@@ -1609,7 +1650,7 @@ declare global {
1609
1650
  declare global {
1610
1651
  namespace JSX {
1611
1652
  interface IntrinsicElements {
1612
- 'gs-genome-data-viewer': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1653
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1613
1654
  }
1614
1655
  }
1615
1656
  }
@@ -1617,7 +1658,7 @@ declare global {
1617
1658
 
1618
1659
  declare global {
1619
1660
  interface HTMLElementTagNameMap {
1620
- 'gs-mutation-comparison-component': MutationComparisonComponent;
1661
+ 'gs-genome-data-viewer': GenomeDataViewerComponent;
1621
1662
  }
1622
1663
  }
1623
1664
 
@@ -1625,7 +1666,7 @@ declare global {
1625
1666
  declare global {
1626
1667
  namespace JSX {
1627
1668
  interface IntrinsicElements {
1628
- 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1669
+ 'gs-genome-data-viewer': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1629
1670
  }
1630
1671
  }
1631
1672
  }
@@ -1761,10 +1802,11 @@ declare global {
1761
1802
 
1762
1803
  declare global {
1763
1804
  interface HTMLElementTagNameMap {
1764
- 'gs-location-filter': LocationFilterComponent;
1805
+ 'gs-date-range-filter': DateRangeFilterComponent;
1765
1806
  }
1766
1807
  interface HTMLElementEventMap {
1767
- [gsEventNames.locationChanged]: LocationChangedEvent;
1808
+ [gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
1809
+ [gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
1768
1810
  }
1769
1811
  }
1770
1812
 
@@ -1772,7 +1814,7 @@ declare global {
1772
1814
  declare global {
1773
1815
  namespace JSX {
1774
1816
  interface IntrinsicElements {
1775
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1817
+ 'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1776
1818
  }
1777
1819
  }
1778
1820
  }
@@ -1780,11 +1822,10 @@ declare global {
1780
1822
 
1781
1823
  declare global {
1782
1824
  interface HTMLElementTagNameMap {
1783
- 'gs-date-range-filter': DateRangeFilterComponent;
1825
+ 'gs-location-filter': LocationFilterComponent;
1784
1826
  }
1785
1827
  interface HTMLElementEventMap {
1786
- [gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
1787
- [gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
1828
+ [gsEventNames.locationChanged]: LocationChangedEvent;
1788
1829
  }
1789
1830
  }
1790
1831
 
@@ -1792,7 +1833,7 @@ declare global {
1792
1833
  declare global {
1793
1834
  namespace JSX {
1794
1835
  interface IntrinsicElements {
1795
- 'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1836
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1796
1837
  }
1797
1838
  }
1798
1839
  }