@genspectrum/dashboard-components 0.5.7 → 0.6.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 (43) hide show
  1. package/custom-elements.json +194 -128
  2. package/dist/dashboard-components.js +14 -93
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +24 -28
  5. package/dist/style.css +0 -4
  6. package/package.json +1 -1
  7. package/src/preact/aggregatedData/aggregate.stories.tsx +0 -2
  8. package/src/preact/aggregatedData/aggregate.tsx +3 -12
  9. package/src/preact/components/error-boundary.stories.tsx +2 -6
  10. package/src/preact/components/error-boundary.tsx +2 -5
  11. package/src/preact/lineageFilter/__mockData__/aggregated.json +14510 -0
  12. package/src/preact/lineageFilter/fetchLineageAutocompleteList.spec.ts +14 -0
  13. package/src/preact/lineageFilter/fetchLineageAutocompleteList.ts +9 -0
  14. package/src/preact/lineageFilter/lineage-filter.stories.tsx +56 -0
  15. package/src/preact/lineageFilter/lineage-filter.tsx +100 -0
  16. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -3
  17. package/src/preact/mutationComparison/mutation-comparison.tsx +3 -12
  18. package/src/preact/mutations/mutations.stories.tsx +0 -3
  19. package/src/preact/mutations/mutations.tsx +3 -12
  20. package/src/preact/numberSequencesOverTime/__mockData__/twoVariantsEG.json +0 -8
  21. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +0 -2
  22. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +3 -7
  23. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -4
  24. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +3 -12
  25. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -3
  26. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -7
  27. package/src/preact/textInput/text-input.tsx +1 -5
  28. package/src/web-components/input/gs-lineage-filter.stories.ts +137 -0
  29. package/src/web-components/input/gs-lineage-filter.tsx +79 -0
  30. package/src/web-components/visualization/gs-aggregate.stories.ts +0 -4
  31. package/src/web-components/visualization/gs-aggregate.tsx +0 -7
  32. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +0 -4
  33. package/src/web-components/visualization/gs-mutation-comparison.tsx +0 -7
  34. package/src/web-components/visualization/gs-mutations.stories.ts +0 -4
  35. package/src/web-components/visualization/gs-mutations.tsx +0 -7
  36. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +1 -3
  37. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +14 -11
  38. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +0 -5
  39. package/src/web-components/visualization/gs-prevalence-over-time.tsx +0 -7
  40. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +0 -4
  41. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +0 -7
  42. package/src/preact/components/headline.stories.tsx +0 -47
  43. package/src/preact/components/headline.tsx +0 -36
@@ -1357,30 +1357,10 @@ const ErrorDisplay = ({ error }) => {
1357
1357
  const ResizeContainer = ({ children, size: size2 }) => {
1358
1358
  return /* @__PURE__ */ u$1("div", { style: size2, children });
1359
1359
  };
1360
- const Headline = ({ heading, children }) => {
1361
- if (!heading) {
1362
- return /* @__PURE__ */ u$1(Fragment, { children });
1363
- }
1364
- return /* @__PURE__ */ u$1(ResizingHeadline, { heading, children });
1365
- };
1366
- const ResizingHeadline = ({ heading, children }) => {
1367
- const ref = A(null);
1368
- const [h1Height, setH1Height] = h("2rem");
1369
- y(() => {
1370
- if (ref.current) {
1371
- const h1Height2 = ref.current.getBoundingClientRect().height;
1372
- setH1Height(`${h1Height2}px`);
1373
- }
1374
- }, []);
1375
- return /* @__PURE__ */ u$1("div", { className: "h-full w-full", children: [
1376
- /* @__PURE__ */ u$1("h1", { ref, children: heading }),
1377
- /* @__PURE__ */ u$1("div", { style: { height: `calc(100% - ${h1Height})` }, children })
1378
- ] });
1379
- };
1380
- const ErrorBoundary = ({ size: size2, headline, children }) => {
1360
+ const ErrorBoundary = ({ size: size2, children }) => {
1381
1361
  const [internalError] = b2();
1382
1362
  if (internalError) {
1383
- return /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error: internalError }) }) });
1363
+ return /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(ErrorDisplay, { error: internalError }) });
1384
1364
  }
