@genspectrum/dashboard-components 0.4.5 → 0.5.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.
Files changed (52) hide show
  1. package/README.md +2 -2
  2. package/custom-elements.json +178 -102
  3. package/dist/dashboard-components.js +473 -289
  4. package/dist/dashboard-components.js.map +1 -1
  5. package/dist/genspectrum-components.d.ts +93 -57
  6. package/dist/style.css +53 -13
  7. package/package.json +5 -5
  8. package/src/preact/aggregatedData/aggregate-table.tsx +4 -2
  9. package/src/preact/dateRangeSelector/date-range-selector.tsx +3 -5
  10. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +1 -1
  11. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +18 -18
  12. package/src/preact/mutationComparison/mutation-comparison.tsx +6 -6
  13. package/src/preact/mutationComparison/queryMutationData.ts +4 -4
  14. package/src/preact/mutations/mutations.stories.tsx +3 -3
  15. package/src/preact/mutations/mutations.tsx +16 -6
  16. package/src/preact/mutations/queryMutations.ts +3 -3
  17. package/src/preact/prevalenceOverTime/__mockData__/{denominatorOneVariant.json → denominatorFilterOneDataset.json} +1 -1
  18. package/src/preact/prevalenceOverTime/__mockData__/{numeratorOneVariant.json → numeratorFilterOneDataset.json} +1 -1
  19. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +42 -5
  20. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +26 -7
  21. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +62 -28
  22. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +26 -16
  23. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +38 -11
  24. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +39 -7
  25. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +10 -4
  26. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +19 -10
  27. package/src/preact/shared/charts/confideceInterval.ts +7 -2
  28. package/src/preact/shared/charts/getYAxisMax.ts +24 -0
  29. package/src/preact/shared/charts/getYAxisScale.ts +1 -3
  30. package/src/query/queryAggregateData.ts +3 -3
  31. package/src/query/queryInsertions.ts +7 -2
  32. package/src/query/querySubstitutionsOrDeletions.ts +2 -2
  33. package/src/web-components/input/gs-date-range-selector.tsx +1 -1
  34. package/src/web-components/input/gs-location-filter.tsx +1 -1
  35. package/src/web-components/input/gs-mutation-filter.tsx +1 -1
  36. package/src/web-components/input/gs-text-input.tsx +1 -1
  37. package/src/web-components/visualization/gs-aggregate.tsx +2 -2
  38. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +12 -12
  39. package/src/web-components/visualization/gs-mutation-comparison.tsx +18 -19
  40. package/src/web-components/visualization/gs-mutations.stories.ts +4 -4
  41. package/src/web-components/visualization/gs-mutations.tsx +10 -11
  42. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +46 -35
  43. package/src/web-components/visualization/gs-prevalence-over-time.tsx +54 -20
  44. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +32 -18
  45. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +51 -13
  46. /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsOtherVariant.json → nucleotideMutationsOtherDataset.json} +0 -0
  47. /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsSomeVariant.json → nucleotideMutationsSomeDataset.json} +0 -0
  48. /package/src/preact/prevalenceOverTime/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
  49. /package/src/preact/prevalenceOverTime/__mockData__/{numeratorEG.json → numeratorFilterEG.json} +0 -0
  50. /package/src/preact/prevalenceOverTime/__mockData__/{numeratorJN1.json → numeratorFilterJN1.json} +0 -0
  51. /package/src/preact/relativeGrowthAdvantage/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
  52. /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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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 variants.
