@genspectrum/dashboard-components 0.13.4 → 0.13.5
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 +19 -0
- package/dist/components.d.ts +23 -17
- package/dist/components.js +22 -9
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +17 -17
- package/package.json +1 -1
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +11 -5
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +7 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +9 -0
- package/standalone-bundle/dashboard-components.js +3478 -3467
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/dist/util.d.ts
CHANGED
|
@@ -870,7 +870,7 @@ declare global {
|
|
|
870
870
|
|
|
871
871
|
declare global {
|
|
872
872
|
interface HTMLElementTagNameMap {
|
|
873
|
-
'gs-
|
|
873
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
|
|
@@ -878,7 +878,7 @@ declare global {
|
|
|
878
878
|
declare global {
|
|
879
879
|
namespace JSX {
|
|
880
880
|
interface IntrinsicElements {
|
|
881
|
-
'gs-
|
|
881
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
}
|
|
@@ -886,7 +886,7 @@ declare global {
|
|
|
886
886
|
|
|
887
887
|
declare global {
|
|
888
888
|
interface HTMLElementTagNameMap {
|
|
889
|
-
'gs-
|
|
889
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
|
|
@@ -894,7 +894,7 @@ declare global {
|
|
|
894
894
|
declare global {
|
|
895
895
|
namespace JSX {
|
|
896
896
|
interface IntrinsicElements {
|
|
897
|
-
'gs-
|
|
897
|
+
'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
900
|
}
|
|
@@ -902,7 +902,7 @@ declare global {
|
|
|
902
902
|
|
|
903
903
|
declare global {
|
|
904
904
|
interface HTMLElementTagNameMap {
|
|
905
|
-
'gs-
|
|
905
|
+
'gs-aggregate': AggregateComponent;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
908
|
|
|
@@ -910,7 +910,7 @@ declare global {
|
|
|
910
910
|
declare global {
|
|
911
911
|
namespace JSX {
|
|
912
912
|
interface IntrinsicElements {
|
|
913
|
-
'gs-
|
|
913
|
+
'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
}
|
|
@@ -918,7 +918,7 @@ declare global {
|
|
|
918
918
|
|
|
919
919
|
declare global {
|
|
920
920
|
interface HTMLElementTagNameMap {
|
|
921
|
-
'gs-
|
|
921
|
+
'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
924
|
|
|
@@ -926,7 +926,7 @@ declare global {
|
|
|
926
926
|
declare global {
|
|
927
927
|
namespace JSX {
|
|
928
928
|
interface IntrinsicElements {
|
|
929
|
-
'gs-
|
|
929
|
+
'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}
|
|
@@ -1037,10 +1037,10 @@ declare global {
|
|
|
1037
1037
|
|
|
1038
1038
|
declare global {
|
|
1039
1039
|
interface HTMLElementTagNameMap {
|
|
1040
|
-
'gs-
|
|
1040
|
+
'gs-location-filter': LocationFilterComponent;
|
|
1041
1041
|
}
|
|
1042
1042
|
interface HTMLElementEventMap {
|
|
1043
|
-
'gs-
|
|
1043
|
+
'gs-location-changed': LocationChangedEvent;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
@@ -1048,7 +1048,7 @@ declare global {
|
|
|
1048
1048
|
declare global {
|
|
1049
1049
|
namespace JSX {
|
|
1050
1050
|
interface IntrinsicElements {
|
|
1051
|
-
'gs-
|
|
1051
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
@@ -1056,10 +1056,10 @@ declare global {
|
|
|
1056
1056
|
|
|
1057
1057
|
declare global {
|
|
1058
1058
|
interface HTMLElementTagNameMap {
|
|
1059
|
-
'gs-
|
|
1059
|
+
'gs-mutation-filter': MutationFilterComponent;
|
|
1060
1060
|
}
|
|
1061
1061
|
interface HTMLElementEventMap {
|
|
1062
|
-
'gs-
|
|
1062
|
+
'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
@@ -1067,7 +1067,7 @@ declare global {
|
|
|
1067
1067
|
declare global {
|
|
1068
1068
|
namespace JSX {
|
|
1069
1069
|
interface IntrinsicElements {
|
|
1070
|
-
'gs-
|
|
1070
|
+
'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
@@ -1075,10 +1075,10 @@ declare global {
|
|
|
1075
1075
|
|
|
1076
1076
|
declare global {
|
|
1077
1077
|
interface HTMLElementTagNameMap {
|
|
1078
|
-
'gs-
|
|
1078
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1079
1079
|
}
|
|
1080
1080
|
interface HTMLElementEventMap {
|
|
1081
|
-
'gs-
|
|
1081
|
+
'gs-lineage-filter-changed': LineageFilterChangedEvent;
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
@@ -1086,7 +1086,7 @@ declare global {
|
|
|
1086
1086
|
declare global {
|
|
1087
1087
|
namespace JSX {
|
|
1088
1088
|
interface IntrinsicElements {
|
|
1089
|
-
'gs-
|
|
1089
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
package/package.json
CHANGED
|
@@ -12,14 +12,20 @@ import { formatProportion } from '../shared/table/formatProportion';
|
|
|
12
12
|
export interface MutationsOverTimeGridProps {
|
|
13
13
|
data: MutationOverTimeDataMap;
|
|
14
14
|
colorScale: ColorScale;
|
|
15
|
+
maxNumberOfGridRows?: number;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const MAX_NUMBER_OF_GRID_ROWS = 100;
|
|
18
19
|
const MUTATION_CELL_WIDTH_REM = 8;
|
|
19
20
|
|
|
20
|
-
const MutationsOverTimeGrid: FunctionComponent<MutationsOverTimeGridProps> = ({
|
|
21
|
+
const MutationsOverTimeGrid: FunctionComponent<MutationsOverTimeGridProps> = ({
|
|
22
|
+
data,
|
|
23
|
+
colorScale,
|
|
24
|
+
maxNumberOfGridRows,
|
|
25
|
+
}) => {
|
|
26
|
+
const currentMaxNumberOfGridRows = maxNumberOfGridRows ?? MAX_NUMBER_OF_GRID_ROWS;
|
|
21
27
|
const allMutations = data.getFirstAxisKeys();
|
|
22
|
-
const shownMutations = allMutations.slice(0,
|
|
28
|
+
const shownMutations = allMutations.slice(0, currentMaxNumberOfGridRows);
|
|
23
29
|
|
|
24
30
|
const dates = data.getSecondAxisKeys();
|
|
25
31
|
|
|
@@ -27,10 +33,10 @@ const MutationsOverTimeGrid: FunctionComponent<MutationsOverTimeGridProps> = ({
|
|
|
27
33
|
|
|
28
34
|
return (
|
|
29
35
|
<>
|
|
30
|
-
{allMutations.length >
|
|
36
|
+
{allMutations.length > currentMaxNumberOfGridRows && (
|
|
31
37
|
<div className='pl-2'>
|
|
32
|
-
Showing {
|
|
33
|
-
reduce the number of mutations.
|
|
38
|
+
Showing {currentMaxNumberOfGridRows} of {allMutations.length} mutations. You can narrow the filter
|
|
39
|
+
to reduce the number of mutations.
|
|
34
40
|
</div>
|
|
35
41
|
)}
|
|
36
42
|
{allMutations.length === 0 && (
|
|
@@ -23,6 +23,7 @@ const wastewaterMutationOverTimeSchema = z.object({
|
|
|
23
23
|
sequenceType: sequenceTypeSchema,
|
|
24
24
|
width: z.string(),
|
|
25
25
|
height: z.string(),
|
|
26
|
+
maxNumberOfGridRows: z.number().optional(),
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
export type WastewaterMutationsOverTimeProps = z.infer<typeof wastewaterMutationOverTimeSchema>;
|
|
@@ -75,6 +76,7 @@ export const WastewaterMutationsOverTimeInner: FunctionComponent<WastewaterMutat
|
|
|
75
76
|
<MutationsOverTimeTabs
|
|
76
77
|
mutationOverTimeDataPerLocation={mutationOverTimeDataPerLocation}
|
|
77
78
|
originalComponentProps={componentProps}
|
|
79
|
+
maxNumberOfGridRows={componentProps.maxNumberOfGridRows}
|
|
78
80
|
/>
|
|
79
81
|
);
|
|
80
82
|
};
|
|
@@ -87,17 +89,21 @@ type MutationOverTimeDataPerLocation = {
|
|
|
87
89
|
type MutationOverTimeTabsProps = {
|
|
88
90
|
mutationOverTimeDataPerLocation: MutationOverTimeDataPerLocation;
|
|
89
91
|
originalComponentProps: WastewaterMutationsOverTimeProps;
|
|
92
|
+
maxNumberOfGridRows?: number;
|
|
90
93
|
};
|
|
91
94
|
|
|
92
95
|
const MutationsOverTimeTabs: FunctionComponent<MutationOverTimeTabsProps> = ({
|
|
93
96
|
mutationOverTimeDataPerLocation,
|
|
94
97
|
originalComponentProps,
|
|
98
|
+
maxNumberOfGridRows,
|
|
95
99
|
}) => {
|
|
96
100
|
const [colorScale, setColorScale] = useState<ColorScale>({ min: 0, max: 1, color: 'indigo' });
|
|
97
101
|
|
|
98
102
|
const tabs = mutationOverTimeDataPerLocation.map(({ location, data }) => ({
|
|
99
103
|
title: location,
|
|
100
|
-
content:
|
|
104
|
+
content: (
|
|
105
|
+
<MutationsOverTimeGrid data={data} colorScale={colorScale} maxNumberOfGridRows={maxNumberOfGridRows} />
|
|
106
|
+
),
|
|
101
107
|
}));
|
|
102
108
|
|
|
103
109
|
const toolbar = (
|
|
@@ -65,6 +65,14 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
|
|
|
65
65
|
@property({ type: String })
|
|
66
66
|
height: string = '700px';
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* The maximum number of grid rows to display.
|
|
70
|
+
*
|
|
71
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
72
|
+
*/
|
|
73
|
+
@property({ type: Number })
|
|
74
|
+
maxNumberOfGridRows: number = 100;
|
|
75
|
+
|
|
68
76
|
override render() {
|
|
69
77
|
return (
|
|
70
78
|
<WastewaterMutationsOverTime
|
|
@@ -72,6 +80,7 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
|
|
|
72
80
|
sequenceType={this.sequenceType}
|
|
73
81
|
width={this.width}
|
|
74
82
|
height={this.height}
|
|
83
|
+
maxNumberOfGridRows={this.maxNumberOfGridRows}
|
|
75
84
|
/>
|
|
76
85
|
);
|
|
77
86
|
}
|