1385
1365
  return /* @__PURE__ */ u$1(Fragment, { children });
1386
1366
  };
@@ -1688,14 +1668,9 @@ function useQuery(fetchDataCallback, dependencies = []) {
1688
1668
  }, [JSON.stringify(dependencies)]);
1689
1669
  return { data, error, isLoading };
1690
1670
  }
1691
- const MutationComparison = ({
1692
- width,
1693
- height,
1694
- headline = "Mutation comparison",
1695
- ...innerProps
1696
- }) => {
1671
+ const MutationComparison = ({ width, height, ...innerProps }) => {
1697
1672
  const size2 = { height, width };
1698
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...innerProps }) }) }) });
1673
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...innerProps }) }) });
1699
1674
  };
1700
1675
  const MutationComparisonInner = ({
1701
1676
  lapisFilters,
@@ -4448,10 +4423,6 @@ input.tab:checked + .tab-content,
4448
4423
  --tw-border-opacity: 1;
4449
4424
  border-color: rgb(239 68 68 / var(--tw-border-opacity));
4450
4425
  }
4451
- .bg-base-200 {
4452
- --tw-bg-opacity: 1;
4453
- background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
4454
- }
4455
4426
  .bg-white {
4456
4427
  --tw-bg-opacity: 1;
4457
4428
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -4663,7 +4634,6 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
4663
4634
  this.views = ["table"];
4664
4635
  this.width = "100%";
4665
4636
  this.height = "700px";
4666
- this.headline = "Mutation comparison";
4667
4637
  this.pageSize = false;
4668
4638
  }
4669
4639
  render() {
@@ -4675,7 +4645,6 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
4675
4645
  views: this.views,
4676
4646
  width: this.width,
4677
4647
  height: this.height,
4678
- headline: this.headline,
4679
4648
  pageSize: this.pageSize
4680
4649
  }
4681
4650
  );
@@ -4696,9 +4665,6 @@ __decorateClass$9([
4696
4665
  __decorateClass$9([
4697
4666
  n2({ type: String })
4698
4667
  ], MutationComparisonComponent.prototype, "height", 2);
4699
- __decorateClass$9([
4700
- n2({ type: String })
4701
- ], MutationComparisonComponent.prototype, "headline", 2);
4702
4668
  __decorateClass$9([
4703
4669
  n2({ type: Object })
4704
4670
  ], MutationComparisonComponent.prototype, "pageSize", 2);
@@ -4968,14 +4934,9 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
4968
4934
  gridData: filteredSubstitutionsOrDeletions
4969
4935
  };
4970
4936
  }
4971
- const Mutations = ({
4972
- width,
4973
- height,
4974
- headline = "Mutations",
4975
- ...innerProps
4976
- }) => {
4937
+ const Mutations = ({ width, height, ...innerProps }) => {
4977
4938
  const size2 = { height, width };
4978
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsInner, { ...innerProps }) }) }) });
4939
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(MutationsInner, { ...innerProps }) }) });
4979
4940
  };
4980
4941
  const MutationsInner = ({
4981
4942
  lapisFilter,
@@ -5127,7 +5088,6 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
5127
5088
  this.views = ["table", "grid"];
5128
5089
  this.width = "100%";
5129
5090
  this.height = "700px";
5130
- this.headline = "Mutations";
5131
5091
  this.pageSize = false;
5132
5092
  }
5133
5093
  render() {
@@ -5139,7 +5099,6 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
5139
5099
  views: this.views,
5140
5100
  width: this.width,
5141
5101
  height: this.height,
5142
- headline: this.headline,
5143
5102
  pageSize: this.pageSize
5144
5103
  }
5145
5104
  );
@@ -5160,9 +5119,6 @@ __decorateClass$8([
5160
5119
  __decorateClass$8([
5161
5120
  n2({ type: String })
5162
5121
  ], MutationsComponent.prototype, "height", 2);
5163
- __decorateClass$8([
5164
- n2({ type: String })
5165
- ], MutationsComponent.prototype, "headline", 2);
5166
5122
  __decorateClass$8([
5167
5123
  n2({ type: Object })
5168
5124
  ], MutationsComponent.prototype, "pageSize", 2);
@@ -6761,14 +6717,9 @@ const ScalingSelector = ({
6761
6717
  }
6762
6718
  );
6763
6719
  };
6764
- const PrevalenceOverTime = ({
6765
- width,
6766
- height,
6767
- headline = "Prevalence over time",
6768
- ...innerProps
6769
- }) => {
6720
+ const PrevalenceOverTime = ({ width, height, ...innerProps }) => {
6770
6721
  const size2 = { height, width };
6771
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...innerProps }) }) }) });
6722
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...innerProps }) }) });
6772
6723
  };
