@genspectrum/dashboard-components 0.15.0 → 0.16.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/custom-elements.json +255 -57
- package/dist/components.d.ts +49 -32
- package/dist/components.js +361 -212
- package/dist/components.js.map +1 -1
- package/dist/style.css +9 -0
- package/dist/util.d.ts +43 -43
- package/package.json +1 -1
- package/src/preact/ReferenceGenomeContext.ts +16 -1
- package/src/preact/aggregatedData/aggregate-bar-chart.tsx +26 -5
- package/src/preact/aggregatedData/aggregate.stories.tsx +0 -1
- package/src/preact/aggregatedData/aggregate.tsx +5 -1
- package/src/preact/components/ReferenceGenomesAwaiter.tsx +1 -6
- package/src/preact/components/info.tsx +1 -0
- package/src/preact/components/resize-container.tsx +1 -1
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +4 -2
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +5 -1
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -1
- package/src/preact/mutationFilter/mutation-filter.tsx +8 -0
- package/src/preact/mutations/mutations.stories.tsx +0 -1
- package/src/preact/mutations/mutations.tsx +1 -1
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +70 -14
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +30 -7
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +56 -55
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +26 -39
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +22 -7
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +18 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +48 -35
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +83 -70
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +48 -37
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +6 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +31 -23
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +5 -1
- package/src/preact/sequencesByLocation/__mockData__/worldAtlas.json +1 -0
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-map.tsx +6 -3
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-table.tsx +1 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.stories.tsx +58 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.tsx +10 -1
- package/src/preact/shared/aspectRatio/AspectRatio.tsx +13 -0
- package/src/preact/shared/charts/getMaintainAspectRatio.ts +3 -0
- package/src/preact/statistic/statistics.stories.tsx +0 -1
- package/src/preact/statistic/statistics.tsx +4 -4
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +0 -1
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
- package/src/query/computeMapLocationData.spec.ts +1 -1
- package/src/query/computeMapLocationData.ts +1 -1
- package/src/query/querySequencesByLocationData.ts +1 -1
- package/src/utilEntrypoint.ts +1 -1
- package/src/web-components/PreactLitAdapter.tsx +2 -5
- package/src/web-components/ResizeContainer.mdx +4 -1
- package/src/web-components/gs-app.ts +2 -4
- package/src/web-components/visualization/gs-aggregate.stories.ts +13 -6
- package/src/web-components/visualization/gs-aggregate.tsx +1 -1
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +1 -1
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +24 -1
- package/src/web-components/visualization/gs-mutations-over-time.tsx +30 -1
- package/src/web-components/visualization/gs-mutations.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutations.tsx +1 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +11 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -2
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +8 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -1
- package/src/web-components/visualization/gs-sequences-by-location.stories.ts +13 -7
- package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -3
- package/src/web-components/visualization/gs-statistics.stories.ts +0 -1
- package/src/web-components/visualization/gs-statistics.tsx +1 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +9 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +1 -1
- package/standalone-bundle/dashboard-components.js +5817 -5706
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/src/preact/map/__mockData__/worldAtlas.json +0 -497127
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedGermany.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedWorld.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/germanyMap.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/howToGenerateWorldMap.md +0 -0
- /package/src/preact/{map → sequencesByLocation}/leafletStyleModifications.css +0 -0
- /package/src/preact/{map → sequencesByLocation}/loadMapSource.tsx +0 -0
package/dist/style.css
CHANGED
|
@@ -3065,6 +3065,9 @@ input.tab:checked + .tab-content,
|
|
|
3065
3065
|
.relative {
|
|
3066
3066
|
position: relative;
|
|
3067
3067
|
}
|
|
3068
|
+
.inset-0 {
|
|
3069
|
+
inset: 0px;
|
|
3070
|
+
}
|
|
3068
3071
|
.-right-3 {
|
|
3069
3072
|
right: -0.75rem;
|
|
3070
3073
|
}
|
|
@@ -3248,6 +3251,9 @@ input.tab:checked + .tab-content,
|
|
|
3248
3251
|
.min-w-32 {
|
|
3249
3252
|
min-width: 8rem;
|
|
3250
3253
|
}
|
|
3254
|
+
.min-w-\[180px\] {
|
|
3255
|
+
min-width: 180px;
|
|
3256
|
+
}
|
|
3251
3257
|
.min-w-\[7\.5rem\] {
|
|
3252
3258
|
min-width: 7.5rem;
|
|
3253
3259
|
}
|
|
@@ -3331,6 +3337,9 @@ input.tab:checked + .tab-content,
|
|
|
3331
3337
|
.whitespace-nowrap {
|
|
3332
3338
|
white-space: nowrap;
|
|
3333
3339
|
}
|
|
3340
|
+
.text-wrap {
|
|
3341
|
+
text-wrap: wrap;
|
|
3342
|
+
}
|
|
3334
3343
|
.text-nowrap {
|
|
3335
3344
|
text-wrap: nowrap;
|
|
3336
3345
|
}
|
package/dist/util.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare const aggregatePropsSchema: default_2.ZodObject<{
|
|
|
25
25
|
initialSortDirection: default_2.ZodUnion<[default_2.ZodLiteral<"ascending">, default_2.ZodLiteral<"descending">]>;
|
|
26
26
|
pageSize: default_2.ZodUnion<[default_2.ZodBoolean, default_2.ZodNumber]>;
|
|
27
27
|
width: default_2.ZodString;
|
|
28
|
-
height: default_2.ZodString
|
|
28
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
29
29
|
maxNumberOfBars: default_2.ZodNumber;
|
|
30
30
|
}, "strip", default_2.ZodTypeAny, {
|
|
31
31
|
lapisFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
@@ -35,13 +35,13 @@ declare const aggregatePropsSchema: default_2.ZodObject<{
|
|
|
35
35
|
aminoAcidInsertions?: string[] | undefined;
|
|
36
36
|
};
|
|
37
37
|
fields: string[];
|
|
38
|
-
height: string;
|
|
39
38
|
width: string;
|
|
40
39
|
pageSize: number | boolean;
|
|
41
40
|
views: ("table" | "bar")[];
|
|
42
41
|
initialSortField: string;
|
|
43
42
|
initialSortDirection: "ascending" | "descending";
|
|
44
43
|
maxNumberOfBars: number;
|
|
44
|
+
height?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
lapisFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
47
47
|
nucleotideMutations?: string[] | undefined;
|
|
@@ -50,13 +50,13 @@ declare const aggregatePropsSchema: default_2.ZodObject<{
|
|
|
50
50
|
aminoAcidInsertions?: string[] | undefined;
|
|
51
51
|
};
|
|
52
52
|
fields: string[];
|
|
53
|
-
height: string;
|
|
54
53
|
width: string;
|
|
55
54
|
pageSize: number | boolean;
|
|
56
55
|
views: ("table" | "bar")[];
|
|
57
56
|
initialSortField: string;
|
|
58
57
|
initialSortDirection: "ascending" | "descending";
|
|
59
58
|
maxNumberOfBars: number;
|
|
59
|
+
height?: string | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
|
|
62
62
|
export declare type AggregateView = default_2.infer<typeof aggregateViewSchema>;
|
|
@@ -206,7 +206,7 @@ export declare type MutationComparisonProps = default_2.infer<typeof mutationCom
|
|
|
206
206
|
|
|
207
207
|
declare const mutationComparisonPropsSchema: default_2.ZodObject<{
|
|
208
208
|
width: default_2.ZodString;
|
|
209
|
-
height: default_2.ZodString
|
|
209
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
210
210
|
lapisFilters: default_2.ZodArray<default_2.ZodObject<{
|
|
211
211
|
lapisFilter: default_2.ZodIntersection<default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodArray<default_2.ZodString, "many">, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean, default_2.ZodUndefined]>>, default_2.ZodObject<{
|
|
212
212
|
nucleotideMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
@@ -246,7 +246,6 @@ declare const mutationComparisonPropsSchema: default_2.ZodObject<{
|
|
|
246
246
|
views: default_2.ZodArray<default_2.ZodUnion<[default_2.ZodLiteral<"table">, default_2.ZodLiteral<"venn">]>, "many">;
|
|
247
247
|
pageSize: default_2.ZodUnion<[default_2.ZodBoolean, default_2.ZodNumber]>;
|
|
248
248
|
}, "strip", default_2.ZodTypeAny, {
|
|
249
|
-
height: string;
|
|
250
249
|
width: string;
|
|
251
250
|
pageSize: number | boolean;
|
|
252
251
|
lapisFilters: {
|
|
@@ -260,8 +259,8 @@ declare const mutationComparisonPropsSchema: default_2.ZodObject<{
|
|
|
260
259
|
}[];
|
|
261
260
|
sequenceType: "nucleotide" | "amino acid";
|
|
262
261
|
views: ("table" | "venn")[];
|
|
262
|
+
height?: string | undefined;
|
|
263
263
|
}, {
|
|
264
|
-
height: string;
|
|
265
264
|
width: string;
|
|
266
265
|
pageSize: number | boolean;
|
|
267
266
|
lapisFilters: {
|
|
@@ -275,6 +274,7 @@ declare const mutationComparisonPropsSchema: default_2.ZodObject<{
|
|
|
275
274
|
}[];
|
|
276
275
|
sequenceType: "nucleotide" | "amino acid";
|
|
277
276
|
views: ("table" | "venn")[];
|
|
277
|
+
height?: string | undefined;
|
|
278
278
|
}>;
|
|
279
279
|
|
|
280
280
|
export declare type MutationComparisonView = default_2.infer<typeof mutationComparisonViewSchema>;
|
|
@@ -339,7 +339,7 @@ declare const mutationsPropsSchema: default_2.ZodObject<{
|
|
|
339
339
|
views: default_2.ZodArray<default_2.ZodUnion<[default_2.ZodLiteral<"table">, default_2.ZodLiteral<"grid">, default_2.ZodLiteral<"insertions">]>, "many">;
|
|
340
340
|
pageSize: default_2.ZodUnion<[default_2.ZodBoolean, default_2.ZodNumber]>;
|
|
341
341
|
width: default_2.ZodString;
|
|
342
|
-
height: default_2.ZodString
|
|
342
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
343
343
|
}, "strip", default_2.ZodTypeAny, {
|
|
344
344
|
lapisFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
345
345
|
nucleotideMutations?: string[] | undefined;
|
|
@@ -347,11 +347,11 @@ declare const mutationsPropsSchema: default_2.ZodObject<{
|
|
|
347
347
|
nucleotideInsertions?: string[] | undefined;
|
|
348
348
|
aminoAcidInsertions?: string[] | undefined;
|
|
349
349
|
};
|
|
350
|
-
height: string;
|
|
351
350
|
width: string;
|
|
352
351
|
pageSize: number | boolean;
|
|
353
352
|
sequenceType: "nucleotide" | "amino acid";
|
|
354
353
|
views: ("table" | "grid" | "insertions")[];
|
|
354
|
+
height?: string | undefined;
|
|
355
355
|
baselineLapisFilter?: (Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
356
356
|
nucleotideMutations?: string[] | undefined;
|
|
357
357
|
aminoAcidMutations?: string[] | undefined;
|
|
@@ -365,11 +365,11 @@ declare const mutationsPropsSchema: default_2.ZodObject<{
|
|
|
365
365
|
nucleotideInsertions?: string[] | undefined;
|
|
366
366
|
aminoAcidInsertions?: string[] | undefined;
|
|
367
367
|
};
|
|
368
|
-
height: string;
|
|
369
368
|
width: string;
|
|
370
369
|
pageSize: number | boolean;
|
|
371
370
|
sequenceType: "nucleotide" | "amino acid";
|
|
372
371
|
views: ("table" | "grid" | "insertions")[];
|
|
372
|
+
height?: string | undefined;
|
|
373
373
|
baselineLapisFilter?: (Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
374
374
|
nucleotideMutations?: string[] | undefined;
|
|
375
375
|
aminoAcidMutations?: string[] | undefined;
|
|
@@ -424,7 +424,7 @@ export declare type NumberSequencesOverTimeProps = default_2.infer<typeof number
|
|
|
424
424
|
|
|
425
425
|
declare const numberSequencesOverTimePropsSchema: default_2.ZodObject<{
|
|
426
426
|
width: default_2.ZodString;
|
|
427
|
-
height: default_2.ZodString
|
|
427
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
428
428
|
lapisFilters: default_2.ZodArray<default_2.ZodObject<{
|
|
429
429
|
lapisFilter: default_2.ZodIntersection<default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodArray<default_2.ZodString, "many">, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean, default_2.ZodUndefined]>>, default_2.ZodObject<{
|
|
430
430
|
nucleotideMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
@@ -466,7 +466,6 @@ declare const numberSequencesOverTimePropsSchema: default_2.ZodObject<{
|
|
|
466
466
|
smoothingWindow: default_2.ZodNumber;
|
|
467
467
|
pageSize: default_2.ZodUnion<[default_2.ZodBoolean, default_2.ZodNumber]>;
|
|
468
468
|
}, "strip", default_2.ZodTypeAny, {
|
|
469
|
-
height: string;
|
|
470
469
|
width: string;
|
|
471
470
|
pageSize: number | boolean;
|
|
472
471
|
lapisFilters: {
|
|
@@ -482,8 +481,8 @@ declare const numberSequencesOverTimePropsSchema: default_2.ZodObject<{
|
|
|
482
481
|
granularity: "day" | "week" | "month" | "year";
|
|
483
482
|
smoothingWindow: number;
|
|
484
483
|
lapisDateField: string;
|
|
484
|
+
height?: string | undefined;
|
|
485
485
|
}, {
|
|
486
|
-
height: string;
|
|
487
486
|
width: string;
|
|
488
487
|
pageSize: number | boolean;
|
|
489
488
|
lapisFilters: {
|
|
@@ -499,6 +498,7 @@ declare const numberSequencesOverTimePropsSchema: default_2.ZodObject<{
|
|
|
499
498
|
granularity: "day" | "week" | "month" | "year";
|
|
500
499
|
smoothingWindow: number;
|
|
501
500
|
lapisDateField: string;
|
|
501
|
+
height?: string | undefined;
|
|
502
502
|
}>;
|
|
503
503
|
|
|
504
504
|
export declare type NumberSequencesOverTimeView = default_2.infer<typeof numberSequencesOverTimeViewSchema>;
|
|
@@ -509,7 +509,7 @@ export declare type PrevalenceOverTimeProps = default_2.infer<typeof prevalenceO
|
|
|
509
509
|
|
|
510
510
|
declare const prevalenceOverTimePropsSchema: default_2.ZodObject<{
|
|
511
511
|
width: default_2.ZodString;
|
|
512
|
-
height: default_2.ZodString
|
|
512
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
513
513
|
numeratorFilters: default_2.ZodArray<default_2.ZodObject<{
|
|
514
514
|
lapisFilter: default_2.ZodIntersection<default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodArray<default_2.ZodString, "many">, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean, default_2.ZodUndefined]>>, default_2.ZodObject<{
|
|
515
515
|
nucleotideMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
@@ -570,7 +570,6 @@ declare const prevalenceOverTimePropsSchema: default_2.ZodObject<{
|
|
|
570
570
|
yAxisMaxLinear: default_2.ZodUnion<[default_2.ZodLiteral<"maxInData">, default_2.ZodLiteral<"limitTo1">, default_2.ZodNumber]>;
|
|
571
571
|
yAxisMaxLogarithmic: default_2.ZodUnion<[default_2.ZodLiteral<"maxInData">, default_2.ZodLiteral<"limitTo1">, default_2.ZodNumber]>;
|
|
572
572
|
}, "strip", default_2.ZodTypeAny, {
|
|
573
|
-
height: string;
|
|
574
573
|
width: string;
|
|
575
574
|
pageSize: number | boolean;
|
|
576
575
|
views: ("table" | "bar" | "line" | "bubble")[];
|
|
@@ -595,8 +594,8 @@ declare const prevalenceOverTimePropsSchema: default_2.ZodObject<{
|
|
|
595
594
|
lapisDateField: string;
|
|
596
595
|
yAxisMaxLinear: number | "maxInData" | "limitTo1";
|
|
597
596
|
yAxisMaxLogarithmic: number | "maxInData" | "limitTo1";
|
|
597
|
+
height?: string | undefined;
|
|
598
598
|
}, {
|
|
599
|
-
height: string;
|
|
600
599
|
width: string;
|
|
601
600
|
pageSize: number | boolean;
|
|
602
601
|
views: ("table" | "bar" | "line" | "bubble")[];
|
|
@@ -621,6 +620,7 @@ declare const prevalenceOverTimePropsSchema: default_2.ZodObject<{
|
|
|
621
620
|
lapisDateField: string;
|
|
622
621
|
yAxisMaxLinear: number | "maxInData" | "limitTo1";
|
|
623
622
|
yAxisMaxLogarithmic: number | "maxInData" | "limitTo1";
|
|
623
|
+
height?: string | undefined;
|
|
624
624
|
}>;
|
|
625
625
|
|
|
626
626
|
export declare type PrevalenceOverTimeView = default_2.infer<typeof prevalenceOverTimeViewSchema>;
|
|
@@ -631,7 +631,7 @@ export declare type RelativeGrowthAdvantageProps = default_2.infer<typeof relati
|
|
|
631
631
|
|
|
632
632
|
declare const relativeGrowthAdvantagePropsSchema: default_2.ZodObject<{
|
|
633
633
|
width: default_2.ZodString;
|
|
634
|
-
height: default_2.ZodString
|
|
634
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
635
635
|
numeratorFilter: default_2.ZodIntersection<default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodArray<default_2.ZodString, "many">, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean, default_2.ZodUndefined]>>, default_2.ZodObject<{
|
|
636
636
|
nucleotideMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
637
637
|
aminoAcidMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
@@ -670,7 +670,6 @@ declare const relativeGrowthAdvantagePropsSchema: default_2.ZodObject<{
|
|
|
670
670
|
yAxisMaxLinear: default_2.ZodUnion<[default_2.ZodLiteral<"maxInData">, default_2.ZodLiteral<"limitTo1">, default_2.ZodNumber]>;
|
|
671
671
|
yAxisMaxLogarithmic: default_2.ZodUnion<[default_2.ZodLiteral<"maxInData">, default_2.ZodLiteral<"limitTo1">, default_2.ZodNumber]>;
|
|
672
672
|
}, "strip", default_2.ZodTypeAny, {
|
|
673
|
-
height: string;
|
|
674
673
|
width: string;
|
|
675
674
|
views: "line"[];
|
|
676
675
|
denominatorFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
@@ -689,8 +688,8 @@ declare const relativeGrowthAdvantagePropsSchema: default_2.ZodObject<{
|
|
|
689
688
|
aminoAcidInsertions?: string[] | undefined;
|
|
690
689
|
};
|
|
691
690
|
generationTime: number;
|
|
691
|
+
height?: string | undefined;
|
|
692
692
|
}, {
|
|
693
|
-
height: string;
|
|
694
693
|
width: string;
|
|
695
694
|
views: "line"[];
|
|
696
695
|
denominatorFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
@@ -709,6 +708,7 @@ declare const relativeGrowthAdvantagePropsSchema: default_2.ZodObject<{
|
|
|
709
708
|
aminoAcidInsertions?: string[] | undefined;
|
|
710
709
|
};
|
|
711
710
|
generationTime: number;
|
|
711
|
+
height?: string | undefined;
|
|
712
712
|
}>;
|
|
713
713
|
|
|
714
714
|
export declare type RelativeGrowthAdvantageView = default_2.infer<typeof relativeGrowthAdvantageViewSchema>;
|
|
@@ -723,7 +723,7 @@ export declare type StatisticsProps = default_2.infer<typeof statisticsPropsSche
|
|
|
723
723
|
|
|
724
724
|
declare const statisticsPropsSchema: default_2.ZodObject<{
|
|
725
725
|
width: default_2.ZodString;
|
|
726
|
-
height: default_2.ZodString
|
|
726
|
+
height: default_2.ZodOptional<default_2.ZodString>;
|
|
727
727
|
numeratorFilter: default_2.ZodIntersection<default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodArray<default_2.ZodString, "many">, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean, default_2.ZodUndefined]>>, default_2.ZodObject<{
|
|
728
728
|
nucleotideMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
729
729
|
aminoAcidMutations: default_2.ZodOptional<default_2.ZodArray<default_2.ZodString, "many">>;
|
|
@@ -757,7 +757,6 @@ declare const statisticsPropsSchema: default_2.ZodObject<{
|
|
|
757
757
|
aminoAcidInsertions?: string[] | undefined;
|
|
758
758
|
}>>;
|
|
759
759
|
}, "strip", default_2.ZodTypeAny, {
|
|
760
|
-
height: string;
|
|
761
760
|
width: string;
|
|
762
761
|
denominatorFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
763
762
|
nucleotideMutations?: string[] | undefined;
|
|
@@ -771,8 +770,8 @@ declare const statisticsPropsSchema: default_2.ZodObject<{
|
|
|
771
770
|
nucleotideInsertions?: string[] | undefined;
|
|
772
771
|
aminoAcidInsertions?: string[] | undefined;
|
|
773
772
|
};
|
|
773
|
+
height?: string | undefined;
|
|
774
774
|
}, {
|
|
775
|
-
height: string;
|
|
776
775
|
width: string;
|
|
777
776
|
denominatorFilter: Record<string, string | number | boolean | string[] | null | undefined> & {
|
|
778
777
|
nucleotideMutations?: string[] | undefined;
|
|
@@ -786,6 +785,7 @@ declare const statisticsPropsSchema: default_2.ZodObject<{
|
|
|
786
785
|
nucleotideInsertions?: string[] | undefined;
|
|
787
786
|
aminoAcidInsertions?: string[] | undefined;
|
|
788
787
|
};
|
|
788
|
+
height?: string | undefined;
|
|
789
789
|
}>;
|
|
790
790
|
|
|
791
791
|
export declare type TemporalGranularity = default_2.infer<typeof temporalGranularitySchema>;
|
|
@@ -848,7 +848,7 @@ declare global {
|
|
|
848
848
|
|
|
849
849
|
declare global {
|
|
850
850
|
interface HTMLElementTagNameMap {
|
|
851
|
-
'gs-
|
|
851
|
+
'gs-mutation-comparison-component': MutationComparisonComponent;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
|
|
@@ -856,7 +856,7 @@ declare global {
|
|
|
856
856
|
declare global {
|
|
857
857
|
namespace JSX {
|
|
858
858
|
interface IntrinsicElements {
|
|
859
|
-
'gs-
|
|
859
|
+
'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
}
|
|
@@ -864,7 +864,7 @@ declare global {
|
|
|
864
864
|
|
|
865
865
|
declare global {
|
|
866
866
|
interface HTMLElementTagNameMap {
|
|
867
|
-
'gs-
|
|
867
|
+
'gs-mutations-component': MutationsComponent;
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
870
|
|
|
@@ -872,7 +872,7 @@ declare global {
|
|
|
872
872
|
declare global {
|
|
873
873
|
namespace JSX {
|
|
874
874
|
interface IntrinsicElements {
|
|
875
|
-
'gs-
|
|
875
|
+
'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
}
|
|
@@ -880,7 +880,7 @@ declare global {
|
|
|
880
880
|
|
|
881
881
|
declare global {
|
|
882
882
|
interface HTMLElementTagNameMap {
|
|
883
|
-
'gs-
|
|
883
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
|
|
@@ -888,7 +888,7 @@ declare global {
|
|
|
888
888
|
declare global {
|
|
889
889
|
namespace JSX {
|
|
890
890
|
interface IntrinsicElements {
|
|
891
|
-
'gs-
|
|
891
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
894
|
}
|
|
@@ -896,7 +896,7 @@ declare global {
|
|
|
896
896
|
|
|
897
897
|
declare global {
|
|
898
898
|
interface HTMLElementTagNameMap {
|
|
899
|
-
'gs-
|
|
899
|
+
'gs-aggregate': AggregateComponent;
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
|
|
@@ -904,7 +904,7 @@ declare global {
|
|
|
904
904
|
declare global {
|
|
905
905
|
namespace JSX {
|
|
906
906
|
interface IntrinsicElements {
|
|
907
|
-
'gs-
|
|
907
|
+
'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
}
|
|
@@ -944,7 +944,7 @@ declare global {
|
|
|
944
944
|
|
|
945
945
|
declare global {
|
|
946
946
|
interface HTMLElementTagNameMap {
|
|
947
|
-
'gs-
|
|
947
|
+
'gs-mutations-over-time': MutationsOverTimeComponent;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
|
|
@@ -952,7 +952,7 @@ declare global {
|
|
|
952
952
|
declare global {
|
|
953
953
|
namespace JSX {
|
|
954
954
|
interface IntrinsicElements {
|
|
955
|
-
'gs-
|
|
955
|
+
'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
}
|
|
@@ -960,7 +960,7 @@ declare global {
|
|
|
960
960
|
|
|
961
961
|
declare global {
|
|
962
962
|
interface HTMLElementTagNameMap {
|
|
963
|
-
'gs-
|
|
963
|
+
'gs-sequences-by-location': SequencesByLocationComponent;
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
966
|
|
|
@@ -968,7 +968,7 @@ declare global {
|
|
|
968
968
|
declare global {
|
|
969
969
|
namespace JSX {
|
|
970
970
|
interface IntrinsicElements {
|
|
971
|
-
'gs-
|
|
971
|
+
'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
}
|
|
@@ -976,7 +976,7 @@ declare global {
|
|
|
976
976
|
|
|
977
977
|
declare global {
|
|
978
978
|
interface HTMLElementTagNameMap {
|
|
979
|
-
'gs-
|
|
979
|
+
'gs-statistics': StatisticsComponent;
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
982
|
|
|
@@ -984,7 +984,7 @@ declare global {
|
|
|
984
984
|
declare global {
|
|
985
985
|
namespace JSX {
|
|
986
986
|
interface IntrinsicElements {
|
|
987
|
-
'gs-
|
|
987
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
}
|
|
@@ -992,7 +992,7 @@ declare global {
|
|
|
992
992
|
|
|
993
993
|
declare global {
|
|
994
994
|
interface HTMLElementTagNameMap {
|
|
995
|
-
'gs-
|
|
995
|
+
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
|
|
@@ -1000,7 +1000,7 @@ declare global {
|
|
|
1000
1000
|
declare global {
|
|
1001
1001
|
namespace JSX {
|
|
1002
1002
|
interface IntrinsicElements {
|
|
1003
|
-
'gs-
|
|
1003
|
+
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
@@ -1066,10 +1066,10 @@ declare global {
|
|
|
1066
1066
|
|
|
1067
1067
|
declare global {
|
|
1068
1068
|
interface HTMLElementTagNameMap {
|
|
1069
|
-
'gs-
|
|
1069
|
+
'gs-mutation-filter': MutationFilterComponent;
|
|
1070
1070
|
}
|
|
1071
1071
|
interface HTMLElementEventMap {
|
|
1072
|
-
'gs-
|
|
1072
|
+
'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
@@ -1077,7 +1077,7 @@ declare global {
|
|
|
1077
1077
|
declare global {
|
|
1078
1078
|
namespace JSX {
|
|
1079
1079
|
interface IntrinsicElements {
|
|
1080
|
-
'gs-
|
|
1080
|
+
'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
@@ -1085,10 +1085,10 @@ declare global {
|
|
|
1085
1085
|
|
|
1086
1086
|
declare global {
|
|
1087
1087
|
interface HTMLElementTagNameMap {
|
|
1088
|
-
'gs-
|
|
1088
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1089
1089
|
}
|
|
1090
1090
|
interface HTMLElementEventMap {
|
|
1091
|
-
'gs-
|
|
1091
|
+
'gs-lineage-filter-changed': LineageFilterChangedEvent;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
@@ -1096,7 +1096,7 @@ declare global {
|
|
|
1096
1096
|
declare global {
|
|
1097
1097
|
namespace JSX {
|
|
1098
1098
|
interface IntrinsicElements {
|
|
1099
|
-
'gs-
|
|
1099
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
package/package.json
CHANGED
|
@@ -2,4 +2,19 @@ import { createContext } from 'preact';
|
|
|
2
2
|
|
|
3
3
|
import { type ReferenceGenome } from '../lapisApi/ReferenceGenome';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const UNINITIALIZED_SEQUENCE = '__uninitialized__';
|
|
6
|
+
|
|
7
|
+
export const INITIAL_REFERENCE_GENOMES = {
|
|
8
|
+
nucleotideSequences: [{ name: UNINITIALIZED_SEQUENCE, sequence: '' }],
|
|
9
|
+
genes: [],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ReferenceGenomeContext = createContext<ReferenceGenome>(INITIAL_REFERENCE_GENOMES);
|
|
13
|
+
|
|
14
|
+
export function isNotInitialized(referenceGenome: ReferenceGenome) {
|
|
15
|
+
return (
|
|
16
|
+
referenceGenome.genes.length === 0 &&
|
|
17
|
+
referenceGenome.nucleotideSequences.length === 1 &&
|
|
18
|
+
referenceGenome.nucleotideSequences[0].name === UNINITIALIZED_SEQUENCE
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -13,6 +13,7 @@ interface AggregateBarChartProps {
|
|
|
13
13
|
data: AggregateData;
|
|
14
14
|
fields: string[];
|
|
15
15
|
maxNumberOfBars: number;
|
|
16
|
+
maintainAspectRatio: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
Chart.register(...registerables, BarController);
|
|
@@ -23,7 +24,12 @@ type DataPoint = {
|
|
|
23
24
|
proportion: number;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
export const AggregateBarChart: FunctionComponent<AggregateBarChartProps> = ({
|
|
27
|
+
export const AggregateBarChart: FunctionComponent<AggregateBarChartProps> = ({
|
|
28
|
+
data,
|
|
29
|
+
fields,
|
|
30
|
+
maxNumberOfBars,
|
|
31
|
+
maintainAspectRatio,
|
|
32
|
+
}) => {
|
|
27
33
|
if (data.length === 0) {
|
|
28
34
|
return <NoDataDisplay />;
|
|
29
35
|
}
|
|
@@ -42,10 +48,22 @@ export const AggregateBarChart: FunctionComponent<AggregateBarChartProps> = ({ d
|
|
|
42
48
|
);
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
return
|
|
51
|
+
return (
|
|
52
|
+
<AggregateBarChartInner
|
|
53
|
+
data={data}
|
|
54
|
+
fields={fields}
|
|
55
|
+
maxNumberOfBars={maxNumberOfBars}
|
|
56
|
+
maintainAspectRatio={maintainAspectRatio}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
46
59
|
};
|
|
47
60
|
|
|
48
|
-
const AggregateBarChartInner: FunctionComponent<AggregateBarChartProps> = ({
|
|
61
|
+
const AggregateBarChartInner: FunctionComponent<AggregateBarChartProps> = ({
|
|
62
|
+
data,
|
|
63
|
+
fields,
|
|
64
|
+
maxNumberOfBars,
|
|
65
|
+
maintainAspectRatio,
|
|
66
|
+
}) => {
|
|
49
67
|
const config = useMemo((): ChartConfiguration<'bar', DataPoint[]> => {
|
|
50
68
|
const { datasets, countsOfEachBar } = getDatasets(fields, maxNumberOfBars, data);
|
|
51
69
|
|
|
@@ -55,7 +73,7 @@ const AggregateBarChartInner: FunctionComponent<AggregateBarChartProps> = ({ dat
|
|
|
55
73
|
datasets,
|
|
56
74
|
},
|
|
57
75
|
options: {
|
|
58
|
-
maintainAspectRatio
|
|
76
|
+
maintainAspectRatio,
|
|
59
77
|
animation: false,
|
|
60
78
|
indexAxis: 'y',
|
|
61
79
|
scales: {
|
|
@@ -64,6 +82,9 @@ const AggregateBarChartInner: FunctionComponent<AggregateBarChartProps> = ({ dat
|
|
|
64
82
|
},
|
|
65
83
|
y: {
|
|
66
84
|
stacked: true,
|
|
85
|
+
ticks: {
|
|
86
|
+
autoSkip: false,
|
|
87
|
+
},
|
|
67
88
|
},
|
|
68
89
|
},
|
|
69
90
|
plugins: {
|
|
@@ -92,7 +113,7 @@ const AggregateBarChartInner: FunctionComponent<AggregateBarChartProps> = ({ dat
|
|
|
92
113
|
},
|
|
93
114
|
},
|
|
94
115
|
};
|
|
95
|
-
}, [data, fields, maxNumberOfBars]);
|
|
116
|
+
}, [data, fields, maintainAspectRatio, maxNumberOfBars]);
|
|
96
117
|
|
|
97
118
|
return <GsChart configuration={config} />;
|
|
98
119
|
};
|
|
@@ -15,6 +15,7 @@ import { ResizeContainer } from '../components/resize-container';
|
|
|
15
15
|
import Tabs from '../components/tabs';
|
|
16
16
|
import { useQuery } from '../useQuery';
|
|
17
17
|
import { AggregateBarChart } from './aggregate-bar-chart';
|
|
18
|
+
import { getMaintainAspectRatio } from '../shared/charts/getMaintainAspectRatio';
|
|
18
19
|
|
|
19
20
|
const aggregateViewSchema = z.union([z.literal(views.table), z.literal(views.bar)]);
|
|
20
21
|
export type AggregateView = z.infer<typeof aggregateViewSchema>;
|
|
@@ -27,7 +28,7 @@ const aggregatePropsSchema = z.object({
|
|
|
27
28
|
initialSortDirection: z.union([z.literal('ascending'), z.literal('descending')]),
|
|
28
29
|
pageSize: z.union([z.boolean(), z.number()]),
|
|
29
30
|
width: z.string(),
|
|
30
|
-
height: z.string(),
|
|
31
|
+
height: z.string().optional(),
|
|
31
32
|
maxNumberOfBars: z.number(),
|
|
32
33
|
});
|
|
33
34
|
export type AggregateProps = z.infer<typeof aggregatePropsSchema>;
|
|
@@ -74,6 +75,8 @@ type AggregatedDataTabsProps = {
|
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data, originalComponentProps }) => {
|
|
78
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
79
|
+
|
|
77
80
|
const getTab = (view: AggregateView) => {
|
|
78
81
|
switch (view) {
|
|
79
82
|
case views.table:
|
|
@@ -97,6 +100,7 @@ const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data,
|
|
|
97
100
|
data={data}
|
|
98
101
|
fields={originalComponentProps.fields}
|
|
99
102
|
maxNumberOfBars={originalComponentProps.maxNumberOfBars}
|
|
103
|
+
maintainAspectRatio={maintainAspectRatio}
|
|
100
104
|
/>
|
|
101
105
|
),
|
|
102
106
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ComponentChildren, type FunctionalComponent } from 'preact';
|
|
2
2
|
import { useContext } from 'preact/hooks';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { ReferenceGenomeContext } from '../ReferenceGenomeContext';
|
|
4
|
+
import { isNotInitialized, ReferenceGenomeContext } from '../ReferenceGenomeContext';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Sometimes the reference genome is not immediately available.
|
|
@@ -19,7 +18,3 @@ export const ReferenceGenomesAwaiter: FunctionalComponent<{ children: ComponentC
|
|
|
19
18
|
|
|
20
19
|
return <>{children}</>;
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
function isNotInitialized(referenceGenome: ReferenceGenome) {
|
|
24
|
-
return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
|
|
25
|
-
}
|
|
@@ -97,6 +97,7 @@ function componentParametersToCode(componentName: string, params: object, lapisU
|
|
|
97
97
|
|
|
98
98
|
const attributes = indentLines(
|
|
99
99
|
Object.entries(params)
|
|
100
|
+
.filter(([_, value]) => value !== undefined)
|
|
100
101
|
.map(([key, value]) => `${key}='${stringifyIfNeeded(value) as string}'`)
|
|
101
102
|
.join('\n'),
|
|
102
103
|
4,
|
|
@@ -13,11 +13,13 @@ Chart.register(...registerables, VennDiagramController, ArcSlice);
|
|
|
13
13
|
export interface MutationComparisonVennProps {
|
|
14
14
|
data: Dataset<MutationData>;
|
|
15
15
|
proportionInterval: ProportionInterval;
|
|
16
|
+
maintainAspectRatio: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const MutationComparisonVenn: FunctionComponent<MutationComparisonVennProps> = ({
|
|
19
20
|
data,
|
|
20
21
|
proportionInterval,
|
|
22
|
+
maintainAspectRatio,
|
|
21
23
|
}) => {
|
|
22
24
|
const [selectedDatasetIndex, setSelectedDatasetIndex] = useState<null | number>(null);
|
|
23
25
|
|
|
@@ -48,7 +50,7 @@ export const MutationComparisonVenn: FunctionComponent<MutationComparisonVennPro
|
|
|
48
50
|
type: 'venn',
|
|
49
51
|
data: sets,
|
|
50
52
|
options: {
|
|
51
|
-
maintainAspectRatio
|
|
53
|
+
maintainAspectRatio,
|
|
52
54
|
scales: {
|
|
53
55
|
x: {
|
|
54
56
|
ticks: {
|
|
@@ -91,7 +93,7 @@ export const MutationComparisonVenn: FunctionComponent<MutationComparisonVennPro
|
|
|
91
93
|
},
|
|
92
94
|
},
|
|
93
95
|
}),
|
|
94
|
-
[sets],
|
|
96
|
+
[maintainAspectRatio, sets],
|
|
95
97
|
);
|
|
96
98
|
|
|
97
99
|
if (data.content.length > 5) {
|