@genspectrum/dashboard-components 0.10.4 → 0.11.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 (53) hide show
  1. package/custom-elements.json +58 -58
  2. package/dist/components.d.ts +82 -32
  3. package/dist/components.js +57 -65
  4. package/dist/components.js.map +1 -1
  5. package/dist/{dateRangeOption-Doo6WHKu.js → dateRangeOption-Bh2p78z0.js} +9 -4
  6. package/dist/dateRangeOption-Bh2p78z0.js.map +1 -0
  7. package/dist/util.d.ts +623 -14
  8. package/dist/util.js +1 -1
  9. package/package.json +5 -5
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +1 -1
  11. package/src/preact/aggregatedData/aggregate.tsx +11 -8
  12. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +3 -11
  13. package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
  14. package/src/preact/mutationComparison/mutation-comparison.tsx +4 -6
  15. package/src/preact/mutationFilter/mutation-filter.tsx +4 -13
  16. package/src/preact/mutations/mutations.tsx +4 -4
  17. package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
  18. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +4 -13
  19. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  20. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -25
  21. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -8
  22. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -14
  23. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +11 -7
  24. package/src/query/queryNumberOfSequencesOverTime.spec.ts +4 -4
  25. package/src/query/queryNumberOfSequencesOverTime.ts +1 -4
  26. package/src/query/queryPrevalenceOverTime.ts +1 -4
  27. package/src/types.ts +11 -4
  28. package/src/utilEntrypoint.ts +17 -4
  29. package/src/utils/utils.ts +0 -29
  30. package/src/web-components/app.ts +1 -1
  31. package/src/web-components/input/gs-date-range-selector.stories.ts +4 -4
  32. package/src/web-components/input/gs-date-range-selector.tsx +5 -5
  33. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  34. package/src/web-components/input/gs-location-filter.tsx +1 -1
  35. package/src/web-components/input/gs-mutation-filter.tsx +5 -8
  36. package/src/web-components/input/gs-text-input.tsx +1 -1
  37. package/src/web-components/visualization/gs-aggregate.stories.ts +3 -3
  38. package/src/web-components/visualization/gs-aggregate.tsx +10 -6
  39. package/src/web-components/visualization/gs-mutation-comparison.tsx +7 -2
  40. package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -2
  41. package/src/web-components/visualization/gs-mutations.tsx +7 -2
  42. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +5 -5
  43. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +13 -15
  44. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -8
  45. package/src/web-components/visualization/gs-prevalence-over-time.tsx +17 -14
  46. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +4 -5
  47. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +17 -15
  48. package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -1
  49. package/src/web-components/visualization/gs-statistics.tsx +12 -3
  50. package/standalone-bundle/dashboard-components.js +2520 -2516
  51. package/standalone-bundle/dashboard-components.js.map +1 -1
  52. package/dist/dateRangeOption-Doo6WHKu.js.map +0 -1
  53. package/src/utils/utils.spec.ts +0 -16
@@ -35,12 +35,17 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
35
35
  /**
36
36
  * A list of tabs with views that this component should provide.
37
37
  */
38
- views: View[];
38
+ views: AggregateView[];
39
39
  /**
40
40
  * The filter to apply to the data.
41
41
  * It must be a valid LAPIS filter object.
42
42
  */
43
- filter: LapisFilter;
43
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
44
+ nucleotideMutations?: string[];
45
+ aminoAcidMutations?: string[];
46
+ nucleotideInsertions?: string[];
47
+ aminoAcidInsertions?: string[];
48
+ };
44
49
  /**
45
50
  * The width of the component.
46
51
  *
@@ -70,6 +75,10 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
70
75
  render(): JSX_2.Element;
71
76
  }
72
77
 
78
+ declare type AggregateView = default_2.infer<typeof aggregateViewSchema>;
79
+
80
+ declare const aggregateViewSchema: default_2.ZodLiteral<"table">;
81
+
73
82
  /**
74
83
  * ## Context
75
84
  *
@@ -187,9 +196,9 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
187
196
  */
188
197
  width: string;
189
198
  /**
190
- * The name of the column in LAPIS that contains the date information.
199
+ * The name of the metadata field in LAPIS that contains the date information.
191
200
  */
192
- dateColumn: string;
201
+ lapisDateField: string;
193
202
  render(): JSX_2.Element;
194
203
  }
195
204
 
@@ -199,10 +208,6 @@ declare class ErrorEvent_2 extends Event {
199
208
  }
200
209
  export { ErrorEvent_2 as ErrorEvent }
201
210
 
