@genspectrum/dashboard-components 0.8.0 → 0.8.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 (26) hide show
  1. package/dist/assets/mutationOverTimeWorker-ICjqmm9j.js.map +1 -0
  2. package/dist/dashboard-components.js +131 -67
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +39 -39
  5. package/dist/style.css +36 -0
  6. package/package.json +1 -1
  7. package/src/lapisApi/lapisApi.ts +59 -34
  8. package/src/preact/aggregatedData/aggregate.stories.tsx +35 -0
  9. package/src/preact/aggregatedData/aggregate.tsx +1 -2
  10. package/src/preact/components/error-boundary.tsx +9 -4
  11. package/src/preact/components/error-display.stories.tsx +23 -3
  12. package/src/preact/components/error-display.tsx +37 -25
  13. package/src/preact/dateRangeSelector/date-range-selector.tsx +1 -1
  14. package/src/preact/lineageFilter/lineage-filter.tsx +2 -3
  15. package/src/preact/locationFilter/location-filter.tsx +2 -3
  16. package/src/preact/mutationComparison/mutation-comparison.tsx +1 -2
  17. package/src/preact/mutationFilter/mutation-filter.tsx +1 -1
  18. package/src/preact/mutations/mutations.tsx +1 -2
  19. package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -2
  20. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +1 -2
  21. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +1 -2
  22. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +1 -2
  23. package/src/preact/textInput/text-input.tsx +2 -3
  24. package/standalone-bundle/dashboard-components.js +4184 -4089
  25. package/standalone-bundle/dashboard-components.js.map +1 -1
  26. package/dist/assets/mutationOverTimeWorker-BOCXtKzd.js.map +0 -1
@@ -4,7 +4,6 @@ import { useContext, useRef } from 'preact/hooks';
4
4
  import { fetchLineageAutocompleteList } from './fetchLineageAutocompleteList';
5
5
  import { LapisUrlContext } from '../LapisUrlContext';
6
6
  import { ErrorBoundary } from '../components/error-boundary';
7
- import { ErrorDisplay } from '../components/error-display';
8
7
  import { LoadingDisplay } from '../components/loading-display';
9
8
  import { NoDataDisplay } from '../components/no-data-display';
10
9
  import { ResizeContainer } from '../components/resize-container';
