@genspectrum/dashboard-components 0.15.0 → 0.16.0

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 (80) hide show
  1. package/custom-elements.json +200 -56
  2. package/dist/components.d.ts +35 -35
  3. package/dist/components.js +311 -192
  4. package/dist/components.js.map +1 -1
  5. package/dist/style.css +9 -0
  6. package/dist/util.d.ts +46 -46
  7. package/package.json +1 -1
  8. package/src/preact/ReferenceGenomeContext.ts +14 -1
  9. package/src/preact/aggregatedData/aggregate-bar-chart.tsx +26 -5
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +0 -1
  11. package/src/preact/aggregatedData/aggregate.tsx +5 -1
  12. package/src/preact/components/ReferenceGenomesAwaiter.tsx +1 -6
  13. package/src/preact/components/resize-container.tsx +1 -1
  14. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +4 -2
  15. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -1
  16. package/src/preact/mutationComparison/mutation-comparison.tsx +5 -1
  17. package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -1
  18. package/src/preact/mutationFilter/mutation-filter.tsx +8 -0
  19. package/src/preact/mutations/mutations.stories.tsx +0 -1
  20. package/src/preact/mutations/mutations.tsx +1 -1
  21. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +0 -2
  22. package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -1
  23. package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +8 -3
  24. package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +8 -3
  25. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
  26. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +18 -3
  27. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +48 -35
  28. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +83 -70
  29. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +48 -37
  30. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -3
  31. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +6 -1
  32. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +31 -23
  33. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -1
  34. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +5 -1
  35. package/src/preact/sequencesByLocation/__mockData__/worldAtlas.json +1 -0
  36. package/src/preact/{map → sequencesByLocation}/sequences-by-location-map.tsx +6 -3
  37. package/src/preact/{map → sequencesByLocation}/sequences-by-location-table.tsx +1 -1
  38. package/src/preact/{map → sequencesByLocation}/sequences-by-location.stories.tsx +58 -1
  39. package/src/preact/{map → sequencesByLocation}/sequences-by-location.tsx +10 -1
  40. package/src/preact/shared/aspectRatio/AspectRatio.tsx +13 -0
  41. package/src/preact/shared/charts/getMaintainAspectRatio.ts +3 -0
  42. package/src/preact/statistic/statistics.stories.tsx +0 -1
  43. package/src/preact/statistic/statistics.tsx +4 -4
  44. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +0 -1
  45. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
  46. package/src/query/computeMapLocationData.spec.ts +1 -1
  47. package/src/query/computeMapLocationData.ts +1 -1
  48. package/src/query/querySequencesByLocationData.ts +1 -1
  49. package/src/utilEntrypoint.ts +1 -1
  50. package/src/web-components/ResizeContainer.mdx +4 -1
  51. package/src/web-components/visualization/gs-aggregate.stories.ts +13 -6
  52. package/src/web-components/visualization/gs-aggregate.tsx +1 -1
  53. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +8 -1
  54. package/src/web-components/visualization/gs-mutation-comparison.tsx +1 -1
  55. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +9 -1
  56. package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -1
  57. package/src/web-components/visualization/gs-mutations.stories.ts +8 -1
  58. package/src/web-components/visualization/gs-mutations.tsx +1 -1
  59. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +11 -1
  60. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -1
  61. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -2
  62. package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
  63. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +8 -1
  64. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -1
  65. package/src/web-components/visualization/gs-sequences-by-location.stories.ts +13 -7
  66. package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -3
  67. package/src/web-components/visualization/gs-statistics.stories.ts +0 -1
  68. package/src/web-components/visualization/gs-statistics.tsx +1 -1
  69. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +9 -1
  70. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +1 -1
  71. package/standalone-bundle/dashboard-components.js +4965 -4876
  72. package/standalone-bundle/dashboard-components.js.map +1 -1
  73. package/standalone-bundle/style.css +1 -1
  74. package/src/preact/map/__mockData__/worldAtlas.json +0 -497127
  75. /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedGermany.json +0 -0
  76. /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedWorld.json +0 -0
  77. /package/src/preact/{map → sequencesByLocation}/__mockData__/germanyMap.json +0 -0
  78. /package/src/preact/{map → sequencesByLocation}/__mockData__/howToGenerateWorldMap.md +0 -0
  79. /package/src/preact/{map → sequencesByLocation}/leafletStyleModifications.css +0 -0
  80. /package/src/preact/{map → sequencesByLocation}/loadMapSource.tsx +0 -0