202
- declare type LapisFilter = default_2.infer<typeof lapisFilterSchema>;
203
-
204
- declare const lapisFilterSchema: default_2.ZodRecord<default_2.ZodString, default_2.ZodUnion<[default_2.ZodString, default_2.ZodNumber, default_2.ZodNull, default_2.ZodBoolean]>>;
205
-
206
211
  /**
207
212
  *
208
213
  * ## Context
@@ -343,7 +348,12 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
343
348
  * It should be human-readable.
344
349
  */
345
350
  lapisFilters: {
346
- lapisFilter: Record<string, string | number | null | boolean>;
351
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
352
+ nucleotideMutations?: string[];
353
+ aminoAcidMutations?: string[];
354
+ nucleotideInsertions?: string[];
355
+ aminoAcidInsertions?: string[];
356
+ };
347
357
  displayName: string;
348
358
  }[];
349
359
  /**
@@ -471,7 +481,12 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
471
481
  /**
472
482
  * LAPIS filter to select the displayed data. If not provided, all data is displayed.
473
483
  */
474
- lapisFilter: Record<string, string | number | null | boolean>;
484
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
485
+ nucleotideMutations?: string[];
486
+ aminoAcidMutations?: string[];
487
+ nucleotideInsertions?: string[];
488
+ aminoAcidInsertions?: string[];
489
+ };
475
490
  /**
476
491
  * The type of the sequence for which the mutations should be shown.
477
492
  */
@@ -529,7 +544,12 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
529
544
  /**
530
545
  * LAPIS filter to select the displayed data. If not provided, all data is displayed.
531
546
  */
532
- lapisFilter: Record<string, string | number | null | boolean>;
547
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
548
+ nucleotideMutations?: string[];
549
+ aminoAcidMutations?: string[];
550
+ nucleotideInsertions?: string[];
551
+ aminoAcidInsertions?: string[];
552
+ };
533
553
  /**
534
554
  * The type of the sequence for which the mutations should be shown.
535
555
  */
@@ -587,11 +607,13 @@ export declare class NumberSequencesOverTimeComponent extends PreactLitAdapterWi
587
607
  * The `displayName` will be used to label the component views.
588
608
  * It should be human-readable.
589
609
  *
590
- */ lapisFilter: {
591
- lapisFilter: Record<string, string | number | null | boolean>;
592
- displayName: string;
593
- } | {
594
- lapisFilter: Record<string, string | number | null | boolean>;
610
+ */ lapisFilters: {
611
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
612
+ nucleotideMutations?: string[];
613
+ aminoAcidMutations?: string[];
614
+ nucleotideInsertions?: string[];
615
+ aminoAcidInsertions?: string[];
616
+ };
595
617
  displayName: string;
596
618
  }[];
597
619
  /**
@@ -700,18 +722,25 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
700
722
  * It should be human-readable.
701
723
  *
702
724
  */
703
- numeratorFilter: {
704
- lapisFilter: Record<string, string | number | null | boolean>;
705
- displayName: string;
706
- } | {
707
- lapisFilter: Record<string, string | number | null | boolean>;
725
+ numeratorFilters: {
726
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
727
+ nucleotideMutations?: string[];
728
+ aminoAcidMutations?: string[];
729
+ nucleotideInsertions?: string[];
730
+ aminoAcidInsertions?: string[];
731
+ };
708
732
  displayName: string;
709
733
  }[];
710
734
  /**
711
735
  * The LAPIS filter, to select the data of the reference.
712
736
  * It must be a valid LAPIS filter object.
713
737
  */
714
- denominatorFilter: Record<string, string | number | null | boolean>;
738
+ denominatorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
739
+ nucleotideMutations?: string[];
740
+ aminoAcidMutations?: string[];
741
+ nucleotideInsertions?: string[];
742
+ aminoAcidInsertions?: string[];
743
+ };
715
744
  /**
716
745
  * The granularity of the time axis.
717
746
  */
@@ -854,12 +883,22 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
854
883
  * LAPIS filter to select the data of the focal variant.
855
884
  * It must be a valid LAPIS filter object.
856
885
  */
857
- numeratorFilter: Record<string, string | number | null | boolean>;
886
+ numeratorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
887
+ nucleotideMutations?: string[];
888
+ aminoAcidMutations?: string[];
889
+ nucleotideInsertions?: string[];
890
+ aminoAcidInsertions?: string[];
891
+ };
858
892
  /**
859
893
  * LAPIS filter to select the data of the baseline variant.
860
894
  * It must be a valid LAPIS filter object.
861
895
  */