6773
6724
  const PrevalenceOverTimeInner = ({
6774
6725
  numeratorFilter,
@@ -6946,7 +6897,6 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6946
6897
  this.smoothingWindow = 0;
6947
6898
  this.views = ["bar", "line", "bubble", "table"];
6948
6899
  this.confidenceIntervalMethods = ["wilson"];
6949
- this.headline = "Prevalence over time";
6950
6900
  this.width = "100%";
6951
6901
  this.height = "700px";
6952
6902
  this.lapisDateField = "date";
@@ -6966,7 +6916,6 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6966
6916
  confidenceIntervalMethods: this.confidenceIntervalMethods,
6967
6917
  width: this.width,
6968
6918
  height: this.height,
6969
- headline: this.headline,
6970
6919
  lapisDateField: this.lapisDateField,
6971
6920
  pageSize: this.pageSize,
6972
6921
  yAxisMaxConfig: {
@@ -6995,9 +6944,6 @@ __decorateClass$7([
6995
6944
  __decorateClass$7([
6996
6945
  n2({ type: Array })
6997
6946
  ], PrevalenceOverTimeComponent.prototype, "confidenceIntervalMethods", 2);
6998
- __decorateClass$7([
6999
- n2({ type: String })
7000
- ], PrevalenceOverTimeComponent.prototype, "headline", 2);
7001
6947
  __decorateClass$7([
7002
6948
  n2({ type: String })
7003
6949
  ], PrevalenceOverTimeComponent.prototype, "width", 2);
@@ -7231,11 +7177,10 @@ function toYearMonthDay(d2) {
7231
7177
  const RelativeGrowthAdvantage = ({
7232
7178
  width,
7233
7179
  height,
7234
- headline = "Relative growth advantage",
7235
7180
  ...innerProps
7236
7181
  }) => {
7237
7182
  const size2 = { height, width };
7238
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...innerProps }) }) }) });
7183
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...innerProps }) }) });
7239
7184
  };
7240
7185
  const RelativeGrowthAdvantageInner = ({
7241
7186
  numeratorFilter,
@@ -7359,7 +7304,6 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
7359
7304
  this.denominatorFilter = {};
7360
7305
  this.generationTime = 7;
7361
7306
  this.views = ["line"];
7362
- this.headline = "Relative growth advantage";
7363
7307
  this.width = "100%";
7364
7308
  this.height = "700px";
7365
7309
  this.lapisDateField = "date";
@@ -7376,7 +7320,6 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
7376
7320
  views: this.views,
7377
7321
  width: this.width,
7378
7322
  height: this.height,
7379
- headline: this.headline,
7380
7323
  lapisDateField: this.lapisDateField,
7381
7324
  yAxisMaxConfig: {
7382
7325
  linear: this.yAxisMaxLinear,
@@ -7398,9 +7341,6 @@ __decorateClass$6([
7398
7341
  __decorateClass$6([
7399
7342
  n2({ type: Array })
7400
7343
  ], RelativeGrowthAdvantageComponent.prototype, "views", 2);
7401
- __decorateClass$6([
7402
- n2({ type: String })
7403
- ], RelativeGrowthAdvantageComponent.prototype, "headline", 2);
7404
7344
  __decorateClass$6([
7405
7345
  n2({ type: String })
7406
7346
  ], RelativeGrowthAdvantageComponent.prototype, "width", 2);
@@ -7467,14 +7407,9 @@ const AggregateTable = ({ data, fields, pageSize }) => {
7467
7407
  ];
7468
7408
  return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
7469
7409
  };
7470
- const Aggregate = ({
7471
- width,
7472
- height,
7473
- headline = "Mutations",
7474
- ...innerProps
7475
- }) => {
7410
+ const Aggregate = ({ width, height, ...innerProps }) => {
7476
7411
  const size2 = { height, width };
7477
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregateInner, { ...innerProps }) }) }) });
7412
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(AggregateInner, { ...innerProps }) }) });
7478
7413
  };
