@genspectrum/dashboard-components 0.7.0 → 0.7.2

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.
@@ -1039,10 +1039,7 @@ declare global {
1039
1039
 
1040
1040
  declare global {
1041
1041
  interface HTMLElementTagNameMap {
1042
- 'gs-date-range-selector': DateRangeSelectorComponent;
1043
- }
1044
- interface HTMLElementEventMap {
1045
- 'gs-date-range-changed': CustomEvent<Record<string, string>>;
1042
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1046
1043
  }
1047
1044
  }
1048
1045
 
@@ -1050,7 +1047,7 @@ declare global {
1050
1047
  declare global {
1051
1048
  namespace JSX {
1052
1049
  interface IntrinsicElements {
1053
- 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1050
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1054
1051
  }
1055
1052
  }
1056
1053
  }
@@ -1058,10 +1055,7 @@ declare global {
1058
1055
 
1059
1056
  declare global {
1060
1057
  interface HTMLElementTagNameMap {
1061
- 'gs-location-filter': LocationFilterComponent;
1062
- }
1063
- interface HTMLElementEventMap {
1064
- 'gs-location-changed': CustomEvent<Record<string, string>>;
1058
+ 'gs-mutations-component': MutationsComponent;
1065
1059
  }
1066
1060
  }
1067
1061
 
@@ -1069,7 +1063,7 @@ declare global {
1069
1063
  declare global {
1070
1064
  namespace JSX {
1071
1065
  interface IntrinsicElements {
1072
- 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1066
+ 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1073
1067
  }
1074
1068
  }
1075
1069
  }
@@ -1077,10 +1071,7 @@ declare global {
1077
1071
 
1078
1072
  declare global {
1079
1073
  interface HTMLElementTagNameMap {
1080
- 'gs-text-input': TextInputComponent;
1081
- }
1082
- interface HTMLElementEventMap {
1083
- 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1074
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1084
1075
  }
1085
1076
  }
1086
1077
 
@@ -1088,7 +1079,7 @@ declare global {
1088
1079
  declare global {
1089
1080
  namespace JSX {
1090
1081
  interface IntrinsicElements {
1091
- 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1082
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1092
1083
  }
1093
1084
  }
1094
1085
  }
@@ -1096,11 +1087,7 @@ declare global {
1096
1087
 
1097
1088
  declare global {
1098
1089
  interface HTMLElementTagNameMap {
1099
- 'gs-mutation-filter': MutationFilterComponent;
1100
- }
1101
- interface HTMLElementEventMap {
1102
- 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1103
- 'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
1090
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1104
1091
  }
1105
1092
  }
1106
1093
 
@@ -1108,7 +1095,7 @@ declare global {
1108
1095
  declare global {
1109
1096
  namespace JSX {
1110
1097
  interface IntrinsicElements {
1111
- 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1098
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1112
1099
  }
1113
1100
  }
1114
1101
  }
@@ -1116,10 +1103,7 @@ declare global {
1116
1103
 
1117
1104
  declare global {
1118
1105
  interface HTMLElementTagNameMap {
1119
- 'gs-lineage-filter': LineageFilterComponent;
1120
- }
1121
- interface HTMLElementEventMap {
1122
- 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1106
+ 'gs-aggregate-component': AggregateComponent;
1123
1107
  }
1124
1108
  }
1125
1109
 
@@ -1127,7 +1111,7 @@ declare global {
1127
1111
  declare global {
1128
1112
  namespace JSX {
1129
1113
  interface IntrinsicElements {
1130
- 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1114
+ 'gs-aggregate-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1131
1115
  }
1132
1116
  }
1133
1117
  }
@@ -1135,7 +1119,7 @@ declare global {
1135
1119
 
1136
1120
  declare global {
1137
1121
  interface HTMLElementTagNameMap {
1138
- 'gs-mutation-comparison-component': MutationComparisonComponent;
1122
+ 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1139
1123
  }
1140
1124
  }
1141
1125
 
@@ -1143,7 +1127,7 @@ declare global {
1143
1127
  declare global {
1144
1128
  namespace JSX {
1145
1129
  interface IntrinsicElements {
1146
- 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1130
+ 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1147
1131
  }
1148
1132
  }
1149
1133
  }
@@ -1151,7 +1135,7 @@ declare global {
1151
1135
 
1152
1136
  declare global {
1153
1137
  interface HTMLElementTagNameMap {
1154
- 'gs-mutations-component': MutationsComponent;
1138
+ 'gs-mutations-over-time': MutationsOverTimeComponent;
1155
1139
  }
1156
1140
  }
1157
1141
 
@@ -1159,7 +1143,7 @@ declare global {
1159
1143
  declare global {
1160
1144
  namespace JSX {
1161
1145
  interface IntrinsicElements {
1162
- 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1146
+ 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1163
1147
  }
1164
1148
  }
1165
1149
  }
@@ -1167,7 +1151,10 @@ declare global {
1167
1151
 
1168
1152
  declare global {
1169
1153
  interface HTMLElementTagNameMap {
1170
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1154
+ 'gs-date-range-selector': DateRangeSelectorComponent;
1155
+ }
1156
+ interface HTMLElementEventMap {
1157
+ 'gs-date-range-changed': CustomEvent<Record<string, string>>;
1171
1158
  }
1172
1159
  }
1173
1160
 
@@ -1175,7 +1162,7 @@ declare global {
1175
1162
  declare global {
1176
1163
  namespace JSX {
1177
1164
  interface IntrinsicElements {
1178
- 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1165
+ 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1179
1166
  }
1180
1167
  }
1181
1168
  }
@@ -1183,7 +1170,10 @@ declare global {
1183
1170
 
1184
1171
  declare global {
1185
1172
  interface HTMLElementTagNameMap {
1186
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1173
+ 'gs-location-filter': LocationFilterComponent;
1174
+ }
1175
+ interface HTMLElementEventMap {
1176
+ 'gs-location-changed': CustomEvent<Record<string, string>>;
1187
1177
  }
1188
1178
  }
1189
1179
 
@@ -1191,7 +1181,7 @@ declare global {
1191
1181
  declare global {
1192
1182
  namespace JSX {
1193
1183
  interface IntrinsicElements {
1194
- 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1184
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1195
1185
  }
1196
1186
  }
1197
1187
  }
@@ -1199,7 +1189,10 @@ declare global {
1199
1189
 
1200
1190
  declare global {
1201
1191
  interface HTMLElementTagNameMap {
1202
- 'gs-aggregate-component': AggregateComponent;
1192
+ 'gs-text-input': TextInputComponent;
1193
+ }
1194
+ interface HTMLElementEventMap {
1195
+ 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1203
1196
  }
1204
1197
  }
1205
1198
 
@@ -1207,7 +1200,7 @@ declare global {
1207
1200
  declare global {
1208
1201
  namespace JSX {
1209
1202
  interface IntrinsicElements {
1210
- 'gs-aggregate-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1203
+ 'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1211
1204
  }
1212
1205
  }
1213
1206
  }
@@ -1215,7 +1208,11 @@ declare global {
1215
1208
 
1216
1209
  declare global {
1217
1210
  interface HTMLElementTagNameMap {
1218
- 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1211
+ 'gs-mutation-filter': MutationFilterComponent;
1212
+ }
1213
+ interface HTMLElementEventMap {
1214
+ 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1215
+ 'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
1219
1216
  }
1220
1217
  }
1221
1218
 
@@ -1223,7 +1220,7 @@ declare global {
1223
1220
  declare global {
1224
1221
  namespace JSX {
1225
1222
  interface IntrinsicElements {
1226
- 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1223
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1227
1224
  }
1228
1225
  }
1229
1226
  }
@@ -1231,7 +1228,10 @@ declare global {
1231
1228
 
1232
1229
  declare global {
1233
1230
  interface HTMLElementTagNameMap {
1234
- 'gs-mutations-over-time': MutationsOverTimeComponent;
1231
+ 'gs-lineage-filter': LineageFilterComponent;
1232
+ }
1233
+ interface HTMLElementEventMap {
1234
+ 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1235
1235
  }
1236
1236
  }
1237
1237
 
@@ -1239,7 +1239,7 @@ declare global {
1239
1239
  declare global {
1240
1240
  namespace JSX {
1241
1241
  interface IntrinsicElements {
1242
- 'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1242
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1243
1243
  }
1244
1244
  }
1245
1245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genspectrum/dashboard-components",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "GenSpectrum web components for building dashboards",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",
@@ -111,7 +111,7 @@
111
111
  "eslint-config-preact": "^1.3.0",
112
112
  "eslint-plugin-import": "^2.29.1",
113
113
  "eslint-plugin-jest": "^28.2.0",
114
- "eslint-plugin-storybook": "^0.10.1",
114
+ "eslint-plugin-storybook": "^0.11.0",
115
115
  "http-server": "^14.1.1",
116
116
  "lit-analyzer": "^2.0.3",
117
117
  "msw": "^2.2.14",
@@ -14,6 +14,9 @@ export class SlidingOperator<Data, AggregationResult> implements Operator<Aggreg
14
14
  async evaluate(lapis: string, signal?: AbortSignal) {
15
15
  const childEvaluated = await this.child.evaluate(lapis, signal);
16
16
  const content = new Array<AggregationResult>();
17
+ if (childEvaluated.content.length === 0) {
18
+ return { content };
19
+ }
17
20
  const numberOfWindows = Math.max(childEvaluated.content.length - this.windowSize, 0) + 1;
18
21
  for (let i = 0; i < numberOfWindows; i++) {
19
22
  content.push(this.aggregate(childEvaluated.content.slice(i, i + this.windowSize)));
@@ -9,7 +9,7 @@ import { CsvDownloadButton } from '../components/csv-download-button';
9
9
  import { ErrorBoundary } from '../components/error-boundary';
10
10
  import { ErrorDisplay } from '../components/error-display';
11
11
  import { Fullscreen } from '../components/fullscreen';
12
- import Info, { InfoHeadline1, InfoParagraph } from '../components/info';
12
+ import Info, { InfoComponentCode, InfoHeadline1, InfoParagraph } from '../components/info';
13
13
  import { LoadingDisplay } from '../components/loading-display';
14
14
  import { NoDataDisplay } from '../components/no-data-display';
15
15
  import { ResizeContainer } from '../components/resize-container';
@@ -22,37 +22,29 @@ export type InitialSort = { field: string; direction: 'ascending' | 'descending'
22
22
  export type AggregateProps = {
23
23
  width: string;
24
24
  height: string;
25
- } & AggregateInnerProps;
26
-
27
- export interface AggregateInnerProps {
28
25
  filter: LapisFilter;
29
26
  fields: string[];
30
27
  views: View[];
31
28
  initialSortField: string;
32
29
  initialSortDirection: 'ascending' | 'descending';
33
30
  pageSize: boolean | number;
34
- }
31
+ };
35
32
 
36
- export const Aggregate: FunctionComponent<AggregateProps> = ({ width, height, ...innerProps }) => {
33
+ export const Aggregate: FunctionComponent<AggregateProps> = (componentProps) => {
34
+ const { width, height } = componentProps;
37
35
  const size = { height, width };
38
36
 
39
37
  return (
40
38
  <ErrorBoundary size={size}>
41
39
  <ResizeContainer size={size}>
42
- <AggregateInner {...innerProps} />
40
+ <AggregateInner {...componentProps} />
43
41
  </ResizeContainer>
44
42
  </ErrorBoundary>
45
43
  );
46
44
  };
47
45
 
48
- export const AggregateInner: FunctionComponent<AggregateInnerProps> = ({
49
- fields,
50
- views,
51
- filter,
52
- initialSortField,
53
- initialSortDirection,
54
- pageSize,
55
- }) => {
46
+ export const AggregateInner: FunctionComponent<AggregateProps> = (componentProps) => {
47
+ const { fields, filter, initialSortField, initialSortDirection } = componentProps;
56
48
  const lapis = useContext(LapisUrlContext);
57
49
 
58
50
  const { data, error, isLoading } = useQuery(async () => {
@@ -71,50 +63,66 @@ export const AggregateInner: FunctionComponent<AggregateInnerProps> = ({
71
63
  return <NoDataDisplay />;
72
64
  }
73
65
 
74
- return <AggregatedDataTabs data={data} views={views} fields={fields} pageSize={pageSize} />;
66
+ return <AggregatedDataTabs data={data} originalComponentProps={componentProps} />;
75
67
  };
76
68
 
77
69
  type AggregatedDataTabsProps = {
78
70
  data: AggregateData;
79
- fields: string[];
80
- views: View[];
81
- pageSize: boolean | number;
71
+ originalComponentProps: AggregateProps;
82
72
  };
83
73
 
84
- const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data, views, fields, pageSize }) => {
74
+ const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data, originalComponentProps }) => {
85
75
  const getTab = (view: View) => {
86
76
  switch (view) {
87
77
  case 'table':
88
78
  return {
89
79
  title: 'Table',
90
- content: <AggregateTable data={data} fields={fields} pageSize={pageSize} />,
80
+ content: (
81
+ <AggregateTable
82
+ data={data}
83
+ fields={originalComponentProps.fields}
84
+ pageSize={originalComponentProps.pageSize}
85
+ />
86
+ ),
91
87
  };
92
88
  }
93
89
  };
94
90
 
95
- const tabs = views.map((view) => getTab(view));
91
+ const tabs = originalComponentProps.views.map((view) => getTab(view));
96
92
 
97
- return <Tabs tabs={tabs} toolbar={<Toolbar data={data} fields={fields} />} />;
93
+ return <Tabs tabs={tabs} toolbar={<Toolbar data={data} originalComponentProps={originalComponentProps} />} />;
98
94
  };
99
95
 
100
96
  type ToolbarProps = {
101
97
  data: AggregateData;
102
- fields: string[];
98
+ originalComponentProps: AggregateProps;
103
99
  };
104
100
 
105
- const Toolbar: FunctionComponent<ToolbarProps> = ({ data, fields }) => {
101
+ const Toolbar: FunctionComponent<ToolbarProps> = ({ data, originalComponentProps }) => {
106
102
  return (
107
103
  <div class='flex flex-row'>
108
104
  <CsvDownloadButton className='mx-1 btn btn-xs' getData={() => data} filename='aggregate.csv' />
109
- <Info>
110
- <InfoHeadline1>Aggregated data</InfoHeadline1>
111
- <InfoParagraph>
112
- This table shows the number and proportion of sequences stratified by the following fields:{' '}
113
- {fields.join(', ')}. The proportion is calculated with respect to the total count within the
114
- filtered dataset.
115
- </InfoParagraph>
116
- </Info>
105
+ <AggregateInfo originalComponentProps={originalComponentProps} />
117
106
  <Fullscreen />
118
107
  </div>
119
108
  );
120
109
  };
110
+
111
+ type AggregateInfoProps = {
112
+ originalComponentProps: AggregateProps;
113
+ };
114
+
115
+ const AggregateInfo: FunctionComponent<AggregateInfoProps> = ({ originalComponentProps }) => {
116
+ const lapis = useContext(LapisUrlContext);
117
+ return (
118
+ <Info>
119
+ <InfoHeadline1>Aggregated data</InfoHeadline1>
120
+ <InfoParagraph>
121
+ This table shows the number and proportion of sequences stratified by the following fields:{' '}
122
+ {originalComponentProps.fields.join(', ')}. The proportion is calculated with respect to the total count
123
+ within the filtered dataset.
124
+ </InfoParagraph>
125
+ <InfoComponentCode componentName='aggregate' params={originalComponentProps} lapisUrl={lapis} />
126
+ </Info>
127
+ );
128
+ };
@@ -25,6 +25,7 @@ export class UserFacingError extends Error {
25
25
  }
26
26
 
27
27
  export const ErrorDisplay: FunctionComponent<{ error: Error }> = ({ error }) => {
28
+ // eslint-disable-next-line no-console -- Currently we use the following statement for our error handling
28
29
  console.error(error);
29
30
 
30
31
  const containerRef = useRef<HTMLInputElement>(null);
@@ -11,7 +11,7 @@ import { CsvDownloadButton } from '../components/csv-download-button';
11
11
  import { ErrorBoundary } from '../components/error-boundary';
12
12
  import { ErrorDisplay } from '../components/error-display';
13
13
  import { Fullscreen } from '../components/fullscreen';
14
- import Info from '../components/info';
14
+ import Info, { InfoComponentCode, InfoHeadline1, InfoParagraph } from '../components/info';
15
15
  import { LoadingDisplay } from '../components/loading-display';
16
16
  import { type DisplayedMutationType, MutationTypeSelector } from '../components/mutation-type-selector';
17
17
  import { NoDataDisplay } from '../components/no-data-display';
@@ -24,36 +24,30 @@ import { useQuery } from '../useQuery';
24
24
 
25
25
  export type View = 'table' | 'venn';
26
26
 
27
- export interface MutationComparisonProps extends MutationComparisonInnerProps {
27
+ export interface MutationComparisonProps {
28
28
  width: string;
29
29
  height: string;
30
- }
31
-
32
- export interface MutationComparisonInnerProps {
33
30
  lapisFilters: NamedLapisFilter[];
34
31
  sequenceType: SequenceType;
35
32
  views: View[];
36
33
  pageSize: boolean | number;
37
34
  }
38
35
 
39
- export const MutationComparison: FunctionComponent<MutationComparisonProps> = ({ width, height, ...innerProps }) => {
36
+ export const MutationComparison: FunctionComponent<MutationComparisonProps> = (componentProps) => {
37
+ const { width, height } = componentProps;
40
38
  const size = { height, width };
41
39
 
42
40
  return (
43
41
  <ErrorBoundary size={size}>
44
42
  <ResizeContainer size={size}>
45
- <MutationComparisonInner {...innerProps} />
43
+ <MutationComparisonInner {...componentProps} />
46
44
  </ResizeContainer>
47
45
  </ErrorBoundary>
48
46
  );
49
47
  };
50
48
 
51
- export const MutationComparisonInner: FunctionComponent<MutationComparisonInnerProps> = ({
52
- lapisFilters,
53
- sequenceType,
54
- views,
55
- pageSize,
56
- }) => {
49
+ export const MutationComparisonInner: FunctionComponent<MutationComparisonProps> = (componentProps) => {
50
+ const { lapisFilters, sequenceType } = componentProps;
57
51
  const lapis = useContext(LapisUrlContext);
58
52
 
59
53
  const { data, error, isLoading } = useQuery(async () => {
@@ -72,35 +66,21 @@ export const MutationComparisonInner: FunctionComponent<MutationComparisonInnerP
72
66
  return <NoDataDisplay />;
73
67
  }
74
68
 
75
- return (
76
- <MutationComparisonTabs
77
- data={data.mutationData}
78
- sequenceType={sequenceType}
79
- views={views}
80
- pageSize={pageSize}
81
- />
82
- );
69
+ return <MutationComparisonTabs data={data.mutationData} originalComponentProps={componentProps} />;
83
70
  };
84
71
 
85
72
  type MutationComparisonTabsProps = {
86
73
  data: MutationData[];
87
- views: View[];
88
- sequenceType: SequenceType;
89
- pageSize: boolean | number;
74
+ originalComponentProps: MutationComparisonProps;
90
75
  };
91
76
 
92
- const MutationComparisonTabs: FunctionComponent<MutationComparisonTabsProps> = ({
93
- data,
94
- views,
95
- sequenceType,
96
- pageSize,
97
- }) => {
77
+ const MutationComparisonTabs: FunctionComponent<MutationComparisonTabsProps> = ({ data, originalComponentProps }) => {
98
78
  const [proportionInterval, setProportionInterval] = useState({ min: 0.5, max: 1 });
99
79
  const [displayedMutationTypes, setDisplayedMutationTypes] = useState<DisplayedMutationType[]>([
100
80
  { label: 'Substitutions', checked: true, type: 'substitution' },
101
81
  { label: 'Deletions', checked: true, type: 'deletion' },
102
82
  ]);
103
- const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
83
+ const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(originalComponentProps.sequenceType);
104
84
 
105
85
  const filteredData = useMemo(
106
86
  () => filterMutationData(data, displayedSegments, displayedMutationTypes),
@@ -116,7 +96,7 @@ const MutationComparisonTabs: FunctionComponent<MutationComparisonTabsProps> = (
116
96
  <MutationComparisonTable
117
97
  data={{ content: filteredData }}
118
98
  proportionInterval={proportionInterval}
119
- pageSize={pageSize}
99
+ pageSize={originalComponentProps.pageSize}
120
100
  />
121
101
  ),
122
102
  };
@@ -133,7 +113,7 @@ const MutationComparisonTabs: FunctionComponent<MutationComparisonTabsProps> = (
133
113
  }
134
114
  };
135
115
 
136
- const tabs = views.map((view) => getTab(view));
116
+ const tabs = originalComponentProps.views.map((view) => getTab(view));
137
117
 
138
118
  return (
139
119
  <Tabs
@@ -147,6 +127,7 @@ const MutationComparisonTabs: FunctionComponent<MutationComparisonTabsProps> = (
147
127
  filteredData={filteredData}
148
128
  proportionInterval={proportionInterval}
149
129
  setProportionInterval={setProportionInterval}
130
+ originalComponentProps={originalComponentProps}
150
131
  />
151
132
  }
152
133
  />
@@ -161,6 +142,7 @@ type ToolbarProps = {
161
142
  filteredData: MutationData[];
162
143
  proportionInterval: ProportionInterval;
163
144
  setProportionInterval: Dispatch<StateUpdater<ProportionInterval>>;
145
+ originalComponentProps: MutationComparisonProps;
164
146
  };
165
147
 
166
148
  const Toolbar: FunctionComponent<ToolbarProps> = ({
@@ -171,6 +153,7 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
171
153
  filteredData,
172
154
  proportionInterval,
173
155
  setProportionInterval,
156
+ originalComponentProps,
174
157
  }) => {
175
158
  return (
176
159
  <>
@@ -189,8 +172,23 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
189
172
  getData={() => getMutationComparisonTableData({ content: filteredData }, proportionInterval)}
190
173
  filename='mutation_comparison.csv'
191
174
  />
192
- <Info>Info for mutation comparison</Info>
175
+ <MutationComparisonInfo originalComponentProps={originalComponentProps} />
193
176
  <Fullscreen />
194
177
  </>
195
178
  );
196
179
  };
180
+
181
+ type MutationComparisonInfoProps = {
182
+ originalComponentProps: MutationComparisonProps;
183
+ };
184
+
185
+ const MutationComparisonInfo: FunctionComponent<MutationComparisonInfoProps> = ({ originalComponentProps }) => {
186
+ const lapis = useContext(LapisUrlContext);
187
+ return (
188
+ <Info>
189
+ <InfoHeadline1>Info for mutation comparison</InfoHeadline1>
190
+ <InfoParagraph>TODO: https://github.com/GenSpectrum/dashboard-components/issues/465</InfoParagraph>
191
+ <InfoComponentCode componentName='mutation-comparison' params={originalComponentProps} lapisUrl={lapis} />
192
+ </Info>
193
+ );
194
+ };