@genspectrum/dashboard-components 0.10.2 → 0.10.3

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 (52) hide show
  1. package/README.md +19 -19
  2. package/custom-elements.json +49 -33
  3. package/dist/assets/{mutationOverTimeWorker-Di6yP1e6.js.map → mutationOverTimeWorker-CNg_ztNp.js.map} +1 -1
  4. package/dist/components.d.ts +49 -60
  5. package/dist/components.js +203 -45
  6. package/dist/components.js.map +1 -1
  7. package/dist/{dateRangeOption-du8H7LWu.js → dateRangeOption-DjtcAEWq.js} +16 -3
  8. package/dist/dateRangeOption-DjtcAEWq.js.map +1 -0
  9. package/dist/style.css +11 -5
  10. package/dist/util.d.ts +91 -42
  11. package/dist/util.js +1 -1
  12. package/package.json +2 -2
  13. package/src/preact/aggregatedData/aggregate.stories.tsx +14 -0
  14. package/src/preact/aggregatedData/aggregate.tsx +17 -15
  15. package/src/preact/components/error-boundary.stories.tsx +24 -3
  16. package/src/preact/components/error-boundary.tsx +3 -4
  17. package/src/preact/components/error-display.tsx +38 -17
  18. package/src/preact/components/tabs.tsx +2 -2
  19. package/src/preact/mutationFilter/mutation-filter.tsx +26 -13
  20. package/src/preact/mutations/mutations.tsx +16 -12
  21. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +14 -0
  22. package/src/preact/mutationsOverTime/mutations-over-time.tsx +18 -14
  23. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +14 -0
  24. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +22 -14
  25. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -0
  26. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +28 -19
  27. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +14 -0
  28. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +18 -15
  29. package/src/preact/shared/charts/confideceInterval.ts +10 -8
  30. package/src/preact/shared/charts/getYAxisMax.ts +10 -5
  31. package/src/preact/statistic/statistics.tsx +10 -8
  32. package/src/preact/textInput/text-input.stories.tsx +14 -0
  33. package/src/preact/textInput/text-input.tsx +16 -11
  34. package/src/query/queryAggregateData.ts +2 -1
  35. package/src/types.ts +12 -1
  36. package/src/utilEntrypoint.ts +7 -0
  37. package/src/web-components/app.stories.ts +17 -2
  38. package/src/web-components/app.ts +17 -5
  39. package/src/web-components/input/gs-mutation-filter.stories.ts +2 -0
  40. package/src/web-components/input/gs-text-input.tsx +2 -2
  41. package/src/web-components/introduction.mdx +4 -4
  42. package/src/web-components/visualization/data_visualization_statistical_analysis.mdx +3 -3
  43. package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -3
  44. package/src/web-components/visualization/gs-mutations.tsx +1 -3
  45. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -3
  46. package/src/web-components/visualization/gs-prevalence-over-time.tsx +3 -6
  47. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -5
  48. package/standalone-bundle/assets/mutationOverTimeWorker-cIyshfj_.js.map +1 -1
  49. package/standalone-bundle/dashboard-components.js +6079 -5944
  50. package/standalone-bundle/dashboard-components.js.map +1 -1
  51. package/standalone-bundle/style.css +1 -1
  52. package/dist/dateRangeOption-du8H7LWu.js.map +0 -1
@@ -469,9 +469,7 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
469
469
  */
