@genspectrum/dashboard-components 0.4.4 → 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.
Files changed (64) hide show
  1. package/README.md +2 -2
  2. package/custom-elements.json +279 -108
  3. package/dist/dashboard-components.js +495 -283
  4. package/dist/dashboard-components.js.map +1 -1
  5. package/dist/genspectrum-components.d.ts +115 -55
  6. package/dist/style.css +34 -7
  7. package/package.json +5 -5
  8. package/src/preact/aggregatedData/aggregate-table.tsx +3 -2
  9. package/src/preact/aggregatedData/aggregate.stories.tsx +2 -0
  10. package/src/preact/aggregatedData/aggregate.tsx +8 -3
  11. package/src/preact/components/table.stories.tsx +51 -1
  12. package/src/preact/components/table.tsx +4 -3
  13. package/src/preact/locationFilter/location-filter.stories.tsx +12 -1
  14. package/src/preact/locationFilter/location-filter.tsx +10 -3
  15. package/src/preact/mutationComparison/mutation-comparison-table.tsx +7 -2
  16. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +1 -1
  17. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +21 -18
  18. package/src/preact/mutationComparison/mutation-comparison.tsx +30 -8
  19. package/src/preact/mutationComparison/queryMutationData.ts +4 -4
  20. package/src/preact/mutations/mutations-grid.tsx +8 -2
  21. package/src/preact/mutations/mutations-insertions-table.tsx +3 -2
  22. package/src/preact/mutations/mutations-table.tsx +3 -2
  23. package/src/preact/mutations/mutations.stories.tsx +6 -3
  24. package/src/preact/mutations/mutations.tsx +30 -10
  25. package/src/preact/mutations/queryMutations.ts +3 -3
  26. package/src/preact/prevalenceOverTime/__mockData__/{denominatorOneVariant.json → denominatorFilterOneDataset.json} +1 -1
  27. package/src/preact/prevalenceOverTime/__mockData__/{numeratorOneVariant.json → numeratorFilterOneDataset.json} +1 -1
  28. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +42 -5
  29. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +26 -7
  30. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +62 -28
  31. package/src/preact/prevalenceOverTime/prevalence-over-time-table.tsx +3 -2
  32. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +30 -16
  33. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +46 -12
  34. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +39 -7
  35. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +10 -4
  36. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +19 -10
  37. package/src/preact/shared/charts/confideceInterval.ts +7 -2
  38. package/src/preact/shared/charts/getYAxisMax.ts +24 -0
  39. package/src/preact/shared/charts/getYAxisScale.ts +1 -3
  40. package/src/query/queryAggregateData.ts +2 -2
  41. package/src/query/queryInsertions.ts +7 -2
  42. package/src/query/querySubstitutionsOrDeletions.ts +2 -2
  43. package/src/web-components/input/gs-date-range-selector.tsx +1 -1
  44. package/src/web-components/input/gs-location-filter.stories.ts +11 -0
  45. package/src/web-components/input/gs-location-filter.tsx +15 -2
  46. package/src/web-components/input/gs-mutation-filter.tsx +1 -1
  47. package/src/web-components/input/gs-text-input.tsx +1 -1
  48. package/src/web-components/visualization/gs-aggregate.stories.ts +4 -0
  49. package/src/web-components/visualization/gs-aggregate.tsx +10 -2
  50. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +16 -12
  51. package/src/web-components/visualization/gs-mutation-comparison.tsx +26 -19
  52. package/src/web-components/visualization/gs-mutations.stories.ts +8 -4
  53. package/src/web-components/visualization/gs-mutations.tsx +18 -11
  54. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +51 -35
  55. package/src/web-components/visualization/gs-prevalence-over-time.tsx +66 -24
  56. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +32 -18
  57. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +51 -13
  58. /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsOtherVariant.json → nucleotideMutationsOtherDataset.json} +0 -0
  59. /package/src/preact/mutationComparison/__mockData__/{nucleotideMutationsSomeVariant.json → nucleotideMutationsSomeDataset.json} +0 -0
  60. /package/src/preact/prevalenceOverTime/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
  61. /package/src/preact/prevalenceOverTime/__mockData__/{numeratorEG.json → numeratorFilterEG.json} +0 -0
  62. /package/src/preact/prevalenceOverTime/__mockData__/{numeratorJN1.json → numeratorFilterJN1.json} +0 -0
  63. /package/src/preact/relativeGrowthAdvantage/__mockData__/{denominator.json → denominatorFilter.json} +0 -0
  64. /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
  /**
@@ -66,6 +66,11 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
66
66
  * The initial sort direction of the table.
67
67
  */