862
- denominatorFilter: Record<string, string | number | null | boolean>;
896
+ denominatorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
897
+ nucleotideMutations?: string[];
898
+ aminoAcidMutations?: string[];
899
+ nucleotideInsertions?: string[];
900
+ aminoAcidInsertions?: string[];
901
+ };
863
902
  /**
864
903
  * The generation time represents the number of days over which the variant's relative growth advantage is measured.
865
904
  * For example, if we set a generation time of 7 days, then we estimate the growth advantage per week.
@@ -996,7 +1035,12 @@ export declare class SequencesByLocationComponent extends PreactLitAdapterWithGr
996
1035
  * If you want to display the distribution over the states of a certain country,
997
1036
  * you should usually filter by that country here (e.g. { country: 'USA' }).
998
1037
  */
999
- lapisFilter: Record<string, string | number | null | boolean>;
1038
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
1039
+ nucleotideMutations?: string[];
1040
+ aminoAcidMutations?: string[];
1041
+ nucleotideInsertions?: string[];
1042
+ aminoAcidInsertions?: string[];
1043
+ };
1000
1044
  /**
1001
1045
  * Required.
1002
1046
  *
@@ -1072,12 +1116,22 @@ export declare class StatisticsComponent extends PreactLitAdapterWithGridJsStyle
1072
1116
  * The filter to apply to the data for the overall number of sequences and as the numerator for the proportion.
1073
1117
  * It must be a valid LAPIS filter object.
1074
1118
  */
1075
- numeratorFilter: LapisFilter;
1119
+ numeratorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
1120
+ nucleotideMutations?: string[];
1121
+ aminoAcidMutations?: string[];
1122
+ nucleotideInsertions?: string[];
1123
+ aminoAcidInsertions?: string[];
1124
+ };
1076
1125
  /**
1077
1126
  * The filter to apply to the data for the denominator of the proportion.
1078
1127
  * It must be a valid LAPIS filter object.
1079
1128
  */