7479
7414
  const AggregateInner = ({
7480
7415
  fields,
@@ -7536,7 +7471,6 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
7536
7471
  this.filter = {};
7537
7472
  this.width = "100%";
7538
7473
  this.height = "700px";
7539
- this.headline = "Aggregate";
7540
7474
  this.initialSortField = "count";
7541
7475
  this.initialSortDirection = "descending";
7542
7476
  this.pageSize = false;
@@ -7550,7 +7484,6 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
7550
7484
  filter: this.filter,
7551
7485
  width: this.width,
7552
7486
  height: this.height,
7553
- headline: this.headline,
7554
7487
  initialSortField: this.initialSortField,
7555
7488
  initialSortDirection: this.initialSortDirection,
7556
7489
  pageSize: this.pageSize
@@ -7573,9 +7506,6 @@ __decorateClass$5([
7573
7506
  __decorateClass$5([
7574
7507
  n2({ type: String })
7575
7508
  ], AggregateComponent.prototype, "height", 2);
7576
- __decorateClass$5([
7577
- n2({ type: String })
7578
- ], AggregateComponent.prototype, "headline", 2);
7579
7509
  __decorateClass$5([
7580
7510
  n2({ type: String })
7581
7511
  ], AggregateComponent.prototype, "initialSortField", 2);
@@ -7744,9 +7674,9 @@ async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField
7744
7674
  });
7745
7675
  return Promise.all(queries);
7746
7676
  }
7747
- const NumberSequencesOverTime = ({ width, height, headline, ...innerProps }) => {
7677
+ const NumberSequencesOverTime = ({ width, height, ...innerProps }) => {
7748
7678
  const size2 = { height, width };
7749
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...innerProps }) }) }) });
7679
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...innerProps }) }) });
7750
7680
  };
7751
7681
  const NumberSequencesOverTimeInner = ({
7752
7682
  lapisFilter,
@@ -7852,7 +7782,6 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
7852
7782
  this.lapisFilter = { displayName: "", lapisFilter: {} };
7853
7783
  this.lapisDateField = "date";
7854
7784
  this.views = ["bar", "line", "table"];
7855
- this.headline = "Number of sequences of time";
7856
7785
  this.width = "100%";
7857
7786
  this.height = "700px";
7858
7787
  this.granularity = "day";
@@ -7866,7 +7795,6 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
7866
7795
  lapisFilter: this.lapisFilter,
7867
7796
  lapisDateField: this.lapisDateField,
7868
7797
  views: this.views,
7869
- headline: this.headline,
7870
7798
  width: this.width,
7871
7799
  height: this.height,
7872
7800
  granularity: this.granularity,
@@ -7885,9 +7813,6 @@ __decorateClass$4([
7885
7813
  __decorateClass$4([
7886
7814
  n2({ type: Array })
7887
7815
  ], NumberSequencesOverTimeComponent.prototype, "views", 2);
7888
- __decorateClass$4([
7889
- n2({ type: String })
7890
- ], NumberSequencesOverTimeComponent.prototype, "headline", 2);
7891
7816
  __decorateClass$4([
7892
7817
  n2({ type: String })
7893
7818
  ], NumberSequencesOverTimeComponent.prototype, "width", 2);
@@ -8393,11 +8318,7 @@ const TextInput = ({ width, ...innerProps }) => {
8393
8318
  const size2 = { width, height: "3rem" };
8394
8319
  return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(TextInputInner, { ...innerProps }) }) });
8395
8320
  };
8396
- const TextInputInner = ({
8397
- lapisField,
8398
- placeholderText,
8399
- initialValue
8400
- }) => {
8321
+ const TextInputInner = ({ lapisField, placeholderText, initialValue }) => {
8401
8322
  const lapis = x(LapisUrlContext);
8402
8323
  const inputRef = A(null);
8403
8324
  const { data, error, isLoading } = useQuery(() => fetchAutocompleteList(lapis, lapisField), [lapisField, lapis]);