-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(website): extract Gs*.astro components that wrap the web com…
…ponents (#417) This requires some types from the components library so that we can type the wrapper props. Also clean up some types in general.
- Loading branch information
1 parent
d2a4d03
commit 167b2fd
Showing
35 changed files
with
463 additions
and
469 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
import { type LapisFilter } from '@genspectrum/dashboard-components/util'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
title: string; | ||
height?: string; | ||
fields: string[]; | ||
lapisFilter: LapisFilter; | ||
} | ||
const { title, height, fields, lapisFilter } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title={title} height={height}> | ||
<gs-aggregate | ||
fields={JSON.stringify(fields)} | ||
lapisFilter={JSON.stringify(lapisFilter)} | ||
pageSize={defaultTablePageSize} | ||
width='100%' | ||
height='100%'></gs-aggregate> | ||
</ComponentWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
website/src/components/genspectrum/GsMutationComparison.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
import type { NamedLapisFilter, SequenceType } from '@genspectrum/dashboard-components/util'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
lapisFilters: NamedLapisFilter[]; | ||
sequenceType: SequenceType; | ||
} | ||
const { lapisFilters, sequenceType } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title={sequenceType === 'nucleotide' ? 'Nucleotide changes' : 'Amino acid changes'}> | ||
<gs-mutation-comparison | ||
lapisFilters={JSON.stringify(lapisFilters)} | ||
sequenceType={sequenceType} | ||
views='["venn", "table"]' | ||
pageSize={defaultTablePageSize} | ||
width='100%' | ||
height='100%'></gs-mutation-comparison> | ||
</ComponentWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
import type { LapisFilter, SequenceType } from '@genspectrum/dashboard-components/util'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
lapisFilter: LapisFilter; | ||
sequenceType: SequenceType; | ||
} | ||
const { lapisFilter, sequenceType } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title={sequenceType === 'nucleotide' ? 'Nucleotide mutations' : 'Amino acid mutations'}> | ||
<gs-mutations | ||
lapisFilter={JSON.stringify(lapisFilter)} | ||
sequenceType={sequenceType} | ||
views='["grid", "table", "insertions"]' | ||
pageSize={defaultTablePageSize} | ||
width='100%' | ||
height='100%'></gs-mutations> | ||
</ComponentWrapper> |
29 changes: 29 additions & 0 deletions
29
website/src/components/genspectrum/GsMutationsOverTime.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
import type { TemporalGranularity, LapisFilter, SequenceType } from '@genspectrum/dashboard-components/util'; | ||
import { ComponentHeight } from '../../views/OrganismConstants'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
lapisFilter: LapisFilter; | ||
sequenceType: SequenceType; | ||
granularity: TemporalGranularity; | ||
lapisDateField: string; | ||
} | ||
const { lapisFilter, sequenceType, granularity, lapisDateField } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper | ||
title={sequenceType === 'nucleotide' ? 'Nucleotide mutations over time' : 'Amino acid mutations over time'} | ||
height={ComponentHeight.large} | ||
> | ||
<gs-mutations-over-time | ||
width='100%' | ||
height='100%' | ||
lapisFilter={JSON.stringify(lapisFilter)} | ||
sequenceType={sequenceType} | ||
views='["grid"]' | ||
granularity={granularity} | ||
lapisDateField={lapisDateField}></gs-mutations-over-time> | ||
</ComponentWrapper> |
26 changes: 26 additions & 0 deletions
26
website/src/components/genspectrum/GsNumberSequencesOverTime.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import type { NamedLapisFilter } from '@genspectrum/dashboard-components/util'; | ||
import { ComponentHeight } from '../../views/OrganismConstants'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
lapisFilters: NamedLapisFilter[]; | ||
lapisDateField: string; | ||
granularity: string; | ||
} | ||
const { lapisFilters, lapisDateField, granularity } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title='Number sequences' height={ComponentHeight.large}> | ||
<gs-number-sequences-over-time | ||
lapisFilters={JSON.stringify(lapisFilters)} | ||
lapisDateField={lapisDateField} | ||
views='["bar", "line", "table"]' | ||
pageSize={defaultTablePageSize} | ||
width='100%' | ||
height='100%' | ||
granularity={granularity}></gs-number-sequences-over-time> | ||
</ComponentWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
website/src/components/genspectrum/GsPrevalenceOverTime.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
import type { | ||
LapisFilter, | ||
NamedLapisFilter, | ||
PrevalenceOverTimeView, | ||
TemporalGranularity, | ||
} from '@genspectrum/dashboard-components/util'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
numeratorFilters: NamedLapisFilter[]; | ||
denominatorFilter: LapisFilter; | ||
lapisDateField: string; | ||
granularity: TemporalGranularity; | ||
views?: PrevalenceOverTimeView[]; | ||
} | ||
const { | ||
numeratorFilters, | ||
denominatorFilter, | ||
lapisDateField, | ||
granularity, | ||
views = ['bar', 'line', 'bubble', 'table'], | ||
} = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title='Prevalence over time'> | ||
<gs-prevalence-over-time | ||
numeratorFilters={JSON.stringify(numeratorFilters)} | ||
denominatorFilter={JSON.stringify(denominatorFilter)} | ||
lapisDateField={lapisDateField} | ||
granularity={granularity} | ||
smoothingWindow='0' | ||
pageSize={defaultTablePageSize} | ||
views={JSON.stringify(views)} | ||
width='100%' | ||
height='100%'></gs-prevalence-over-time> | ||
</ComponentWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
website/src/components/genspectrum/GsRelativeGrowthAdvantage.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
import type { LapisFilter } from '@genspectrum/dashboard-components/util'; | ||
import { defaultTablePageSize } from '../../views/View'; | ||
import ComponentWrapper from '../ComponentWrapper.astro'; | ||
interface Props { | ||
numeratorFilter: LapisFilter; | ||
denominatorFilter: LapisFilter; | ||
lapisDateField: string; | ||
} | ||
const { numeratorFilter, denominatorFilter, lapisDateField } = Astro.props; | ||
--- | ||
|
||
<ComponentWrapper title='Relative growth advantage'> | ||
<gs-relative-growth-advantage | ||
numeratorFilter={JSON.stringify(numeratorFilter)} | ||
denominatorFilter={JSON.stringify(denominatorFilter)} | ||
generationTime='7' | ||
pageSize={defaultTablePageSize} | ||
width='100%' | ||
height='100%' | ||
lapisDateField={lapisDateField}></gs-relative-growth-advantage> | ||
</ComponentWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.