@genspectrum/dashboard-components 0.4.5 → 0.5.0
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 +2 -2
- package/custom-elements.json +178 -102
- package/dist/dashboard-components.js +318 -147
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +91 -55
- package/dist/style.css +34 -7
- package/package.json +5 -5
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +1 -1
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +18 -18
- package/src/preact/mutationComparison/mutation-comparison.tsx +6 -6
- package/src/preact/mutationComparison/queryMutationData.ts +4 -4
- package/src/preact/mutations/mutations.stories.tsx +3 -3
- package/src/preact/mutations/mutations.tsx +16 -6
- package/src/preact/mutations/queryMutations.ts +3 -3
- package/src/preact/prevalenceOverTime/__mockData__/{denominatorOneVariant.json → denominatorFilterOneDataset.json} +1 -1
- package/src/preact/prevalenceOverTime/__mockData__/{numeratorOneVariant.json → numeratorFilterOneDataset.json} +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +42 -5
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +26 -7
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +62 -28
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +26 -16
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +38 -11
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +39 -7
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +10 -4
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +19 -10
- package/src/preact/shared/charts/confideceInterval.ts +7 -2
- package/src/preact/shared/charts/getYAxisMax.ts +24 -0
- package/src/preact/shared/charts/getYAxisScale.ts +1 -3
- package/src/query/queryAggregateData.ts +2 -2
- package/src/query/queryInsertions.ts +7 -2
- package/src/query/querySubstitutionsOrDeletions.ts +2 -2
- package/src/web-components/input/gs-date-range-selector.tsx +1 -1
- package/src/web-components/input/gs-location-filter.tsx +1 -1
- package/src/web-components/input/gs-mutation-filter.tsx +1 -1
- package/src/web-components/input/gs-text-input.tsx +1 -1
- package/src/web-components/visualization/gs-aggregate.tsx +2 -2
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +12 -12
- package/src/web-components/visualization/gs-mutation-comparison.tsx +18 -19
- package/src/web-components/visualization/gs-mutations.stories.ts +4 -4
- package/src/web-components/visualization/gs-mutations.tsx +10 -11
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +46 -35
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +54 -20
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +32 -18
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +51 -13
- /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsOtherVariant.json → nucleotideMutationsOtherDataset.json} +0 -0
- /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsSomeVariant.json → nucleotideMutationsSomeDataset.json} +0 -0
- /package/src/preact/prevalenceOverTime/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
- /package/src/preact/prevalenceOverTime/__mockData__/{numeratorEG.json → numeratorFilterEG.json} +0 -0
- /package/src/preact/prevalenceOverTime/__mockData__/{numeratorJN1.json → numeratorFilterJN1.json} +0 -0
- /package/src/preact/relativeGrowthAdvantage/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
- /package/src/preact/relativeGrowthAdvantage/__mockData__/{numerator.json → numeratorFilter.json} +0 -0
|
@@ -44,13 +44,13 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
44
44
|
/**
|
|
45
45
|
* The width of the component.
|
|
46
46
|
*
|
|
47
|
-
* Visit https://genspectrum.github.io/
|
|
47
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
48
48
|
*/
|
|
49
49
|
width: string;
|
|
50
50
|
/**
|
|
51
51
|
* The height of the component.
|
|
52
52
|
*
|
|
53
|
-
* Visit https://genspectrum.github.io/
|
|
53
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
54
54
|
*/
|
|
55
55
|
height: string;
|
|
56
56
|
/**
|
|
@@ -172,7 +172,7 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
172
172
|
/**
|
|
173
173
|
* The width of the component.
|
|
174
174
|
*
|
|
175
|
-
* Visit https://genspectrum.github.io/
|
|
175
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
176
176
|
*/
|
|
177
177
|
width: string;
|
|
178
178
|
/**
|
|
@@ -230,7 +230,7 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
|
|
|
230
230
|
/**
|
|
231
231
|
* The width of the component.
|
|
232
232
|
*
|
|
233
|
-
* Visit https://genspectrum.github.io/
|
|
233
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
234
234
|
*/
|
|
235
235
|
width: string;
|
|
236
236
|
/**
|
|
@@ -243,8 +243,8 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
|
|
|
243
243
|
/**
|
|
244
244
|
* ## Context
|
|
245
245
|
*
|
|
246
|
-
* This component allows to compare mutations between different
|
|
247
|
-
*
|
|
246
|
+
* This component allows to compare mutations between two different datasets.
|
|
247
|
+
* The datasets are selected by LAPIS filters.
|
|
248
248
|
*
|
|
249
249
|
* It only shows substitutions and deletions, it does not show insertions.
|
|
250
250
|
*
|
|
@@ -252,32 +252,31 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
|
|
|
252
252
|
*
|
|
253
253
|
* ### Table View
|
|
254
254
|
*
|
|
255
|
-
* The table view shows mutations
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* and where the proportion is within the selected proportion interval for at least one variant.
|
|
255
|
+
* The table view shows mutations and the proportions with which the mutation occurs in the respective data subsets.
|
|
256
|
+
* It only shows mutations that are present in at least one of the data subsets
|
|
257
|
+
* and where the proportion is within the selected proportion interval for at least one data subset.
|
|
259
258
|
*
|
|
260
259
|
* ### Venn View
|
|
261
260
|
*
|
|
262
|
-
* The Venn view shows the overlap of mutations between the
|
|
263
|
-
* A
|
|
264
|
-
*
|
|
265
|
-
* Thus, changing the proportion interval may change a mutations from being "common" between
|
|
266
|
-
* to being "for one
|
|
261
|
+
* The Venn view shows the overlap of mutations between the datasets in a Venn diagram.
|
|
262
|
+
* A dataset is considered to have a certain mutation, if the proportion of the mutation in the dataset is within the
|
|
263
|
+
* selected proportion interval.
|
|
264
|
+
* Thus, changing the proportion interval may change a mutations from being "common" between the datasets
|
|
265
|
+
* to being "for one dataset only".
|
|
267
266
|
*/
|
|
268
267
|
export declare class MutationComparisonComponent extends PreactLitAdapterWithGridJsStyles {
|
|
269
268
|
/**
|
|
270
269
|
* Required.
|
|
271
270
|
*
|
|
272
|
-
* An array of
|
|
271
|
+
* An array of LAPIS filters to select the data to compare.
|
|
273
272
|
*
|
|
274
273
|
* The `lapisFilter` will be sent as is to LAPIS to filter the mutation data.
|
|
275
274
|
* It must be a valid LAPIS filter object.
|
|
276
275
|
*
|
|
277
|
-
* The `displayName` will be used as the label for the
|
|
276
|
+
* The `displayName` will be used as the label for the filtered dataset in the views.
|
|
278
277
|
* It should be human-readable.
|
|
279
278
|
*/
|
|
280
|
-
|
|
279
|
+
lapisFilters: {
|
|
281
280
|
lapisFilter: Record<string, string | number | null | boolean>;
|
|
282
281
|
displayName: string;
|
|
283
282
|
}[];
|
|
@@ -292,13 +291,13 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
|
|
|
292
291
|
/**
|
|
293
292
|
* The width of the component.
|
|
294
293
|
*
|
|
295
|
-
* Visit https://genspectrum.github.io/
|
|
294
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
296
295
|
*/
|
|
297
296
|
width: string;
|
|
298
297
|
/**
|
|
299
298
|
* The height of the component.
|
|
300
299
|
*
|
|
301
|
-
* Visit https://genspectrum.github.io/
|
|
300
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
302
301
|
*/
|
|
303
302
|
height: string;
|
|
304
303
|
/**
|
|
@@ -382,7 +381,7 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
|
|
|
382
381
|
/**
|
|
383
382
|
* The width of the component.
|
|
384
383
|
*
|
|
385
|
-
* Visit https://genspectrum.github.io/
|
|
384
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
386
385
|
*/
|
|
387
386
|
width: string;
|
|
388
387
|
render(): JSX_2.Element;
|
|
@@ -391,15 +390,15 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
|
|
|
391
390
|
/**
|
|
392
391
|
* ## Context
|
|
393
392
|
*
|
|
394
|
-
* This component displays mutations (substitutions, deletions and insertions) for a
|
|
393
|
+
* This component displays mutations (substitutions, deletions and insertions) for a dataset selected by a LAPIS filter.
|
|
395
394
|
*
|
|
396
395
|
* ## Views
|
|
397
396
|
*
|
|
398
397
|
* ### Table View
|
|
399
398
|
*
|
|
400
|
-
* The table view shows all substitutions and deletions for the
|
|
399
|
+
* The table view shows all substitutions and deletions for the dataset.
|
|
401
400
|
* It shows the type (substitution or deletion), the total count of the mutation
|
|
402
|
-
* and the proportion of the mutation in the
|
|
401
|
+
* and the proportion of the mutation in the dataset.
|
|
403
402
|
* The proportion is relative to the total number of sequences matching
|
|
404
403
|
* the specified sequence filters with non-ambiguous reads at that position.
|
|
405
404
|
*
|
|
@@ -412,17 +411,16 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
|
|
|
412
411
|
*
|
|
413
412
|
* ### Insertions View
|
|
414
413
|
*
|
|
415
|
-
* The insertions view shows the count of all insertions for the
|
|
414
|
+
* The insertions view shows the count of all insertions for the dataset.
|
|
416
415
|
*
|
|
417
416
|
*/
|
|
418
417
|
export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles {
|
|
419
418
|
/**
|
|
420
419
|
* Required.
|
|
421
420
|
*
|
|
422
|
-
*
|
|
423
|
-
* It must be a valid LAPIS filter object.
|
|
421
|
+
* LAPIS filter to select the displayed data.
|
|
424
422
|
*/
|
|
425
|
-
|
|
423
|
+
lapisFilter: Record<string, string | number | null | boolean>;
|
|
426
424
|
/**
|
|
427
425
|
* The type of the sequence for which the mutations should be shown.
|
|
428
426
|
*/
|
|
@@ -434,13 +432,13 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
434
432
|
/**
|
|
435
433
|
* The width of the component.
|
|
436
434
|
*
|
|
437
|
-
* Visit https://genspectrum.github.io/
|
|
435
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
438
436
|
*/
|
|
439
437
|
width: string;
|
|
440
438
|
/**
|
|
441
439
|
* The height of the component.
|
|
442
440
|
*
|
|
443
|
-
* Visit https://genspectrum.github.io/
|
|
441
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
444
442
|
*/
|
|
445
443
|
height: string;
|
|
446
444
|
/**
|
|
@@ -470,9 +468,9 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
|
|
|
470
468
|
/**
|
|
471
469
|
* ## Context
|
|
472
470
|
*
|
|
473
|
-
* This component displays the prevalence over time of one or more
|
|
474
|
-
* The prevalence is calculated as the ratio of the number of cases of each
|
|
475
|
-
*
|
|
471
|
+
* This component displays the prevalence over time of one or more datasets, selected by LAPIS filters.
|
|
472
|
+
* The prevalence is calculated as the ratio of the number of cases of each dataset to the number of cases of a reference dataset.
|
|
473
|
+
* The reference dataset is also selected by a LAPIS filter.
|
|
476
474
|
*
|
|
477
475
|
* In the chart views,
|
|
478
476
|
* - the user can select whether to display a confidence interval (not available in the bubble chart).
|
|
@@ -486,19 +484,19 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
|
|
|
486
484
|
* ### Bar View
|
|
487
485
|
*
|
|
488
486
|
* Displays the prevalence over time as a bar chart.
|
|
489
|
-
* Shows a bar for each
|
|
487
|
+
* Shows a bar for each dataset of the `numeratorFilter` on every time step.
|
|
490
488
|
*
|
|
491
489
|
* ### Line View
|
|
492
490
|
*
|
|
493
491
|
* Displays the prevalence over time as a line chart.
|
|
494
492
|
* Each data point is connected for better visibility.
|
|
495
|
-
* Shows a line for each
|
|
493
|
+
* Shows a line for each dataset of the `numeratorFilter`.
|
|
496
494
|
*
|
|
497
495
|
* ### Bubble View
|
|
498
496
|
*
|
|
499
497
|
* Displays the prevalence over time as a bubble chart.
|
|
500
|
-
* The size of the bubbles represents the number of cases of the `
|
|
501
|
-
* The height of the bubbles represents the prevalence of the `
|
|
498
|
+
* The size of the bubbles represents the number of cases of the reference, defined by the `denominatorFilter`.
|
|
499
|
+
* The height of the bubbles represents the prevalence of the datasets selected by the `numeratorFilters`.
|
|
502
500
|
*
|
|
503
501
|
* ### Table View
|
|
504
502
|
*
|
|
@@ -507,13 +505,16 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
|
|
|
507
505
|
export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
|
|
508
506
|
/**
|
|
509
507
|
* Required.
|
|
508
|
+
* Either a LAPIS filter or an array of LAPIS filters to calculate the prevalence for.
|
|
509
|
+
*
|
|
510
|
+
* The `lapisFilter` will be sent as is to LAPIS to select the data.
|
|
511
|
+
* It must be a valid LAPIS filter object.
|
|
512
|
+
*
|
|
513
|
+
* The `displayName` will be used as the label the prevalence in the views.
|
|
514
|
+
* It should be human-readable.
|
|
510
515
|
*
|
|
511
|
-
* Either a single variant or an array of variants to compare.
|
|
512
|
-
* This must be a valid LAPIS filter object with an additional `displayName` property
|
|
513
|
-
* which will be used as the label for the variant in the views,
|
|
514
|
-
* or an array of such objects.
|
|
515
516
|
*/
|
|
516
|
-
|
|
517
|
+
numeratorFilter: {
|
|
517
518
|
lapisFilter: Record<string, string | number | null | boolean>;
|
|
518
519
|
displayName: string;
|
|
519
520
|
} | {
|
|
@@ -523,9 +524,10 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
|
|
|
523
524
|
/**
|
|
524
525
|
* Required.
|
|
525
526
|
*
|
|
526
|
-
* The
|
|
527
|
+
* The LAPIS filter, to select the data of the reference.
|
|
528
|
+
* It must be a valid LAPIS filter object.
|
|
527
529
|
*/
|
|
528
|
-
|
|
530
|
+
denominatorFilter: Record<string, string | number | null | boolean>;
|
|
529
531
|
/**
|
|
530
532
|
* The granularity of the time axis.
|
|
531
533
|
*/
|
|
@@ -557,13 +559,13 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
|
|
|
557
559
|
/**
|
|
558
560
|
* The width of the component.
|
|
559
561
|
*
|
|
560
|
-
* Visit https://genspectrum.github.io/
|
|
562
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
561
563
|
*/
|
|
562
564
|
width: string;
|
|
563
565
|
/**
|
|
564
566
|
* The height of the component.
|
|
565
567
|
*
|
|
566
|
-
* Visit https://genspectrum.github.io/
|
|
568
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
567
569
|
*/
|
|
568
570
|
height: string;
|
|
569
571
|
/**
|
|
@@ -579,6 +581,22 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
|
|
|
579
581
|
* Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
|
|
580
582
|
*/
|
|
581
583
|
pageSize: boolean | number;
|
|
584
|
+
/**
|
|
585
|
+
* The maximum value for the y-axis on all graphs in linear view.
|
|
586
|
+
* If set to a number, the maximum value is set to this number.
|
|
587
|
+
* If set to `maxInData`, the maximum value is set to the maximum value in the data.
|
|
588
|
+
* If set to `limitTo1`, the maximum value is set to `min(1, the maximum value in the data)`.
|
|
589
|
+
* If not set, the maximum value is set to the default value (1).
|
|
590
|
+
*/
|
|
591
|
+
yAxisMaxLinear: 'maxInData' | 'limitTo1' | number;
|
|
592
|
+
/**
|
|
593
|
+
* The maximum value for the y-axis on all graphs in logarithmic view.
|
|
594
|
+
* If set to a number, the maximum value is set to this number.
|
|
595
|
+
* If set to `maxInData`, the maximum value is set to the maximum value in the data.
|
|
596
|
+
* If set to `limitTo1`, the maximum value is set to `min(1, the maximum value in the data)`.
|
|
597
|
+
* If not set, the maximum value is set to the default value (1).
|
|
598
|
+
*/
|
|
599
|
+
yAxisMaxLogarithmic: 'maxInData' | 'limitTo1' | number;
|
|
582
600
|
render(): JSX_2.Element;
|
|
583
601
|
}
|
|
584
602
|
|
|
@@ -631,7 +649,7 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
|
|
|
631
649
|
* For this component, we assume a discrete time model, where new infections happen exactly every `generationTime` days.
|
|
632
650
|
* This is what we call a "generation".
|
|
633
651
|
*
|
|
634
|
-
* This component estimates the relative growth advantage of a variant by performing a logistic regression.
|
|
652
|
+
* This component estimates the relative growth advantage of a variant (defined by its LAPIS filter) by performing a logistic regression.
|
|
635
653
|
* Based on the inferred logistic growth rate, we derive the relative growth advantage (per generation).
|
|
636
654
|
*
|
|
637
655
|
* For details on the scientific method, see:
|
|
@@ -647,7 +665,7 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
|
|
|
647
665
|
* ### Line View
|
|
648
666
|
*
|
|
649
667
|
* The line view shows the relative growth advantage over time in a line chart.
|
|
650
|
-
* The dots in the plot show the proportions of the focal variant (`
|
|
668
|
+
* The dots in the plot show the proportions of the focal variant (defined by the `numeratorFilter`) to the baseline variant (defined by the `denominatorFilter`)
|
|
651
669
|
* for every day as observed in the data.
|
|
652
670
|
* The line shows a logistic curve fitted to the data points, including a 95% confidence interval.
|
|
653
671
|
*/
|
|
@@ -655,15 +673,17 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
655
673
|
/**
|
|
656
674
|
* Required.
|
|
657
675
|
*
|
|
658
|
-
*
|
|
676
|
+
* LAPIS filter to select the data of the focal variant.
|
|
677
|
+
* It must be a valid LAPIS filter object.
|
|
659
678
|
*/
|
|
660
|
-
|
|
679
|
+
numeratorFilter: Record<string, string | number | null | boolean>;
|
|
661
680
|
/**
|
|
662
681
|
* Required.
|
|
663
682
|
*
|
|
664
|
-
*
|
|
683
|
+
* LAPIS filter to select the data of the baseline variant.
|
|
684
|
+
* It must be a valid LAPIS filter object.
|
|
665
685
|
*/
|
|
666
|
-
|
|
686
|
+
denominatorFilter: Record<string, string | number | null | boolean>;
|
|
667
687
|
/**
|
|
668
688
|
* The generation time represents the number of days over which the variant's relative growth advantage is measured.
|
|
669
689
|
* For example, if we set a generation time of 7 days, then we estimate the growth advantage per week.
|
|
@@ -680,13 +700,13 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
680
700
|
/**
|
|
681
701
|
* The width of the component.
|
|
682
702
|
*
|
|
683
|
-
* Visit https://genspectrum.github.io/
|
|
703
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
684
704
|
*/
|
|
685
705
|
width: string;
|
|
686
706
|
/**
|
|
687
707
|
* The height of the component.
|
|
688
708
|
*
|
|
689
|
-
* Visit https://genspectrum.github.io/
|
|
709
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
690
710
|
*/
|
|
691
711
|
height: string;
|
|
692
712
|
/**
|
|
@@ -697,6 +717,22 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
697
717
|
* Must be a field of type `date` in LAPIS.
|
|
698
718
|
*/
|
|
699
719
|
lapisDateField: string;
|
|
720
|
+
/**
|
|
721
|
+
* The maximum value for the y-axis on all graphs in linear view.
|
|
722
|
+
* If set to a number, the maximum value is set to this number.
|
|
723
|
+
* If set to `maxInData`, the maximum value is set to the maximum value in the data.
|
|
724
|
+
* If set to `limitTo1`, the maximum value is set to `min(1, the maximum value in the data)`.
|
|
725
|
+
* If not set, the maximum value is set to the default value (1).
|
|
726
|
+
*/
|
|
727
|
+
yAxisMaxLinear: 'maxInData' | 'limitTo1' | number;
|
|
728
|
+
/**
|
|
729
|
+
* The maximum value for the y-axis on all graphs in logarithmic view.
|
|
730
|
+
* If set to a number, the maximum value is set to this number.
|
|
731
|
+
* If set to `maxInData`, the maximum value is set to the maximum value in the data.
|
|
732
|
+
* If set to `limitTo1`, the maximum value is set to `min(1, the maximum value in the data)`.
|
|
733
|
+
* If not set, the maximum value is set to the default value (1).
|
|
734
|
+
*/
|
|
735
|
+
yAxisMaxLogarithmic: 'maxInData' | 'limitTo1' | number;
|
|
700
736
|
render(): JSX_2.Element;
|
|
701
737
|
}
|
|
702
738
|
|
|
@@ -735,7 +771,7 @@ export declare class TextInputComponent extends PreactLitAdapter {
|
|
|
735
771
|
/**
|
|
736
772
|
* The width of the component.
|
|
737
773
|
*
|
|
738
|
-
* Visit https://genspectrum.github.io/
|
|
774
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
|
|
739
775
|
*/
|
|
740
776
|
width: string;
|
|
741
777
|
render(): JSX_2.Element;
|
package/dist/style.css
CHANGED
|
@@ -1468,8 +1468,8 @@ html {
|
|
|
1468
1468
|
appearance: none;
|
|
1469
1469
|
height: 3rem;
|
|
1470
1470
|
min-height: 3rem;
|
|
1471
|
-
padding-
|
|
1472
|
-
padding-
|
|
1471
|
+
padding-inline-start: 1rem;
|
|
1472
|
+
padding-inline-end: 2.5rem;
|
|
1473
1473
|
font-size: 0.875rem;
|
|
1474
1474
|
line-height: 1.25rem;
|
|
1475
1475
|
line-height: 2;
|
|
@@ -1511,7 +1511,9 @@ html {
|
|
|
1511
1511
|
display: grid;
|
|
1512
1512
|
align-items: flex-end;
|
|
1513
1513
|
}
|
|
1514
|
-
.tabs-lifted:has(.tab-content[class^="rounded-"])
|
|
1514
|
+
.tabs-lifted:has(.tab-content[class^="rounded-"])
|
|
1515
|
+
.tab:first-child:not(:is(.tab-active, [aria-selected="true"])), .tabs-lifted:has(.tab-content[class*=" rounded-"])
|
|
1516
|
+
.tab:first-child:not(:is(.tab-active, [aria-selected="true"])) {
|
|
1515
1517
|
border-bottom-color: transparent;
|
|
1516
1518
|
}
|
|
1517
1519
|
.tab {
|
|
@@ -2349,7 +2351,7 @@ input.tab:checked + .tab-content,
|
|
|
2349
2351
|
.tabs-boxed .tab {
|
|
2350
2352
|
border-radius: var(--rounded-btn, 0.5rem);
|
|
2351
2353
|
}
|
|
2352
|
-
:
|
|
2354
|
+
.table:where([dir="rtl"], [dir="rtl"] *) {
|
|
2353
2355
|
text-align: right;
|
|
2354
2356
|
}
|
|
2355
2357
|
.table :where(th, td) {
|
|
@@ -2365,7 +2367,7 @@ input.tab:checked + .tab-content,
|
|
|
2365
2367
|
--tw-bg-opacity: 1;
|
|
2366
2368
|
background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
|
|
2367
2369
|
}
|
|
2368
|
-
.table :where(thead tr, tbody tr:not(:last-child),tbody tr:first-child:last-child) {
|
|
2370
|
+
.table :where(thead tr, tbody tr:not(:last-child), tbody tr:first-child:last-child) {
|
|
2369
2371
|
border-bottom-width: 1px;
|
|
2370
2372
|
--tw-border-opacity: 1;
|
|
2371
2373
|
border-bottom-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));
|
|
@@ -2649,7 +2651,7 @@ input.tab:checked + .tab-content,
|
|
|
2649
2651
|
content: "";
|
|
2650
2652
|
margin-inline-start: -100%;
|
|
2651
2653
|
}
|
|
2652
|
-
:
|
|
2654
|
+
.steps-horizontal .step:where([dir="rtl"], [dir="rtl"] *):before {
|
|
2653
2655
|
--tw-translate-x: 0px;
|
|
2654
2656
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2655
2657
|
}
|
|
@@ -2668,7 +2670,7 @@ input.tab:checked + .tab-content,
|
|
|
2668
2670
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2669
2671
|
margin-inline-start: 50%;
|
|
2670
2672
|
}
|
|
2671
|
-
:
|
|
2673
|
+
.steps-vertical .step:where([dir="rtl"], [dir="rtl"] *):before {
|
|
2672
2674
|
--tw-translate-x: 50%;
|
|
2673
2675
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2674
2676
|
}
|
|
@@ -2702,6 +2704,7 @@ input.tab:checked + .tab-content,
|
|
|
2702
2704
|
}
|
|
2703
2705
|
.tooltip:before {
|
|
2704
2706
|
max-width: 20rem;
|
|
2707
|
+
white-space: normal;
|
|
2705
2708
|
border-radius: 0.25rem;
|
|
2706
2709
|
padding-left: 0.5rem;
|
|
2707
2710
|
padding-right: 0.5rem;
|
|
@@ -2794,6 +2797,10 @@ input.tab:checked + .tab-content,
|
|
|
2794
2797
|
margin-left: 0.25rem;
|
|
2795
2798
|
margin-right: 0.25rem;
|
|
2796
2799
|
}
|
|
2800
|
+
.mx-auto {
|
|
2801
|
+
margin-left: auto;
|
|
2802
|
+
margin-right: auto;
|
|
2803
|
+
}
|
|
2797
2804
|
.my-1 {
|
|
2798
2805
|
margin-top: 0.25rem;
|
|
2799
2806
|
margin-bottom: 0.25rem;
|
|
@@ -2805,6 +2812,15 @@ input.tab:checked + .tab-content,
|
|
|
2805
2812
|
.mb-2 {
|
|
2806
2813
|
margin-bottom: 0.5rem;
|
|
2807
2814
|
}
|
|
2815
|
+
.ml-2 {
|
|
2816
|
+
margin-left: 0.5rem;
|
|
2817
|
+
}
|
|
2818
|
+
.ml-2\.5 {
|
|
2819
|
+
margin-left: 0.625rem;
|
|
2820
|
+
}
|
|
2821
|
+
.ml-3 {
|
|
2822
|
+
margin-left: 0.75rem;
|
|
2823
|
+
}
|
|
2808
2824
|
.mr-2 {
|
|
2809
2825
|
margin-right: 0.5rem;
|
|
2810
2826
|
}
|
|
@@ -2878,6 +2894,9 @@ input.tab:checked + .tab-content,
|
|
|
2878
2894
|
.flex-wrap {
|
|
2879
2895
|
flex-wrap: wrap;
|
|
2880
2896
|
}
|
|
2897
|
+
.items-end {
|
|
2898
|
+
align-items: flex-end;
|
|
2899
|
+
}
|
|
2881
2900
|
.items-center {
|
|
2882
2901
|
align-items: center;
|
|
2883
2902
|
}
|
|
@@ -3007,6 +3026,10 @@ input.tab:checked + .tab-content,
|
|
|
3007
3026
|
.text-justify {
|
|
3008
3027
|
text-align: justify;
|
|
3009
3028
|
}
|
|
3029
|
+
.text-2xl {
|
|
3030
|
+
font-size: 1.5rem;
|
|
3031
|
+
line-height: 2rem;
|
|
3032
|
+
}
|
|
3010
3033
|
.text-base {
|
|
3011
3034
|
font-size: 1rem;
|
|
3012
3035
|
line-height: 1.5rem;
|
|
@@ -3036,6 +3059,10 @@ input.tab:checked + .tab-content,
|
|
|
3036
3059
|
.leading-5 {
|
|
3037
3060
|
line-height: 1.25rem;
|
|
3038
3061
|
}
|
|
3062
|
+
.text-\[\#606060\] {
|
|
3063
|
+
--tw-text-opacity: 1;
|
|
3064
|
+
color: rgb(96 96 96 / var(--tw-text-opacity));
|
|
3065
|
+
}
|
|
3039
3066
|
.text-blue-600 {
|
|
3040
3067
|
--tw-text-opacity: 1;
|
|
3041
3068
|
color: rgb(37 99 235 / var(--tw-text-opacity));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genspectrum/dashboard-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "GenSpectrum web components for building dashboards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"@storybook/preact": "^8.0.9",
|
|
83
83
|
"@storybook/preact-vite": "^8.0.9",
|
|
84
84
|
"@storybook/test": "^8.0.0",
|
|
85
|
-
"@storybook/test-runner": "^0.
|
|
85
|
+
"@storybook/test-runner": "^0.19.0",
|
|
86
86
|
"@storybook/types": "^8.0.9",
|
|
87
87
|
"@storybook/web-components": "^8.0.9",
|
|
88
88
|
"@storybook/web-components-vite": "^8.0.9",
|
|
89
89
|
"@types/node": "^20.12.7",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
91
|
-
"@typescript-eslint/parser": "^7.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
91
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
92
92
|
"autoprefixer": "^10.4.19",
|
|
93
93
|
"daisyui": "^4.10.2",
|
|
94
94
|
"depcheck": "^1.4.7",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"storybook": "^8.0.9",
|
|
107
107
|
"storybook-addon-fetch-mock": "^2.0.0",
|
|
108
108
|
"tailwindcss": "^3.4.3",
|
|
109
|
-
"typescript": "~5.
|
|
109
|
+
"typescript": "~5.5.2",
|
|
110
110
|
"vite": "^5.2.10",
|
|
111
111
|
"vite-plugin-dts": "^3.8.3",
|
|
112
112
|
"vitest": "^1.5.0"
|
|
@@ -111,7 +111,7 @@ export const MutationComparisonVenn: FunctionComponent<MutationComparisonVennPro
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
if (data.content.length > 5) {
|
|
114
|
-
return <div>Too many
|
|
114
|
+
return <div>Too many datasets to display. Maximum are five. </div>;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
return (
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { type Meta, type StoryObj } from '@storybook/preact';
|
|
2
2
|
import { expect, userEvent, waitFor, within } from '@storybook/test';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import nucleotideMutationsOtherDataset from './__mockData__/nucleotideMutationsOtherDataset.json';
|
|
5
|
+
import nucleotideMutationsSomeDataset from './__mockData__/nucleotideMutationsSomeDataset.json';
|
|
6
6
|
import { MutationComparison, type MutationComparisonProps } from './mutation-comparison';
|
|
7
7
|
import { LAPIS_URL, NUCLEOTIDE_MUTATIONS_ENDPOINT } from '../../constants';
|
|
8
8
|
import referenceGenome from '../../lapisApi/__mockData__/referenceGenome.json';
|
|
9
9
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
10
10
|
import { ReferenceGenomeContext } from '../ReferenceGenomeContext';
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const dateToSomeDataset = '2022-01-01';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const dateFromOtherDataset = '2021-01-01';
|
|
15
|
+
const dateToOtherDataset = '2022-01-02';
|
|
16
16
|
|
|
17
17
|
const meta: Meta<MutationComparisonProps> = {
|
|
18
18
|
title: 'Visualization/Mutation comparison',
|
|
19
19
|
component: MutationComparison,
|
|
20
20
|
argTypes: {
|
|
21
|
-
|
|
21
|
+
lapisFilters: [{ control: 'object' }],
|
|
22
22
|
sequenceType: {
|
|
23
23
|
options: ['nucleotide', 'amino acid'],
|
|
24
24
|
control: { type: 'radio' },
|
|
@@ -42,13 +42,13 @@ const meta: Meta<MutationComparisonProps> = {
|
|
|
42
42
|
body: {
|
|
43
43
|
country: 'Switzerland',
|
|
44
44
|
pangoLineage: 'B.1.1.7',
|
|
45
|
-
dateTo:
|
|
45
|
+
dateTo: dateToSomeDataset,
|
|
46
46
|
minProportion: 0,
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
response: {
|
|
50
50
|
status: 200,
|
|
51
|
-
body:
|
|
51
|
+
body: nucleotideMutationsSomeDataset,
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -58,14 +58,14 @@ const meta: Meta<MutationComparisonProps> = {
|
|
|
58
58
|
body: {
|
|
59
59
|
country: 'Switzerland',
|
|
60
60
|
pangoLineage: 'B.1.1.7',
|
|
61
|
-
dateFrom:
|
|
62
|
-
dateTo:
|
|
61
|
+
dateFrom: dateFromOtherDataset,
|
|
62
|
+
dateTo: dateToOtherDataset,
|
|
63
63
|
minProportion: 0,
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
response: {
|
|
67
67
|
status: 200,
|
|
68
|
-
body:
|
|
68
|
+
body: nucleotideMutationsOtherDataset,
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
71
|
],
|
|
@@ -80,7 +80,7 @@ const Template: StoryObj<MutationComparisonProps> = {
|
|
|
80
80
|
<LapisUrlContext.Provider value={LAPIS_URL}>
|
|
81
81
|
<ReferenceGenomeContext.Provider value={referenceGenome}>
|
|
82
82
|
<MutationComparison
|
|
83
|
-
|
|
83
|
+
lapisFilters={args.lapisFilters}
|
|
84
84
|
sequenceType={args.sequenceType}
|
|
85
85
|
views={args.views}
|
|
86
86
|
width={args.width}
|
|
@@ -96,18 +96,18 @@ const Template: StoryObj<MutationComparisonProps> = {
|
|
|
96
96
|
export const TwoVariants: StoryObj<MutationComparisonProps> = {
|
|
97
97
|
...Template,
|
|
98
98
|
args: {
|
|
99
|
-
|
|
99
|
+
lapisFilters: [
|
|
100
100
|
{
|
|
101
|
-
displayName: 'Some
|
|
102
|
-
lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo:
|
|
101
|
+
displayName: 'Some dataset',
|
|
102
|
+
lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: dateToSomeDataset },
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
displayName: 'Other
|
|
105
|
+
displayName: 'Other dataset',
|
|
106
106
|
lapisFilter: {
|
|
107
107
|
country: 'Switzerland',
|
|
108
108
|
pangoLineage: 'B.1.1.7',
|
|
109
|
-
dateFrom:
|
|
110
|
-
dateTo:
|
|
109
|
+
dateFrom: dateFromOtherDataset,
|
|
110
|
+
dateTo: dateToOtherDataset,
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
113
|
],
|