@@ -6,6 +6,7 @@ import { useEffect, useRef } from 'preact/hooks';
6
6
  import type { EnhancedGeoJsonFeatureProperties } from '../../query/computeMapLocationData';
7
7
  import { InfoHeadline1, InfoParagraph } from '../components/info';
8
8
  import { Modal, useModalRef } from '../components/modal';
9
+ import { AspectRatio } from '../shared/aspectRatio/AspectRatio';
9
10
  import { formatProportion } from '../shared/table/formatProportion';
10
11
 
11
12
  type SequencesByLocationMapProps = {
@@ -20,6 +21,7 @@ type SequencesByLocationMapProps = {
20
21
  offsetX: number;
21
22
  offsetY: number;
22
23
  hasTableView: boolean;
24
+ maintainAspectRatio: boolean;
23
25
  };
24
26
 
25
27
  export const SequencesByLocationMap: FunctionComponent<SequencesByLocationMapProps> = ({
@@ -34,6 +36,7 @@ export const SequencesByLocationMap: FunctionComponent<SequencesByLocationMapPro
34
36
  offsetX,
35
37
  offsetY,
36
38
  hasTableView,
39
+ maintainAspectRatio,
37
40
  }) => {
38
41
  const ref = useRef<HTMLDivElement>(null);
39
42
 
@@ -69,8 +72,8 @@ export const SequencesByLocationMap: FunctionComponent<SequencesByLocationMapPro
69
72
  }, [ref, locations, enableMapNavigation, lapisLocationField, zoom, offsetX, offsetY]);
70
73
 
71
74
  return (
72
- <div className='h-full'>
73
- <div ref={ref} className='h-full' />
75
+ <AspectRatio aspectRatio={maintainAspectRatio ? 50 : undefined}>
76
+ <div className='h-full' ref={ref} />
74
77
  <div className='relative'>
75
78
  <DataMatchInformation
76
79
  totalCount={totalCount}
@@ -80,7 +83,7 @@ export const SequencesByLocationMap: FunctionComponent<SequencesByLocationMapPro
80
83
  hasTableView={hasTableView}
81
84
  />
82
85
  </div>
83
- </div>
86
+ </AspectRatio>
84
87
  );
85
88
  };
86
89
 
@@ -32,7 +32,7 @@ export const SequencesByLocationTable: FunctionComponent<SequencesByLocationTabl
32
32
  sort: true,
33
33
  formatter: (cell: number) => formatProportion(cell),
34
34
  },
35
- ...('isShownOnMap' in tableData[0]
35
+ ...(tableData.length > 0 && 'isShownOnMap' in tableData[0]
36
36
  ? [{ id: 'isShownOnMap', name: 'shown on map', sort: true, width: '20%' }]
37
37
  : []),
38
38
  ];
@@ -1,4 +1,5 @@
1
1
  import { type Meta, type StoryObj } from '@storybook/preact';
2
+ import { expect, waitFor, within } from '@storybook/test';
2
3
 
3
4
  import worldAtlas from './__mockData__/worldAtlas.json';
4
5
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
@@ -13,6 +14,21 @@ import './leafletStyleModifications.css';
13
14
  const meta: Meta<SequencesByLocationProps> = {
14
15
  title: 'Visualization/SequencesByLocation',
15
16
  component: SequencesByLocation,
17
+ argTypes: {
18
+ lapisFilter: { control: 'object' },
19
+ lapisLocationField: { control: { type: 'text' } },
20
+ enableMapNavigation: { control: { type: 'boolean' } },
21
+ width: { control: { type: 'text' } },
22
+ height: { control: { type: 'text' } },
23
+ views: {
24
+ options: ['map', 'table'],
25
+ control: { type: 'check' },
26
+ },
27
+ zoom: { control: { type: 'number' } },
28
+ offsetX: { control: { type: 'number' } },
29
+ offsetY: { control: { type: 'number' } },
30
+ pageSize: { control: 'object' },
31
+ },
16
32
  };