68
68
  initialSortDirection: 'ascending' | 'descending';
69
+ /**
70
+ * The maximum number of rows to display in the table view.
71
+ * Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
72
+ */
73
+ pageSize: boolean | number;
69
74
  render(): JSX_2.Element;
70
75
  }
71
76
 
@@ -167,7 +172,7 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
167
172
  /**
168
173
  * The width of the component.
169
174
  *
170
- * 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.
171
176
  */
172
177
  width: string;
173
178
  /**
@@ -225,17 +230,21 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
225
230
  /**
226
231
  * The width of the component.
227
232
  *
228
- * 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.
229
234
  */
230
235
  width: string;
236
+ /**
237
+ * The placeholder text to display in the input field, if it is empty.
238
+ */
239
+ placeholderText: string;
231
240
  render(): JSX_2.Element;
232
241
  }
233
242
 
234
243
  /**
235
244
  * ## Context
236
245
  *
237
- * This component allows to compare mutations between different variants.
238
- * 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.
239
248
  *
240
249
  * It only shows substitutions and deletions, it does not show insertions.
241
250
  *
@@ -243,32 +252,31 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
243
252
  *
244
253
  * ### Table View
245
254
  *
246
- * The table view shows mutations
247
- * and the proportions with which the mutation occurs in the respective variant.
248
- * It only shows mutations that are present in at least one of the variants
249
- * 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.
250
258
  *
251
259
  * ### Venn View
252
260
  *
253
- * The Venn view shows the overlap of mutations between the variants in a Venn diagram.
254
- * A variant is considered to have a certain mutation,
255
- * if the proportion of the mutation in the variant is within the selected proportion interval.
256
- * Thus, changing the proportion interval may change a mutations from being "common" between variant
257
- * 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".
258
266
  */
