@genspectrum/dashboard-components 0.19.5 → 0.19.6
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 +99 -0
- package/dist/{LineageFilterChangedEvent-GgkxoF3X.js → LineageFilterChangedEvent-Cqa8Frcf.js} +2 -1
- package/dist/{LineageFilterChangedEvent-GgkxoF3X.js.map → LineageFilterChangedEvent-Cqa8Frcf.js.map} +1 -1
- package/dist/assets/mutationOverTimeWorker-DQGh08AS.js.map +1 -0
- package/dist/components.d.ts +45 -14
- package/dist/components.js +48 -15
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +15 -14
- package/dist/util.js +1 -1
- package/package.json +1 -1
- package/src/preact/aggregatedData/aggregate.stories.tsx +6 -0
- package/src/preact/aggregatedData/aggregate.tsx +10 -1
- package/src/preact/components/tabs.tsx +4 -4
- package/src/preact/genomeViewer/CDSPlot.tsx +4 -1
- package/src/preact/genomeViewer/genome-data-viewer.stories.tsx +6 -0
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +6 -0
- package/src/preact/mutationComparison/mutation-comparison.tsx +4 -0
- package/src/preact/mutations/mutations.stories.tsx +6 -0
- package/src/preact/mutations/mutations.tsx +4 -1
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +6 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +6 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +4 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +6 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +4 -1
- package/src/preact/sequencesByLocation/sequences-by-location.stories.tsx +6 -0
- package/src/preact/sequencesByLocation/sequences-by-location.tsx +4 -0
- package/src/preact/shared/stories/expectFinishedLoadingEvent.ts +12 -0
- package/src/preact/statistic/statistics.stories.tsx +6 -0
- package/src/preact/statistic/statistics.tsx +4 -1
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +2 -0
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +4 -1
- package/src/utils/gsEventNames.ts +1 -0
- package/src/utils/useDispatchFinishedLoadingEvent.ts +19 -0
- package/src/web-components/visualization/gs-aggregate.tsx +3 -0
- package/src/web-components/visualization/gs-genome-data-viewer.tsx +2 -0
- package/src/web-components/visualization/gs-mutation-comparison.tsx +3 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +3 -0
- package/src/web-components/visualization/gs-mutations.tsx +2 -0
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +3 -0
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +3 -0
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +3 -0
- package/src/web-components/visualization/gs-sequences-by-location.tsx +3 -0
- package/src/web-components/visualization/gs-statistics.tsx +3 -0
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +3 -0
- package/standalone-bundle/assets/mutationOverTimeWorker-DAf2_NiP.js.map +1 -0
- package/standalone-bundle/dashboard-components.js +6933 -6904
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/dist/assets/mutationOverTimeWorker-ChQTFL68.js.map +0 -1
- package/standalone-bundle/assets/mutationOverTimeWorker-jChgWnwp.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -1951,6 +1951,15 @@
|
|
|
1951
1951
|
"attribute": "maxNumberOfBars"
|
|
1952
1952
|
}
|
|
1953
1953
|
],
|
|
1954
|
+
"events": [
|
|
1955
|
+
{
|
|
1956
|
+
"type": {
|
|
1957
|
+
"text": "CustomEvent<undefined>"
|
|
1958
|
+
},
|
|
1959
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
1960
|
+
"name": "gs-component-finished-loading"
|
|
1961
|
+
}
|
|
1962
|
+
],
|
|
1954
1963
|
"attributes": [
|
|
1955
1964
|
{
|
|
1956
1965
|
"name": "fields",
|
|
@@ -2147,6 +2156,15 @@
|
|
|
2147
2156
|
"attribute": "width"
|
|
2148
2157
|
}
|
|
2149
2158
|
],
|
|
2159
|
+
"events": [
|
|
2160
|
+
{
|
|
2161
|
+
"type": {
|
|
2162
|
+
"text": "CustomEvent<undefined>"
|
|
2163
|
+
},
|
|
2164
|
+
"description": "Fired when the component has finished loading the required data.",
|
|
2165
|
+
"name": "gs-component-finished-loading"
|
|
2166
|
+
}
|
|
2167
|
+
],
|
|
2150
2168
|
"attributes": [
|
|
2151
2169
|
{
|
|
2152
2170
|
"name": "gff3Source",
|
|
@@ -2345,6 +2363,15 @@
|
|
|
2345
2363
|
"attribute": "pageSize"
|
|
2346
2364
|
}
|
|
2347
2365
|
],
|
|
2366
|
+
"events": [
|
|
2367
|
+
{
|
|
2368
|
+
"type": {
|
|
2369
|
+
"text": "CustomEvent<undefined>"
|
|
2370
|
+
},
|
|
2371
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
2372
|
+
"name": "gs-component-finished-loading"
|
|
2373
|
+
}
|
|
2374
|
+
],
|
|
2348
2375
|
"attributes": [
|
|
2349
2376
|
{
|
|
2350
2377
|
"name": "lapisFilters",
|
|
@@ -2664,6 +2691,15 @@
|
|
|
2664
2691
|
"attribute": "pageSizes"
|
|
2665
2692
|
}
|
|
2666
2693
|
],
|
|
2694
|
+
"events": [
|
|
2695
|
+
{
|
|
2696
|
+
"type": {
|
|
2697
|
+
"text": "CustomEvent<undefined>"
|
|
2698
|
+
},
|
|
2699
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
2700
|
+
"name": "gs-component-finished-loading"
|
|
2701
|
+
}
|
|
2702
|
+
],
|
|
2667
2703
|
"attributes": [
|
|
2668
2704
|
{
|
|
2669
2705
|
"name": "lapisFilter",
|
|
@@ -2967,6 +3003,15 @@
|
|
|
2967
3003
|
"attribute": "pageSize"
|
|
2968
3004
|
}
|
|
2969
3005
|
],
|
|
3006
|
+
"events": [
|
|
3007
|
+
{
|
|
3008
|
+
"type": {
|
|
3009
|
+
"text": "CustomEvent<undefined>"
|
|
3010
|
+
},
|
|
3011
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
3012
|
+
"name": "gs-component-finished-loading"
|
|
3013
|
+
}
|
|
3014
|
+
],
|
|
2970
3015
|
"attributes": [
|
|
2971
3016
|
{
|
|
2972
3017
|
"name": "lapisFilter",
|
|
@@ -3269,6 +3314,15 @@
|
|
|
3269
3314
|
"attribute": "pageSize"
|
|
3270
3315
|
}
|
|
3271
3316
|
],
|
|
3317
|
+
"events": [
|
|
3318
|
+
{
|
|
3319
|
+
"type": {
|
|
3320
|
+
"text": "CustomEvent<undefined>"
|
|
3321
|
+
},
|
|
3322
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
3323
|
+
"name": "gs-component-finished-loading"
|
|
3324
|
+
}
|
|
3325
|
+
],
|
|
3272
3326
|
"attributes": [
|
|
3273
3327
|
{
|
|
3274
3328
|
"name": "lapisFilters",
|
|
@@ -3620,6 +3674,15 @@
|
|
|
3620
3674
|
"attribute": "yAxisMaxLogarithmic"
|
|
3621
3675
|
}
|
|
3622
3676
|
],
|
|
3677
|
+
"events": [
|
|
3678
|
+
{
|
|
3679
|
+
"type": {
|
|
3680
|
+
"text": "CustomEvent<undefined>"
|
|
3681
|
+
},
|
|
3682
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
3683
|
+
"name": "gs-component-finished-loading"
|
|
3684
|
+
}
|
|
3685
|
+
],
|
|
3623
3686
|
"attributes": [
|
|
3624
3687
|
{
|
|
3625
3688
|
"name": "numeratorFilters",
|
|
@@ -3913,6 +3976,15 @@
|
|
|
3913
3976
|
"attribute": "yAxisMaxLogarithmic"
|
|
3914
3977
|
}
|
|
3915
3978
|
],
|
|
3979
|
+
"events": [
|
|
3980
|
+
{
|
|
3981
|
+
"type": {
|
|
3982
|
+
"text": "CustomEvent<undefined>"
|
|
3983
|
+
},
|
|
3984
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
3985
|
+
"name": "gs-component-finished-loading"
|
|
3986
|
+
}
|
|
3987
|
+
],
|
|
3916
3988
|
"attributes": [
|
|
3917
3989
|
{
|
|
3918
3990
|
"name": "numeratorFilter",
|
|
@@ -4247,6 +4319,15 @@
|
|
|
4247
4319
|
"attribute": "pageSize"
|
|
4248
4320
|
}
|
|
4249
4321
|
],
|
|
4322
|
+
"events": [
|
|
4323
|
+
{
|
|
4324
|
+
"type": {
|
|
4325
|
+
"text": "CustomEvent<undefined>"
|
|
4326
|
+
},
|
|
4327
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
4328
|
+
"name": "gs-component-finished-loading"
|
|
4329
|
+
}
|
|
4330
|
+
],
|
|
4250
4331
|
"attributes": [
|
|
4251
4332
|
{
|
|
4252
4333
|
"name": "lapisFilter",
|
|
@@ -4465,6 +4546,15 @@
|
|
|
4465
4546
|
"attribute": "height"
|
|
4466
4547
|
}
|
|
4467
4548
|
],
|
|
4549
|
+
"events": [
|
|
4550
|
+
{
|
|
4551
|
+
"type": {
|
|
4552
|
+
"text": "CustomEvent<undefined>"
|
|
4553
|
+
},
|
|
4554
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
4555
|
+
"name": "gs-component-finished-loading"
|
|
4556
|
+
}
|
|
4557
|
+
],
|
|
4468
4558
|
"attributes": [
|
|
4469
4559
|
{
|
|
4470
4560
|
"name": "numeratorFilter",
|
|
@@ -4745,6 +4835,15 @@
|
|
|
4745
4835
|
"attribute": "pageSizes"
|
|
4746
4836
|
}
|
|
4747
4837
|
],
|
|
4838
|
+
"events": [
|
|
4839
|
+
{
|
|
4840
|
+
"type": {
|
|
4841
|
+
"text": "CustomEvent<undefined>"
|
|
4842
|
+
},
|
|
4843
|
+
"description": "Fired when the component has finished loading the required data from LAPIS.",
|
|
4844
|
+
"name": "gs-component-finished-loading"
|
|
4845
|
+
}
|
|
4846
|
+
],
|
|
4748
4847
|
"attributes": [
|
|
4749
4848
|
{
|
|
4750
4849
|
"name": "lapisFilter",
|
package/dist/{LineageFilterChangedEvent-GgkxoF3X.js → LineageFilterChangedEvent-Cqa8Frcf.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
const gsEventNames = {
|
|
3
3
|
error: "gs-error",
|
|
4
|
+
componentFinishedLoading: "gs-component-finished-loading",
|
|
4
5
|
dateRangeFilterChanged: "gs-date-range-filter-changed",
|
|
5
6
|
dateRangeOptionChanged: "gs-date-range-option-changed",
|
|
6
7
|
mutationFilterChanged: "gs-mutation-filter-changed",
|
|
@@ -160,4 +161,4 @@ export {
|
|
|
160
161
|
temporalGranularitySchema as t,
|
|
161
162
|
views as v
|
|
162
163
|
};
|
|
163
|
-
//# sourceMappingURL=LineageFilterChangedEvent-
|
|
164
|
+
//# sourceMappingURL=LineageFilterChangedEvent-Cqa8Frcf.js.map
|
package/dist/{LineageFilterChangedEvent-GgkxoF3X.js.map → LineageFilterChangedEvent-Cqa8Frcf.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineageFilterChangedEvent-GgkxoF3X.js","sources":["../src/utils/gsEventNames.ts","../src/types.ts","../src/preact/dateRangeFilter/dateConversion.ts","../src/preact/dateRangeFilter/dateRangeOption.ts","../src/preact/locationFilter/LocationChangedEvent.ts","../src/preact/textFilter/TextFilterChangedEvent.ts","../src/preact/lineageFilter/LineageFilterChangedEvent.ts"],"sourcesContent":["export const gsEventNames = {\n error: 'gs-error',\n dateRangeFilterChanged: 'gs-date-range-filter-changed',\n dateRangeOptionChanged: 'gs-date-range-option-changed',\n mutationFilterChanged: 'gs-mutation-filter-changed',\n lineageFilterChanged: 'gs-lineage-filter-changed',\n locationChanged: 'gs-location-changed',\n textFilterChanged: 'gs-text-filter-changed',\n numberRangeFilterChanged: 'gs-number-range-filter-changed',\n numberRangeValueChanged: 'gs-number-range-value-changed',\n} as const;\n","import z from 'zod';\n\nimport {\n type Deletion,\n type DeletionClass,\n type Insertion,\n type InsertionClass,\n type Substitution,\n type SubstitutionClass,\n} from './utils/mutations';\n\nexport const mutationsFilterSchema = z.object({\n nucleotideMutations: z.array(z.string()),\n aminoAcidMutations: z.array(z.string()),\n nucleotideInsertions: z.array(z.string()),\n aminoAcidInsertions: z.array(z.string()),\n});\nexport type MutationsFilter = z.infer<typeof mutationsFilterSchema>;\n\nexport const lapisFilterSchema = z\n .record(z.union([z.string(), z.array(z.string()), z.number(), z.null(), z.boolean(), z.undefined()]))\n .and(mutationsFilterSchema.partial());\nexport type LapisFilter = z.infer<typeof lapisFilterSchema>;\n\nexport const namedLapisFilterSchema = z.object({\n lapisFilter: lapisFilterSchema,\n displayName: z.string(),\n});\nexport type NamedLapisFilter = z.infer<typeof namedLapisFilterSchema>;\n\nexport const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined()]));\nexport type LapisLocationFilter = z.infer<typeof lapisLocationFilterSchema>;\n\nexport const temporalGranularitySchema = z.union([\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n]);\nexport type TemporalGranularity = z.infer<typeof temporalGranularitySchema>;\n\nexport const sequenceTypeSchema = z.union([z.literal('nucleotide'), z.literal('amino acid')]);\nexport type SequenceType = z.infer<typeof sequenceTypeSchema>;\n\nexport type SubstitutionOrDeletion = 'substitution' | 'deletion';\n\nexport type MutationType = SubstitutionOrDeletion | 'insertion';\n\nexport type SubstitutionEntry<T extends Substitution = SubstitutionClass> = {\n type: 'substitution';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type DeletionEntry<T extends Deletion = DeletionClass> = {\n type: 'deletion';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type InsertionEntry<T extends Insertion = InsertionClass> = { type: 'insertion'; mutation: T; count: number };\n\nexport type SubstitutionOrDeletionEntry<\n S extends Substitution = SubstitutionClass,\n D extends Deletion = DeletionClass,\n> = SubstitutionEntry<S> | DeletionEntry<D>;\n\nexport type MutationEntry = SubstitutionEntry | DeletionEntry | InsertionEntry;\n\nexport const views = {\n table: 'table',\n venn: 'venn',\n grid: 'grid',\n insertions: 'insertions',\n bar: 'bar',\n line: 'line',\n bubble: 'bubble',\n map: 'map',\n} as const;\n","export const toYYYYMMDD = (date: Date) => {\n const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };\n return date.toLocaleDateString('en-CA', options);\n};\n","import z from 'zod';\n\nimport { toYYYYMMDD } from './dateConversion';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\n/**\n * A date range option that can be used in the `gs-date-range-filter` component.\n */\nexport const dateRangeOptionSchema = z.object({\n /** The label of the date range option that will be shown to the user */\n label: z.string(),\n /**\n * The start date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the `earliestDate` property.\n */\n dateFrom: z.string().date().optional(),\n /**\n * The end date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the current date.\n */\n dateTo: z.string().date().optional(),\n});\n\nexport type DateRangeOption = z.infer<typeof dateRangeOptionSchema>;\n\nexport const dateRangeValueSchema = z\n .union([\n z.string(),\n z.object({\n dateFrom: z.string().date().optional(),\n dateTo: z.string().date().optional(),\n }),\n ])\n .nullable();\n\nexport type DateRangeValue = z.infer<typeof dateRangeValueSchema>;\n\nexport class DateRangeOptionChangedEvent extends CustomEvent<DateRangeValue> {\n constructor(detail: DateRangeValue) {\n super(gsEventNames.dateRangeOptionChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n\nconst today = new Date();\n\nconst twoWeeksAgo = new Date();\ntwoWeeksAgo.setDate(today.getDate() - 14);\n\nconst lastMonth = new Date(today);\nlastMonth.setMonth(today.getMonth() - 1);\n\nconst last2Months = new Date(today);\nlast2Months.setMonth(today.getMonth() - 2);\n\nconst last3Months = new Date(today);\nlast3Months.setMonth(today.getMonth() - 3);\n\nconst last6Months = new Date(today);\nlast6Months.setMonth(today.getMonth() - 6);\n\nconst lastYear = new Date(today);\nlastYear.setFullYear(today.getFullYear() - 1);\n\n/**\n * Presets for the `gs-date-range-filter` component that can be used as `dateRangeOptions`.\n */\nexport const dateRangeOptionPresets = {\n last2Weeks: {\n label: 'Last 2 weeks',\n dateFrom: toYYYYMMDD(twoWeeksAgo),\n },\n lastMonth: {\n label: 'Last month',\n dateFrom: toYYYYMMDD(lastMonth),\n },\n last2Months: {\n label: 'Last 2 months',\n dateFrom: toYYYYMMDD(last2Months),\n },\n last3Months: {\n label: 'Last 3 months',\n dateFrom: toYYYYMMDD(last3Months),\n },\n last6Months: {\n label: 'Last 6 months',\n dateFrom: toYYYYMMDD(last6Months),\n },\n lastYear: {\n label: 'Last year',\n dateFrom: toYYYYMMDD(lastYear),\n },\n allTimes: {\n label: 'All times',\n },\n} satisfies Record<string, DateRangeOption>;\n","import { type LapisLocationFilter } from '../../types';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\nexport class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {\n constructor(detail: LapisLocationFilter) {\n super(gsEventNames.locationChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisTextFilter = Record<string, string | undefined>;\n\nexport class TextFilterChangedEvent extends CustomEvent<LapisTextFilter> {\n constructor(detail: LapisTextFilter) {\n super(gsEventNames.textFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisLineageFilter = Record<string, string | undefined>;\n\nexport class LineageFilterChangedEvent extends CustomEvent<LapisLineageFilter> {\n constructor(detail: LapisLineageFilter) {\n super(gsEventNames.lineageFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n"],"names":[],"mappings":";AAAO,MAAM,eAAe;AAAA,EACxB,OAAO;A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M,YAAY,IAAI,CAAC;AAKrC,MAAM,yBAAyB;AAAA,EAClC,YAAY;AAAA,IACR,OAAO;AAAA,IACP,UAAU,WAAW,WAAW;AAAA,EACpC;AAAA,EACA,WAAW;AAAA,IACP,OAAO;AAAA,IACP,UAAU,WAAW,SAAS;AAAA,EAClC;AAAA,EACA,aAAa;AAAA,IACT,OAAO;AAAA,IACP,UAAU,WAAW,WAAW;AAAA,EACpC;AAAA,EACA,aAAa;AAAA,IACT,OAAO;AAAA,IACP,UAAU,WAAW,WAAW;AAAA,EACpC;AAAA,EACA,aAAa;AAAA,IACT,OAAO;AAAA,IACP,UAAU,WAAW,WAAW;AAAA,EACpC;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,IACP,UAAU,WAAW,QAAQ;AAAA,EACjC;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,EAAA;AAEf;AC/FO,MAAM,6BAA6B,YAAiC;AAAA,EACvE,YAAY,QAA6B;AACrC,UAAM,aAAa,iBAAiB;AAAA,MAChC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;ACPO,MAAM,+BAA+B,YAA6B;AAAA,EACrE,YAAY,QAAyB;AACjC,UAAM,aAAa,mBAAmB;AAAA,MAClC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;ACRO,MAAM,kCAAkC,YAAgC;AAAA,EAC3E,YAAY,QAA4B;AACpC,UAAM,aAAa,sBAAsB;AAAA,MACrC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;"}
|
|
1
|
+
{"version":3,"file":"LineageFilterChangedEvent-Cqa8Frcf.js","sources":["../src/utils/gsEventNames.ts","../src/types.ts","../src/preact/dateRangeFilter/dateConversion.ts","../src/preact/dateRangeFilter/dateRangeOption.ts","../src/preact/locationFilter/LocationChangedEvent.ts","../src/preact/textFilter/TextFilterChangedEvent.ts","../src/preact/lineageFilter/LineageFilterChangedEvent.ts"],"sourcesContent":["export const gsEventNames = {\n error: 'gs-error',\n componentFinishedLoading: 'gs-component-finished-loading',\n dateRangeFilterChanged: 'gs-date-range-filter-changed',\n dateRangeOptionChanged: 'gs-date-range-option-changed',\n mutationFilterChanged: 'gs-mutation-filter-changed',\n lineageFilterChanged: 'gs-lineage-filter-changed',\n locationChanged: 'gs-location-changed',\n textFilterChanged: 'gs-text-filter-changed',\n numberRangeFilterChanged: 'gs-number-range-filter-changed',\n numberRangeValueChanged: 'gs-number-range-value-changed',\n} as const;\n","import z from 'zod';\n\nimport {\n type Deletion,\n type DeletionClass,\n type Insertion,\n type InsertionClass,\n type Substitution,\n type SubstitutionClass,\n} from './utils/mutations';\n\nexport const mutationsFilterSchema = z.object({\n nucleotideMutations: z.array(z.string()),\n aminoAcidMutations: z.array(z.string()),\n nucleotideInsertions: z.array(z.string()),\n aminoAcidInsertions: z.array(z.string()),\n});\nexport type MutationsFilter = z.infer<typeof mutationsFilterSchema>;\n\nexport const lapisFilterSchema = z\n .record(z.union([z.string(), z.array(z.string()), z.number(), z.null(), z.boolean(), z.undefined()]))\n .and(mutationsFilterSchema.partial());\nexport type LapisFilter = z.infer<typeof lapisFilterSchema>;\n\nexport const namedLapisFilterSchema = z.object({\n lapisFilter: lapisFilterSchema,\n displayName: z.string(),\n});\nexport type NamedLapisFilter = z.infer<typeof namedLapisFilterSchema>;\n\nexport const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined()]));\nexport type LapisLocationFilter = z.infer<typeof lapisLocationFilterSchema>;\n\nexport const temporalGranularitySchema = z.union([\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n]);\nexport type TemporalGranularity = z.infer<typeof temporalGranularitySchema>;\n\nexport const sequenceTypeSchema = z.union([z.literal('nucleotide'), z.literal('amino acid')]);\nexport type SequenceType = z.infer<typeof sequenceTypeSchema>;\n\nexport type SubstitutionOrDeletion = 'substitution' | 'deletion';\n\nexport type MutationType = SubstitutionOrDeletion | 'insertion';\n\nexport type SubstitutionEntry<T extends Substitution = SubstitutionClass> = {\n type: 'substitution';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type DeletionEntry<T extends Deletion = DeletionClass> = {\n type: 'deletion';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type InsertionEntry<T extends Insertion = InsertionClass> = { type: 'insertion'; mutation: T; count: number };\n\nexport type SubstitutionOrDeletionEntry<\n S extends Substitution = SubstitutionClass,\n D extends Deletion = DeletionClass,\n> = SubstitutionEntry<S> | DeletionEntry<D>;\n\nexport type MutationEntry = SubstitutionEntry | DeletionEntry | InsertionEntry;\n\nexport const views = {\n table: 'table',\n venn: 'venn',\n grid: 'grid',\n insertions: 'insertions',\n bar: 'bar',\n line: 'line',\n bubble: 'bubble',\n map: 'map',\n} as const;\n","export const toYYYYMMDD = (date: Date) => {\n const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };\n return date.toLocaleDateString('en-CA', options);\n};\n","import z from 'zod';\n\nimport { toYYYYMMDD } from './dateConversion';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\n/**\n * A date range option that can be used in the `gs-date-range-filter` component.\n */\nexport const dateRangeOptionSchema = z.object({\n /** The label of the date range option that will be shown to the user */\n label: z.string(),\n /**\n * The start date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the `earliestDate` property.\n */\n dateFrom: z.string().date().optional(),\n /**\n * The end date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the current date.\n */\n dateTo: z.string().date().optional(),\n});\n\nexport type DateRangeOption = z.infer<typeof dateRangeOptionSchema>;\n\nexport const dateRangeValueSchema = z\n .union([\n z.string(),\n z.object({\n dateFrom: z.string().date().optional(),\n dateTo: z.string().date().optional(),\n }),\n ])\n .nullable();\n\nexport type DateRangeValue = z.infer<typeof dateRangeValueSchema>;\n\nexport class DateRangeOptionChangedEvent extends CustomEvent<DateRangeValue> {\n constructor(detail: DateRangeValue) {\n super(gsEventNames.dateRangeOptionChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n\nconst today = new Date();\n\nconst twoWeeksAgo = new Date();\ntwoWeeksAgo.setDate(today.getDate() - 14);\n\nconst lastMonth = new Date(today);\nlastMonth.setMonth(today.getMonth() - 1);\n\nconst last2Months = new Date(today);\nlast2Months.setMonth(today.getMonth() - 2);\n\nconst last3Months = new Date(today);\nlast3Months.setMonth(today.getMonth() - 3);\n\nconst last6Months = new Date(today);\nlast6Months.setMonth(today.getMonth() - 6);\n\nconst lastYear = new Date(today);\nlastYear.setFullYear(today.getFullYear() - 1);\n\n/**\n * Presets for the `gs-date-range-filter` component that can be used as `dateRangeOptions`.\n */\nexport const dateRangeOptionPresets = {\n last2Weeks: {\n label: 'Last 2 weeks',\n dateFrom: toYYYYMMDD(twoWeeksAgo),\n },\n lastMonth: {\n label: 'Last month',\n dateFrom: toYYYYMMDD(lastMonth),\n },\n last2Months: {\n label: 'Last 2 months',\n dateFrom: toYYYYMMDD(last2Months),\n },\n last3Months: {\n label: 'Last 3 months',\n dateFrom: toYYYYMMDD(last3Months),\n },\n last6Months: {\n label: 'Last 6 months',\n dateFrom: toYYYYMMDD(last6Months),\n },\n lastYear: {\n label: 'Last year',\n dateFrom: toYYYYMMDD(lastYear),\n },\n allTimes: {\n label: 'All times',\n },\n} satisfies Record<string, DateRangeOption>;\n","import { type LapisLocationFilter } from '../../types';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\nexport class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {\n constructor(detail: LapisLocationFilter) {\n super(gsEventNames.locationChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisTextFilter = Record<string, string | undefined>;\n\nexport class TextFilterChangedEvent extends CustomEvent<LapisTextFilter> {\n constructor(detail: LapisTextFilter) {\n super(gsEventNames.textFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisLineageFilter = Record<string, string | undefined>;\n\nexport class LineageFilterChangedEvent extends CustomEvent<LapisLineageFilter> {\n constructor(detail: LapisLineageFilter) {\n super(gsEventNames.lineageFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n"],"names":[],"mappings":";AAAO,MAAM,eAAe;AAAA,EACxB,OAAO;AAAA,EACP,0BAA0B;AAAA,EAC1B,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,yBAAyB;AAC7B;ACAa,MAAA,wBAAwB,EAAE,OAAO;AAAA,EAC1C,qBAAqB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACvC,oBAAoB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACtC,sBAAsB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACxC,qBAAqB,EAAE,MAAM,EAAE,OAAQ,CAAA;AAC3C,CAAC;AAGM,MAAM,oBAAoB,EAC5B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAQ,CAAA,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,EAAE,QAAW,GAAA,EAAE,UAAW,CAAA,CAAC,CAAC,EACnG,IAAI,sBAAsB,QAAS,CAAA;AAG3B,MAAA,yBAAyB,EAAE,OAAO;AAAA,EAC3C,aAAa;AAAA,EACb,aAAa,EAAE,OAAO;AAC1B,CAAC;AAGM,MAAM,4BAA4B,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAU,GAAA,EAAE,UAAW,CAAA,CAAC,CAAC;AAGzE,MAAA,4BAA4B,EAAE,MAAM;AAAA,EAC7C,EAAE,QAAQ,KAAK;AAAA,EACf,EAAE,QAAQ,MAAM;AAAA,EAChB,EAAE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