@genspectrum/dashboard-components 1.12.0 → 1.14.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 (71) hide show
  1. package/README.md +0 -7
  2. package/custom-elements.json +399 -27
  3. package/dist/components.d.ts +144 -33
  4. package/dist/components.js +2126 -1402
  5. package/dist/components.js.map +1 -1
  6. package/dist/util.d.ts +177 -26
  7. package/package.json +1 -5
  8. package/src/lapisApi/lapisApi.ts +21 -1
  9. package/src/lapisApi/lapisTypes.ts +36 -0
  10. package/src/preact/components/annotated-mutation.tsx +2 -2
  11. package/src/preact/{mutationsOverTime/mutations-over-time-grid.tsx → components/features-over-time-grid.tsx} +45 -52
  12. package/src/preact/genomeViewer/genome-data-viewer.tsx +2 -2
  13. package/src/preact/mutationsOverTime/MutationOverTimeData.ts +6 -4
  14. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay/aminoAcidMutations.json +5482 -0
  15. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay/aminoAcidMutationsOverTime.json +5496 -0
  16. package/src/preact/mutationsOverTime/__mockData__/byWeek/mutationsOverTime.json +7100 -0
  17. package/src/preact/mutationsOverTime/__mockData__/byWeek/nucleotideMutations.json +10122 -0
  18. package/src/preact/mutationsOverTime/__mockData__/defaultMockData/mutationsOverTime.json +12646 -0
  19. package/src/preact/mutationsOverTime/__mockData__/defaultMockData/nucleotideMutations.json +12632 -0
  20. package/src/preact/mutationsOverTime/__mockData__/request1800s/mutationsOverTime.json +16 -0
  21. package/src/preact/mutationsOverTime/__mockData__/request1800s/nucleotideMutations.json +11 -0
  22. package/src/preact/mutationsOverTime/__mockData__/withDisplayMutations/mutationsOverTime.json +52 -0
  23. package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +3 -3
  24. package/src/preact/mutationsOverTime/mutations-over-time-grid-tooltip.tsx +3 -6
  25. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +199 -12
  26. package/src/preact/mutationsOverTime/mutations-over-time.tsx +30 -35
  27. package/src/preact/queriesOverTime/__mockData__/defaultMockData/queriesOverTime.json +32 -0
  28. package/src/preact/queriesOverTime/__mockData__/manyQueries.json +128 -0
  29. package/src/preact/queriesOverTime/__mockData__/request1800s.json +16 -0
  30. package/src/preact/queriesOverTime/__mockData__/withGaps.json +52 -0
  31. package/src/preact/queriesOverTime/getFilteredQueriesOverTimeData.ts +85 -0
  32. package/src/preact/queriesOverTime/queries-over-time-filter.tsx +25 -0
  33. package/src/preact/queriesOverTime/queries-over-time-grid-tooltip.stories.tsx +134 -0
  34. package/src/preact/queriesOverTime/queries-over-time-grid-tooltip.tsx +123 -0
  35. package/src/preact/queriesOverTime/queries-over-time.stories.tsx +481 -0
  36. package/src/preact/queriesOverTime/queries-over-time.tsx +304 -0
  37. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +30 -3
  38. package/src/query/queryDatesInDataset.ts +89 -0
  39. package/src/query/queryMutationsOverTime.spec.ts +526 -548
  40. package/src/query/queryMutationsOverTime.ts +21 -232
  41. package/src/query/queryQueriesOverTime.spec.ts +432 -0
  42. package/src/query/queryQueriesOverTime.ts +125 -0
  43. package/src/utilEntrypoint.ts +4 -1
  44. package/src/utils/mutations.spec.ts +6 -0
  45. package/src/utils/mutations.ts +1 -1
  46. package/src/utils/temporalClass.ts +4 -0
  47. package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +2 -2
  48. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +283 -17
  49. package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -10
  50. package/src/web-components/visualization/gs-queries-over-time.spec-d.ts +38 -0
  51. package/src/web-components/visualization/gs-queries-over-time.stories.ts +288 -0
  52. package/src/web-components/visualization/gs-queries-over-time.tsx +154 -0
  53. package/src/web-components/visualization/index.ts +1 -0
  54. package/standalone-bundle/dashboard-components.js +10393 -9798
  55. package/standalone-bundle/dashboard-components.js.map +1 -1
  56. package/dist/assets/mutationOverTimeWorker-f8Kp0S6V.js.map +0 -1
  57. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +0 -47170
  58. package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +0 -54026
  59. package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +0 -108385
  60. package/src/preact/mutationsOverTime/__mockData__/mockConversion.ts +0 -54
  61. package/src/preact/mutationsOverTime/__mockData__/noDataWhenNoMutationsAreInFilter.ts +0 -23
  62. package/src/preact/mutationsOverTime/__mockData__/noDataWhenThereAreNoDatesInFilter.ts +0 -23
  63. package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +0 -65527
  64. package/src/preact/mutationsOverTime/__mockData__/withDisplayMutations.ts +0 -352
  65. package/src/preact/mutationsOverTime/__mockData__/withGaps.ts +0 -298
  66. package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +0 -33
  67. package/src/preact/mutationsOverTime/mutationOverTimeWorker.ts +0 -29
  68. package/src/preact/webWorkers/useWebWorker.ts +0 -74
  69. package/src/preact/webWorkers/workerFunction.ts +0 -30
  70. package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +0 -988
  71. package/standalone-bundle/assets/mutationOverTimeWorker-AhhjjklP.js.map +0 -1
