@genspectrum/dashboard-components 1.2.0 → 1.3.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.
- package/README.md +9 -0
- package/custom-elements.json +20 -1
- package/dist/assets/mutationOverTimeWorker-CQxrFo53.js.map +1 -0
- package/dist/components.d.ts +34 -28
- package/dist/components.js +48 -16
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +28 -28
- package/package.json +1 -1
- package/src/lapisApi/lapisApi.ts +29 -0
- package/src/lapisApi/lapisTypes.ts +35 -1
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenNoMutationsAreInFilter.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenThereAreNoDatesInFilter.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/withDisplayMutations.ts +352 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +0 -24
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +0 -8
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +2 -0
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +2 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +11 -6
- package/src/query/queryMutationsOverTime.spec.ts +98 -0
- package/src/query/queryMutationsOverTime.ts +172 -28
- package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +1057 -0
- package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +3 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +3 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +9 -0
- package/standalone-bundle/assets/mutationOverTimeWorker-CDACUs6w.js.map +1 -0
- package/standalone-bundle/dashboard-components.js +3628 -3594
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/dist/assets/mutationOverTimeWorker-DpW4YOGl.js.map +0 -1
- 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>
|