247
- * A variant is defined by its LAPIS filter.
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
- * and the proportions with which the mutation occurs in the respective variant.
257
- * It only shows mutations that are present in at least one of the variants
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 variants in a Venn diagram.
263
- * A variant is considered to have a certain mutation,
264
- * if the proportion of the mutation in the variant is within the selected proportion interval.
265
- * Thus, changing the proportion interval may change a mutations from being "common" between variant
266
- * to being "for one variant only".
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 variants to compare.
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 variant in the views.
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
- variants: {
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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 given variant.
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 given variant.
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 variant.
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 given variant.
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
- * The `variant` will be sent as is to LAPIS to filter the mutation data.
423
- * It must be a valid LAPIS filter object.
421
+ * LAPIS filter to select the displayed data.
424
422
  */
425
- variant: Record<string, string | number | null | boolean>;
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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 variants.
474
- * The prevalence is calculated as the ratio of the number of cases of each variant given as `numerator`
475
- * to the number of cases of the variant given as `denominator`.
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 variant in the `numerator` on every time step.
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 variant in the `numerator`.
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 `denominator` variant.
501
- * The height of the bubbles represents the prevalence of the `numerator` variants.
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
- numerator: {
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 variant that the variants in `numerator` are compared to.
527
+ * The LAPIS filter, to select the data of the reference.
528
+ * It must be a valid LAPIS filter object.
527
529
  */
528
- denominator: Record<string, string | number | null | boolean>;
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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 (`numerator`) to the `denominator` 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
- * The LAPIS filter for the focal variant.
676
+ * LAPIS filter to select the data of the focal variant.
677
+ * It must be a valid LAPIS filter object.
659
678
  */
660
- numerator: Record<string, string | number | null | boolean>;
679
+ numeratorFilter: Record<string, string | number | null | boolean>;
661
680
  /**
662
681
  * Required.
663
682
  *
664
- * The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.
683
+ * LAPIS filter to select the data of the baseline variant.
684
+ * It must be a valid LAPIS filter object.
665
685
  */
666
- denominator: Record<string, string | number | null | boolean>;
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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/dashboards/?path=/docs/components-size-of-components--docs for more information.
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;
@@ -769,14 +805,14 @@ declare global {
769
805
 
770
806
  declare global {
771
807
  interface HTMLElementTagNameMap {
772
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
808
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
773
809
  }
774
810
  }
775
811
 
776
812
 
777
813
  declare global {
778
814
  interface HTMLElementTagNameMap {
779
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
815
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
780
816
  }
781
817
  }
782
818
 
package/dist/style.css CHANGED
@@ -836,7 +836,11 @@ html {
836
836
  }
837
837
 
838
838
  * {
839
- scrollbar-color: currentColor transparent;
839
+ scrollbar-color: color-mix(in oklch, currentColor 35%, transparent) transparent;
840
+ }
841
+
842
+ *:hover {
843
+ scrollbar-color: color-mix(in oklch, currentColor 60%, transparent) transparent;
840
844
  }
841
845
 
842
846
  :root {
@@ -1468,8 +1472,8 @@ html {
1468
1472
  appearance: none;
1469
1473
  height: 3rem;
1470
1474
  min-height: 3rem;
1471
- padding-left: 1rem;
1472
- padding-right: 2.5rem;
1475
+ padding-inline-start: 1rem;
1476
+ padding-inline-end: 2.5rem;
1473
1477
  font-size: 0.875rem;
1474
1478
  line-height: 1.25rem;
1475
1479
  line-height: 2;
@@ -1511,7 +1515,9 @@ html {
1511
1515
  display: grid;
1512
1516
  align-items: flex-end;
1513
1517
  }
1514
- .tabs-lifted:has(.tab-content[class^="rounded-"]) .tab:first-child:not(:is(.tab-active, [aria-selected="true"])), .tabs-lifted:has(.tab-content[class*=" rounded-"]) .tab:first-child:not(:is(.tab-active, [aria-selected="true"])) {
1518
+ .tabs-lifted:has(.tab-content[class^="rounded-"])
1519
+ .tab:first-child:not(:is(.tab-active, [aria-selected="true"])), .tabs-lifted:has(.tab-content[class*=" rounded-"])
1520
+ .tab:first-child:not(:is(.tab-active, [aria-selected="true"])) {
1515
1521
  border-bottom-color: transparent;
1516
1522
  }
1517
1523
  .tab {
@@ -1844,6 +1850,9 @@ input.tab:checked + .tab-content,
1844
1850
  margin-bottom: 0px;
1845
1851
  margin-inline-start: -1px;
1846
1852
  }
1853
+ .join > :where(*:not(:first-child)):is(.btn) {
1854
+ margin-inline-start: calc(var(--border-btn) * -1);
1855
+ }
1847
1856
  .loading {
1848
1857
  pointer-events: none;
1849
1858
  display: inline-block;
@@ -2349,7 +2358,7 @@ input.tab:checked + .tab-content,
2349
2358
  .tabs-boxed .tab {
2350
2359
  border-radius: var(--rounded-btn, 0.5rem);
2351
2360
  }
2352
- :is([dir="rtl"] .table) {
2361
+ .table:where([dir="rtl"], [dir="rtl"] *) {
2353
2362
  text-align: right;
2354
2363
  }
2355
2364
  .table :where(th, td) {
@@ -2365,7 +2374,7 @@ input.tab:checked + .tab-content,
2365
2374
  --tw-bg-opacity: 1;
2366
2375
  background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
2367
2376
  }
2368
- .table :where(thead tr, tbody tr:not(:last-child),tbody tr:first-child:last-child) {
2377
+ .table :where(thead tr, tbody tr:not(:last-child), tbody tr:first-child:last-child) {
2369
2378
  border-bottom-width: 1px;
2370
2379
  --tw-border-opacity: 1;
2371
2380
  border-bottom-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));
@@ -2594,11 +2603,17 @@ input.tab:checked + .tab-content,
2594
2603
  margin-right: 0px;
2595
2604
  margin-top: -1px;
2596
2605
  }
2606
+ .join.join-vertical > :where(*:not(:first-child)):is(.btn) {
2607
+ margin-top: calc(var(--border-btn) * -1);
2608
+ }
2597
2609
  .join.join-horizontal > :where(*:not(:first-child)) {
2598
2610
  margin-top: 0px;
2599
2611
  margin-bottom: 0px;
2600
2612
  margin-inline-start: -1px;
2601
2613
  }
2614
+ .join.join-horizontal > :where(*:not(:first-child)):is(.btn) {
2615
+ margin-inline-start: calc(var(--border-btn) * -1);
2616
+ }
2602
2617
  .modal-top :where(.modal-box) {
2603
2618
  width: 100%;
2604
2619
  max-width: none;
@@ -2649,7 +2664,7 @@ input.tab:checked + .tab-content,
2649
2664
  content: "";
2650
2665
  margin-inline-start: -100%;
2651
2666
  }
2652
- :is([dir="rtl"] .steps-horizontal .step):before {
2667
+ .steps-horizontal .step:where([dir="rtl"], [dir="rtl"] *):before {
2653
2668
  --tw-translate-x: 0px;
2654
2669
  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
2670
  }
@@ -2668,7 +2683,7 @@ input.tab:checked + .tab-content,
2668
2683
  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
2684
  margin-inline-start: 50%;
2670
2685
  }
2671
- :is([dir="rtl"] .steps-vertical .step):before {
2686
+ .steps-vertical .step:where([dir="rtl"], [dir="rtl"] *):before {
2672
2687
  --tw-translate-x: 50%;
2673
2688
  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
2689
  }
@@ -2702,6 +2717,7 @@ input.tab:checked + .tab-content,
2702
2717
  }
2703
2718
  .tooltip:before {
2704
2719
  max-width: 20rem;
2720
+ white-space: normal;
2705
2721
  border-radius: 0.25rem;
2706
2722
  padding-left: 0.5rem;
2707
2723
  padding-right: 0.5rem;
@@ -2794,6 +2810,10 @@ input.tab:checked + .tab-content,
2794
2810
  margin-left: 0.25rem;
2795
2811
  margin-right: 0.25rem;
2796
2812
  }
2813
+ .mx-auto {
2814
+ margin-left: auto;
2815
+ margin-right: auto;
2816
+ }
2797
2817
  .my-1 {
2798
2818
  margin-top: 0.25rem;
2799
2819
  margin-bottom: 0.25rem;
@@ -2805,6 +2825,15 @@ input.tab:checked + .tab-content,
2805
2825
  .mb-2 {
2806
2826
  margin-bottom: 0.5rem;
2807
2827
  }
2828
+ .ml-2 {
2829
+ margin-left: 0.5rem;
2830
+ }
2831
+ .ml-2\.5 {
2832
+ margin-left: 0.625rem;
2833
+ }
2834
+ .ml-3 {
2835
+ margin-left: 0.75rem;
2836
+ }
2808
2837
  .mr-2 {
2809
2838
  margin-right: 0.5rem;
2810
2839
  }
@@ -2838,12 +2867,12 @@ input.tab:checked + .tab-content,
2838
2867
  .w-32 {
2839
2868
  width: 8rem;
2840
2869
  }
2841
- .w-40 {
2842
- width: 10rem;
2843
- }
2844
2870
  .w-64 {
2845
2871
  width: 16rem;
2846
2872
  }
2873
+ .w-\[7\.5rem\] {
2874
+ width: 7.5rem;
2875
+ }
2847
2876
  .w-full {
2848
2877
  width: 100%;
2849
2878
  }
@@ -2851,8 +2880,8 @@ input.tab:checked + .tab-content,
2851
2880
  width: -moz-max-content;
2852
2881
  width: max-content;
2853
2882
  }
2854
- .min-w-40 {
2855
- min-width: 10rem;
2883
+ .min-w-\[7\.5rem\] {
2884
+ min-width: 7.5rem;
2856
2885
  }
2857
2886
  .max-w-screen-lg {
2858
2887
  max-width: 1024px;
@@ -2878,6 +2907,9 @@ input.tab:checked + .tab-content,
2878
2907
  .flex-wrap {
2879
2908
  flex-wrap: wrap;
2880
2909
  }
2910
+ .items-end {
2911
+ align-items: flex-end;
2912
+ }
2881
2913
  .items-center {
2882
2914
  align-items: center;
2883
2915
  }
@@ -3007,6 +3039,10 @@ input.tab:checked + .tab-content,
3007
3039
  .text-justify {
3008
3040
  text-align: justify;
3009
3041
  }
3042
+ .text-2xl {
3043
+ font-size: 1.5rem;
3044
+ line-height: 2rem;
3045
+ }
3010
3046
  .text-base {
3011
3047
  font-size: 1rem;
3012
3048
  line-height: 1.5rem;
@@ -3036,6 +3072,10 @@ input.tab:checked + .tab-content,
3036
3072
  .leading-5 {
3037
3073
  line-height: 1.25rem;
3038
3074
  }
3075
+ .text-\[\#606060\] {
3076
+ --tw-text-opacity: 1;
3077
+ color: rgb(96 96 96 / var(--tw-text-opacity));
3078
+ }
3039
3079
  .text-blue-600 {
3040
3080
  --tw-text-opacity: 1;
3041
3081
  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.4.5",
3
+ "version": "0.5.1",
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.18.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.7.0",
91
- "@typescript-eslint/parser": "^7.7.0",
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.4.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"
@@ -1,6 +1,6 @@
1
1
  import { type FunctionComponent } from 'preact';
2
2
 
3
- import { type AggregateData } from '../../query/queryAggregateData';
3
+ import { type AggregateData, compareAscending } from '../../query/queryAggregateData';
4
4
  import { Table } from '../components/table';
5
5
  import { formatProportion } from '../shared/table/formatProportion';
6
6
 
@@ -15,7 +15,9 @@ export const AggregateTable: FunctionComponent<AggregateTableProps> = ({ data, f
15
15
  ...fields.map((field) => {
16
16
  return {
17
17
  name: field,
18
- sort: true,
18
+ sort: {
19
+ compare: compareAscending,
20
+ },
19
21
  };
20
22
  }),
21
23
  {
@@ -182,7 +182,7 @@ export const DateRangeSelectorInner = <CustomLabel extends string>({
182
182
  <Select
183
183
  items={getSelectableOptions(customSelectOptions)}
184
184
  selected={selectedDateRange}
185
- selectStyle='select-bordered rounded-none flex-grow w-40'
185
+ selectStyle='select-bordered rounded-none flex-grow min-w-[7.5rem]'
186
186
  onChange={(event: Event) => {
187
187
  event.preventDefault();
188
188
  const select = event.target as HTMLSelectElement;
@@ -192,18 +192,16 @@ export const DateRangeSelectorInner = <CustomLabel extends string>({
192
192
  />
193
193
  <div className={'flex flex-wrap flex-grow'}>
194
194
  <input
195
- class='input input-bordered rounded-none flex-grow min-w-40'
195
+ class='input input-bordered rounded-none flex-grow w-[7.5rem]'
196
196
  type='text'
197
- size={10}
198
197
  placeholder='Date from'
199
198
  ref={fromDatePickerRef}
200
199
  onChange={onChangeDateFrom}
201
200
  onBlur={onChangeDateFrom}
202
201
  />
203
202
  <input
204
- class='input input-bordered rounded-none flex-grow min-w-40'
203
+ class='input input-bordered rounded-none flex-grow w-[7.5rem]'
205
204
  type='text'
206
- size={10}
207
205
  placeholder='Date to'
208
206
  ref={toDatePickerRef}
209
207
  onChange={onChangeDateTo}
@@ -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 variants to display. Maximum are five. </div>;
114
+ return <div>Too many datasets to display. Maximum are five. </div>;
115
115
  }
116
116
 
117
117
  return (