@genspectrum/dashboard-components 0.2.0 → 0.3.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 +328 -177
- package/dist/dashboard-components.js +376 -129
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +156 -110
- package/dist/style.css +179 -33
- package/package.json +1 -2
- package/src/constants.ts +1 -1
- package/src/lapisApi/lapisApi.ts +46 -2
- package/src/lapisApi/lapisTypes.ts +14 -0
- package/src/preact/aggregatedData/aggregate.stories.tsx +4 -2
- package/src/preact/aggregatedData/aggregate.tsx +8 -6
- package/src/preact/components/error-boundary.stories.tsx +6 -14
- package/src/preact/components/error-boundary.tsx +2 -11
- package/src/preact/components/error-display.stories.tsx +12 -5
- package/src/preact/components/error-display.tsx +37 -3
- package/src/preact/components/loading-display.stories.tsx +1 -1
- package/src/preact/components/resize-container.tsx +5 -14
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +2 -0
- package/src/preact/dateRangeSelector/date-range-selector.tsx +11 -8
- package/src/preact/locationFilter/fetchAutocompletionList.ts +15 -1
- package/src/preact/locationFilter/location-filter.tsx +4 -5
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +6 -3
- package/src/preact/mutationComparison/mutation-comparison.tsx +10 -13
- package/src/preact/mutationComparison/queryMutationData.ts +2 -3
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +8 -8
- package/src/preact/mutationFilter/mutation-filter.tsx +7 -6
- package/src/preact/mutations/mutations.stories.tsx +6 -3
- package/src/preact/mutations/mutations.tsx +8 -6
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -7
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +10 -8
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +6 -3
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +9 -7
- package/src/preact/textInput/text-input.stories.tsx +26 -0
- package/src/preact/textInput/text-input.tsx +4 -5
- package/src/query/queryPrevalenceOverTime.ts +4 -10
- package/src/types.ts +4 -1
- package/src/web-components/ResizeContainer.mdx +13 -0
- package/src/web-components/app.ts +3 -1
- package/src/web-components/input/gs-date-range-selector.stories.ts +10 -2
- package/src/web-components/input/gs-date-range-selector.tsx +26 -16
- package/src/web-components/input/gs-location-filter.stories.ts +5 -3
- package/src/web-components/input/gs-location-filter.tsx +5 -6
- package/src/web-components/input/gs-mutation-filter.stories.ts +11 -8
- package/src/web-components/input/gs-mutation-filter.tsx +38 -26
- package/src/web-components/input/gs-text-input.stories.ts +3 -3
- package/src/web-components/input/gs-text-input.tsx +10 -10
- package/src/web-components/input/introduction.mdx +11 -0
- package/src/web-components/introduction.mdx +15 -0
- package/src/web-components/visualization/gs-aggregate.stories.ts +19 -6
- package/src/web-components/visualization/gs-aggregate.tsx +31 -15
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +13 -7
- package/src/web-components/visualization/gs-mutation-comparison.tsx +26 -17
- package/src/web-components/visualization/gs-mutations.stories.ts +14 -8
- package/src/web-components/visualization/gs-mutations.tsx +18 -8
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +28 -18
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +45 -22
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +11 -5
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +21 -9
|
@@ -15,6 +15,9 @@ const codeExample = String.raw`
|
|
|
15
15
|
denominator='{ "country": "Switzerland", "dateFrom": "2020-12-01" }'
|
|
16
16
|
generationTime="7"
|
|
17
17
|
views='["line"]'
|
|
18
|
+
width='100%'
|
|
19
|
+
height='700px'
|
|
20
|
+
headline="Relative growth advantage"
|
|
18
21
|
></gs-relative-growth-advantage>`;
|
|
19
22
|
|
|
20
23
|
const meta: Meta<RelativeGrowthAdvantageProps> = {
|
|
@@ -28,7 +31,8 @@ const meta: Meta<RelativeGrowthAdvantageProps> = {
|
|
|
28
31
|
options: ['line'],
|
|
29
32
|
control: { type: 'check' },
|
|
30
33
|
},
|
|
31
|
-
|
|
34
|
+
width: { control: 'text' },
|
|
35
|
+
height: { control: 'text' },
|
|
32
36
|
headline: { control: 'text' },
|
|
33
37
|
},
|
|
34
38
|
parameters: withComponentDocs({
|
|
@@ -43,7 +47,7 @@ const meta: Meta<RelativeGrowthAdvantageProps> = {
|
|
|
43
47
|
|
|
44
48
|
export default meta;
|
|
45
49
|
|
|
46
|
-
const Template: StoryObj<RelativeGrowthAdvantageProps
|
|
50
|
+
const Template: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
|
|
47
51
|
render: (args) => html`
|
|
48
52
|
<gs-app lapis="${LAPIS_URL}">
|
|
49
53
|
<gs-relative-growth-advantage
|
|
@@ -51,21 +55,23 @@ const Template: StoryObj<RelativeGrowthAdvantageProps> = {
|
|
|
51
55
|
.denominator=${args.denominator}
|
|
52
56
|
.generationTime=${args.generationTime}
|
|
53
57
|
.views=${args.views}
|
|
54
|
-
.
|
|
58
|
+
.width=${args.width}
|
|
59
|
+
.height=${args.height}
|
|
55
60
|
.headline=${args.headline}
|
|
56
61
|
></gs-relative-growth-advantage>
|
|
57
62
|
</gs-app>
|
|
58
63
|
`,
|
|
59
64
|
};
|
|
60
65
|
|
|
61
|
-
export const Default: StoryObj<RelativeGrowthAdvantageProps
|
|
66
|
+
export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
|
|
62
67
|
...Template,
|
|
63
68
|
args: {
|
|
64
69
|
numerator: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01' },
|
|
65
70
|
denominator: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' },
|
|
66
71
|
generationTime: 7,
|
|
67
72
|
views: ['line'],
|
|
68
|
-
|
|
73
|
+
width: '100%',
|
|
74
|
+
height: '700px',
|
|
69
75
|
headline: 'Relative growth advantage',
|
|
70
76
|
},
|
|
71
77
|
parameters: {
|
|
@@ -6,7 +6,9 @@ import { type Equals, type Expect } from '../../utils/typeAssertions';
|
|
|
6
6
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* ## Context
|
|
10
|
+
*
|
|
11
|
+
* For this component, we assume a discrete time model, where new infections happen exactly every `generationTime` days.
|
|
10
12
|
* This is what we call a "generation".
|
|
11
13
|
*
|
|
12
14
|
* This component estimates the relative growth advantage of a variant by performing a logistic regression.
|
|
@@ -32,12 +34,16 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
32
34
|
@customElement('gs-relative-growth-advantage')
|
|
33
35
|
export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
34
36
|
/**
|
|
37
|
+
* Required.
|
|
38
|
+
*
|
|
35
39
|
* The LAPIS filter for the focal variant.
|
|
36
40
|
*/
|
|
37
41
|
@property({ type: Object })
|
|
38
42
|
numerator: Record<string, string | number | null | boolean> = {};
|
|
39
43
|
|
|
40
44
|
/**
|
|
45
|
+
* Required.
|
|
46
|
+
*
|
|
41
47
|
* The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.
|
|
42
48
|
*/
|
|
43
49
|
@property({ type: Object })
|
|
@@ -60,18 +66,23 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
60
66
|
* The headline of the component. Set to an empty string to hide the headline.
|
|
61
67
|
*/
|
|
62
68
|
@property({ type: String })
|
|
63
|
-
headline: string
|
|
69
|
+
headline: string = 'Relative growth advantage';
|
|
64
70
|
|
|
65
71
|
/**
|
|
66
|
-
* The
|
|
72
|
+
* The width of the component.
|
|
67
73
|
*
|
|
68
|
-
*
|
|
74
|
+
* Visit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.
|
|
75
|
+
*/
|
|
76
|
+
@property({ type: String })
|
|
77
|
+
width: string = '100%';
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The height of the component.
|
|
69
81
|
*
|
|
70
|
-
*
|
|
71
|
-
* If the unit is %, the size will be relative to the container of the component.
|
|
82
|
+
* Visit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.
|
|
72
83
|
*/
|
|
73
|
-
@property({ type:
|
|
74
|
-
|
|
84
|
+
@property({ type: String })
|
|
85
|
+
height: string = '700px';
|
|
75
86
|
|
|
76
87
|
override render() {
|
|
77
88
|
return (
|
|
@@ -80,7 +91,8 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
80
91
|
denominator={this.denominator}
|
|
81
92
|
generationTime={this.generationTime}
|
|
82
93
|
views={this.views}
|
|
83
|
-
|
|
94
|
+
width={this.width}
|
|
95
|
+
height={this.height}
|
|
84
96
|
headline={this.headline}
|
|
85
97
|
/>
|
|
86
98
|
);
|