package/README.md CHANGED
@@ -172,13 +172,6 @@ Make sure that stories don't issue actual HTTP calls to LAPIS or other services.
172
172
  This is to make sure that we have stable tests in CI that don't depend on the availability of other services.
173
173
  We still use the real LAPIS URL so that a user can change the filters in a story and will still see data.
174
174
 
175
- In general, we use `storybook-addon-fetch-mock` for all outgoing requests. This strategy
176
- cannot be used for components that use web workers, like gs-mutations-over-time. Therefore, we created custom mock
177
- workers that return mocked data. The mock workers are enabled in the package.json using
178
- Node.js [subpath imports](https://nodejs.org/api/packages.html#subpath-imports), following the guide
179
- from [storybook](https://storybook.js.org/docs/writing-stories/mocking-data-and-modules/mocking-modules). This ensures
180
- that when importing the worker in the component, the mock worker is used inside Storybook instead of the real worker.
181
-
182
175
  ### How The Release Build Works
183
176
 
184
177
  The `"exports"` field in `package.json` defines which files a user of the package can import using the normal module systems.
@@ -2717,7 +2717,7 @@
2717
2717
  "type": {
2718
2718
  "text": "Meta<Required<MutationsOverTimeProps>>"
2719
2719
  },
2720
- "default": "{ title: 'Visualization/Mutations over time', component: 'gs-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, displayMutations: { control: 'object' }, initialMeanProportionInterval: { control: 'object' }, hideGaps: { control: 'boolean' }, useNewEndpoint: { control: 'boolean' }, pageSizes: { control: 'object' }, customColumns: { control: 'object' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, sequenceType: 'nucleotide', views: ['grid'], width: '100%', granularity: 'month', lapisDateField: 'date', initialMeanProportionInterval: { min: 0.05, max: 0.9 }, hideGaps: false, useNewEndpoint: false, pageSizes: [10, 20, 30, 40, 50], }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: {}, }), tags: ['autodocs'], }"
2720
+ "default": "{ title: 'Visualization/Mutations over time', component: 'gs-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, displayMutations: { control: 'object' }, initialMeanProportionInterval: { control: 'object' }, hideGaps: { control: 'boolean' }, pageSizes: { control: 'object' }, customColumns: { control: 'object' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, sequenceType: 'nucleotide', views: ['grid'], width: '100%', granularity: 'month', lapisDateField: 'date', initialMeanProportionInterval: { min: 0.05, max: 0.9 }, hideGaps: false, pageSizes: [10, 20, 30, 40, 50], }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/nucleotideMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: mockDefaultNucleotideMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/nucleotideMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10', }, dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, { dateFrom: '2024-05-01', dateTo: '2024-05-31' }, { dateFrom: '2024-06-01', dateTo: '2024-06-30' }, { dateFrom: '2024-07-01', dateTo: '2024-07-31' }, ], dateField: 'date', }, matchPartialBody: true, response: { status: 200, body: mockDefaultMutationsOverTime, }, }, }, ], }, }), tags: ['autodocs'], }"
2721
2721
  },
2722
2722
  {
2723
2723
  "kind": "variable",
@@ -2733,7 +2733,7 @@
2733
2733
  "type": {
2734
2734
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
2735
2735
  },
2736
- "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A19722G', 'G21641T', 'T21653-'], }, }"
2736
+ "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A13121T', 'G24872T', 'T21653-'], }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/nucleotideMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: mockDefaultNucleotideMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/nucleotideMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, { dateFrom: '2024-05-01', dateTo: '2024-05-31' }, { dateFrom: '2024-06-01', dateTo: '2024-06-30' }, { dateFrom: '2024-07-01', dateTo: '2024-07-31' }, ], includeMutations: ['A13121T', 'T21653-', 'G24872T'], dateField: 'date', }, response: { status: 200, body: mockWithDisplayMutationsMutationsOverTime, }, }, }, ], }, }, }"
2737
2737
  },
2738
2738
  {
2739
2739
  "kind": "variable",
@@ -2741,7 +2741,7 @@
2741
2741
  "type": {
2742
2742
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
2743
2743
  },
2744
- "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A19722G', 'G21641T', 'T21652-'], hideGaps: true, }, }"
2744
+ "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A13121T', 'G24872T', 'T21653-'], hideGaps: true, }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/nucleotideMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: mockDefaultNucleotideMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/nucleotideMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, { dateFrom: '2024-05-01', dateTo: '2024-05-31' }, { dateFrom: '2024-06-01', dateTo: '2024-06-30' }, { dateFrom: '2024-07-01', dateTo: '2024-07-31' }, ], includeMutations: ['A13121T', 'T21653-', 'G24872T'], dateField: 'date', }, response: { status: 200, body: mockWithDisplayMutationsMutationsOverTime, }, }, }, ], }, }, }"
2745
2745
  },
2746
2746
  {
2747
2747
  "kind": "variable",
@@ -2749,7 +2749,7 @@
2749
2749
  "type": {
2750
2750
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
2751
2751
  },
2752
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' }, granularity: 'week', }, }"
2752
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' }, granularity: 'week', }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/nucleotideMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11', minProportion: 0.001, }, response: { status: 200, body: mockByWeekNucleotideMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/nucleotideMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11', }, dateRanges: [ { dateFrom: '2024-01-15', dateTo: '2024-01-21' }, { dateFrom: '2024-01-22', dateTo: '2024-01-28' }, { dateFrom: '2024-01-29', dateTo: '2024-02-04' }, { dateFrom: '2024-02-05', dateTo: '2024-02-11' }, ], dateField: 'date', }, matchPartialBody: true, response: { status: 200, body: mockByWeekMutationsOverTime, }, }, }, ], }, }, }"
2753
2753
  },
2754
2754
  {
2755
2755
  "kind": "variable",
@@ -2757,7 +2757,7 @@
2757
2757
  "type": {
2758
2758
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
2759
2759
  },
2760
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26' }, granularity: 'day', sequenceType: 'amino acid', }, }"
2760
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26' }, granularity: 'day', sequenceType: 'amino acid', }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/aminoAcidMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', minProportion: 0.001, }, response: { status: 200, body: mockAminoAcidMutationsByDayAminoAcidMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/aminoAcidMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', }, dateRanges: [ { dateFrom: '2024-01-20', dateTo: '2024-01-20' }, { dateFrom: '2024-01-21', dateTo: '2024-01-21' }, { dateFrom: '2024-01-22', dateTo: '2024-01-22' }, { dateFrom: '2024-01-23', dateTo: '2024-01-23' }, { dateFrom: '2024-01-24', dateTo: '2024-01-24' }, { dateFrom: '2024-01-25', dateTo: '2024-01-25' }, { dateFrom: '2024-01-26', dateTo: '2024-01-26' }, ], dateField: 'date', }, matchPartialBody: true, response: { status: 200, body: mockAminoAcidMutationsByDayAminoAcidMutationsOverTime, }, }, }, ], }, }, }"
2761
2761
  },
2762
2762
  {
2763
2763
  "kind": "variable",
@@ -2781,7 +2781,7 @@
2781
2781
  "type": {
2782
2782
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
2783
2783
  },
2784
- "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A19722G', 'G21641T', 'T21653-'], customColumns: [ { header: 'Jaccard Index', values: { A19722G: 0.75, G21641T: 0.92, 'T21653-': 0.58, }, }, ], }, }"
2784
+ "default": "{ ...Template, args: { ...Template.args, displayMutations: ['A13121T', 'G24872T', 'T21653-'], customColumns: [ { header: 'Jaccard Index', values: { A13121T: 0.75, G24872T: 0.92, 'T21653-': 0.58, }, }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/sample/nucleotideMutations`, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: mockDefaultNucleotideMutations, }, }, }, { matcher: { url: `${LAPIS_URL}/component/nucleotideMutationsOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, { dateFrom: '2024-05-01', dateTo: '2024-05-31' }, { dateFrom: '2024-06-01', dateTo: '2024-06-30' }, { dateFrom: '2024-07-01', dateTo: '2024-07-31' }, ], includeMutations: ['A13121T', 'T21653-', 'G24872T'], dateField: 'date', }, response: { status: 200, body: mockWithDisplayMutationsMutationsOverTime, }, }, }, ], }, }, }"
2785
2785
  }
2786
2786
  ],