17
33
 
18
34
  export default meta;
@@ -51,7 +67,6 @@ export const Default: StoryObj<SequencesByLocationProps> = {
51
67
  },
52
68
  enableMapNavigation: false,
53
69
  width: '1100px',
54
- height: '800px',
55
70
  views: ['map', 'table'],
56
71
  zoom: 2,
57
72
  offsetX: 0,
@@ -77,6 +92,48 @@ export const Default: StoryObj<SequencesByLocationProps> = {
77
92
  },
78
93
  };
79
94
 
95
+ export const NoData: StoryObj<SequencesByLocationProps> = {
96
+ ...Default,
97
+ parameters: {
98
+ fetchMock: {
99
+ mocks: [
100
+ {
101
+ matcher: {
102
+ name: 'worldMap',
103
+ url: worldMapUrl,
104
+ },
105
+ response: {
106
+ status: 200,
107
+ body: worldAtlas,
108
+ },
109
+ },
110
+ {
111
+ matcher: {
112
+ name: 'aggregatedData',
113
+ url: AGGREGATED_ENDPOINT,
114
+ body: {
115
+ fields: ['country'],
116
+ dateFrom: '2022-01-01',
117
+ dateTo: '2022-04-01',
118
+ },
119
+ },
120
+ response: {
121
+ status: 200,
122
+ body: { data: [] },
123
+ },
124
+ },
125
+ ],
126
+ },
127
+ },
128
+ play: async ({ canvasElement }) => {
129
+ const canvas = within(canvasElement);
130
+
131
+ await waitFor(async () => {
132
+ await expect(canvas.getByText('No data available.')).toBeVisible();
133
+ });
134
+ },
135
+ };
136
+
80
137
  export const InvalidTopoJsonTopology: StoryObj<SequencesByLocationProps> = {
81
138
  ...Default,
82
139
  parameters: {
@@ -20,7 +20,9 @@ import { ResizeContainer } from '../components/resize-container';
20
20
  import { useQuery } from '../useQuery';
21
21
  import { mapSourceSchema } from './loadMapSource';
22
22
  import { lapisFilterSchema, views } from '../../types';
23
+ import { NoDataDisplay } from '../components/no-data-display';
23
24
  import Tabs from '../components/tabs';
25
+ import { getMaintainAspectRatio } from '../shared/charts/getMaintainAspectRatio';
24
26
 
25
27
  export const sequencesByLocationViewSchema = z.union([z.literal(views.map), z.literal(views.table)]);
26
28
  export type SequencesByLocationMapView = z.infer<typeof sequencesByLocationViewSchema>;
@@ -31,7 +33,7 @@ const sequencesByLocationPropsSchema = z.object({
31
33
  mapSource: mapSourceSchema.optional(),
32
34
  enableMapNavigation: z.boolean(),
33
35
  width: z.string(),
34
- height: z.string(),
36
+ height: z.string().optional(),
35
37
  views: z.array(sequencesByLocationViewSchema),
36
38
  zoom: z.number(),
37
39
  offsetX: z.number(),
@@ -75,6 +77,10 @@ const SequencesByLocationMapInner: FunctionComponent<SequencesByLocationProps> =
75
77
  throw error;
76
78
  }
77
79
 
80
+ if (data.tableData.length === 0) {
81
+ return <NoDataDisplay />;
82
+ }
83
+
78
84
  return <SequencesByLocationMapTabs data={data} originalComponentProps={props} />;
79
85
  };
80
86
 
@@ -87,6 +93,8 @@ const SequencesByLocationMapTabs: FunctionComponent<SequencesByLocationMapTabsPr
87
93
  originalComponentProps,
88
94
  data,
89
95
  }) => {
96
+ const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
97
+
90
98
  const getTab = (view: SequencesByLocationMapView) => {
91
99
  switch (view) {
92
100
  case views.map: {
@@ -105,6 +113,7 @@ const SequencesByLocationMapTabs: FunctionComponent<SequencesByLocationMapTabsPr
105
113
  offsetX={originalComponentProps.offsetX}
106
114
  offsetY={originalComponentProps.offsetY}
107
115
  hasTableView={originalComponentProps.views.includes(views.table)}
116
+ maintainAspectRatio={maintainAspectRatio}
108
117
  />
109
118
  ),
110
119
  };
@@ -0,0 +1,13 @@
1
+ import { type PropsWithChildren } from 'react';
2
+
3
+ export function AspectRatio({ children, aspectRatio }: PropsWithChildren<{ aspectRatio?: number }>) {
4
+ if (aspectRatio === undefined) {
5
+ return children;
6
+ }
7
+
8
+ return (
9
+ <div class={`w-full relative`} style={{ paddingTop: `${aspectRatio}%` }}>
10
+ <div className='absolute inset-0'>{children}</div>
11
+ </div>
12
+ );
13
+ }
@@ -0,0 +1,3 @@
1
+ export function getMaintainAspectRatio(height: string | undefined) {
2
+ return height === undefined || height === '';
3
+ }
@@ -68,7 +68,6 @@ export const Default: StoryObj<StatisticsProps> = {
68
68
  division: 'Alabama',
69
69
  },
70
70
  width: '100%',
71
- height: '100%',
72
71
  },
73
72
  play: async ({ canvasElement }) => {
74
73
  const canvas = within(canvasElement);
@@ -13,7 +13,7 @@ import { useQuery } from '../useQuery';
13
13
 
14
14
  const statisticsPropsSchema = z.object({
15
15
  width: z.string(),
16
- height: z.string(),
16
+ height: z.string().optional(),
17
17
  numeratorFilter: lapisFilterSchema,
18
18
  denominatorFilter: lapisFilterSchema,
19
19
  });
@@ -62,17 +62,17 @@ type MetricDataTabsProps = {
62
62
  const MetricDataTabs: FunctionComponent<MetricDataTabsProps> = ({ data }) => {
63
63
  const { count, proportion } = data;
64
64
  return (
65
- <div className='flex flex-col sm:flex-row rounded-md border-2 border-gray-100'>
65
+ <div className='flex flex-col sm:flex-row rounded-md border-2 border-gray-100 min-w-[180px]'>
66
66
  <div className='stat'>
67
67
  <div className='stat-title'>Sequences</div>
68
68
  <div className='stat-value text-2xl sm:text-4xl'>{count.toLocaleString('en-us')}</div>
69
- <div className='stat-desc'>The total number of sequenced samples</div>
69
+ <div className='stat-desc text-wrap'>The total number of sequenced samples</div>
70
70
  </div>
71
71
 
72
72
  <div className='stat'>
73
73
  <div className='stat-title'>Overall proportion</div>
74
74
  <div className='stat-value text-2xl sm:text-4xl'>{formatProportion(proportion)}</div>
75
- <div className='stat-desc'>The proportion among all sequenced samples</div>
75
+ <div className='stat-desc text-wrap'>The proportion among all sequenced samples</div>
76
76
  </div>
77
77
  </div>
78
78
  );
@@ -40,7 +40,6 @@ export const Default: StoryObj<WastewaterMutationsOverTimeProps> = {
40
40
  ...Template,
41
41
  args: {
42
42
  width: '100%',
43
- height: '700px',
44
43
  lapisFilter: {},
45
44
  sequenceType: 'nucleotide',
46
45
  maxNumberOfGridRows: 100,
@@ -22,7 +22,7 @@ const wastewaterMutationOverTimeSchema = z.object({
22
22
  lapisFilter: lapisFilterSchema,
23
23
  sequenceType: sequenceTypeSchema,
24
24
  width: z.string(),
25
- height: z.string(),
25
+ height: z.string().optional(),
26
26
  maxNumberOfGridRows: z.number(),
27
27
  });
28
28
 
@@ -2,7 +2,7 @@ import type { FeatureCollection, GeometryObject } from 'geojson';
2
2
  import { describe, expect, test } from 'vitest';
3
3
 
4
4
  import { computeMapLocationData } from './computeMapLocationData';
5
- import type { GeoJsonFeatureProperties } from '../preact/map/loadMapSource';
5
+ import type { GeoJsonFeatureProperties } from '../preact/sequencesByLocation/loadMapSource';
6
6
 
7
7
  const lapisLocationField = 'locationField';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import type { Feature, FeatureCollection, GeometryObject } from 'geojson';
2
2
 
3
3
  import type { AggregateData } from './queryAggregateData';
4
- import type { GeoJsonFeatureProperties } from '../preact/map/loadMapSource';
4
+ import type { GeoJsonFeatureProperties } from '../preact/sequencesByLocation/loadMapSource';
5
5
 
6
6
  export type FeatureData = { proportion: number; count: number };
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { computeMapLocationData } from './computeMapLocationData';
2
2
  import { queryAggregateData } from './queryAggregateData';
3
- import { loadMapSource, type MapSource } from '../preact/map/loadMapSource';
3
+ import { loadMapSource, type MapSource } from '../preact/sequencesByLocation/loadMapSource';
4
4
  import type { LapisFilter } from '../types';
5
5
 
6
6
  export async function querySequencesByLocationData(
@@ -27,7 +27,7 @@ export type {
27
27
  RelativeGrowthAdvantageProps,
28
28
  } from './preact/relativeGrowthAdvantage/relative-growth-advantage';
29
29
  export type { StatisticsProps } from './preact/statistic/statistics';
30
- export type { MapSource } from './preact/map/loadMapSource';
30
+ export type { MapSource } from './preact/sequencesByLocation/loadMapSource';
31
31
 
32
32
  export type { ConfidenceIntervalMethod } from './preact/shared/charts/confideceInterval';
33
33
 
@@ -5,7 +5,10 @@ import { Meta } from '@storybook/blocks';
5
5
  # Size of components
6
6
 
7
7
  All visualization and input components can be provided with a width prop (or height, when applicable) to control the size of the component.
8
- If not provided, the default width or height is used. In most cases, the default is a width of '100%' of its parent container and a predefined height.
8
+ If the width is not provided, the default is used. In most cases, the default is a width of '100%' of its parent container.
9
+ If the height is not set, the component takes up as much space as needed in the vertical direction.
10
+ For table views, this includes showing the complete table.
11
+ For diagrams, a fixed aspect ratio of 2:1 (width/height) is used.
9
12
 
10
13
  Both width and height can be set using the css units (e.g. 'px', 'em', 'rem', '%', 'vh', 'vw', etc.).
11
14
  By using '%', the size of the component can be controlled by the parent component.
@@ -54,7 +54,7 @@ const meta: Meta<Required<AggregateProps>> = {
54
54
 
55
55
  export default meta;
56
56
 
57
- export const Table: StoryObj<Required<AggregateProps>> = {
57
+ export const Default: StoryObj<Required<AggregateProps>> = {
58
58
  render: (args) => html`
59
59
  <gs-app lapis="${LAPIS_URL}">
60
60
  <gs-aggregate
@@ -97,7 +97,6 @@ export const Table: StoryObj<Required<AggregateProps>> = {
97
97
  country: 'USA',
98
98
  },
99
99
  width: '100%',
100
- height: '700px',
101
100
  initialSortField: 'count',
102
101
  initialSortDirection: 'descending',
103
102
  pageSize: 10,
@@ -105,10 +104,18 @@ export const Table: StoryObj<Required<AggregateProps>> = {
105
104
  },
106
105
  };
107
106
 
107
+ export const WithFixedHeight: StoryObj<Required<AggregateProps>> = {
108
+ ...Default,
109
+ args: {
110
+ ...Default.args,
111
+ height: '700px',
112
+ },
113
+ };
114
+
108
115
  export const BarChartWithOneField: StoryObj<Required<AggregateProps>> = {
109
- ...Table,
116
+ ...Default,
110
117
  args: {
111
- ...Table.args,
118
+ ...Default.args,
112
119
  fields: ['division'],
113
120
  views: ['bar', 'table'],
114
121
  },
@@ -135,9 +142,9 @@ export const BarChartWithOneField: StoryObj<Required<AggregateProps>> = {
135
142
  };
136
143
 
137
144
  export const BarChartWithTwoFields: StoryObj<Required<AggregateProps>> = {
138
- ...Table,
145
+ ...Default,
139
146
  args: {
140
- ...Table.args,
147
+ ...Default.args,
141
148
  fields: ['division', 'nextstrainClade'],
142
149
  lapisFilter: {
143
150
  country: 'Germany',
@@ -75,7 +75,7 @@ export class AggregateComponent extends PreactLitAdapterWithGridJsStyles {
75
75
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
76
76
  */
77
77
  @property({ type: String })
78
- height: string = '700px';
78
+ height: string | undefined = undefined;
79
79
 
80
80
  /**
81
81
  * The field by which the table is initially sorted.
@@ -89,7 +89,6 @@ export const Default: StoryObj<Required<MutationComparisonProps>> = {
89
89
  sequenceType: 'nucleotide',
90
90
  views: ['table', 'venn'],
91
91
  width: '100%',
92
- height: '700px',
93
92
  pageSize: 10,
94
93
  },
95
94
  parameters: {
@@ -162,3 +161,11 @@ export const VennDiagram: StoryObj<Required<MutationComparisonProps>> = {
162
161
  });
163
162
  },
164
163
  };
164
+
165
+ export const WithFixedHeight: StoryObj<Required<MutationComparisonProps>> = {
166
+ ...Default,
167
+ args: {
168
+ ...Default.args,
169
+ height: '700px',
170
+ },
171
+ };
@@ -79,7 +79,7 @@ export class MutationComparisonComponent extends PreactLitAdapterWithGridJsStyle
79
79
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
80
80
  */
81
81
  @property({ type: String })
82
- height: string = '700px';
82
+ height: string | undefined = undefined;
83
83
 
84
84
  /**
85
85
  * The maximum number of rows to display in the table view.
@@ -44,7 +44,6 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
44
44
  sequenceType: 'nucleotide',
45
45
  views: ['grid'],
46
46
  width: '100%',
47
- height: '700px',
48
47
  granularity: 'month',
49
48
  lapisDateField: 'date',
50
49
  },
@@ -111,3 +110,12 @@ export const HideProportionOnSmallScreen: StoryObj<Required<MutationsOverTimePro
111
110
  width: '300px',
112
111
  },
113
112
  };
113
+
114
+ // This test uses mock data: defaultMockData.ts (through mutationOverTimeWorker.mock.ts)
115
+ export const WithFixedHeight: StoryObj<Required<MutationsOverTimeProps>> = {
116
+ ...Template,
117
+ args: {
118
+ ...Template,
119
+ height: '700px',
120
+ },
121
+ };
@@ -69,7 +69,7 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
69
69
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
70
70
  */
71
71
  @property({ type: String })
72
- height: string = '700px';
72
+ height: string | undefined = undefined;
73
73
 
74
74
  /**
75
75
  * The granularity of the time axis.
@@ -54,7 +54,6 @@ const meta: Meta<Required<MutationsProps>> = {
54
54
  sequenceType: 'nucleotide',
55
55
  views: ['grid', 'table', 'insertions'],
56
56
  width: '100%',
57
- height: '700px',
58
57
  pageSize: 10,
59
58
  },
60
59
  parameters: withComponentDocs({
@@ -189,3 +188,11 @@ export const OnInsertionsTab: StoryObj<Required<MutationsProps>> = {
189
188
  await fireEvent.click(canvas.getByRole('button', { name: 'Insertions' }));
190
189
  },
191
190
  };
191
+
192
+ export const WithFixedHeight: StoryObj<Required<MutationsProps>> = {
193
+ ...Default,
194
+ args: {
195
+ ...Default.args,
196
+ height: '700px',
197
+ },
198
+ };
@@ -111,7 +111,7 @@ export class MutationsComponent extends PreactLitAdapterWithGridJsStyles {
111
111
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
112
112
  */
113
113
  @property({ type: String })
114
- height: string = '700px';
114
+ height: string | undefined = undefined;
115
115
 
116
116
  /**
117
117
  * The maximum number of rows to display in the table view.
@@ -38,6 +38,9 @@ const meta: Meta<NumberSequencesOverTimeProps> = {
38
38
  control: { type: 'check' },
39
39
  },
40
40
  pageSize: { control: 'object' },
41
+ height: {
42
+ control: 'text',
43
+ },
41
44
  },
42
45
  parameters: withComponentDocs({
43
46
  componentDocs: {
@@ -73,7 +76,6 @@ const Template: StoryObj<NumberSequencesOverTimeProps> = {
73
76
  ],
74
77
  lapisDateField: 'date',
75
78
  width: '100%',
76
- height: '700px',
77
79
  smoothingWindow: 0,
78
80
  granularity: 'month',
79
81
  pageSize: 10,
@@ -239,3 +241,11 @@ export const TwoDatasetsWithNonOverlappingDates: StoryObj<NumberSequencesOverTim
239
241
  },
240
242
  },
241
243
  };
244
+
245
+ export const WithFixedHeight: StoryObj<NumberSequencesOverTimeProps> = {
246
+ ...Template,
247
+ args: {
248
+ ...Template.args,
249
+ height: '700px',
250
+ },
251
+ };
@@ -72,7 +72,7 @@ export class NumberSequencesOverTimeComponent extends PreactLitAdapterWithGridJs
72
72
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
73
73
  */
74
74
  @property({ type: String })
75
- height: string = '700px';
75
+ height: string | undefined = undefined;
76
76
 
77
77
  /**
78
78
  * The granularity of the time axis.
@@ -99,7 +99,6 @@ export const TwoDatasets: StoryObj<Required<PrevalenceOverTimeProps>> = {
99
99
  views: ['bar', 'line', 'bubble', 'table'],
100
100
  confidenceIntervalMethods: ['wilson'],
101
101
  width: '100%',
102
- height: '700px',
103
102
  lapisDateField: 'date',
104
103
  pageSize: 10,
105
104
  yAxisMaxLinear: 1,
@@ -175,7 +174,6 @@ export const OneDataset: StoryObj<Required<PrevalenceOverTimeProps>> = {
175
174
  views: ['bar', 'line', 'bubble', 'table'],
176
175
  confidenceIntervalMethods: ['wilson'],
177
176
  width: '100%',
178
- height: '700px',
179
177
  lapisDateField: 'date',
180
178
  pageSize: 10,
181
179
  yAxisMaxLinear: 1,
@@ -252,3 +250,11 @@ export const OneDatasetOnTableTab: StoryObj<Required<PrevalenceOverTimeProps>> =
252
250
  await fireEvent.click(canvas.getByRole('button', { name: 'Table' }));
253
251
  },
254
252
  };
253
+
254
+ export const WithFixedHeight: StoryObj<Required<PrevalenceOverTimeProps>> = {
255
+ ...TwoDatasets,
256
+ args: {
257
+ ...TwoDatasets.args,
258
+ height: '700px',
259
+ },
260
+ };
@@ -123,7 +123,7 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
123
123
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
124
124
  */
125
125
  @property({ type: String })
126
- height: string = '700px';
126
+ height: string | undefined = undefined;
127
127
 
128
128
  /**
129
129
  * Required.
@@ -81,7 +81,6 @@ export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
81
81
  generationTime: 7,
82
82
  views: ['line'],
83
83
  width: '100%',
84
- height: '700px',
85
84
  lapisDateField: 'date',
86
85
  yAxisMaxLinear: 1,
87
86
  yAxisMaxLogarithmic: 'limitTo1',
@@ -126,3 +125,11 @@ export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
126
125
  },
127
126
  },
128
127
  };
128
+
129
+ export const WithFixedHeight: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
130
+ ...Default,
131
+ args: {
132
+ ...Default.args,
133
+ height: '700px',
134
+ },
135
+ };
@@ -87,7 +87,7 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
87
87
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
88
88
  */
89
89
  @property({ type: String })
90
- height: string = '700px';
90
+ height: string | undefined = undefined;
91
91
 
92
92
  /**
93
93
  * Required.
@@ -5,11 +5,11 @@ import { html } from 'lit';
5
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
6
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
7
7
  import aggregatedData from '../../preact/aggregatedData/__mockData__/aggregated.json';
8
- import aggregatedGermany from '../../preact/map/__mockData__/aggregatedGermany.json';
9
- import aggregatedWorld from '../../preact/map/__mockData__/aggregatedWorld.json';
10
- import mapOfGermany from '../../preact/map/__mockData__/germanyMap.json';
11
- import worldAtlas from '../../preact/map/__mockData__/worldAtlas.json';
12
- import { type SequencesByLocationProps } from '../../preact/map/sequences-by-location';
8
+ import aggregatedGermany from '../../preact/sequencesByLocation/__mockData__/aggregatedGermany.json';
9
+ import aggregatedWorld from '../../preact/sequencesByLocation/__mockData__/aggregatedWorld.json';
10
+ import mapOfGermany from '../../preact/sequencesByLocation/__mockData__/germanyMap.json';
11
+ import worldAtlas from '../../preact/sequencesByLocation/__mockData__/worldAtlas.json';
12
+ import { type SequencesByLocationProps } from '../../preact/sequencesByLocation/sequences-by-location';
13
13
  import { withinShadowRoot } from '../withinShadowRoot.story';
14
14
 
15
15
  import './gs-sequences-by-location';
@@ -86,7 +86,6 @@ const Template: StoryObj<SequencesByLocationProps> = {
86
86
  args: {
87
87
  enableMapNavigation: false,
88
88
  width: '1100px',
89
- height: '700px',
90
89
  views: ['map', 'table'],
91
90
  pageSize: 10,
92
91
  },
@@ -222,7 +221,6 @@ export const GermanyTableOnly: StoryObj<SequencesByLocationProps> = {
222
221
  lapisFilter: { dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany' },
223
222
  lapisLocationField: 'division',
224
223
  width: '100%',
225
- height: '700px',
226
224
  views: ['table'],
227
225
  pageSize: 10,
228
226
  },
@@ -249,3 +247,11 @@ export const GermanyTableOnly: StoryObj<SequencesByLocationProps> = {
249
247
  },
250
248
  },
251
249
  };
250
+
251
+ export const WithFixedHeight: StoryObj<SequencesByLocationProps> = {
252
+ ...WorldMap,
253
+ args: {
254
+ ...WorldMap.args,
255
+ height: '700px',
256
+ },
257
+ };
@@ -3,8 +3,11 @@ import { unsafeCSS } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import type { DetailedHTMLProps, HTMLAttributes } from 'react';
5
5
 
6
- import leafletStyleModifications from '../../preact/map/leafletStyleModifications.css?inline';
7
- import { SequencesByLocation, type SequencesByLocationProps } from '../../preact/map/sequences-by-location';
6
+ import leafletStyleModifications from '../../preact/sequencesByLocation/leafletStyleModifications.css?inline';
7
+ import {
8
+ SequencesByLocation,
9
+ type SequencesByLocationProps,
10
+ } from '../../preact/sequencesByLocation/sequences-by-location';
8
11
  import type { Equals, Expect } from '../../utils/typeAssertions';
9
12
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
10
13
 
@@ -148,7 +151,7 @@ export class SequencesByLocationComponent extends PreactLitAdapterWithGridJsStyl
148
151
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
149
152
  */
150
153
  @property({ type: String })
151
- height: string = '700px';
154
+ height: string | undefined = undefined;
152
155
 
153
156
  /**
154
157
  A list of tabs with views that this component should provide.
@@ -90,6 +90,5 @@ export const Default: StoryObj<Required<StatisticsProps>> = {
90
90
  division: 'Alabama',
91
91
  },
92
92
  width: '100%',
93
- height: '700px',
94
93
  },
95
94
  };