@genspectrum/dashboard-components 1.2.0 → 1.3.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 (27) hide show
  1. package/custom-elements.json +20 -1
  2. package/dist/assets/mutationOverTimeWorker-C7saVShx.js.map +1 -0
  3. package/dist/components.d.ts +20 -14
  4. package/dist/components.js +46 -8
  5. package/dist/components.js.map +1 -1
  6. package/dist/util.d.ts +14 -14
  7. package/package.json +1 -1
  8. package/src/lapisApi/lapisApi.ts +29 -0
  9. package/src/lapisApi/lapisTypes.ts +35 -1
  10. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +1 -0
  11. package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +1 -0
  12. package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +1 -0
  13. package/src/preact/mutationsOverTime/__mockData__/noDataWhenNoMutationsAreInFilter.ts +1 -0
  14. package/src/preact/mutationsOverTime/__mockData__/noDataWhenThereAreNoDatesInFilter.ts +1 -0
  15. package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +1 -0
  16. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +2 -0
  17. package/src/preact/mutationsOverTime/mutations-over-time.tsx +9 -3
  18. package/src/query/queryMutationsOverTime.ts +101 -23
  19. package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +935 -0
  20. package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +3 -0
  21. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +3 -0
  22. package/src/web-components/visualization/gs-mutations-over-time.tsx +9 -0
  23. package/standalone-bundle/assets/mutationOverTimeWorker-DRRi3aMG.js.map +1 -0
  24. package/standalone-bundle/dashboard-components.js +3619 -3583
  25. package/standalone-bundle/dashboard-components.js.map +1 -1
  26. package/dist/assets/mutationOverTimeWorker-DpW4YOGl.js.map +0 -1
  27. package/standalone-bundle/assets/mutationOverTimeWorker-CZVvQBze.js.map +0 -1
@@ -32,6 +32,9 @@ describe('gs-mutations-over-time', () => {
32
32
  expectTypeOf<typeof MutationsOverTimeComponent.prototype.initialMeanProportionInterval>().toEqualTypeOf<
33
33
  MutationsOverTimeProps['initialMeanProportionInterval']
34
34
  >();
35
+ expectTypeOf<typeof MutationsOverTimeComponent.prototype.useNewEndpoint>().toEqualTypeOf<
36
+ MutationsOverTimeProps['useNewEndpoint']
37
+ >();
35
38
  expectTypeOf<typeof MutationsOverTimeComponent.prototype.pageSizes>().toEqualTypeOf<
36
39
  MutationsOverTimeProps['pageSizes']
37
40
  >();
@@ -42,6 +42,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
42
42
  lapisDateField: { control: 'text' },
43
43
  displayMutations: { control: 'object' },
44
44
  initialMeanProportionInterval: { control: 'object' },
45
+ useNewEndpoint: { control: 'boolean' },
45
46
  pageSizes: { control: 'object' },
46
47
  },
47
48
  args: {
@@ -52,6 +53,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
52
53
  granularity: 'month',
53
54
  lapisDateField: 'date',
54
55
  initialMeanProportionInterval: { min: 0.05, max: 0.9 },
56
+ useNewEndpoint: false,
55
57
  pageSizes: [10, 20, 30, 40, 50],
56
58
  },
57
59
  parameters: withComponentDocs({
@@ -99,6 +101,7 @@ const Template: StoryObj<Required<MutationsOverTimeProps>> = {
99
101
  .displayMutations=${args.displayMutations}
100
102
  .initialMeanProportionInterval=${args.initialMeanProportionInterval}
101
103
  .pageSizes=${args.pageSizes}
104
+ .useNewEndpoint=${args.useNewEndpoint}
102
105
  ></gs-mutations-over-time>
103
106
  </gs-app>
104
107
  `,
@@ -113,6 +113,14 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
113
113
  @property({ type: Object })
114
114
  initialMeanProportionInterval: { min: number; max: number } = { min: 0.05, max: 0.9 };
115
115
 
116
+ /**
117
+ * Whether to use the mutationsOverTime endpoint from LAPIS.
118
+ * If true, use the endpoint, if false, compute component data as before.
119
+ * Eventually, the new endpoint will become the default.
120
+ */
121
+ @property({ type: Boolean })
122
+ useNewEndpoint?: boolean = false;
123
+
116
124
  /**
117
125
  * The number of rows per page, which can be selected by the user.
118
126
  */
@@ -138,6 +146,7 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
138
146
  lapisDateField={this.lapisDateField}
139
147
  displayMutations={this.displayMutations}
140
148
  initialMeanProportionInterval={this.initialMeanProportionInterval}
149
+ useNewEndpoint={this.useNewEndpoint}
141
150
  pageSizes={this.pageSizes}
142
151
  />
143
152
  </MutationAnnotationsContextProvider>