@genspectrum/dashboard-components 1.7.0 → 1.8.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 (31) hide show
  1. package/README.md +22 -2
  2. package/custom-elements.json +81 -0
  3. package/dist/assets/{mutationOverTimeWorker-DPS3tmOd.js.map → mutationOverTimeWorker-BRPqAM5Z.js.map} +1 -1
  4. package/dist/components.d.ts +49 -22
  5. package/dist/components.js +130 -37
  6. package/dist/components.js.map +1 -1
  7. package/dist/util.d.ts +22 -22
  8. package/package.json +1 -1
  9. package/src/preact/MutationLinkTemplateContext.tsx +56 -0
  10. package/src/preact/components/annotated-mutation.stories.tsx +69 -17
  11. package/src/preact/components/annotated-mutation.tsx +45 -19
  12. package/src/preact/mutationComparison/mutation-comparison-table.tsx +3 -0
  13. package/src/preact/mutations/mutations-table.tsx +3 -0
  14. package/src/preact/shared/stories/expectMutationAnnotation.ts +3 -1
  15. package/src/preact/wastewater/mutationsOverTime/__mockData__/detailsAminAcidNonSegmented.json +88 -0
  16. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +34 -0
  17. package/src/query/queryWastewaterMutationsOverTime.ts +1 -1
  18. package/src/utils/mutations.ts +18 -10
  19. package/src/web-components/gs-app.spec-d.ts +7 -0
  20. package/src/web-components/gs-app.stories.ts +32 -2
  21. package/src/web-components/gs-app.ts +17 -0
  22. package/src/web-components/mutation-link-template-context.ts +13 -0
  23. package/src/web-components/mutationLinks.mdx +27 -0
  24. package/src/web-components/visualization/gs-mutation-comparison.tsx +18 -8
  25. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +12 -1
  26. package/src/web-components/visualization/gs-mutations-over-time.tsx +24 -14
  27. package/src/web-components/visualization/gs-mutations.tsx +19 -9
  28. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +17 -7
  29. package/standalone-bundle/assets/{mutationOverTimeWorker-Dp-A14AP.js.map → mutationOverTimeWorker-DtFX4Ihx.js.map} +1 -1
  30. package/standalone-bundle/dashboard-components.js +6360 -6298
  31. package/standalone-bundle/dashboard-components.js.map +1 -1
@@ -130,6 +130,16 @@ export declare class AppComponent extends LitElement {
130
130
  aminoAcidMutations?: string[];
131
131
  aminoAcidPositions?: string[];
132
132
  }[];
133
+ /**
134
+ * Supply a link template for nucleotide and amino acid mutations.
135
+ * The template should include '{{mutation}}' where the mutation code will be inserted, for example:
136
+ *
137
+ * https://my-site.org/query?nucleotideMutation={{mutation}}
138
+ */
139
+ mutationLinkTemplate: {
140
+ nucleotideMutation?: string;
141
+ aminoAcidMutation?: string;
142
+ };
133
143
  /* Excluded from this release type: referenceGenome */
134
144
  /* Excluded from this release type: updateReferenceGenome */
135
145
  render(): TemplateResult<1> | undefined;
@@ -499,6 +509,7 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
499
509
  */
500
510
  pageSize: boolean | number;
501
511
  /* Excluded from this release type: mutationAnnotations */
512
+ /* Excluded from this release type: mutationLinkTemplate */
502
513
  render(): JSX_2.Element;
503
514
  }
504
515
 
@@ -585,6 +596,19 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
585
596
  render(): JSX_2.Element;
586
597
  }
587
598
 
599
+ declare type MutationLinkTemplate = default_2.infer<typeof mutationLinkTemplateSchema>;
600
+
601
+ declare const mutationLinkTemplateSchema: default_2.ZodObject<{
602
+ nucleotideMutation: default_2.ZodOptional<default_2.ZodString>;
603
+ aminoAcidMutation: default_2.ZodOptional<default_2.ZodString>;
604
+ }, "strip", default_2.ZodTypeAny, {
605
+ nucleotideMutation?: string | undefined;
606
+ aminoAcidMutation?: string | undefined;
607
+ }, {
608
+ nucleotideMutation?: string | undefined;
609
+ aminoAcidMutation?: string | undefined;
610
+ }>;
611
+
588
612
  /**
589
613
  * ## Context
590
614
  *
@@ -687,6 +711,7 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
687
711
  */
