@genspectrum/dashboard-components 0.9.1 → 0.10.1
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 +168 -5
- package/dist/assets/{mutationOverTimeWorker-DuWGESoO.js.map → mutationOverTimeWorker-CvZg52rf.js.map} +1 -1
- package/dist/components.d.ts +49 -1
- package/dist/components.js +268 -128
- package/dist/components.js.map +1 -1
- package/dist/style.css +41 -0
- package/dist/util.d.ts +16 -0
- package/package.json +2 -2
- package/src/preact/components/confidence-interval-selector.tsx +1 -1
- package/src/preact/components/min-max-range-slider.tsx +4 -4
- package/src/preact/components/percent-intput.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +0 -1
- package/src/preact/mutationFilter/parseMutation.spec.ts +30 -0
- package/src/preact/mutationFilter/sequenceTypeFromSegment.ts +3 -2
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +4 -4
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +11 -1
- package/src/preact/statistic/__mockData__/denominator.json +13 -0
- package/src/preact/statistic/__mockData__/numerator.json +13 -0
- package/src/preact/statistic/statistics.stories.tsx +81 -0
- package/src/preact/statistic/statistics.tsx +78 -0
- package/src/query/queryGeneralStatistics.ts +18 -0
- package/src/utils/mutations.ts +3 -3
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +1 -1
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +2 -2
- package/src/web-components/visualization/gs-statistics.stories.ts +95 -0
- package/src/web-components/visualization/gs-statistics.tsx +83 -0
- package/src/web-components/visualization/index.ts +1 -0
- package/standalone-bundle/assets/{mutationOverTimeWorker-MVSt1FVw.js.map → mutationOverTimeWorker-CypX_PYM.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +4422 -4350
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
2
|
+
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Statistics, type StatisticsProps } from '../../preact/statistic/statistics';
|
|
5
|
+
import type { LapisFilter } from '../../types';
|
|
6
|
+
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
7
|
+
import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ## Context
|
|
11
|
+
*
|
|
12
|
+
* This component displays general statistics (number of sequences, overall proportion)
|
|
13
|
+
* for a given numerator and denominator filter.
|
|
14
|
+
*/
|
|
15
|
+
@customElement('gs-statistics')
|
|
16
|
+
export class StatisticsComponent extends PreactLitAdapterWithGridJsStyles {
|
|
17
|
+
/**
|
|
18
|
+
* The filter to apply to the data for the overall number of sequences and as the numerator for the proportion.
|
|
19
|
+
* It must be a valid LAPIS filter object.
|
|
20
|
+
*/
|
|
21
|
+
@property({ type: Object })
|
|
22
|
+
numeratorFilter: LapisFilter = {};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The filter to apply to the data for the denominator of the proportion.
|
|
26
|
+
* It must be a valid LAPIS filter object.
|
|
27
|
+
*/
|
|
28
|
+
@property({ type: Object })
|
|
29
|
+
denominatorFilter: LapisFilter = {};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The width of the component.
|
|
33
|
+
*
|
|
34
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
35
|
+
*/
|
|
36
|
+
@property({ type: String })
|
|
37
|
+
width: string = '100%';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The height of the component.
|
|
41
|
+
*
|
|
42
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
43
|
+
*/
|
|
44
|
+
@property({ type: String })
|
|
45
|
+
height: string = '100%';
|
|
46
|
+
|
|
47
|
+
override render() {
|
|
48
|
+
return (
|
|
49
|
+
<Statistics
|
|
50
|
+
numeratorFilter={this.numeratorFilter}
|
|
51
|
+
denominatorFilter={this.denominatorFilter}
|
|
52
|
+
width={this.width}
|
|
53
|
+
height={this.height}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare global {
|
|
60
|
+
interface HTMLElementTagNameMap {
|
|
61
|
+
'gs-statistics': StatisticsComponent;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare global {
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
67
|
+
namespace JSX {
|
|
68
|
+
interface IntrinsicElements {
|
|
69
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
75
|
+
type WidthMatches = Expect<Equals<typeof StatisticsComponent.prototype.width, StatisticsProps['width']>>;
|
|
76
|
+
type HeightMatches = Expect<Equals<typeof StatisticsComponent.prototype.height, StatisticsProps['height']>>;
|
|
77
|
+
type DenominatorFilterMatches = Expect<
|
|
78
|
+
Equals<typeof StatisticsComponent.prototype.denominatorFilter, StatisticsProps['denominatorFilter']>
|
|
79
|
+
>;
|
|
80
|
+
type NumeratorFilterMatches = Expect<
|
|
81
|
+
Equals<typeof StatisticsComponent.prototype.numeratorFilter, StatisticsProps['numeratorFilter']>
|
|
82
|
+
>;
|
|
83
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -5,3 +5,4 @@ export { RelativeGrowthAdvantageComponent } from './gs-relative-growth-advantage
|
|
|
5
5
|
export { AggregateComponent } from './gs-aggregate';
|
|
6
6
|
export { NumberSequencesOverTimeComponent } from './gs-number-sequences-over-time';
|
|
7
7
|
export { MutationsOverTimeComponent } from './gs-mutations-over-time';
|
|
8
|
+
export { StatisticsComponent } from './gs-statistics';
|