2787
2787
  "exports": [
@@ -2962,22 +2962,12 @@
2962
2962
  "kind": "field",
2963
2963
  "name": "hideGaps",
2964
2964
  "type": {
2965
- "text": "boolean"
2965
+ "text": "boolean | undefined"
2966
2966
  },
2967
2967
  "default": "false",
2968
2968
  "description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
2969
2969
  "attribute": "hideGaps"
2970
2970
  },
2971
- {
2972
- "kind": "field",
2973
- "name": "useNewEndpoint",
2974
- "type": {
2975
- "text": "boolean | undefined"
2976
- },
2977
- "default": "false",
2978
- "description": "Whether to use the mutationsOverTime endpoint from LAPIS.\nIf true, use the endpoint, if false, compute component data as before.\nEventually, the new endpoint will become the default.",
2979
- "attribute": "useNewEndpoint"
2980
- },
2981
2971
  {
2982
2972
  "kind": "field",
2983
2973
  "name": "pageSizes",
@@ -3093,21 +3083,12 @@
3093
3083
  {
3094
3084
  "name": "hideGaps",
3095
3085
  "type": {
3096
- "text": "boolean"
3086
+ "text": "boolean | undefined"
3097
3087
  },
3098
3088
  "default": "false",
3099
3089
  "description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
3100
3090
  "fieldName": "hideGaps"
3101
3091
  },
3102
- {
3103
- "name": "useNewEndpoint",
3104
- "type": {
3105
- "text": "boolean | undefined"
3106
- },
3107
- "default": "false",
3108
- "description": "Whether to use the mutationsOverTime endpoint from LAPIS.\nIf true, use the endpoint, if false, compute component data as before.\nEventually, the new endpoint will become the default.",
3109
- "fieldName": "useNewEndpoint"
3110
- },
3111
3092
  {
3112
3093
  "name": "pageSizes",
3113
3094
  "type": {
@@ -4155,6 +4136,389 @@
4155
4136
  }
4156
4137
  ]
4157
4138
  },