688
712
  pageSize: boolean | number;
689
713
  /* Excluded from this release type: mutationAnnotations */
714
+ /* Excluded from this release type: mutationLinkTemplate */
690
715
  render(): JSX_2.Element;
691
716
  }
692
717
 
@@ -796,6 +821,7 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
796
821
  */
797
822
  pageSizes: number[] | number;
798
823
  /* Excluded from this release type: mutationAnnotations */
824
+ /* Excluded from this release type: mutationLinkTemplate */
799
825
  render(): JSX_2.Element;
800
826
  }
801
827
 
@@ -1595,6 +1621,7 @@ export declare class WastewaterMutationsOverTimeComponent extends PreactLitAdapt
1595
1621
  */
1596
1622
  pageSizes: number[] | number;
1597
1623
  /* Excluded from this release type: mutationAnnotations */
1624
+ /* Excluded from this release type: mutationLinkTemplate */
1598
1625
  render(): JSX_2.Element;
1599
1626
  }
1600
1627
 
@@ -1674,7 +1701,7 @@ declare global {
1674
1701
 
1675
1702
  declare global {
1676
1703
  interface HTMLElementTagNameMap {
1677
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1704
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1678
1705
  }
1679
1706
  }
1680
1707
 
@@ -1682,7 +1709,7 @@ declare global {
1682
1709
  declare global {
1683
1710
  namespace JSX {
1684
1711
  interface IntrinsicElements {
1685
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1712
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1686
1713
  }
1687
1714
  }
1688
1715
  }
@@ -1690,7 +1717,7 @@ declare global {
1690
1717
 
1691
1718
  declare global {
1692
1719
  interface HTMLElementTagNameMap {
1693
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1720
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1694
1721
  }
1695
1722
  }
1696
1723
 
@@ -1698,7 +1725,7 @@ declare global {
1698
1725
  declare global {
1699
1726
  namespace JSX {
1700
1727
  interface IntrinsicElements {
1701
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1728
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1702
1729
  }
1703
1730
  }
1704
1731
  }
@@ -1752,6 +1779,22 @@ declare global {
1752
1779
  }
1753
1780
 
1754
1781
 
1782
+ declare global {
1783
+ interface HTMLElementTagNameMap {
1784
+ 'gs-statistics': StatisticsComponent;
1785
+ }
1786
+ }
1787
+
1788
+
1789
+ declare global {
1790
+ namespace JSX {
1791
+ interface IntrinsicElements {
1792
+ 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1793
+ }
1794
+ }
1795
+ }
1796
+
1797
+
1755
1798
  declare global {
1756
1799
  interface HTMLElementTagNameMap {
1757
1800
  'gs-sequences-by-location': SequencesByLocationComponent;
@@ -1770,7 +1813,7 @@ declare global {
1770
1813
 
1771
1814
  declare global {
1772
1815
  interface HTMLElementTagNameMap {
1773
- 'gs-statistics': StatisticsComponent;
1816
+ 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1774
1817
  }
1775
1818
  }
1776
1819
 
@@ -1778,7 +1821,7 @@ declare global {
1778
1821
  declare global {
1779
1822
  namespace JSX {
1780
1823
  interface IntrinsicElements {
1781
- 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1824
+ 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1782
1825
  }
1783
1826
  }
1784
1827
  }
@@ -1900,22 +1943,6 @@ declare global {
1900
1943
  }
1901
1944
 
1902
1945
 
1903
- declare global {
1904
- interface HTMLElementTagNameMap {
1905
- 'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
1906
- }
1907
- }
1908
-
1909
-
1910
- declare global {
1911
- namespace JSX {
1912
- interface IntrinsicElements {
1913
- 'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1914
- }
1915
- }
1916
- }
1917
-
1918
-
1919
1946
  declare module 'chart.js' {
1920
1947
  interface CartesianScaleTypeRegistry {
1921
1948
  logit: {