@@ -24,7 +23,7 @@ export const LineageFilter: FunctionComponent<LineageFilterProps> = ({ width, ..
24
23
  const size = { width, height: '3rem' };
25
24
 
26
25
  return (
27
- <ErrorBoundary size={size}>
26
+ <ErrorBoundary size={size} layout='horizontal'>
28
27
  <ResizeContainer size={size}>
29
28
  <LineageFilterInner {...innerProps} />
30
29
  </ResizeContainer>
@@ -51,7 +50,7 @@ const LineageFilterInner: FunctionComponent<LineageFilterInnerProps> = ({
51
50
  }
52
51
 
53
52
  if (error !== null) {
54
- return <ErrorDisplay error={error} />;
53
+ throw error;
55
54
  }
56
55
 
57
56
  if (data === null) {
@@ -5,7 +5,6 @@ import { type JSXInternal } from 'preact/src/jsx';
5
5
  import { fetchAutocompletionList } from './fetchAutocompletionList';
6
6
  import { LapisUrlContext } from '../LapisUrlContext';
7
7
  import { ErrorBoundary } from '../components/error-boundary';
8
- import { ErrorDisplay } from '../components/error-display';
9
8
  import { LoadingDisplay } from '../components/loading-display';
10
9
  import { ResizeContainer } from '../components/resize-container';
11
10
  import { useQuery } from '../useQuery';
@@ -24,7 +23,7 @@ export const LocationFilter: FunctionComponent<LocationFilterProps> = ({ width,
24
23
  const size = { width, height: '3rem' };
25
24
 
26
25
  return (
27
- <ErrorBoundary size={size}>
26
+ <ErrorBoundary size={size} layout='horizontal'>
28
27
  <ResizeContainer size={size}>
29
28
  <LocationFilterInner {...innerProps} />
30
29
  </ResizeContainer>
@@ -46,7 +45,7 @@ export const LocationFilterInner = ({ initialValue, fields, placeholderText }: L
46
45
  return <LoadingDisplay />;
47
46
  }
48
47
  if (error) {
49
- return <ErrorDisplay error={error} />;
48
+ throw error;
50
49
  }
51
50
 
52
51
  const onInput = (event: JSXInternal.TargetedInputEvent<HTMLInputElement>) => {
@@ -9,7 +9,6 @@ import { type NamedLapisFilter, type SequenceType } from '../../types';
9
9
  import { LapisUrlContext } from '../LapisUrlContext';
10
10
  import { CsvDownloadButton } from '../components/csv-download-button';
11
11
  import { ErrorBoundary } from '../components/error-boundary';
12
- import { ErrorDisplay } from '../components/error-display';
13
12
  import { Fullscreen } from '../components/fullscreen';
14
13
  import Info, { InfoComponentCode, InfoHeadline1, InfoParagraph } from '../components/info';
15
14
  import { LoadingDisplay } from '../components/loading-display';
@@ -59,7 +58,7 @@ export const MutationComparisonInner: FunctionComponent<MutationComparisonProps>
59
58
  }
60
59
 
61
60
  if (error !== null) {
62
- return <ErrorDisplay error={error} />;
61
+ throw error;
63
62
  }
64
63
 
65
64
  if (data === null) {
@@ -35,7 +35,7 @@ export type SelectedMutationFilterStrings = {
35
35
 
36
36
  export const MutationFilter: FunctionComponent<MutationFilterProps> = ({ initialValue, width }) => {
37
37
  return (
38
- <ErrorBoundary size={{ height: '3.375rem', width }}>
38
+ <ErrorBoundary size={{ height: '3.375rem', width }} layout='horizontal'>
39
39
  <div style={width}>
40
40
  <MutationFilterInner initialValue={initialValue} />
41
41
  </div>
@@ -16,7 +16,6 @@ import {
16
16
  import { LapisUrlContext } from '../LapisUrlContext';
17
17
  import { CsvDownloadButton } from '../components/csv-download-button';
18
18
  import { ErrorBoundary } from '../components/error-boundary';
19
- import { ErrorDisplay } from '../components/error-display';
20
19
  import { Fullscreen } from '../components/fullscreen';
21
20
  import Info, { InfoComponentCode, InfoHeadline1, InfoHeadline2, InfoLink, InfoParagraph } from '../components/info';
22
21
  import { LoadingDisplay } from '../components/loading-display';
@@ -66,7 +65,7 @@ export const MutationsInner: FunctionComponent<MutationsProps> = (componentProps
66
65
  }
67
66
 
68
67
  if (error !== null) {
69
- return <ErrorDisplay error={error} />;
68
+ throw error;
70
69
  }
71
70
 
72
71
  if (data === null) {
@@ -21,7 +21,6 @@ import { type ColorScale } from '../components/color-scale-selector';
21
21
  import { ColorScaleSelectorDropdown } from '../components/color-scale-selector-dropdown';
22
22
  import { CsvDownloadButton } from '../components/csv-download-button';
23
23
  import { ErrorBoundary } from '../components/error-boundary';
24
- import { ErrorDisplay } from '../components/error-display';
25
24
  import { Fullscreen } from '../components/fullscreen';
26
25
  import Info, { InfoComponentCode, InfoHeadline1, InfoParagraph } from '../components/info';
27
26
  import { LoadingDisplay } from '../components/loading-display';
@@ -85,7 +84,7 @@ export const MutationsOverTimeInner: FunctionComponent<MutationsOverTimeProps> =
85
84
  }
86
85
 
87
86
  if (error !== undefined) {
88
- return <ErrorDisplay error={error} />;
87
+ throw error;
89
88
  }
90
89
 
91
90
  if (data === null || data === undefined) {
@@ -13,7 +13,6 @@ import type { NamedLapisFilter, TemporalGranularity } from '../../types';
13
13
  import { LapisUrlContext } from '../LapisUrlContext';
14
14
  import { CsvDownloadButton } from '../components/csv-download-button';
15
15
  import { ErrorBoundary } from '../components/error-boundary';
16
- import { ErrorDisplay } from '../components/error-display';
17
16
  import { Fullscreen } from '../components/fullscreen';
18
17
  import Info, { InfoComponentCode, InfoHeadline1, InfoParagraph } from '../components/info';
19
18
  import { LoadingDisplay } from '../components/loading-display';
@@ -64,7 +63,7 @@ const NumberSequencesOverTimeInner = (componentProps: NumberSequencesOverTimePro
64
63
  }
65
64
 
66
65
  if (error !== null) {
67
- return <ErrorDisplay error={error} />;
66
+ throw error;
68
67
  }
69
68
 
70
69
  if (data === null) {
@@ -12,7 +12,6 @@ import { LapisUrlContext } from '../LapisUrlContext';
12
12
  import { ConfidenceIntervalSelector } from '../components/confidence-interval-selector';
13
13
  import { CsvDownloadButton } from '../components/csv-download-button';
14
14
  import { ErrorBoundary } from '../components/error-boundary';
15
- import { ErrorDisplay } from '../components/error-display';
16
15
  import { Fullscreen } from '../components/fullscreen';
17
16
  import Info, { InfoComponentCode, InfoHeadline1, InfoHeadline2, InfoParagraph } from '../components/info';
18
17
  import { LoadingDisplay } from '../components/loading-display';
@@ -77,7 +76,7 @@ export const PrevalenceOverTimeInner: FunctionComponent<PrevalenceOverTimeProps>
77
76
  }
78
77
 
79
78
  if (error !== null) {
80
- return <ErrorDisplay error={error} />;
79
+ throw error;
81
80
  }
82
81
 
83
82
  if (data === null || data.every((variant) => variant.content.length === 0)) {
@@ -9,7 +9,6 @@ import {
9
9
  import { type LapisFilter } from '../../types';
10
10
  import { LapisUrlContext } from '../LapisUrlContext';
11
11
  import { ErrorBoundary } from '../components/error-boundary';
12
- import { ErrorDisplay } from '../components/error-display';
13
12
  import { Fullscreen } from '../components/fullscreen';
14
13
  import Info, { InfoComponentCode, InfoHeadline1, InfoHeadline2, InfoLink, InfoParagraph } from '../components/info';
15
14
  import { LoadingDisplay } from '../components/loading-display';
@@ -63,7 +62,7 @@ export const RelativeGrowthAdvantageInner: FunctionComponent<RelativeGrowthAdvan
63
62
  }
64
63
 
65
64
  if (error !== null) {
66
- return <ErrorDisplay error={error} />;
65
+ throw error;
67
66
  }
68
67
 
69
68
  if (data === null) {
@@ -4,7 +4,6 @@ import { useContext, useRef } from 'preact/hooks';
4
4
  import { fetchAutocompleteList } from './fetchAutocompleteList';
5
5
  import { LapisUrlContext } from '../LapisUrlContext';
6
6
  import { ErrorBoundary } from '../components/error-boundary';
7
- import { ErrorDisplay } from '../components/error-display';
8
7
  import { LoadingDisplay } from '../components/loading-display';
9
8
  import { NoDataDisplay } from '../components/no-data-display';
10
9
  import { ResizeContainer } from '../components/resize-container';
@@ -24,7 +23,7 @@ export const TextInput: FunctionComponent<TextInputProps> = ({ width, ...innerPr
24
23
  const size = { width, height: '3rem' };
25
24
 
26
25
  return (
27
- <ErrorBoundary size={size}>
26
+ <ErrorBoundary size={size} layout='horizontal'>
28
27
  <ResizeContainer size={size}>
29
28
  <TextInputInner {...innerProps} />
30
29
  </ResizeContainer>
@@ -44,7 +43,7 @@ const TextInputInner: FunctionComponent<TextInputInnerProps> = ({ lapisField, pl
44
43
  }
45
44
 
46
45
  if (error !== null) {
47
- return <ErrorDisplay error={error} />;
46
+ throw error;
48
47
  }
49
48
 
50
49
  if (data === null) {