@genspectrum/dashboard-components 0.14.2 → 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.
- package/custom-elements.json +281 -105
- package/dist/{LineageFilterChangedEvent-C9dXOxt6.js → LineageFilterChangedEvent-COWV-Y0k.js} +6 -6
- package/dist/LineageFilterChangedEvent-COWV-Y0k.js.map +1 -0
- package/dist/assets/{mutationOverTimeWorker-Dxnxrfe0.js.map → mutationOverTimeWorker-BL50C-yi.js.map} +1 -1
- package/dist/components.d.ts +40 -40
- package/dist/components.js +373 -243
- package/dist/components.js.map +1 -1
- package/dist/style.css +9 -0
- package/dist/util.d.ts +49 -49
- package/dist/util.js +2 -2
- package/package.json +1 -1
- package/src/preact/ReferenceGenomeContext.ts +14 -1
- package/src/preact/aggregatedData/aggregate-bar-chart.tsx +26 -5
- package/src/preact/aggregatedData/aggregate.stories.tsx +0 -1
- package/src/preact/aggregatedData/aggregate.tsx +5 -1
- package/src/preact/components/ReferenceGenomesAwaiter.tsx +1 -6
- package/src/preact/components/resize-container.tsx +1 -1
- package/src/preact/{dateRangeSelector/date-range-selector.stories.tsx → dateRangeFilter/date-range-filter.stories.tsx} +15 -15
- package/src/preact/{dateRangeSelector/date-range-selector.tsx → dateRangeFilter/date-range-filter.tsx} +9 -9
- package/src/preact/{dateRangeSelector → dateRangeFilter}/dateRangeOption.ts +2 -2
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +4 -2
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +5 -1
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -1
- package/src/preact/mutationFilter/mutation-filter.tsx +8 -0
- package/src/preact/mutations/mutations.stories.tsx +0 -1
- package/src/preact/mutations/mutations.tsx +1 -1
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +0 -2
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +18 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +48 -35
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +83 -70
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +48 -37
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +6 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +31 -23
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +5 -1
- package/src/preact/sequencesByLocation/__mockData__/worldAtlas.json +1 -0
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-map.tsx +6 -3
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-table.tsx +1 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.stories.tsx +58 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.tsx +10 -1
- package/src/preact/shared/aspectRatio/AspectRatio.tsx +13 -0
- package/src/preact/shared/charts/getMaintainAspectRatio.ts +3 -0
- package/src/preact/statistic/statistics.stories.tsx +0 -1
- package/src/preact/statistic/statistics.tsx +4 -4
- package/src/preact/{textInput/TextInputChangedEvent.ts → textFilter/TextFilterChangedEvent.ts} +2 -2
- package/src/preact/{textInput/text-input.stories.tsx → textFilter/text-filter.stories.tsx} +10 -10
- package/src/preact/{textInput/text-input.tsx → textFilter/text-filter.tsx} +10 -10
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +0 -1
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
- package/src/query/computeMapLocationData.spec.ts +1 -1
- package/src/query/computeMapLocationData.ts +1 -1
- package/src/query/querySequencesByLocationData.ts +1 -1
- package/src/utilEntrypoint.ts +3 -3
- package/src/web-components/ResizeContainer.mdx +4 -1
- package/src/web-components/input/{gs-date-range-selector.stories.ts → gs-date-range-filter.stories.ts} +59 -14
- package/src/web-components/input/{gs-date-range-selector.tsx → gs-date-range-filter.tsx} +28 -13
- package/src/web-components/input/{gs-text-input.stories.ts → gs-text-filter.stories.ts} +15 -15
- package/src/web-components/input/{gs-text-input.tsx → gs-text-filter.tsx} +16 -16
- package/src/web-components/input/index.ts +2 -2
- package/src/web-components/visualization/gs-aggregate.stories.ts +13 -6
- package/src/web-components/visualization/gs-aggregate.tsx +1 -1
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +1 -1
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +9 -1
- package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-mutations.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutations.tsx +1 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +11 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -2
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +8 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -1
- package/src/web-components/visualization/gs-sequences-by-location.stories.ts +13 -7
- package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -3
- package/src/web-components/visualization/gs-statistics.stories.ts +0 -1
- package/src/web-components/visualization/gs-statistics.tsx +1 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +9 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +1 -1
- package/standalone-bundle/assets/{mutationOverTimeWorker-CmSrq4SZ.js.map → mutationOverTimeWorker-CFB5-Mdk.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +6032 -5937
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/dist/LineageFilterChangedEvent-C9dXOxt6.js.map +0 -1
- package/src/preact/map/__mockData__/worldAtlas.json +0 -497127
- /package/src/preact/{dateRangeSelector → dateRangeFilter}/computeInitialValues.spec.ts +0 -0
- /package/src/preact/{dateRangeSelector → dateRangeFilter}/computeInitialValues.ts +0 -0
- /package/src/preact/{dateRangeSelector → dateRangeFilter}/dateConversion.ts +0 -0
- /package/src/preact/{dateRangeSelector → dateRangeFilter}/selectableOptions.ts +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedGermany.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedWorld.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/germanyMap.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/howToGenerateWorldMap.md +0 -0
- /package/src/preact/{map → sequencesByLocation}/leafletStyleModifications.css +0 -0
- /package/src/preact/{map → sequencesByLocation}/loadMapSource.tsx +0 -0
- /package/src/preact/{textInput → textFilter}/__mockData__/aggregated_hosts.json +0 -0
- /package/src/preact/{textInput → textFilter}/fetchStringAutocompleteList.spec.ts +0 -0
- /package/src/preact/{textInput → textFilter}/fetchStringAutocompleteList.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { type DateRangeOptionChangedEvent } from '../../preact/
|
|
4
|
+
import { DateRangeFilter, type DateRangeFilterProps } from '../../preact/dateRangeFilter/date-range-filter';
|
|
5
|
+
import { type DateRangeOptionChangedEvent } from '../../preact/dateRangeFilter/dateRangeOption';
|
|
6
6
|
import { type Equals, type Expect } from '../../utils/typeAssertions';
|
|
7
7
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
8
8
|
|
|
@@ -48,8 +48,8 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
48
48
|
* Use this event, when you want to control this component in your JS application.
|
|
49
49
|
* You can supply the `detail` of this event to the `value` attribute of this component.
|
|
50
50
|
*/
|
|
51
|
-
@customElement('gs-date-range-
|
|
52
|
-
export class
|
|
51
|
+
@customElement('gs-date-range-filter')
|
|
52
|
+
export class DateRangeFilterComponent extends PreactLitAdapter {
|
|
53
53
|
/**
|
|
54
54
|
* An array of date range options that the select field should provide.
|
|
55
55
|
* The `label` will be shown to the user, and it will be available as `value`.
|
|
@@ -78,7 +78,22 @@ export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
78
78
|
* The `detail` of the `gs-date-range-option-changed` event can be used for this attribute,
|
|
79
79
|
* if you want to control this component in your JS application.
|
|
80
80
|
*/
|
|
81
|
-
@property({
|
|
81
|
+
@property({
|
|
82
|
+
converter: (value) => {
|
|
83
|
+
if (value === null) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const result = JSON.parse(value) as unknown;
|
|
88
|
+
if (typeof result !== 'object' && typeof result !== 'string') {
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
} catch (_) {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
})
|
|
82
97
|
value: string | { dateFrom?: string; dateTo?: string } | undefined = undefined;
|
|
83
98
|
|
|
84
99
|
/**
|
|
@@ -97,7 +112,7 @@ export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
97
112
|
|
|
98
113
|
override render() {
|
|
99
114
|
return (
|
|
100
|
-
<
|
|
115
|
+
<DateRangeFilter
|
|
101
116
|
dateRangeOptions={this.dateRangeOptions}
|
|
102
117
|
earliestDate={this.earliestDate}
|
|
103
118
|
value={this.value}
|
|
@@ -110,7 +125,7 @@ export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
110
125
|
|
|
111
126
|
declare global {
|
|
112
127
|
interface HTMLElementTagNameMap {
|
|
113
|
-
'gs-date-range-
|
|
128
|
+
'gs-date-range-filter': DateRangeFilterComponent;
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
interface HTMLElementEventMap {
|
|
@@ -123,21 +138,21 @@ declare global {
|
|
|
123
138
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
124
139
|
namespace JSX {
|
|
125
140
|
interface IntrinsicElements {
|
|
126
|
-
'gs-date-range-
|
|
141
|
+
'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
127
142
|
}
|
|
128
143
|
}
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
132
147
|
type CustomSelectOptionsMatches = Expect<
|
|
133
|
-
Equals<typeof
|
|
148
|
+
Equals<typeof DateRangeFilterComponent.prototype.dateRangeOptions, DateRangeFilterProps['dateRangeOptions']>
|
|
134
149
|
>;
|
|
135
150
|
type EarliestDateMatches = Expect<
|
|
136
|
-
Equals<typeof
|
|
151
|
+
Equals<typeof DateRangeFilterComponent.prototype.earliestDate, DateRangeFilterProps['earliestDate']>
|
|
137
152
|
>;
|
|
138
|
-
type ValueMatches = Expect<Equals<typeof
|
|
139
|
-
type WidthMatches = Expect<Equals<typeof
|
|
153
|
+
type ValueMatches = Expect<Equals<typeof DateRangeFilterComponent.prototype.value, DateRangeFilterProps['value']>>;
|
|
154
|
+
type WidthMatches = Expect<Equals<typeof DateRangeFilterComponent.prototype.width, DateRangeFilterProps['width']>>;
|
|
140
155
|
type DateColumnMatches = Expect<
|
|
141
|
-
Equals<typeof
|
|
156
|
+
Equals<typeof DateRangeFilterComponent.prototype.lapisDateField, DateRangeFilterProps['lapisDateField']>
|
|
142
157
|
>;
|
|
143
158
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -6,26 +6,26 @@ import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
|
6
6
|
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
8
8
|
import '../gs-app';
|
|
9
|
-
import './gs-text-
|
|
10
|
-
import data from '../../preact/
|
|
11
|
-
import type {
|
|
9
|
+
import './gs-text-filter';
|
|
10
|
+
import data from '../../preact/textFilter/__mockData__/aggregated_hosts.json';
|
|
11
|
+
import type { TextFilterProps } from '../../preact/textFilter/text-filter';
|
|
12
12
|
import { withinShadowRoot } from '../withinShadowRoot.story';
|
|
13
13
|
|
|
14
14
|
const codeExample = String.raw`
|
|
15
|
-
<gs-text-
|
|
15
|
+
<gs-text-filter
|
|
16
16
|
lapisField="host"
|
|
17
17
|
lapisFilter='{"country": "Germany"}'
|
|
18
18
|
placeholderText="Enter host name"
|
|
19
19
|
value="Homo sapiens"
|
|
20
20
|
width="50%">
|
|
21
|
-
</gs-text-
|
|
21
|
+
</gs-text-filter>`;
|
|
22
22
|
|
|
23
|
-
const meta: Meta<Required<
|
|
24
|
-
title: 'Input/Text
|
|
25
|
-
component: 'gs-text-
|
|
23
|
+
const meta: Meta<Required<TextFilterProps>> = {
|
|
24
|
+
title: 'Input/Text filter',
|
|
25
|
+
component: 'gs-text-filter',
|
|
26
26
|
parameters: withComponentDocs({
|
|
27
27
|
actions: {
|
|
28
|
-
handles: ['gs-text-
|
|
28
|
+
handles: ['gs-text-filter-changed', ...previewHandles],
|
|
29
29
|
},
|
|
30
30
|
fetchMock: {
|
|
31
31
|
mocks: [
|
|
@@ -83,17 +83,17 @@ const meta: Meta<Required<TextInputProps>> = {
|
|
|
83
83
|
|
|
84
84
|
export default meta;
|
|
85
85
|
|
|
86
|
-
export const Default: StoryObj<Required<
|
|
86
|
+
export const Default: StoryObj<Required<TextFilterProps>> = {
|
|
87
87
|
render: (args) => {
|
|
88
88
|
return html` <gs-app lapis="${LAPIS_URL}">
|
|
89
89
|
<div class="max-w-screen-lg">
|
|
90
|
-
<gs-text-
|
|
90
|
+
<gs-text-filter
|
|
91
91
|
.lapisField=${args.lapisField}
|
|
92
92
|
.lapisFilter=${args.lapisFilter}
|
|
93
93
|
.placeholderText=${args.placeholderText}
|
|
94
94
|
.value=${args.value}
|
|
95
95
|
.width=${args.width}
|
|
96
|
-
></gs-text-
|
|
96
|
+
></gs-text-filter>
|
|
97
97
|
</div>
|
|
98
98
|
</gs-app>`;
|
|
99
99
|
},
|
|
@@ -106,15 +106,15 @@ export const Default: StoryObj<Required<TextInputProps>> = {
|
|
|
106
106
|
},
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
export const FiresEvents: StoryObj<Required<
|
|
109
|
+
export const FiresEvents: StoryObj<Required<TextFilterProps>> = {
|
|
110
110
|
...Default,
|
|
111
111
|
play: async ({ canvasElement, step }) => {
|
|
112
|
-
const canvas = await withinShadowRoot(canvasElement, 'gs-text-
|
|
112
|
+
const canvas = await withinShadowRoot(canvasElement, 'gs-text-filter');
|
|
113
113
|
|
|
114
114
|
const inputField = () => canvas.getByPlaceholderText('Enter host name');
|
|
115
115
|
const listenerMock = fn();
|
|
116
116
|
await step('Setup event listener mock', () => {
|
|
117
|
-
canvasElement.addEventListener('gs-text-
|
|
117
|
+
canvasElement.addEventListener('gs-text-filter-changed', listenerMock);
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
await step('wait until data is loaded', async () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
import { type
|
|
5
|
-
import {
|
|
4
|
+
import { type TextFilterChangedEvent } from '../../preact/textFilter/TextFilterChangedEvent';
|
|
5
|
+
import { TextFilter, type TextFilterProps } from '../../preact/textFilter/text-filter';
|
|
6
6
|
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
7
7
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
12
12
|
*
|
|
13
13
|
* This component provides a text input field to specify filters for arbitrary fields of this LAPIS instance.
|
|
14
14
|
*
|
|
15
|
-
* @fires {CustomEvent<Record<string, string | undefined>>} gs-text-
|
|
15
|
+
* @fires {CustomEvent<Record<string, string | undefined>>} gs-text-filter-changed
|
|
16
16
|
* Fired when the input field is changed.
|
|
17
17
|
* The `details` of this event contain an object with the `lapisField` as key and the input value as value.
|
|
18
18
|
* Example:
|
|
@@ -22,10 +22,10 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
22
22
|
* }
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
@customElement('gs-text-
|
|
26
|
-
export class
|
|
25
|
+
@customElement('gs-text-filter')
|
|
26
|
+
export class TextFilterComponent extends PreactLitAdapter {
|
|
27
27
|
/**
|
|
28
|
-
* The initial value to use for this text
|
|
28
|
+
* The initial value to use for this text filter.
|
|
29
29
|
*/
|
|
30
30
|
@property()
|
|
31
31
|
value: string | undefined = undefined;
|
|
@@ -33,7 +33,7 @@ export class TextInputComponent extends PreactLitAdapter {
|
|
|
33
33
|
/**
|
|
34
34
|
* Required.
|
|
35
35
|
*
|
|
36
|
-
* The LAPIS field name to use for this text
|
|
36
|
+
* The LAPIS field name to use for this text filter.
|
|
37
37
|
* The field must exist on this LAPIS instance.
|
|
38
38
|
*/
|
|
39
39
|
@property()
|
|
@@ -68,7 +68,7 @@ export class TextInputComponent extends PreactLitAdapter {
|
|
|
68
68
|
|
|
69
69
|
override render() {
|
|
70
70
|
return (
|
|
71
|
-
<
|
|
71
|
+
<TextFilter
|
|
72
72
|
lapisField={this.lapisField}
|
|
73
73
|
lapisFilter={this.lapisFilter}
|
|
74
74
|
placeholderText={this.placeholderText}
|
|
@@ -81,11 +81,11 @@ export class TextInputComponent extends PreactLitAdapter {
|
|
|
81
81
|
|
|
82
82
|
declare global {
|
|
83
83
|
interface HTMLElementTagNameMap {
|
|
84
|
-
'gs-text-
|
|
84
|
+
'gs-text-filter': TextFilterComponent;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
interface HTMLElementEventMap {
|
|
88
|
-
'gs-text-
|
|
88
|
+
'gs-text-filter-changed': TextFilterChangedEvent;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -93,19 +93,19 @@ declare global {
|
|
|
93
93
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
94
94
|
namespace JSX {
|
|
95
95
|
interface IntrinsicElements {
|
|
96
|
-
'gs-text-
|
|
96
|
+
'gs-text-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
102
|
-
type InitialValueMatches = Expect<Equals<typeof
|
|
103
|
-
type LapisFieldMatches = Expect<Equals<typeof
|
|
102
|
+
type InitialValueMatches = Expect<Equals<typeof TextFilterComponent.prototype.value, TextFilterProps['value']>>;
|
|
103
|
+
type LapisFieldMatches = Expect<Equals<typeof TextFilterComponent.prototype.lapisField, TextFilterProps['lapisField']>>;
|
|
104
104
|
type LapisFilterMatches = Expect<
|
|
105
|
-
Equals<typeof
|
|
105
|
+
Equals<typeof TextFilterComponent.prototype.lapisFilter, TextFilterProps['lapisFilter']>
|
|
106
106
|
>;
|
|
107
107
|
type PlaceholderTextMatches = Expect<
|
|
108
|
-
Equals<typeof
|
|
108
|
+
Equals<typeof TextFilterComponent.prototype.placeholderText, TextFilterProps['placeholderText']>
|
|
109
109
|
>;
|
|
110
|
-
type WidthMatches = Expect<Equals<typeof
|
|
110
|
+
type WidthMatches = Expect<Equals<typeof TextFilterComponent.prototype.width, TextFilterProps['width']>>;
|
|
111
111
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { DateRangeFilterComponent } from './gs-date-range-filter';
|
|
2
2
|
export { LocationFilterComponent } from './gs-location-filter';
|
|
3
|
-
export {
|
|
3
|
+
export { TextFilterComponent } from './gs-text-filter';
|
|
4
4
|
export { MutationFilterComponent } from './gs-mutation-filter';
|
|
5
5
|
export { LineageFilterComponent } from './gs-lineage-filter';
|
|
@@ -54,7 +54,7 @@ const meta: Meta<Required<AggregateProps>> = {
|
|
|
54
54
|
|
|
55
55
|
export default meta;
|
|
56
56
|
|
|
57
|
-
export const
|
|
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
|
-
...
|
|
116
|
+
...Default,
|
|
110
117
|
args: {
|
|
111
|
-
...
|
|
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
|
-
...
|
|
145
|
+
...Default,
|
|
139
146
|
args: {
|
|
140
|
-
...
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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/
|
|
9
|
-
import aggregatedWorld from '../../preact/
|
|
10
|
-
import mapOfGermany from '../../preact/
|
|
11
|
-
import worldAtlas from '../../preact/
|
|
12
|
-
import { type SequencesByLocationProps } from '../../preact/
|
|
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/
|
|
7
|
-
import {
|
|
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 =
|
|
154
|
+
height: string | undefined = undefined;
|
|
152
155
|
|
|
153
156
|
/**
|
|
154
157
|
A list of tabs with views that this component should provide.
|
|
@@ -51,7 +51,7 @@ export class StatisticsComponent extends PreactLitAdapterWithGridJsStyles {
|
|
|
51
51
|
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
52
52
|
*/
|
|
53
53
|
@property({ type: String })
|
|
54
|
-
height: string =
|
|
54
|
+
height: string | undefined = undefined;
|
|
55
55
|
|
|
56
56
|
override render() {
|
|
57
57
|
return (
|
package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts
CHANGED
|
@@ -35,7 +35,7 @@ const meta: Meta<WastewaterMutationsOverTimeProps & { infoText: string }> = {
|
|
|
35
35
|
lapisFilter: { versionStatus: 'LATEST_VERSION', isRevocation: false },
|
|
36
36
|
sequenceType: 'nucleotide',
|
|
37
37
|
width: '100%',
|
|
38
|
-
height:
|
|
38
|
+
height: undefined,
|
|
39
39
|
infoText: 'Some info text',
|
|
40
40
|
maxNumberOfGridRows: 100,
|
|
41
41
|
},
|
|
@@ -88,3 +88,11 @@ export const WastewaterMutationsOverTime: StoryObj<WastewaterMutationsOverTimePr
|
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
};
|
|
91
|
+
|
|
92
|
+
export const WithFixedHeight: StoryObj<WastewaterMutationsOverTimeProps & { infoText: string }> = {
|
|
93
|
+
...WastewaterMutationsOverTime,
|
|
94
|
+
args: {
|
|
95
|
+
...WastewaterMutationsOverTime.args,
|
|
96
|
+
height: '700px',
|
|
97
|
+
},
|
|
98
|
+
};
|
|
@@ -63,7 +63,7 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
|
|
|
63
63
|
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
64
64
|
*/
|
|
65
65
|
@property({ type: String })
|
|
66
|
-
height: string =
|
|
66
|
+
height: string | undefined = undefined;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The maximum number of grid rows to display.
|