470
470
  export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles {
471
471
  /**
472
- * Required.
473
- *
474
- * LAPIS filter to select the displayed data.
472
+ * LAPIS filter to select the displayed data. If not provided, all data is displayed.
475
473
  */
476
474
  lapisFilter: Record<string, string | number | null | boolean>;
477
475
  /**
@@ -529,9 +527,7 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
529
527
  */
530
528
  export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
531
529
  /**
532
- * Required.
533
- *
534
- * LAPIS filter to select the displayed data.
530
+ * LAPIS filter to select the displayed data. If not provided, all data is displayed.
535
531
  */
536
532
  lapisFilter: Record<string, string | number | null | boolean>;
537
533
  /**
@@ -583,8 +579,6 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
583
579
  */
584
580
  export declare class NumberSequencesOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
585
581
  /**
586
- * Required.
587
- *
588
582
  * Either a LAPIS filter or an array of LAPIS filters to fetch the number of sequences for.
589
583
  *
590
584
  * The `lapisFilter` will be sent as is to LAPIS to select the data.
@@ -697,7 +691,6 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
697
691
  */
698
692
  export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
699
693
  /**
700
- * Required.
701
694
  * Either a LAPIS filter or an array of LAPIS filters to calculate the prevalence for.
702
695
  *
703
696
  * The `lapisFilter` will be sent as is to LAPIS to select the data.
@@ -715,8 +708,6 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
715
708
  displayName: string;
716
709
  }[];
717
710
  /**
718
- * Required.
719
- *
720
711
  * The LAPIS filter, to select the data of the reference.
721
712
  * It must be a valid LAPIS filter object.
722
713
  */
@@ -860,15 +851,11 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
860
851
  */
861
852
  export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
862
853
  /**
863
- * Required.
864
- *
865
854
  * LAPIS filter to select the data of the focal variant.
866
855
  * It must be a valid LAPIS filter object.
867
856
  */
868
857
  numeratorFilter: Record<string, string | number | null | boolean>;
869
858
  /**
870
- * Required.
871
- *
872
859
  * LAPIS filter to select the data of the baseline variant.
873
860
  * It must be a valid LAPIS filter object.
874
861
  */
@@ -973,7 +960,7 @@ export declare class TextInputComponent extends PreactLitAdapter {
973
960
  /**
974
961
  * The initial value to use for this text input.
975
962
  */
976
- initialValue: string;
963
+ initialValue: string | undefined;
977
964
  /**
978
965
  * Required.
979
966
  *
@@ -984,7 +971,7 @@ export declare class TextInputComponent extends PreactLitAdapter {
984
971
  /**
985
972
  * The placeholder text to display in the input field.
986
973
  */
987
- placeholderText: string;
974
+ placeholderText: string | undefined;
988
975
  /**
989
976
  * The width of the component.
990
977
  *
@@ -999,7 +986,9 @@ export declare class UserFacingError extends Error {
999
986
  constructor(headline: string, message: string);
1000
987
  }
1001
988
 
1002
- declare type View = 'table';
989
+ declare type View = default_2.infer<typeof viewSchema>;
990
+
991
+ declare const viewSchema: default_2.ZodLiteral<"table">;
1003
992
 
1004
993
  export { }
1005
994
 
@@ -1029,11 +1018,7 @@ declare global {
1029
1018
 
1030
1019
  declare global {
1031
1020
  interface HTMLElementTagNameMap {
1032
- 'gs-date-range-selector': DateRangeSelectorComponent;
1033
- }
1034
- interface HTMLElementEventMap {
1035
- 'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
1036
- 'gs-date-range-option-changed': DateRangeOptionChangedEvent;
1021
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1037
1022
  }
1038
1023
  }
1039
1024
 
@@ -1041,7 +1026,7 @@ declare global {
1041
1026
  declare global {
1042
1027
  namespace JSX {
1043
1028
  interface IntrinsicElements {
1044
- 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1029
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1045
1030
  }
1046
1031
  }
1047
1032
  }
@@ -1049,10 +1034,7 @@ declare global {
1049
1034
 
1050
1035
  declare global {
1051
1036
  interface HTMLElementTagNameMap {
1052
- 'gs-location-filter': LocationFilterComponent;
1053
- }
1054
- interface HTMLElementEventMap {
1055
- 'gs-location-changed': CustomEvent<Record<string, string>>;
1037
+ 'gs-mutations-component': MutationsComponent;
1056
1038
  }
1057
1039
  }
1058
1040
 
@@ -1060,7 +1042,7 @@ declare global {
1060
1042
  declare global {
1061
1043
  namespace JSX {
1062
1044
  interface IntrinsicElements {
1063
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1045
+ 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1064
1046
  }
1065
1047
  }
1066
1048
  }
@@ -1068,10 +1050,7 @@ declare global {
1068
1050
 
1069
1051
  declare global {
1070
1052
  interface HTMLElementTagNameMap {
1071
- 'gs-text-input': TextInputComponent;
1072
- }
1073
- interface HTMLElementEventMap {
1074
- 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1053
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1075
1054
  }
1076
1055
  }
1077
1056
 
@@ -1079,7 +1058,7 @@ declare global {
1079
1058
  declare global {
1080
1059
  namespace JSX {
1081
1060
  interface IntrinsicElements {
1082
- 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1061
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1083
1062
  }
1084
1063
  }
1085
1064
  }
@@ -1087,10 +1066,7 @@ declare global {
1087
1066
 
1088
1067
  declare global {
1089
1068
  interface HTMLElementTagNameMap {
1090
- 'gs-mutation-filter': MutationFilterComponent;
1091
- }
1092
- interface HTMLElementEventMap {
1093
- 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1069
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1094
1070
  }
1095
1071
  }
1096
1072
 
@@ -1098,7 +1074,7 @@ declare global {
1098
1074
  declare global {
1099
1075
  namespace JSX {
1100
1076
  interface IntrinsicElements {
1101
- 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1077
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1102
1078
  }
1103
1079
  }
1104
1080
  }
@@ -1106,10 +1082,7 @@ declare global {
1106
1082
 
1107
1083
  declare global {
1108
1084
  interface HTMLElementTagNameMap {
1109
- 'gs-lineage-filter': LineageFilterComponent;
1110
- }
1111
- interface HTMLElementEventMap {
1112
- 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1085
+ 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1113
1086
  }
1114
1087
  }
1115
1088
 
@@ -1117,7 +1090,7 @@ declare global {
1117
1090
  declare global {
1118
1091
  namespace JSX {
1119
1092
  interface IntrinsicElements {
1120
- 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1093
+ 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1121
1094
  }
1122
1095
  }
1123
1096
  }
@@ -1125,7 +1098,7 @@ declare global {
1125
1098
 
1126
1099
  declare global {
1127
1100
  interface HTMLElementTagNameMap {
1128
- 'gs-mutation-comparison-component': MutationComparisonComponent;
1101
+ 'gs-aggregate': AggregateComponent;
1129
1102
  }
1130
1103
  }
1131
1104
 
@@ -1133,7 +1106,7 @@ declare global {
1133
1106
  declare global {
1134
1107
  namespace JSX {
1135
1108
  interface IntrinsicElements {
1136
- 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1109
+ 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1137
1110
  }
1138
1111
  }
1139
1112
  }
@@ -1141,7 +1114,7 @@ declare global {
1141
1114
 
1142
1115
  declare global {
1143
1116
  interface HTMLElementTagNameMap {
1144
- 'gs-mutations-component': MutationsComponent;
1117
+ 'gs-mutations-over-time': MutationsOverTimeComponent;
1145
1118
  }
1146
1119
  }
1147
1120
 
@@ -1149,7 +1122,7 @@ declare global {
1149
1122
  declare global {
1150
1123
  namespace JSX {
1151
1124
  interface IntrinsicElements {
1152
- 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1125
+ 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1153
1126
  }
1154
1127
  }
1155
1128
  }
@@ -1157,7 +1130,7 @@ declare global {
1157
1130
 
1158
1131
  declare global {
1159
1132
  interface HTMLElementTagNameMap {
1160
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1133
+ 'gs-statistics': StatisticsComponent;
1161
1134
  }
1162
1135
  }
1163
1136
 
@@ -1165,7 +1138,7 @@ declare global {
1165
1138
  declare global {
1166
1139
  namespace JSX {
1167
1140
  interface IntrinsicElements {
1168
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1141
+ 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1169
1142
  }
1170
1143
  }
1171
1144
  }
@@ -1173,7 +1146,11 @@ declare global {
1173
1146
 
1174
1147
  declare global {
1175
1148
  interface HTMLElementTagNameMap {
1176
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1149
+ 'gs-date-range-selector': DateRangeSelectorComponent;
1150
+ }
1151
+ interface HTMLElementEventMap {
1152
+ 'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
1153
+ 'gs-date-range-option-changed': DateRangeOptionChangedEvent;
1177
1154
  }
1178
1155
  }
1179
1156
 
@@ -1181,7 +1158,7 @@ declare global {
1181
1158
  declare global {
1182
1159
  namespace JSX {
1183
1160
  interface IntrinsicElements {
1184
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1161
+ 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1185
1162
  }
1186
1163
  }
1187
1164
  }
@@ -1189,7 +1166,10 @@ declare global {
1189
1166
 
1190
1167
  declare global {
1191
1168
  interface HTMLElementTagNameMap {
1192
- 'gs-aggregate': AggregateComponent;
1169
+ 'gs-location-filter': LocationFilterComponent;
1170
+ }
1171
+ interface HTMLElementEventMap {
1172
+ 'gs-location-changed': CustomEvent<Record<string, string>>;
1193
1173
  }
1194
1174
  }
1195
1175
 
@@ -1197,7 +1177,7 @@ declare global {
1197
1177
  declare global {
1198
1178
  namespace JSX {
1199
1179
  interface IntrinsicElements {
1200
- 'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1180
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1201
1181
  }
1202
1182
  }
1203
1183
  }
@@ -1205,7 +1185,10 @@ declare global {
1205
1185
 
1206
1186
  declare global {
1207
1187
  interface HTMLElementTagNameMap {
1208
- 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1188
+ 'gs-text-input': TextInputComponent;
1189
+ }
1190
+ interface HTMLElementEventMap {
1191
+ 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1209
1192
  }
1210
1193
  }
1211
1194
 
@@ -1213,7 +1196,7 @@ declare global {
1213
1196
  declare global {
1214
1197
  namespace JSX {
1215
1198
  interface IntrinsicElements {
1216
- 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1199
+ 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1217
1200
  }
1218
1201
  }
1219
1202
  }
@@ -1221,7 +1204,10 @@ declare global {
1221
1204
 
1222
1205
  declare global {
1223
1206
  interface HTMLElementTagNameMap {
1224
- 'gs-mutations-over-time': MutationsOverTimeComponent;
1207
+ 'gs-mutation-filter': MutationFilterComponent;
1208
+ }
1209
+ interface HTMLElementEventMap {
1210
+ 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1225
1211
  }
1226
1212
  }
1227
1213
 
@@ -1229,7 +1215,7 @@ declare global {
1229
1215
  declare global {
1230
1216
  namespace JSX {
1231
1217
  interface IntrinsicElements {
1232
- 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1218
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1233
1219
  }
1234
1220
  }
1235
1221
  }
@@ -1237,7 +1223,10 @@ declare global {
1237
1223
 
1238
1224
  declare global {
1239
1225
  interface HTMLElementTagNameMap {
1240
- 'gs-statistics': StatisticsComponent;
1226
+ 'gs-lineage-filter': LineageFilterComponent;
1227
+ }
1228
+ interface HTMLElementEventMap {
1229
+ 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1241
1230
  }
1242
1231
  }
1243
1232
 
@@ -1245,7 +1234,7 @@ declare global {
1245
1234
  declare global {
1246
1235
  namespace JSX {
1247
1236
  interface IntrinsicElements {
1248
- 'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1237
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1249
1238
  }
1250
1239
  }
1251
1240
  }