1080
- denominatorFilter: LapisFilter;
1129
+ denominatorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
1130
+ nucleotideMutations?: string[];
1131
+ aminoAcidMutations?: string[];
1132
+ nucleotideInsertions?: string[];
1133
+ aminoAcidInsertions?: string[];
1134
+ };
1081
1135
  /**
1082
1136
  * The width of the component.
1083
1137
  *
@@ -1139,10 +1193,6 @@ export declare class UserFacingError extends Error {
1139
1193
  constructor(headline: string, message: string);
1140
1194
  }
1141
1195
 
1142
- declare type View = default_2.infer<typeof viewSchema>;
1143
-
1144
- declare const viewSchema: default_2.ZodLiteral<"table">;
1145
-
1146
1196
  export { }
1147
1197
 
1148
1198
 
@@ -1376,7 +1426,7 @@ declare global {
1376
1426
  'gs-mutation-filter': MutationFilterComponent;
1377
1427
  }
1378
1428
  interface HTMLElementEventMap {
1379
- 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1429
+ 'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
1380
1430
  }
1381
1431
  }
1382
1432
 
@@ -6,7 +6,7 @@ import { options, createContext as createContext$1, Fragment, render } from "pre
6
6
  import { Grid } from "gridjs";
7
7
  import { Chart, registerables, Scale } from "chart.js";
8
8
  import { VennDiagramController, ArcSlice, extractSets } from "chartjs-chart-venn";
9
- import { n as namedLapisFilterSchema, s as sequenceTypeSchema, m as mutationComparisonViewSchema, v as views, l as lapisFilterSchema, t as temporalGranularitySchema, a as dateRangeOptionSchema, b as toYYYYMMDD, D as DateRangeOptionChangedEvent } from "./dateRangeOption-Doo6WHKu.js";
9
+ import { v as views, n as namedLapisFilterSchema, s as sequenceTypeSchema, l as lapisFilterSchema, t as temporalGranularitySchema, a as dateRangeOptionSchema, b as toYYYYMMDD, D as DateRangeOptionChangedEvent, m as mutationsFilterSchema } from "./dateRangeOption-Bh2p78z0.js";
10
10
  import { autoUpdate, computePosition, offset, shift, flip } from "@floating-ui/dom";
11
11
  import { ReactiveElement } from "@lit/reactive-element";
12
12
  import { BarWithErrorBarsController, BarWithErrorBar } from "chartjs-chart-error-bars";
@@ -2038,6 +2038,7 @@ function useQuery(fetchDataCallback, dependencies) {
2038
2038
  }
2039
2039
  return { data, error: null, isLoading: false };
2040
2040
  }
2041
+ const mutationComparisonViewSchema = z$1.union([z$1.literal(views.table), z$1.literal(views.venn)]);
2041
2042
  const mutationComparisonPropsSchema = z$1.object({
2042
2043
  width: z$1.string(),
2043
2044
  height: z$1.string(),
@@ -5640,11 +5641,11 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
5640
5641
  gridData: filteredSubstitutionsOrDeletions
5641
5642
  };
5642
5643
  }
5643
- const viewSchema$4 = z$1.union([z$1.literal(views.table), z$1.literal(views.grid), z$1.literal(views.insertions)]);
5644
+ const mutationsViewSchema = z$1.union([z$1.literal(views.table), z$1.literal(views.grid), z$1.literal(views.insertions)]);
5644
5645
  const mutationsPropsSchema = z$1.object({
5645
5646
  lapisFilter: lapisFilterSchema,
5646
5647
  sequenceType: sequenceTypeSchema,
5647
- views: viewSchema$4.array(),
5648
+ views: mutationsViewSchema.array(),
5648
5649
  pageSize: z$1.union([z$1.boolean(), z$1.number()]),
5649
5650
  width: z$1.string(),
5650
5651
  height: z$1.string()
@@ -5956,7 +5957,7 @@ const confidenceIntervalDataLabel = (value, lowerLimit, upperLimit, prefix) => {
5956
5957
  };
5957
5958
  const confidenceIntervalMethodSchema = z$1.union([z$1.literal("wilson"), z$1.literal("none")]);
5958
5959
  const axisMaxSchema = z$1.union([z$1.literal("maxInData"), z$1.literal("limitTo1"), z$1.number()]);
5959
- const yAxisMaxConfigSchema = z$1.object({
5960
+ z$1.object({
5960
5961
  linear: axisMaxSchema.optional(),
5961
5962
  logarithmic: axisMaxSchema.optional()
5962
5963
  });
@@ -7019,12 +7020,6 @@ function getMinMaxNumber(values) {
7019
7020
  }
7020
7021
  return [min, max];
7021
7022
  }
7022
- function makeArray(arrayOrSingleItem) {
7023
- if (Array.isArray(arrayOrSingleItem)) {
7024
- return arrayOrSingleItem;
7025
- }
7026
- return [arrayOrSingleItem];
7027
- }
7028
7023
  Chart.register(...registerables, LogitScale);
7029
7024
  const PrevalenceOverTimeBubbleChart = ({
7030
7025
  data,
@@ -7450,8 +7445,7 @@ class DivisionOperator {
7450
7445
  return { content };
7451
7446
  }
7452
7447
  }
7453
- function queryPrevalenceOverTime(numeratorFilter, denominatorFilter, granularity, smoothingWindow, lapis, lapisDateField, signal) {
7454
- const numeratorFilters = makeArray(numeratorFilter);
7448
+ function queryPrevalenceOverTime(numeratorFilters, denominatorFilter, granularity, smoothingWindow, lapis, lapisDateField, signal) {
7455
7449
  const denominatorData = queryAggregatedDataOverTime(
7456
7450
  denominatorFilter,
7457
7451
  granularity,
@@ -7543,7 +7537,7 @@ const ScalingSelector = ({
7543
7537
  }
7544
7538
  );
7545
7539
  };
7546
- const viewSchema$3 = z$1.union([
7540
+ const prevalenceOverTimeViewSchema = z$1.union([
7547
7541
  z$1.literal(views.table),
7548
7542
  z$1.literal(views.bar),
7549
7543
  z$1.literal(views.line),
@@ -7552,11 +7546,11 @@ const viewSchema$3 = z$1.union([
7552
7546
  const prevalenceOverTimePropsSchema = z$1.object({
7553
7547
  width: z$1.string(),
7554
7548
  height: z$1.string(),
7555
- numeratorFilter: z$1.union([namedLapisFilterSchema, z$1.array(namedLapisFilterSchema)]),
7549
+ numeratorFilters: z$1.array(namedLapisFilterSchema).min(1),
7556
7550
  denominatorFilter: lapisFilterSchema,
7557
7551
  granularity: temporalGranularitySchema,
7558
7552
  smoothingWindow: z$1.number(),
7559
- views: z$1.array(viewSchema$3),
7553
+ views: z$1.array(prevalenceOverTimeViewSchema),
7560
7554
  confidenceIntervalMethods: z$1.array(confidenceIntervalMethodSchema),
7561
7555
  lapisDateField: z$1.string().min(1),
7562
7556
  pageSize: z$1.union([z$1.boolean(), z$1.number()]),
@@ -7569,18 +7563,18 @@ const PrevalenceOverTime = (componentProps) => {
7569
7563
  return /* @__PURE__ */ u$1(ErrorBoundary, { size, schema: prevalenceOverTimePropsSchema, componentProps, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...componentProps }) }) });
