@genspectrum/dashboard-components 0.10.1 → 0.10.3
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/README.md +19 -19
- package/custom-elements.json +72 -56
- package/dist/assets/{mutationOverTimeWorker-CvZg52rf.js.map → mutationOverTimeWorker-CNg_ztNp.js.map} +1 -1
- package/dist/components.d.ts +19 -28
- package/dist/components.js +343 -96
- package/dist/components.js.map +1 -1
- package/dist/{utilEntrypoint-g4DsyhU7.js → dateRangeOption-DjtcAEWq.js} +46 -2
- package/dist/dateRangeOption-DjtcAEWq.js.map +1 -0
- package/dist/style.css +11 -5
- package/dist/util.d.ts +112 -21
- package/dist/util.js +3 -2
- package/package.json +2 -2
- package/src/preact/aggregatedData/aggregate.stories.tsx +14 -0
- package/src/preact/aggregatedData/aggregate.tsx +17 -15
- package/src/preact/components/color-scale-selector.tsx +7 -3
- package/src/preact/components/error-boundary.stories.tsx +24 -3
- package/src/preact/components/error-boundary.tsx +38 -5
- package/src/preact/components/error-display.tsx +62 -6
- package/src/preact/components/tabs.tsx +2 -2
- package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +8 -2
- package/src/preact/dateRangeSelector/computeInitialValues.ts +6 -0
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +16 -2
- package/src/preact/dateRangeSelector/date-range-selector.tsx +20 -15
- package/src/preact/dateRangeSelector/dateRangeOption.ts +10 -5
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +18 -4
- package/src/preact/lineageFilter/lineage-filter.tsx +15 -10
- package/src/preact/locationFilter/location-filter.stories.tsx +14 -0
- package/src/preact/locationFilter/location-filter.tsx +15 -10
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +17 -18
- package/src/preact/mutationComparison/mutation-comparison.tsx +18 -12
- package/src/preact/mutationFilter/mutation-filter.tsx +26 -13
- package/src/preact/mutations/mutations.tsx +16 -12
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +1326 -9341
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +615 -4920
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +2203 -17624
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +16 -8
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +14 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +19 -17
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +14 -0
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +22 -14
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +28 -19
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +14 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +18 -15
- package/src/preact/shared/charts/confideceInterval.ts +10 -8
- package/src/preact/shared/charts/getYAxisMax.ts +10 -5
- package/src/preact/shared/stories/expectInvalidAttributesErrorMessage.ts +13 -0
- package/src/preact/statistic/statistics.tsx +10 -8
- package/src/preact/textInput/text-input.stories.tsx +14 -0
- package/src/preact/textInput/text-input.tsx +16 -11
- package/src/preact/webWorkers/useWebWorker.ts +8 -4
- package/src/query/queryAggregateData.ts +2 -1
- package/src/query/queryMutationsOverTime.spec.ts +12 -27
- package/src/query/queryMutationsOverTime.ts +2 -6
- package/src/types.ts +31 -7
- package/src/utilEntrypoint.ts +15 -0
- package/src/utils/map2d.spec.ts +10 -10
- package/src/utils/map2d.ts +10 -10
- package/src/web-components/app.stories.ts +17 -2
- package/src/web-components/app.ts +17 -5
- package/src/web-components/input/gs-date-range-selector.stories.ts +2 -2
- package/src/web-components/input/gs-date-range-selector.tsx +3 -3
- package/src/web-components/input/gs-lineage-filter.tsx +1 -1
- package/src/web-components/input/gs-location-filter.tsx +2 -2
- package/src/web-components/input/gs-mutation-filter.stories.ts +2 -0
- package/src/web-components/input/gs-text-input.tsx +2 -2
- package/src/web-components/introduction.mdx +4 -4
- package/src/web-components/visualization/data_visualization_statistical_analysis.mdx +3 -3
- package/src/web-components/visualization/gs-aggregate.tsx +2 -2
- package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -3
- package/src/web-components/visualization/gs-mutations.tsx +1 -3
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -3
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +3 -6
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -5
- package/standalone-bundle/assets/{mutationOverTimeWorker-CypX_PYM.js.map → mutationOverTimeWorker-cIyshfj_.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +8800 -8577
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/dist/utilEntrypoint-g4DsyhU7.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type FunctionComponent } from 'preact';
|
|
2
2
|
import { type Dispatch, type StateUpdater, useContext, useState } from 'preact/hooks';
|
|
3
|
+
import z from 'zod';
|
|
3
4
|
|
|
4
5
|
import { getInsertionsTableData } from './getInsertionsTableData';
|
|
5
6
|
import { getMutationsTableData } from './getMutationsTableData';
|
|
@@ -9,9 +10,10 @@ import MutationsTable from './mutations-table';
|
|
|
9
10
|
import { filterMutationsData, queryMutationsData } from './queryMutations';
|
|
10
11
|
import {
|
|
11
12
|
type InsertionEntry,
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
lapisFilterSchema,
|
|
14
|
+
sequenceTypeSchema,
|
|
14
15
|
type SubstitutionOrDeletionEntry,
|
|
16
|
+
views,
|
|
15
17
|
} from '../../types';
|
|
16
18
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
17
19
|
import { CsvDownloadButton } from '../components/csv-download-button';
|
|
@@ -28,23 +30,25 @@ import { type DisplayedSegment, SegmentSelector, useDisplayedSegments } from '..
|
|
|
28
30
|
import Tabs from '../components/tabs';
|
|
29
31
|
import { useQuery } from '../useQuery';
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const viewSchema = z.union([z.literal(views.table), z.literal(views.grid), z.literal(views.insertions)]);
|
|
34
|
+
export type View = z.infer<typeof viewSchema>;
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
36
|
+
const mutationsPropsSchema = z.object({
|
|
37
|
+
lapisFilter: lapisFilterSchema,
|
|
38
|
+
sequenceType: sequenceTypeSchema,
|
|
39
|
+
views: viewSchema.array(),
|
|
40
|
+
pageSize: z.union([z.boolean(), z.number()]),
|
|
41
|
+
width: z.string(),
|
|
42
|
+
height: z.string(),
|
|
43
|
+
});
|
|
44
|
+
export type MutationsProps = z.infer<typeof mutationsPropsSchema>;
|
|
41
45
|
|
|
42
46
|
export const Mutations: FunctionComponent<MutationsProps> = (componentProps) => {
|
|
43
47
|
const { width, height } = componentProps;
|
|
44
48
|
const size = { height, width };
|
|
45
49
|
|
|
46
50
|
return (
|
|
47
|
-
<ErrorBoundary size={size}>
|
|
51
|
+
<ErrorBoundary size={size} componentProps={componentProps} schema={mutationsPropsSchema}>
|
|
48
52
|
<ResizeContainer size={size}>
|
|
49
53
|
<MutationsInner {...componentProps} />
|
|
50
54
|
</ResizeContainer>
|