259
267
  export declare class MutationComparisonComponent extends PreactLitAdapterWithGridJsStyles {
260
268
  /**
261
269
  * Required.
262
270
  *
263
- * An array of variants to compare.
271
+ * An array of LAPIS filters to select the data to compare.
264
272
  *
265
273
  * The `lapisFilter` will be sent as is to LAPIS to filter the mutation data.
266
274
  * It must be a valid LAPIS filter object.
267
275
  *
268
- * 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.
269
277
  * It should be human-readable.
270
278
  */
271
- variants: {
279
+ lapisFilters: {
272
280
  lapisFilter: Record<string, string | number | null | boolean>;
273
281
  displayName: string;
274
282
  }[];
@@ -283,19 +291,24 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
283
291
  /**
284
292
  * The width of the component.
285
293
  *
286
- * 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.
287
295
  */
288
296
  width: string;
289
297
  /**
290
298
  * The height of the component.
291
299
  *
292
- * 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.
293
301
  */
294
302
  height: string;
295
303
  /**
296
304
  * The headline of the component. Set to an empty string to hide the headline.
297
305
  */
298
306
  headline: string;
307
+ /**
308
+ * The maximum number of rows to display in the table view.
309
+ * Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
310
+ */
311
+ pageSize: boolean | number;
299
312
  render(): JSX_2.Element;
300
313
  }
301
314
 
@@ -368,7 +381,7 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
368
381
  /**
369
382
  * The width of the component.
370
383
  *
371
- * 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.
372
385
  */
373
386
  width: string;
374
387
  render(): JSX_2.Element;
@@ -377,15 +390,15 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
377
390
  /**
378
391
  * ## Context
379
392
  *
380
- * 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.
381
394
  *
382
395
  * ## Views
383
396
  *
384
397
  * ### Table View
385
398
  *
386
- * The table view shows all substitutions and deletions for the given variant.
399
+ * The table view shows all substitutions and deletions for the dataset.
387
400
  * It shows the type (substitution or deletion), the total count of the mutation
388
- * and the proportion of the mutation in the variant.
401
+ * and the proportion of the mutation in the dataset.
389
402
  * The proportion is relative to the total number of sequences matching
390
403
  * the specified sequence filters with non-ambiguous reads at that position.
391
404
  *
@@ -398,17 +411,16 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
398
411
  *
399
412
  * ### Insertions View
400
413
  *
401
- * 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.
402
415
  *
403
416
  */
404
417
  export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles {
405
418
  /**
406
419
  * Required.
407
420
  *
408
- * The `variant` will be sent as is to LAPIS to filter the mutation data.
409
- * It must be a valid LAPIS filter object.
421
+ * LAPIS filter to select the displayed data.
410
422
  */
411
- variant: Record<string, string | number | null | boolean>;
423
+ lapisFilter: Record<string, string | number | null | boolean>;
412
424
  /**
413
425
  * The type of the sequence for which the mutations should be shown.
414
426
  */
@@ -420,19 +432,24 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
420
432
  /**
421
433
  * The width of the component.
422
434
  *
423
- * 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.
424
436
  */
425
437
  width: string;
426
438
  /**
427
439
  * The height of the component.
428
440
  *
429
- * 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.
430
442
  */
431
443
  height: string;
432
444
  /**
433
445
  * The headline of the component. Set to an empty string to hide the headline.
434
446
  */
435
447
  headline: string;
448
+ /**
449
+ * The maximum number of rows to display in the table view.
450
+ * Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
451
+ */
452
+ pageSize: boolean | number;
436
453
  render(): JSX_2.Element;
437
454
  }
438
455
 
@@ -451,9 +468,9 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
451
468
  /**
452
469
  * ## Context
453
470
  *
454
- * This component displays the prevalence over time of one or more variants.
455
- * The prevalence is calculated as the ratio of the number of cases of each variant given as `numerator`
456
- * 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.
457
474
  *
458
475
  * In the chart views,
459
476
  * - the user can select whether to display a confidence interval (not available in the bubble chart).
@@ -467,19 +484,19 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
467
484
  * ### Bar View
468
485
  *
469
486
  * Displays the prevalence over time as a bar chart.
470
- * 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.
471
488
  *
472
489
  * ### Line View
473
490
  *
474
491
  * Displays the prevalence over time as a line chart.
475
492
  * Each data point is connected for better visibility.
476
- * Shows a line for each variant in the `numerator`.
493
+ * Shows a line for each dataset of the `numeratorFilter`.
477
494
  *
478
495
  * ### Bubble View
479
496
  *
480
497
  * Displays the prevalence over time as a bubble chart.
481
- * The size of the bubbles represents the number of cases of the `denominator` variant.
482
- * 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`.
483
500
  *
484
501
  * ### Table View
485
502
  *
@@ -488,13 +505,16 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
488
505
  export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
489
506
  /**
490
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.
491
515
  *
492
- * Either a single variant or an array of variants to compare.
493
- * This must be a valid LAPIS filter object with an additional `displayName` property
494
- * which will be used as the label for the variant in the views,
495
- * or an array of such objects.
496
516
  */
497
- numerator: {
517
+ numeratorFilter: {
498
518
  lapisFilter: Record<string, string | number | null | boolean>;
499
519
  displayName: string;
500
520
  } | {
@@ -504,9 +524,10 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
504
524
  /**
505
525
  * Required.
506
526
  *
507
- * 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.
508
529
  */
509
- denominator: Record<string, string | number | null | boolean>;
530
+ denominatorFilter: Record<string, string | number | null | boolean>;
510
531
  /**
511
532
  * The granularity of the time axis.
512
533
  */
@@ -538,13 +559,13 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
538
559
  /**
539
560
  * The width of the component.
540
561
  *
541
- * 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.
542
563
  */
543
564
  width: string;
544
565
  /**
545
566
  * The height of the component.
546
567
  *
547
- * 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.
548
569
  */
549
570
  height: string;
550
571
  /**
@@ -555,6 +576,27 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
555
576
  * Must be a field of type `date` in LAPIS.
556
577
  */
557
578
  lapisDateField: string;
579
+ /**
580
+ * The maximum number of rows to display in the table view.
581
+ * Set to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).
582
+ */
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;
558
600
  render(): JSX_2.Element;
559
601
  }
560
602
 
@@ -607,7 +649,7 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
607
649
  * For this component, we assume a discrete time model, where new infections happen exactly every `generationTime` days.
608
650
  * This is what we call a "generation".
609
651
  *
610
- * 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.
611
653
  * Based on the inferred logistic growth rate, we derive the relative growth advantage (per generation).
612
654
  *
613
655
  * For details on the scientific method, see:
@@ -623,7 +665,7 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
623
665
  * ### Line View
624
666
  *
625
667
  * The line view shows the relative growth advantage over time in a line chart.
626
- * 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`)
627
669
  * for every day as observed in the data.
628
670
  * The line shows a logistic curve fitted to the data points, including a 95% confidence interval.
629
671
  */
@@ -631,15 +673,17 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
631
673
  /**
632
674
  * Required.
633
675
  *
634
- * 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.
635
678
  */
636
- numerator: Record<string, string | number | null | boolean>;
679
+ numeratorFilter: Record<string, string | number | null | boolean>;
637
680
  /**
638
681
  * Required.
639
682
  *
640
- * 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.
641
685
  */
642
- denominator: Record<string, string | number | null | boolean>;
686
+ denominatorFilter: Record<string, string | number | null | boolean>;
643
687
  /**
644
688
  * The generation time represents the number of days over which the variant's relative growth advantage is measured.
645
689
  * For example, if we set a generation time of 7 days, then we estimate the growth advantage per week.
@@ -656,13 +700,13 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
656
700
  /**
657
701
  * The width of the component.
658
702
  *
659
- * 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.
660
704
  */
661
705
  width: string;
662
706
  /**
663
707
  * The height of the component.
664
708
  *
665
- * 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.
666
710
  */
667
711
  height: string;
668
712
  /**
@@ -673,6 +717,22 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
673
717
  * Must be a field of type `date` in LAPIS.
674
718
  */
675
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;
676
736
  render(): JSX_2.Element;
677
737
  }
678
738
 
@@ -711,7 +771,7 @@ export declare class TextInputComponent extends PreactLitAdapter {
711
771
  /**
712
772
  * The width of the component.
713
773
  *
714
- * 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.
715
775
  */
716
776
  width: string;
717
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-left: 1rem;
1472
- padding-right: 2.5rem;
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-"]) .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"])) {
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
- :is([dir="rtl"] .table) {
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
- :is([dir="rtl"] .steps-horizontal .step):before {
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
- :is([dir="rtl"] .steps-vertical .step):before {
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.4.4",
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.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"
@@ -7,9 +7,10 @@ import { formatProportion } from '../shared/table/formatProportion';
7
7
  type AggregateTableProps = {
8
8
  fields: string[];
9
9
  data: AggregateData;
10
+ pageSize: boolean | number;
10
11
  };
11
12
 
12
- export const AggregateTable: FunctionComponent<AggregateTableProps> = ({ data, fields }) => {
13
+ export const AggregateTable: FunctionComponent<AggregateTableProps> = ({ data, fields, pageSize }) => {
13
14
  const headers = [
14
15
  ...fields.map((field) => {
15
16
  return {
@@ -28,5 +29,5 @@ export const AggregateTable: FunctionComponent<AggregateTableProps> = ({ data, f
28
29
  },
29
30
  ];
30
31
 
31
- return <Table data={data} columns={headers} pagination={true} />;
32
+ return <Table data={data} columns={headers} pageSize={pageSize} />;
32
33
  };
@@ -15,6 +15,7 @@ const meta: Meta<AggregateProps> = {
15
15
  headline: { control: 'text' },
16
16
  initialSortField: { control: 'text' },
17
17
  initialSortDirection: { control: 'radio', options: ['ascending', 'descending'] },
18
+ pageSize: { control: 'object' },
18
19
  },
19
20
  parameters: {
20
21
  fetchMock: {
@@ -57,5 +58,6 @@ export const Default: StoryObj<AggregateProps> = {
57
58
  headline: 'Aggregate',
58
59
  initialSortField: 'count',
59
60
  initialSortDirection: 'descending',
61
+ pageSize: 10,
60
62
  },
61
63
  };
@@ -31,6 +31,7 @@ export interface AggregateInnerProps {
31
31
  views: View[];
32
32
  initialSortField: string;
33
33
  initialSortDirection: 'ascending' | 'descending';
34
+ pageSize: boolean | number;
34
35
  }
35
36
 
36
37
  export const Aggregate: FunctionComponent<AggregateProps> = ({
@@ -40,6 +41,7 @@ export const Aggregate: FunctionComponent<AggregateProps> = ({
40
41
  headline = 'Mutations',
41
42
  filter,
42
43
  fields,
44
+ pageSize,
43
45
  initialSortField,
44
46
  initialSortDirection,
45
47
  }) => {
@@ -55,6 +57,7 @@ export const Aggregate: FunctionComponent<AggregateProps> = ({
55
57
  views={views}
56
58
  initialSortField={initialSortField}
57
59
  initialSortDirection={initialSortDirection}
60
+ pageSize={pageSize}
58
61
  />
59
62
  </Headline>
60
63
  </ResizeContainer>
@@ -68,6 +71,7 @@ export const AggregateInner: FunctionComponent<AggregateInnerProps> = ({
68
71
  filter,
69
72
  initialSortField,
70
73
  initialSortDirection,
74
+ pageSize,
71
75
  }) => {
72
76
  const lapis = useContext(LapisUrlContext);
73
77
 
@@ -87,22 +91,23 @@ export const AggregateInner: FunctionComponent<AggregateInnerProps> = ({
87
91
  return <NoDataDisplay />;
88
92
  }
89
93
 
90
- return <AggregatedDataTabs data={data} views={views} fields={fields} />;
94
+ return <AggregatedDataTabs data={data} views={views} fields={fields} pageSize={pageSize} />;
91
95
  };
92
96
 
93
97
  type AggregatedDataTabsProps = {
94
98
  data: AggregateData;
95
99
  fields: string[];
96
100
  views: View[];
101
+ pageSize: boolean | number;
97
102
  };
98
103
 
99
- const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data, views, fields }) => {
104
+ const AggregatedDataTabs: FunctionComponent<AggregatedDataTabsProps> = ({ data, views, fields, pageSize }) => {
100
105
  const getTab = (view: View) => {
101
106
  switch (view) {
102
107
  case 'table':
103
108
  return {
104
109
  title: 'Table',
105
- content: <AggregateTable data={data} fields={fields} />,
110
+ content: <AggregateTable data={data} fields={fields} pageSize={pageSize} />,
106
111
  };
107
112
  }
108
113
  };