7570
7564
  };
7571
7565
  const PrevalenceOverTimeInner = (componentProps) => {
7572
- const { numeratorFilter, denominatorFilter, granularity, smoothingWindow, lapisDateField } = componentProps;
7566
+ const { numeratorFilters, denominatorFilter, granularity, smoothingWindow, lapisDateField } = componentProps;
7573
7567
  const lapis = x(LapisUrlContext);
7574
7568
  const { data, error, isLoading } = useQuery(
7575
7569
  () => queryPrevalenceOverTime(
7576
- numeratorFilter,
7570
+ numeratorFilters,
7577
7571
  denominatorFilter,
7578
7572
  granularity,
7579
7573
  smoothingWindow,
7580
7574
  lapis,
7581
7575
  lapisDateField
7582
7576
  ),
7583
- [lapis, numeratorFilter, denominatorFilter, granularity, smoothingWindow, lapisDateField]
7577
+ [lapis, numeratorFilters, denominatorFilter, granularity, smoothingWindow, lapisDateField]
7584
7578
  );
7585
7579
  if (isLoading) {
7586
7580
  return /* @__PURE__ */ u$1(LoadingDisplay, {});
@@ -7742,7 +7736,7 @@ var __decorateClass$b = (decorators, target, key, kind) => {
7742
7736
  let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles {
7743
7737
  constructor() {
7744
7738
  super(...arguments);
7745
- this.numeratorFilter = { displayName: "", lapisFilter: {} };
7739
+ this.numeratorFilters = [];
7746
7740
  this.denominatorFilter = {};
7747
7741
  this.granularity = "day";
7748
7742
  this.smoothingWindow = 0;
@@ -7759,7 +7753,7 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
7759
7753
  return /* @__PURE__ */ u$1(
7760
7754
  PrevalenceOverTime,
7761
7755
  {
7762
- numeratorFilter: this.numeratorFilter,
7756
+ numeratorFilters: this.numeratorFilters,
7763
7757
  denominatorFilter: this.denominatorFilter,
7764
7758
  granularity: this.granularity,
7765
7759
  smoothingWindow: this.smoothingWindow,
@@ -7777,7 +7771,7 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
7777
7771
  };
7778
7772
  __decorateClass$b([
7779
7773
  n2({ type: Object })
7780
- ], PrevalenceOverTimeComponent.prototype, "numeratorFilter", 2);
7774
+ ], PrevalenceOverTimeComponent.prototype, "numeratorFilters", 2);
7781
7775
  __decorateClass$b([
7782
7776
  n2({ type: Object })
7783
7777
  ], PrevalenceOverTimeComponent.prototype, "denominatorFilter", 2);
@@ -8041,16 +8035,17 @@ function toYearMonthDay(d2) {
8041
8035
  count: d2.count
8042
8036
  };
8043
8037
  }
8044
- const viewSchema$2 = z$1.literal(views.line);
8038
+ const relativeGrowthAdvantageViewSchema = z$1.literal(views.line);
8045
8039
  const relativeGrowthAdvantagePropsSchema = z$1.object({
8046
8040
  width: z$1.string(),
8047
8041
  height: z$1.string(),
8048
8042
  numeratorFilter: lapisFilterSchema,
8049
8043
  denominatorFilter: lapisFilterSchema,
8050
8044
  generationTime: z$1.number(),
8051
- views: z$1.array(viewSchema$2),
8045
+ views: z$1.array(relativeGrowthAdvantageViewSchema),
8052
8046
  lapisDateField: z$1.string().min(1),
8053
- yAxisMaxConfig: yAxisMaxConfigSchema
8047
+ yAxisMaxLinear: axisMaxSchema,
8048
+ yAxisMaxLogarithmic: axisMaxSchema
8054
8049
  });
8055
8050
  const RelativeGrowthAdvantage = (componentProps) => {
8056
8051
  const { width, height } = componentProps;
@@ -8107,7 +8102,10 @@ const RelativeGrowthAdvantageTabs = ({
8107
8102
  params: data.params
8108
8103
  },
8109
8104
  yAxisScaleType,
8110
- yAxisMaxConfig: originalComponentProps.yAxisMaxConfig
8105
+ yAxisMaxConfig: {
8106
+ linear: originalComponentProps.yAxisMaxLinear,
8107
+ logarithmic: originalComponentProps.yAxisMaxLogarithmic
8108
+ }
8111
8109
  }
8112
8110
  )
8113
8111
  };
@@ -8202,10 +8200,8 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
8202
8200
  width: this.width,
8203
8201
  height: this.height,
8204
8202
  lapisDateField: this.lapisDateField,
8205
- yAxisMaxConfig: {
8206
- linear: this.yAxisMaxLinear,
8207
- logarithmic: this.yAxisMaxLogarithmic
8208
- }
8203
+ yAxisMaxLinear: this.yAxisMaxLinear,
8204
+ yAxisMaxLogarithmic: this.yAxisMaxLogarithmic
8209
8205
  }
8210
8206
  );
