@genspectrum/dashboard-components 0.3.1 → 0.4.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 +86 -29
- package/dist/dashboard-components.js +391 -207
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +37 -12
- package/dist/style.css +58 -50
- package/package.json +2 -1
- package/src/operator/RenameFieldOperator.spec.ts +28 -0
- package/src/operator/RenameFieldOperator.ts +19 -0
- package/src/preact/aggregatedData/aggregate.tsx +1 -1
- package/src/preact/components/info.stories.tsx +8 -8
- package/src/preact/components/info.tsx +113 -20
- package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +99 -0
- package/src/preact/dateRangeSelector/computeInitialValues.ts +73 -0
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +93 -4
- package/src/preact/dateRangeSelector/date-range-selector.tsx +27 -88
- package/src/preact/dateRangeSelector/selectableOptions.ts +79 -0
- package/src/preact/locationFilter/location-filter.tsx +1 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +1 -1
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +3 -6
- package/src/preact/mutationFilter/mutation-filter.tsx +48 -54
- package/src/preact/mutations/mutations.tsx +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +3 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +7 -3
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +2 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +6 -2
- package/src/query/queryPrevalenceOverTime.ts +13 -7
- package/src/query/queryRelativeGrowthAdvantage.ts +11 -7
- package/src/web-components/input/gs-date-range-selector.stories.ts +11 -5
- package/src/web-components/input/gs-date-range-selector.tsx +22 -5
- package/src/web-components/input/gs-location-filter.stories.ts +6 -7
- package/src/web-components/input/gs-location-filter.tsx +3 -2
- package/src/web-components/input/gs-mutation-filter.stories.ts +1 -8
- package/src/web-components/input/gs-mutation-filter.tsx +1 -9
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +6 -2
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +11 -0
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +3 -0
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +11 -0
|
@@ -126,6 +126,16 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
|
|
|
126
126
|
@property({ type: String })
|
|
127
127
|
height: string = '700px';
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Required.
|
|
131
|
+
*
|
|
132
|
+
* The LAPIS field that the data should be aggregated by.
|
|
133
|
+
* The values will be used on the x-axis of the diagram.
|
|
134
|
+
* Must be a field of type `date` in LAPIS.
|
|
135
|
+
*/
|
|
136
|
+
@property({ type: String })
|
|
137
|
+
lapisDateField: string = 'date';
|
|
138
|
+
|
|
129
139
|
override render() {
|
|
130
140
|
return (
|
|
131
141
|
<PrevalenceOverTime
|
|
@@ -138,6 +148,7 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
|
|
|
138
148
|
width={this.width}
|
|
139
149
|
height={this.height}
|
|
140
150
|
headline={this.headline}
|
|
151
|
+
lapisDateField={this.lapisDateField}
|
|
141
152
|
/>
|
|
142
153
|
);
|
|
143
154
|
}
|
|
@@ -18,6 +18,7 @@ const codeExample = String.raw`
|
|
|
18
18
|
width='100%'
|
|
19
19
|
height='700px'
|
|
20
20
|
headline="Relative growth advantage"
|
|
21
|
+
lapisDateField="date"
|
|
21
22
|
></gs-relative-growth-advantage>`;
|
|
22
23
|
|
|
23
24
|
const meta: Meta<RelativeGrowthAdvantageProps> = {
|
|
@@ -58,6 +59,7 @@ const Template: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
|
|
|
58
59
|
.width=${args.width}
|
|
59
60
|
.height=${args.height}
|
|
60
61
|
.headline=${args.headline}
|
|
62
|
+
.lapisDateField=${args.lapisDateField}
|
|
61
63
|
></gs-relative-growth-advantage>
|
|
62
64
|
</gs-app>
|
|
63
65
|
`,
|
|
@@ -73,6 +75,7 @@ export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
|
|
|
73
75
|
width: '100%',
|
|
74
76
|
height: '700px',
|
|
75
77
|
headline: 'Relative growth advantage',
|
|
78
|
+
lapisDateField: 'date',
|
|
76
79
|
},
|
|
77
80
|
parameters: {
|
|
78
81
|
fetchMock: {
|
|
@@ -84,6 +84,16 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
84
84
|
@property({ type: String })
|
|
85
85
|
height: string = '700px';
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Required.
|
|
89
|
+
*
|
|
90
|
+
* The LAPIS field that the data should be aggregated by.
|
|
91
|
+
* The values will be used on the x-axis of the diagram.
|
|
92
|
+
* Must be a field of type `date` in LAPIS.
|
|
93
|
+
*/
|
|
94
|
+
@property({ type: String })
|
|
95
|
+
lapisDateField: string = 'date';
|
|
96
|
+
|
|
87
97
|
override render() {
|
|
88
98
|
return (
|
|
89
99
|
<RelativeGrowthAdvantage
|
|
@@ -94,6 +104,7 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
94
104
|
width={this.width}
|
|
95
105
|
height={this.height}
|
|
96
106
|
headline={this.headline}
|
|
107
|
+
lapisDateField={this.lapisDateField}
|
|
97
108
|
/>
|
|
98
109
|
);
|
|
99
110
|
}
|