4139
+ {
4140
+ "kind": "javascript-module",
4141
+ "path": "src/web-components/visualization/gs-queries-over-time.spec-d.ts",
4142
+ "declarations": [],
4143
+ "exports": []
4144
+ },
4145
+ {
4146
+ "kind": "javascript-module",
4147
+ "path": "src/web-components/visualization/gs-queries-over-time.stories.ts",
4148
+ "declarations": [
4149
+ {
4150
+ "kind": "variable",
4151
+ "name": "meta",
4152
+ "type": {
4153
+ "text": "Meta<Required<QueriesOverTimeProps>>"
4154
+ },
4155
+ "default": "{ title: 'Visualization/Queries over time', component: 'gs-queries-over-time', argTypes: { lapisFilter: { control: 'object' }, queries: { control: 'object' }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, initialMeanProportionInterval: { control: 'object' }, hideGaps: { control: 'boolean' }, pageSizes: { control: 'object' }, customColumns: { control: 'object' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-04-30' }, queries: [ { displayLabel: 'S:F456L (single mutation)', countQuery: 'S:456L', coverageQuery: '!S:456N', }, { displayLabel: 'R346T + F456L (combination)', countQuery: 'S:346T & S:456L', coverageQuery: '!S:346N & !S:456N', }, { displayLabel: 'C22916T or T22917G (nucleotide OR)', countQuery: 'C22916T | T22917G', coverageQuery: '!22916N & !22917N', }, ], views: ['grid'], width: '100%', granularity: 'month', lapisDateField: 'date', initialMeanProportionInterval: { min: 0, max: 1 }, hideGaps: false, pageSizes: [10, 20, 30, 40, 50], }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/component/queriesOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-04-30', }, queries: [ { displayLabel: 'S:F456L (single mutation)', countQuery: 'S:456L', coverageQuery: '!S:456N', }, { displayLabel: 'R346T + F456L (combination)', countQuery: 'S:346T & S:456L', coverageQuery: '!S:346N & !S:456N', }, { displayLabel: 'C22916T or T22917G (nucleotide OR)', countQuery: 'C22916T | T22917G', coverageQuery: '!22916N & !22917N', }, ], dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, ], dateField: 'date', }, matchPartialBody: true, response: { status: 200, body: mockDefaultQueriesOverTime, }, }, }, ], }, }), tags: ['autodocs'], }"
4156
+ },
4157
+ {
4158
+ "kind": "variable",
4159
+ "name": "Default",
4160
+ "type": {
4161
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4162
+ },
4163
+ "default": "{ ...Template, }"
4164
+ },
4165
+ {
4166
+ "kind": "variable",
4167
+ "name": "WithFixedHeight",
4168
+ "type": {
4169
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4170
+ },
4171
+ "default": "{ ...Template, args: { ...Template.args, height: '700px', }, }"
4172
+ },
4173
+ {
4174
+ "kind": "variable",
4175
+ "name": "ByWeek",
4176
+ "type": {
4177
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4178
+ },
4179
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' }, granularity: 'week', }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/component/queriesOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11', }, dateRanges: [ { dateFrom: '2024-01-15', dateTo: '2024-01-21' }, { dateFrom: '2024-01-22', dateTo: '2024-01-28' }, { dateFrom: '2024-01-29', dateTo: '2024-02-04' }, { dateFrom: '2024-02-05', dateTo: '2024-02-11' }, ], }, matchPartialBody: true, response: { status: 200, body: mockDefaultQueriesOverTime, }, }, }, ], }, }, }"
4180
+ },
4181
+ {
4182
+ "kind": "variable",
4183
+ "name": "WithCustomColumns",
4184
+ "type": {
4185
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4186
+ },
4187
+ "default": "{ ...Template, args: { ...Template.args, customColumns: [ { header: 'Jaccard Index', values: { 'S:F456L (single mutation)': 0.75, 'R346T + F456L (combination)': 0.92, 'C22916T or T22917G (nucleotide OR)': 0.58, }, }, ], }, }"
4188
+ },
4189
+ {
4190
+ "kind": "variable",
4191
+ "name": "HideGaps",
4192
+ "type": {
4193
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4194
+ },
4195
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, queries: [ { displayLabel: 'S:F456L', countQuery: 'S:456L', coverageQuery: '!S:456N', }, { displayLabel: 'S:R346T', countQuery: 'S:346T', coverageQuery: '!S:346N', }, { displayLabel: 'S:Q493E', countQuery: 'S:493E', coverageQuery: '!S:493N', }, ], hideGaps: true, }, parameters: { fetchMock: { mocks: [ { matcher: { url: `${LAPIS_URL}/component/queriesOverTime`, body: { filters: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, dateRanges: [ { dateFrom: '2024-01-01', dateTo: '2024-01-31' }, { dateFrom: '2024-02-01', dateTo: '2024-02-29' }, { dateFrom: '2024-03-01', dateTo: '2024-03-31' }, { dateFrom: '2024-04-01', dateTo: '2024-04-30' }, { dateFrom: '2024-05-01', dateTo: '2024-05-31' }, { dateFrom: '2024-06-01', dateTo: '2024-06-30' }, { dateFrom: '2024-07-01', dateTo: '2024-07-31' }, ], }, matchPartialBody: true, response: { status: 200, body: mockWithGapsQueriesOverTime, }, }, }, ], }, }, }"
4196
+ },
4197
+ {
4198
+ "kind": "variable",
4199
+ "name": "SmallWidth",
4200
+ "type": {
4201
+ "text": "StoryObj<Required<QueriesOverTimeProps>>"
4202
+ },
4203
+ "default": "{ ...Template, args: { ...Template.args, width: '300px', }, }"
4204
+ }
4205
+ ],
4206
+ "exports": [
4207
+ {
4208
+ "kind": "js",
4209
+ "name": "default",
4210
+ "declaration": {
4211
+ "name": "meta",
4212
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4213
+ }
4214
+ },
4215
+ {
4216
+ "kind": "js",
4217
+ "name": "Default",
4218
+ "declaration": {
4219
+ "name": "Default",
4220
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4221
+ }
4222
+ },
4223
+ {
4224
+ "kind": "js",
4225
+ "name": "WithFixedHeight",
4226
+ "declaration": {
4227
+ "name": "WithFixedHeight",
4228
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4229
+ }
4230
+ },
4231
+ {
4232
+ "kind": "js",
4233
+ "name": "ByWeek",
4234
+ "declaration": {
4235
+ "name": "ByWeek",
4236
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4237
+ }
4238
+ },
4239
+ {
4240
+ "kind": "js",
4241
+ "name": "WithCustomColumns",
4242
+ "declaration": {
4243
+ "name": "WithCustomColumns",
4244
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4245
+ }
4246
+ },
4247
+ {
4248
+ "kind": "js",
4249
+ "name": "HideGaps",
4250
+ "declaration": {
4251
+ "name": "HideGaps",
4252
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4253
+ }
4254
+ },
4255
+ {
4256
+ "kind": "js",
4257
+ "name": "SmallWidth",
4258
+ "declaration": {
4259
+ "name": "SmallWidth",
4260
+ "module": "src/web-components/visualization/gs-queries-over-time.stories.ts"
4261
+ }
4262
+ }
4263
+ ]
4264
+ },
4265
+ {
4266
+ "kind": "javascript-module",
4267
+ "path": "src/web-components/visualization/gs-queries-over-time.tsx",
4268
+ "declarations": [
4269
+ {
4270
+ "kind": "class",
4271
+ "description": "## Context\n\nThis component displays arbitrary LAPIS queries over time for a dataset.\nEach query consists of a displayLabel (optional), countQuery (string for counting matches),\nand coverageQuery (string for determining the coverage/denominator).\nThe shown date range is determined by the available dates in the dataset.\n\n## Views\n\n### Grid View\n\nThe grid view shows the proportion for each query over date ranges.\nProportions are calculated as count/coverage for each time period.\n\nUsers can filter the displayed rows by mean proportion via a slider in the toolbar.\nThe mean proportion of each row is calculated over the whole data range that the component displays.",
4272
+ "name": "QueriesOverTimeComponent",
4273
+ "members": [
4274
+ {
4275
+ "kind": "field",
4276
+ "name": "lapisFilter",
4277
+ "type": {
4278
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
4279
+ },
4280
+ "default": "{}",
4281
+ "description": "LAPIS filter to apply to all queries. This is used to determine the date range and total counts.",
4282
+ "attribute": "lapisFilter"
4283
+ },
4284
+ {
4285
+ "kind": "field",
4286
+ "name": "queries",
4287
+ "type": {
4288
+ "text": "{\n displayLabel: string;\n countQuery: string;\n coverageQuery: string;\n }[]"
4289
+ },
4290
+ "default": "[]",
4291
+ "description": "Required.\n\nArray of queries to display. Each query has:\n- displayLabel: string - The name to show in the grid row label\n- countQuery: string - Query string to count matches\n- coverageQuery: string - Query string to determine coverage/denominator\n\nBoth queries (count and coverage) are 'advanced queries' as they are defined in LAPIS.",
4292
+ "attribute": "queries"
4293
+ },
4294
+ {
4295
+ "kind": "field",
4296
+ "name": "views",
4297
+ "type": {
4298
+ "text": "'grid'[]"
4299
+ },
4300
+ "default": "['grid']",
4301
+ "description": "A list of tabs with views that this component should provide.",
4302
+ "attribute": "views"
4303
+ },
4304
+ {
4305
+ "kind": "field",
4306
+ "name": "width",
4307
+ "type": {
4308
+ "text": "string"
4309
+ },
4310
+ "default": "'100%'",
4311
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
4312
+ "attribute": "width"
4313
+ },
4314
+ {
4315
+ "kind": "field",
4316
+ "name": "height",
4317
+ "type": {
4318
+ "text": "string | undefined"
4319
+ },
4320
+ "default": "undefined",
4321
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
4322
+ "attribute": "height"
4323
+ },
4324
+ {
4325
+ "kind": "field",
4326
+ "name": "granularity",
4327
+ "type": {
4328
+ "text": "'day' | 'week' | 'month' | 'year'"
4329
+ },
4330
+ "default": "'week'",
4331
+ "description": "The granularity of the time axis.",
4332
+ "attribute": "granularity"
4333
+ },
4334
+ {
4335
+ "kind": "field",
4336
+ "name": "lapisDateField",
4337
+ "type": {
4338
+ "text": "string"
4339
+ },
4340
+ "default": "'date'",
4341
+ "description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nMust be a field of type `date` in LAPIS.",
4342
+ "attribute": "lapisDateField"
4343
+ },
4344
+ {
4345
+ "kind": "field",
4346
+ "name": "initialMeanProportionInterval",
4347
+ "type": {
4348
+ "text": "{ min: number; max: number }"
4349
+ },
4350
+ "default": "{ min: 0, max: 1 }",
4351
+ "description": "The initial proportion interval for the grid view.\nThe values must be between 0 and 1, inclusive.",
4352
+ "attribute": "initialMeanProportionInterval"
4353
+ },
4354
+ {
4355
+ "kind": "field",
4356
+ "name": "hideGaps",
4357
+ "type": {
4358
+ "text": "boolean | undefined"
4359
+ },
4360
+ "default": "false",
4361
+ "description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
4362
+ "attribute": "hideGaps"
4363
+ },
4364
+ {
4365
+ "kind": "field",
4366
+ "name": "pageSizes",
4367
+ "type": {
4368
+ "text": "number[] | number"
4369
+ },
4370
+ "default": "[10, 20, 30, 40, 50]",
4371
+ "description": "The number of rows per page, which can be selected by the user.",
4372
+ "attribute": "pageSizes"
4373
+ },
4374
+ {
4375
+ "kind": "field",
4376
+ "name": "customColumns",
4377
+ "type": {
4378
+ "text": "{ header: string; values: Record<string, string | number> }[] | undefined"
4379
+ },
4380
+ "default": "undefined",
4381
+ "description": "Custom columns to add to the grid.\nEach column has a header and a map of query displayLabels to values.",
4382
+ "attribute": "customColumns"
4383
+ }
4384
+ ],
4385
+ "events": [
4386
+ {
4387
+ "type": {
4388
+ "text": "CustomEvent<undefined>"
4389
+ },
4390
+ "description": "Fired when the component has finished loading the required data from LAPIS.",
4391
+ "name": "gs-component-finished-loading"
4392
+ }
4393
+ ],
4394
+ "attributes": [
4395
+ {
4396
+ "name": "lapisFilter",
4397
+ "type": {
4398
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
4399
+ },
4400
+ "default": "{}",
4401
+ "description": "LAPIS filter to apply to all queries. This is used to determine the date range and total counts.",
4402
+ "fieldName": "lapisFilter"
4403
+ },
4404
+ {
4405
+ "name": "queries",
4406
+ "type": {
4407
+ "text": "{\n displayLabel: string;\n countQuery: string;\n coverageQuery: string;\n }[]"
4408
+ },
4409
+ "default": "[]",
4410
+ "description": "Required.\n\nArray of queries to display. Each query has:\n- displayLabel: string - The name to show in the grid row label\n- countQuery: string - Query string to count matches\n- coverageQuery: string - Query string to determine coverage/denominator\n\nBoth queries (count and coverage) are 'advanced queries' as they are defined in LAPIS.",
4411
+ "fieldName": "queries"
4412
+ },
4413
+ {
4414
+ "name": "views",
4415
+ "type": {
4416
+ "text": "'grid'[]"
4417
+ },
4418
+ "default": "['grid']",
4419
+ "description": "A list of tabs with views that this component should provide.",
4420
+ "fieldName": "views"
4421
+ },
4422
+ {
4423
+ "name": "width",
4424
+ "type": {
4425
+ "text": "string"
4426
+ },
4427
+ "default": "'100%'",
4428
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
4429
+ "fieldName": "width"
4430
+ },
4431
+ {
4432
+ "name": "height",
4433
+ "type": {
4434
+ "text": "string | undefined"
4435
+ },
4436
+ "default": "undefined",
4437
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
4438
+ "fieldName": "height"
4439
+ },
4440
+ {
4441
+ "name": "granularity",
4442
+ "type": {
4443
+ "text": "'day' | 'week' | 'month' | 'year'"
4444
+ },
4445
+ "default": "'week'",
4446
+ "description": "The granularity of the time axis.",
4447
+ "fieldName": "granularity"
4448
+ },
4449
+ {
4450
+ "name": "lapisDateField",
4451
+ "type": {
4452
+ "text": "string"
4453
+ },
4454
+ "default": "'date'",
4455
+ "description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nMust be a field of type `date` in LAPIS.",
4456
+ "fieldName": "lapisDateField"
4457
+ },
4458
+ {
4459
+ "name": "initialMeanProportionInterval",
4460
+ "type": {
4461
+ "text": "{ min: number; max: number }"
4462
+ },
4463
+ "default": "{ min: 0, max: 1 }",
4464
+ "description": "The initial proportion interval for the grid view.\nThe values must be between 0 and 1, inclusive.",
4465
+ "fieldName": "initialMeanProportionInterval"
4466
+ },
4467
+ {
4468
+ "name": "hideGaps",
4469
+ "type": {
4470
+ "text": "boolean | undefined"
4471
+ },
4472
+ "default": "false",
4473
+ "description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
4474
+ "fieldName": "hideGaps"
4475
+ },
4476
+ {
4477
+ "name": "pageSizes",
4478
+ "type": {
4479
+ "text": "number[] | number"
4480
+ },
4481
+ "default": "[10, 20, 30, 40, 50]",
4482
+ "description": "The number of rows per page, which can be selected by the user.",
4483
+ "fieldName": "pageSizes"
4484
+ },
4485
+ {
4486
+ "name": "customColumns",
4487
+ "type": {
4488
+ "text": "{ header: string; values: Record<string, string | number> }[] | undefined"
4489
+ },
4490
+ "default": "undefined",
4491
+ "description": "Custom columns to add to the grid.\nEach column has a header and a map of query displayLabels to values.",
4492
+ "fieldName": "customColumns"
4493
+ }
4494
+ ],
4495
+ "superclass": {
4496
+ "name": "PreactLitAdapterWithGridJsStyles",
4497
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
4498
+ },
4499
+ "tagName": "gs-queries-over-time",
4500
+ "customElement": true
4501
+ }
4502
+ ],
4503
+ "exports": [
4504
+ {
4505
+ "kind": "js",
4506
+ "name": "QueriesOverTimeComponent",
4507
+ "declaration": {
4508
+ "name": "QueriesOverTimeComponent",
4509
+ "module": "src/web-components/visualization/gs-queries-over-time.tsx"
4510
+ }
4511
+ },
4512
+ {
4513
+ "kind": "custom-element-definition",
4514
+ "name": "gs-queries-over-time",
4515
+ "declaration": {
4516
+ "name": "QueriesOverTimeComponent",
4517
+ "module": "src/web-components/visualization/gs-queries-over-time.tsx"
4518
+ }
4519
+ }
4520
+ ]
4521
+ },
4158
4522
  {
4159
4523
  "kind": "javascript-module",
4160
4524
  "path": "src/web-components/visualization/gs-relative-growth-advantage.stories.ts",
@@ -5024,6 +5388,14 @@
5024
5388
  "module": "./gs-mutations-over-time"
5025
5389
  }
5026
5390
  },
5391
+ {
5392
+ "kind": "js",
5393
+ "name": "QueriesOverTimeComponent",
5394
+ "declaration": {
5395
+ "name": "QueriesOverTimeComponent",
5396
+ "module": "./gs-queries-over-time"
5397
+ }
5398
+ },
5027
5399
  {
5028
5400
  "kind": "js",
5029
5401
  "name": "SequencesByLocationComponent",