8211
8207
  }
@@ -8288,11 +8284,11 @@ const AggregateTable = ({ data, fields, pageSize }) => {
8288
8284
  ];
8289
8285
  return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
8290
8286
  };
8291
- const viewSchema$1 = z$1.literal(views.table);
8287
+ const aggregateViewSchema = z$1.literal(views.table);
8292
8288
  const aggregatePropsSchema = z$1.object({
8293
- filter: lapisFilterSchema,
8289
+ lapisFilter: lapisFilterSchema,
8294
8290
  fields: z$1.array(z$1.string().min(1)),
8295
- views: z$1.array(viewSchema$1),
8291
+ views: z$1.array(aggregateViewSchema),
8296
8292
  initialSortField: z$1.string(),
8297
8293
  initialSortDirection: z$1.union([z$1.literal("ascending"), z$1.literal("descending")]),
8298
8294
  pageSize: z$1.union([z$1.boolean(), z$1.number()]),
@@ -8305,11 +8301,14 @@ const Aggregate = (componentProps) => {
8305
8301
  return /* @__PURE__ */ u$1(ErrorBoundary, { size, schema: aggregatePropsSchema, componentProps, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(AggregateInner, { ...componentProps }) }) });
8306
8302
  };
8307
8303
  const AggregateInner = (componentProps) => {
8308
- const { fields, filter, initialSortField, initialSortDirection } = componentProps;
8304
+ const { fields, lapisFilter, initialSortField, initialSortDirection } = componentProps;
8309
8305
  const lapis = x(LapisUrlContext);
8310
8306
  const { data, error, isLoading } = useQuery(async () => {
8311
- return queryAggregateData(filter, fields, lapis, { field: initialSortField, direction: initialSortDirection });
8312
- }, [filter, fields, lapis]);
8307
+ return queryAggregateData(lapisFilter, fields, lapis, {
8308
+ field: initialSortField,
8309
+ direction: initialSortDirection
8310
+ });
8311
+ }, [lapisFilter, fields, lapis]);
8313
8312
  if (isLoading) {
8314
8313
  return /* @__PURE__ */ u$1(LoadingDisplay, {});
8315
8314
  }
@@ -8376,7 +8375,7 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
8376
8375
  super(...arguments);
8377
8376
  this.fields = [];
8378
8377
  this.views = ["table"];
8379
- this.filter = {};
8378
+ this.lapisFilter = {};
8380
8379
  this.width = "100%";
8381
8380
  this.height = "700px";
8382
8381
  this.initialSortField = "count";
@@ -8389,7 +8388,7 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
8389
8388
  {
8390
8389
  fields: this.fields,
8391
8390
  views: this.views,
8392
- filter: this.filter,
8391
+ lapisFilter: this.lapisFilter,
8393
8392
  width: this.width,
8394
8393
  height: this.height,
8395
8394
  initialSortField: this.initialSortField,
@@ -8407,7 +8406,7 @@ __decorateClass$9([
8407
8406
  ], AggregateComponent.prototype, "views", 2);
8408
8407
  __decorateClass$9([
8409
8408
  n2({ type: Object })
8410
- ], AggregateComponent.prototype, "filter", 2);
8409
+ ], AggregateComponent.prototype, "lapisFilter", 2);
8411
8410
  __decorateClass$9([
8412
8411
  n2({ type: String })
8413
8412
  ], AggregateComponent.prototype, "width", 2);
@@ -8566,11 +8565,10 @@ const NumberSequencesOverTimeTable = ({ data, granularity, pageSize }) => {
8566
8565
  }, [data, granularity]);
8567
8566
  return /* @__PURE__ */ u$1(Table, { data: flatTableData, columns, pageSize });
8568
8567
  };
8569
- async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField, granularity, smoothingWindow) {
8570
- const lapisFilters = makeArray(lapisFilter);
8571
- const queries = lapisFilters.map(async ({ displayName, lapisFilter: lapisFilter2 }) => {
8568
+ async function queryNumberOfSequencesOverTime(lapis, lapisFilters, lapisDateField, granularity, smoothingWindow) {
8569
+ const queries = lapisFilters.map(async ({ displayName, lapisFilter }) => {
8572
8570
  const { content } = await queryAggregatedDataOverTime(
8573
- lapisFilter2,
8571
+ lapisFilter,
8574
8572
  granularity,
8575
8573
  smoothingWindow,
8576
8574
  lapisDateField
@@ -8590,7 +8588,7 @@ const numberSequencesOverTimeViewSchema = z$1.union([
8590
8588
  const numberSequencesOverTimePropsSchema = z$1.object({
8591
8589
  width: z$1.string(),
8592
8590
  height: z$1.string(),
8593
- lapisFilter: z$1.union([namedLapisFilterSchema, z$1.array(namedLapisFilterSchema)]),
8591
+ lapisFilters: z$1.array(namedLapisFilterSchema).min(1),
8594
8592
  lapisDateField: z$1.string().min(1),
8595
8593
  views: z$1.array(numberSequencesOverTimeViewSchema),
8596
8594
  granularity: temporalGranularitySchema,
@@ -8603,11 +8601,11 @@ const NumberSequencesOverTime = (componentProps) => {
8603
8601
  return /* @__PURE__ */ u$1(ErrorBoundary, { size, componentProps, schema: numberSequencesOverTimePropsSchema, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...componentProps }) }) });
8604
8602
  };
8605
8603
  const NumberSequencesOverTimeInner = (componentProps) => {
8606
- const { lapisFilter, lapisDateField, granularity, smoothingWindow } = componentProps;
8604
+ const { lapisFilters, lapisDateField, granularity, smoothingWindow } = componentProps;
8607
8605
  const lapis = x(LapisUrlContext);
8608
8606
  const { data, error, isLoading } = useQuery(
8609
- () => queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField, granularity, smoothingWindow),
8610
- [lapis, lapisFilter, lapisDateField, granularity, smoothingWindow]
8607
+ () => queryNumberOfSequencesOverTime(lapis, lapisFilters, lapisDateField, granularity, smoothingWindow),
8608
+ [lapis, lapisFilters, lapisDateField, granularity, smoothingWindow]
8611
8609
  );
8612
8610
  if (isLoading) {
8613
8611
  return /* @__PURE__ */ u$1(LoadingDisplay, {});
@@ -8725,7 +8723,7 @@ var __decorateClass$8 = (decorators, target, key, kind) => {
8725
8723
  let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles {
8726
8724
  constructor() {
8727
8725
  super(...arguments);
8728
- this.lapisFilter = { displayName: "", lapisFilter: {} };
8726
+ this.lapisFilters = [];
8729
8727
  this.lapisDateField = "";
8730
8728
  this.views = ["bar", "line", "table"];
8731
8729
  this.width = "100%";
@@ -8738,7 +8736,7 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
8738
8736
  return /* @__PURE__ */ u$1(
8739
8737
  NumberSequencesOverTime,
8740
8738
  {
8741
- lapisFilter: this.lapisFilter,
8739
+ lapisFilters: this.lapisFilters,
8742
8740
  lapisDateField: this.lapisDateField,
8743
8741
  views: this.views,
8744
8742
  width: this.width,
@@ -8752,7 +8750,7 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
8752
8750
  };
8753
8751
  __decorateClass$8([
8754
8752
  n2({ type: Object })
8755
- ], NumberSequencesOverTimeComponent.prototype, "lapisFilter", 2);
8753
+ ], NumberSequencesOverTimeComponent.prototype, "lapisFilters", 2);
8756
8754
  __decorateClass$8([
8757
8755
  n2({ type: String })
8758
8756
  ], NumberSequencesOverTimeComponent.prototype, "lapisDateField", 2);
@@ -9199,11 +9197,11 @@ function useWebWorker(messageToWorker, WorkerConstructor) {
9199
9197
  }, [messageToWorker, worker]);
9200
9198
  return { data, error, isLoading };
9201
9199
  }
9202
- const viewSchema = z$1.literal(views.grid);
9200
+ const mutationsOverTimeViewSchema = z$1.literal(views.grid);
9203
9201
  const mutationOverTimeSchema = z$1.object({
9204
9202
  lapisFilter: lapisFilterSchema,
9205
9203
  sequenceType: sequenceTypeSchema,
9206
- views: z$1.array(viewSchema),
9204
+ views: z$1.array(mutationsOverTimeViewSchema),
9207
9205
  granularity: temporalGranularitySchema,
9208
9206
  lapisDateField: z$1.string().min(1),
9209
9207
  width: z$1.string(),
@@ -10630,7 +10628,7 @@ const dateRangeSelectorInnerPropsSchema = z$1.object({
10630
10628
  initialValue: z$1.string().optional(),
10631
10629
  initialDateFrom: z$1.string().date().optional(),
10632
10630
  initialDateTo: z$1.string().date().optional(),
10633
- dateColumn: z$1.string().min(1)
10631
+ lapisDateField: z$1.string().min(1)
10634
10632
  });
10635
10633
  const dateRangeSelectorPropsSchema = dateRangeSelectorInnerPropsSchema.extend({
10636
10634
  width: z$1.string()
@@ -10644,7 +10642,7 @@ const DateRangeSelectorInner = ({
10644
10642
  dateRangeOptions,
10645
10643
  earliestDate = "1900-01-01",
10646
10644
  initialValue,
10647
- dateColumn,
10645
+ lapisDateField,
10648
10646
  initialDateFrom,
10649
10647
  initialDateTo
10650
10648
  }) => {
@@ -10746,8 +10744,8 @@ const DateRangeSelectorInner = ({
10746
10744
  const dateFrom = dateFromPicker == null ? void 0 : dateFromPicker.selectedDates[0];
10747
10745
  const dateTo = dateToPicker == null ? void 0 : dateToPicker.selectedDates[0];
10748
10746
  const detail = {
10749
- ...dateFrom !== void 0 && { [`${dateColumn}From`]: toYYYYMMDD(dateFrom) },
10750
- ...dateTo !== void 0 && { [`${dateColumn}To`]: toYYYYMMDD(dateTo) }
10747
+ ...dateFrom !== void 0 && { [`${lapisDateField}From`]: toYYYYMMDD(dateFrom) },
10748
+ ...dateTo !== void 0 && { [`${lapisDateField}To`]: toYYYYMMDD(dateTo) }
10751
10749
  };
10752
10750
  (_a = divRef.current) == null ? void 0 : _a.dispatchEvent(
10753
10751
  new CustomEvent("gs-date-range-filter-changed", {
@@ -10820,7 +10818,7 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
10820
10818
  this.initialDateFrom = void 0;
10821
10819
  this.initialDateTo = void 0;
10822
10820
  this.width = "100%";
10823
- this.dateColumn = "";
10821
+ this.lapisDateField = "";
10824
10822
  }
10825
10823
  render() {
10826
10824
  return /* @__PURE__ */ u$1(
@@ -10831,7 +10829,7 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
10831
10829
  initialValue: this.initialValue,
10832
10830
  initialDateFrom: this.initialDateFrom,
10833
10831
  initialDateTo: this.initialDateTo,
10834
- dateColumn: this.dateColumn,
10832
+ lapisDateField: this.lapisDateField,
10835
10833
  width: this.width
10836
10834
  }
10837
10835
  );
@@ -10857,7 +10855,7 @@ __decorateClass$4([
10857
10855
  ], DateRangeSelectorComponent.prototype, "width", 2);
10858
10856
  __decorateClass$4([
10859
10857
  n2({ type: String })
10860
- ], DateRangeSelectorComponent.prototype, "dateColumn", 2);
10858
+ ], DateRangeSelectorComponent.prototype, "lapisDateField", 2);
10861
10859
  DateRangeSelectorComponent = __decorateClass$4([
10862
10860
  t$2("gs-date-range-selector")
10863
10861
  ], DateRangeSelectorComponent);
@@ -11402,14 +11400,8 @@ const parseAndValidateMutation = (value, referenceGenome) => {
11402
11400
  }
11403
11401
  return null;
11404
11402
  };
11405
- const selectedMutationFilterStringsSchema = z$1.object({
11406
- nucleotideMutations: z$1.array(z$1.string()),
11407
- aminoAcidMutations: z$1.array(z$1.string()),
11408
- nucleotideInsertions: z$1.array(z$1.string()),
11409
- aminoAcidInsertions: z$1.array(z$1.string())
11410
- });
11411
11403
  const mutationFilterInnerPropsSchema = z$1.object({
11412
- initialValue: z$1.union([selectedMutationFilterStringsSchema.optional(), z$1.array(z$1.string()), z$1.undefined()])
11404
+ initialValue: z$1.union([mutationsFilterSchema.optional(), z$1.array(z$1.string()), z$1.undefined()])
11413
11405
  });
11414
11406
  const mutationFilterPropsSchema = mutationFilterInnerPropsSchema.extend({
11415
11407
  width: z$1.string()