@genspectrum/dashboard-components 0.5.6 → 0.6.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 (38) hide show
  1. package/custom-elements.json +13 -127
  2. package/dist/dashboard-components.js +95 -109
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +14 -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/components/scaling-selector.tsx +9 -3
  12. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -3
  13. package/src/preact/mutationComparison/mutation-comparison.tsx +3 -12
  14. package/src/preact/mutations/mutations.stories.tsx +0 -3
  15. package/src/preact/mutations/mutations.tsx +4 -13
  16. package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +9 -2
  17. package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +9 -2
  18. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +0 -2
  19. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +70 -11
  20. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -4
  21. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +4 -13
  22. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -3
  23. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -7
  24. package/src/web-components/visualization/gs-aggregate.stories.ts +0 -4
  25. package/src/web-components/visualization/gs-aggregate.tsx +0 -7
  26. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +0 -4
  27. package/src/web-components/visualization/gs-mutation-comparison.tsx +0 -7
  28. package/src/web-components/visualization/gs-mutations.stories.ts +0 -4
  29. package/src/web-components/visualization/gs-mutations.tsx +0 -7
  30. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +0 -3
  31. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +14 -11
  32. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +0 -5
  33. package/src/web-components/visualization/gs-prevalence-over-time.tsx +0 -7
  34. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +0 -4
  35. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +0 -7
  36. package/src/preact/components/headline.stories.tsx +0 -47
  37. package/src/preact/components/headline.tsx +0 -36
  38. package/src/preact/shared/charts/scales.ts +0 -16
@@ -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,
@@ -1775,7 +1750,7 @@ const MutationComparisonTabs = ({
1775
1750
  {
1776
1751
  tabs,
1777
1752
  toolbar: /* @__PURE__ */ u$1(
1778
- Toolbar$3,
1753
+ Toolbar$4,
1779
1754
  {
1780
1755
  displayedSegments,
1781
1756
  setDisplayedSegments,
@@ -1789,7 +1764,7 @@ const MutationComparisonTabs = ({
1789
1764
  }
1790
1765
  );
1791
1766
  };
1792
- const Toolbar$3 = ({
1767
+ const Toolbar$4 = ({
1793
1768
  displayedSegments,
1794
1769
  setDisplayedSegments,
1795
1770
  displayedMutationTypes,
@@ -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,
@@ -5042,7 +5003,7 @@ const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
5042
5003
  };
5043
5004
  const tabs = views.map((view) => getTab(view));
5044
5005
  const toolbar = (activeTab) => /* @__PURE__ */ u$1(
5045
- Toolbar$2,
5006
+ Toolbar$3,
5046
5007
  {
5047
5008
  activeTab,
5048
5009
  displayedSegments,
@@ -5056,7 +5017,7 @@ const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
5056
5017
  );
5057
5018
  return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
5058
5019
  };
5059
- const Toolbar$2 = ({
5020
+ const Toolbar$3 = ({
5060
5021
  activeTab,
5061
5022
  displayedSegments,
5062
5023
  setDisplayedSegments,
@@ -5089,7 +5050,7 @@ const Toolbar$2 = ({
5089
5050
  {
5090
5051
  className: "mx-1 btn btn-xs",
5091
5052
  getData: () => getMutationsTableData(filteredData.tableData, proportionInterval),
5092
- filename: "substitutionsAndDeletions.csv"
5053
+ filename: "substitutions_and_deletions.csv"
5093
5054
  }
5094
5055
  )
5095
5056
  ] }),
@@ -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);
@@ -6732,16 +6688,20 @@ const ConfidenceIntervalSelector = ({
6732
6688
  }
6733
6689
  );
6734
6690
  };
6691
+ const scaleTypeItem = [
6692
+ { label: "Linear", value: "linear" },
6693
+ { label: "Logarithmic", value: "logarithmic" },
6694
+ { label: "Logit", value: "logit" }
6695
+ ];
6735
6696
  const ScalingSelector = ({
6736
6697
  yAxisScaleType,
6737
6698
  setYAxisScaleType,
6738
- className
6699
+ className,
6700
+ enabledTypes
6739
6701
  }) => {
6740
6702
  const items = [
6741
6703
  { label: "y axis scaling type", value: "none", disabled: true },
6742
- { label: "Linear", value: "linear" },
6743
- { label: "Logarithmic", value: "logarithmic" },
6744
- { label: "Logit", value: "logit" }
6704
+ ...scaleTypeItem.filter((item) => enabledTypes === void 0 || enabledTypes.includes(item.value))
6745
6705
  ];
6746
6706
  return /* @__PURE__ */ u$1(
6747
6707
  Select,
@@ -6757,14 +6717,9 @@ const ScalingSelector = ({
6757
6717
  }
6758
6718
  );
6759
6719
  };
6760
- const PrevalenceOverTime = ({
6761
- width,
6762
- height,
6763
- headline = "Prevalence over time",
6764
- ...innerProps
6765
- }) => {
6720
+ const PrevalenceOverTime = ({ width, height, ...innerProps }) => {
6766
6721
  const size2 = { height, width };
6767
- 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 }) }) });
6768
6723
  };
6769
6724
  const PrevalenceOverTimeInner = ({
6770
6725
  numeratorFilter,
@@ -6871,7 +6826,7 @@ const PrevalenceOverTimeTabs = ({
6871
6826
  };
6872
6827
  const tabs = views.map((view) => getTab(view));
6873
6828
  const toolbar = (activeTab) => /* @__PURE__ */ u$1(
6874
- Toolbar$1,
6829
+ Toolbar$2,
6875
6830
  {
6876
6831
  activeTab,
6877
6832
  yAxisScaleType,
@@ -6885,7 +6840,7 @@ const PrevalenceOverTimeTabs = ({
6885
6840
  );
6886
6841
  return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
6887
6842
  };
6888
- const Toolbar$1 = ({
6843
+ const Toolbar$2 = ({
6889
6844
  activeTab,
6890
6845
  yAxisScaleType,
6891
6846
  setYAxisScaleType,
@@ -6910,7 +6865,7 @@ const Toolbar$1 = ({
6910
6865
  {
6911
6866
  className: "mx-1 btn btn-xs",
6912
6867
  getData: () => getPrevalenceOverTimeTableData(data, granularity),
6913
- filename: "prevalence-over-time.csv"
6868
+ filename: "prevalence_over_time.csv"
6914
6869
  }
6915
6870
  ),
6916
6871
  /* @__PURE__ */ u$1(PrevalenceOverTimeInfo, {})
@@ -6942,7 +6897,6 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6942
6897
  this.smoothingWindow = 0;
6943
6898
  this.views = ["bar", "line", "bubble", "table"];
6944
6899
  this.confidenceIntervalMethods = ["wilson"];
6945
- this.headline = "Prevalence over time";
6946
6900
  this.width = "100%";
6947
6901
  this.height = "700px";
6948
6902
  this.lapisDateField = "date";
@@ -6962,7 +6916,6 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6962
6916
  confidenceIntervalMethods: this.confidenceIntervalMethods,
6963
6917
  width: this.width,
6964
6918
  height: this.height,
6965
- headline: this.headline,
6966
6919
  lapisDateField: this.lapisDateField,
6967
6920
  pageSize: this.pageSize,
6968
6921
  yAxisMaxConfig: {
@@ -6991,9 +6944,6 @@ __decorateClass$7([
6991
6944
  __decorateClass$7([
6992
6945
  n2({ type: Array })
6993
6946
  ], PrevalenceOverTimeComponent.prototype, "confidenceIntervalMethods", 2);
6994
- __decorateClass$7([
6995
- n2({ type: String })
6996
- ], PrevalenceOverTimeComponent.prototype, "headline", 2);
6997
6947
  __decorateClass$7([
6998
6948
  n2({ type: String })
6999
6949
  ], PrevalenceOverTimeComponent.prototype, "width", 2);
@@ -7227,11 +7177,10 @@ function toYearMonthDay(d2) {
7227
7177
  const RelativeGrowthAdvantage = ({
7228
7178
  width,
7229
7179
  height,
7230
- headline = "Relative growth advantage",
7231
7180
  ...innerProps
7232
7181
  }) => {
7233
7182
  const size2 = { height, width };
7234
- 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 }) }) });
7235
7184
  };
7236
7185
  const RelativeGrowthAdvantageInner = ({
7237
7186
  numeratorFilter,
@@ -7355,7 +7304,6 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
7355
7304
  this.denominatorFilter = {};
7356
7305
  this.generationTime = 7;
7357
7306
  this.views = ["line"];
7358
- this.headline = "Relative growth advantage";
7359
7307
  this.width = "100%";
7360
7308
  this.height = "700px";
7361
7309
  this.lapisDateField = "date";
@@ -7372,7 +7320,6 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
7372
7320
  views: this.views,
7373
7321
  width: this.width,
7374
7322
  height: this.height,
7375
- headline: this.headline,
7376
7323
  lapisDateField: this.lapisDateField,
7377
7324
  yAxisMaxConfig: {
7378
7325
  linear: this.yAxisMaxLinear,
@@ -7394,9 +7341,6 @@ __decorateClass$6([
7394
7341
  __decorateClass$6([
7395
7342
  n2({ type: Array })
7396
7343
  ], RelativeGrowthAdvantageComponent.prototype, "views", 2);
7397
- __decorateClass$6([
7398
- n2({ type: String })
7399
- ], RelativeGrowthAdvantageComponent.prototype, "headline", 2);
7400
7344
  __decorateClass$6([
7401
7345
  n2({ type: String })
7402
7346
  ], RelativeGrowthAdvantageComponent.prototype, "width", 2);
@@ -7463,14 +7407,9 @@ const AggregateTable = ({ data, fields, pageSize }) => {
7463
7407
  ];
7464
7408
  return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
7465
7409
  };
7466
- const Aggregate = ({
7467
- width,
7468
- height,
7469
- headline = "Mutations",
7470
- ...innerProps
7471
- }) => {
7410
+ const Aggregate = ({ width, height, ...innerProps }) => {
7472
7411
  const size2 = { height, width };
7473
- 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 }) }) });
7474
7413
  };
7475
7414
  const AggregateInner = ({
7476
7415
  fields,
@@ -7506,9 +7445,9 @@ const AggregatedDataTabs = ({ data, views, fields, pageSize }) => {
7506
7445
  }
7507
7446
  };
7508
7447
  const tabs = views.map((view) => getTab(view));
7509
- return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar: /* @__PURE__ */ u$1(Toolbar, { data }) });
7448
+ return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar: /* @__PURE__ */ u$1(Toolbar$1, { data }) });
7510
7449
  };
7511
- const Toolbar = ({ data }) => {
7450
+ const Toolbar$1 = ({ data }) => {
7512
7451
  return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
7513
7452
  /* @__PURE__ */ u$1(CsvDownloadButton, { className: "mx-1 btn btn-xs", getData: () => data, filename: "aggregate.csv" }),
7514
7453
  /* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for aggregate" })
@@ -7532,7 +7471,6 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
7532
7471
  this.filter = {};
7533
7472
  this.width = "100%";
7534
7473
  this.height = "700px";
7535
- this.headline = "Aggregate";
7536
7474
  this.initialSortField = "count";
7537
7475
  this.initialSortDirection = "descending";
7538
7476
  this.pageSize = false;
@@ -7546,7 +7484,6 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
7546
7484
  filter: this.filter,
7547
7485
  width: this.width,
7548
7486
  height: this.height,
7549
- headline: this.headline,
7550
7487
  initialSortField: this.initialSortField,
7551
7488
  initialSortDirection: this.initialSortDirection,
7552
7489
  pageSize: this.pageSize
@@ -7569,9 +7506,6 @@ __decorateClass$5([
7569
7506
  __decorateClass$5([
7570
7507
  n2({ type: String })
7571
7508
  ], AggregateComponent.prototype, "height", 2);
7572
- __decorateClass$5([
7573
- n2({ type: String })
7574
- ], AggregateComponent.prototype, "headline", 2);
7575
7509
  __decorateClass$5([
7576
7510
  n2({ type: String })
7577
7511
  ], AggregateComponent.prototype, "initialSortField", 2);
@@ -7615,7 +7549,7 @@ const getNumberOfSequencesOverTimeTableData = (data, dateRangeKey) => {
7615
7549
  });
7616
7550
  };
7617
7551
  Chart.register(...registerables);
7618
- const NumberSequencesOverTimeBarChart = ({ data }) => {
7552
+ const NumberSequencesOverTimeBarChart = ({ data, yAxisScaleType }) => {
7619
7553
  const config = T(
7620
7554
  () => ({
7621
7555
  type: "bar",
@@ -7625,6 +7559,11 @@ const NumberSequencesOverTimeBarChart = ({ data }) => {
7625
7559
  options: {
7626
7560
  maintainAspectRatio: false,
7627
7561
  animation: false,
7562
+ scales: {
7563
+ y: {
7564
+ type: getYAxisScale(yAxisScaleType).type
7565
+ }
7566
+ },
7628
7567
  plugins: {
7629
7568
  legend: {
7630
7569
  display: false
@@ -7636,7 +7575,7 @@ const NumberSequencesOverTimeBarChart = ({ data }) => {
7636
7575
  }
7637
7576
  }
7638
7577
  }),
7639
- [data]
7578
+ [data, yAxisScaleType]
7640
7579
  );
7641
7580
  return /* @__PURE__ */ u$1(GsChart, { configuration: config });
7642
7581
  };
@@ -7656,7 +7595,7 @@ const getDatasets$1 = (data) => {
7656
7595
  );
7657
7596
  };
7658
7597
  Chart.register(...registerables);
7659
- const NumberSequencesOverTimeLineChart = ({ data }) => {
7598
+ const NumberSequencesOverTimeLineChart = ({ data, yAxisScaleType }) => {
7660
7599
  const config = T(
7661
7600
  () => ({
7662
7601
  type: "line",
@@ -7666,6 +7605,11 @@ const NumberSequencesOverTimeLineChart = ({ data }) => {
7666
7605
  options: {
7667
7606
  maintainAspectRatio: false,
7668
7607
  animation: false,
7608
+ scales: {
7609
+ y: {
7610
+ type: getYAxisScale(yAxisScaleType).type
7611
+ }
7612
+ },
7669
7613
  plugins: {
7670
7614
  legend: {
7671
7615
  display: false
@@ -7677,7 +7621,7 @@ const NumberSequencesOverTimeLineChart = ({ data }) => {
7677
7621
  }
7678
7622
  }
7679
7623
  }),
7680
- [data]
7624
+ [data, yAxisScaleType]
7681
7625
  );
7682
7626
  return /* @__PURE__ */ u$1(GsChart, { configuration: config });
7683
7627
  };
@@ -7730,9 +7674,9 @@ async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField
7730
7674
  });
7731
7675
  return Promise.all(queries);
7732
7676
  }
7733
- const NumberSequencesOverTime = ({ width, height, headline, ...innerProps }) => {
7677
+ const NumberSequencesOverTime = ({ width, height, ...innerProps }) => {
7734
7678
  const size2 = { height, width };
7735
- 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 }) }) });
7736
7680
  };
7737
7681
  const NumberSequencesOverTimeInner = ({
7738
7682
  lapisFilter,
@@ -7758,12 +7702,19 @@ const NumberSequencesOverTimeInner = ({
7758
7702
  return /* @__PURE__ */ u$1(NumberSequencesOverTimeTabs, { views, data, granularity, pageSize });
7759
7703
  };
7760
7704
  const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) => {
7705
+ const [yAxisScaleType, setYAxisScaleType] = h("linear");
7761
7706
  const getTab = (view) => {
7762
7707
  switch (view) {
7763
7708
  case "bar":
7764
- return { title: "Bar", content: /* @__PURE__ */ u$1(NumberSequencesOverTimeBarChart, { data }) };
7709
+ return {
7710
+ title: "Bar",
7711
+ content: /* @__PURE__ */ u$1(NumberSequencesOverTimeBarChart, { data, yAxisScaleType })
7712
+ };
7765
7713
  case "line":
7766
- return { title: "Line", content: /* @__PURE__ */ u$1(NumberSequencesOverTimeLineChart, { data }) };
7714
+ return {
7715
+ title: "Line",
7716
+ content: /* @__PURE__ */ u$1(NumberSequencesOverTimeLineChart, { data, yAxisScaleType })
7717
+ };
7767
7718
  case "table":
7768
7719
  return {
7769
7720
  title: "Table",
@@ -7773,8 +7724,48 @@ const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) =>
7773
7724
  throw new Error(`Unknown view: ${view}`);
7774
7725
  }
7775
7726
  };
7776
- return /* @__PURE__ */ u$1(Tabs, { tabs: views.map((view) => getTab(view)) });
7727
+ return /* @__PURE__ */ u$1(
7728
+ Tabs,
7729
+ {
7730
+ tabs: views.map((view) => getTab(view)),
7731
+ toolbar: (activeTab) => /* @__PURE__ */ u$1(
7732
+ Toolbar,
7733
+ {
7734
+ activeTab,
7735
+ data,
7736
+ granularity,
7737
+ yAxisScaleType,
7738
+ setYAxisScaleType
7739
+ }
7740
+ )
7741
+ }
7742
+ );
7743
+ };
7744
+ const Toolbar = ({ activeTab, data, granularity, yAxisScaleType, setYAxisScaleType }) => {
7745
+ return /* @__PURE__ */ u$1(Fragment, { children: [
7746
+ activeTab !== "Table" && /* @__PURE__ */ u$1(
7747
+ ScalingSelector,
7748
+ {
7749
+ yAxisScaleType,
7750
+ setYAxisScaleType,
7751
+ enabledTypes: ["linear", "logarithmic"]
7752
+ }
7753
+ ),
7754
+ /* @__PURE__ */ u$1(
7755
+ CsvDownloadButton,
7756
+ {
7757
+ className: "mx-1 btn btn-xs",
7758
+ getData: () => getNumberOfSequencesOverTimeTableData(data, granularity),
7759
+ filename: "number_of_sequences_over_time.csv"
7760
+ }
7761
+ ),
7762
+ /* @__PURE__ */ u$1(NumberSequencesOverTimeInfo, {})
7763
+ ] });
7777
7764
  };
7765
+ const NumberSequencesOverTimeInfo = () => /* @__PURE__ */ u$1(Info, { height: "100px", children: [
7766
+ /* @__PURE__ */ u$1(InfoHeadline1, { children: "Number of sequences over time" }),
7767
+ /* @__PURE__ */ u$1(InfoParagraph, { children: /* @__PURE__ */ u$1("a", { href: "https://github.com/GenSpectrum/dashboard-components/issues/315", children: "TODO" }) })
7768
+ ] });
7778
7769
  var __defProp$4 = Object.defineProperty;
7779
7770
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
7780
7771
  var __decorateClass$4 = (decorators, target, key, kind) => {
@@ -7791,7 +7782,6 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
7791
7782
  this.lapisFilter = { displayName: "", lapisFilter: {} };
7792
7783
  this.lapisDateField = "date";
7793
7784
  this.views = ["bar", "line", "table"];
7794
- this.headline = "Number of sequences of time";
7795
7785
  this.width = "100%";
7796
7786
  this.height = "700px";
7797
7787
  this.granularity = "day";
@@ -7805,7 +7795,6 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
7805
7795
  lapisFilter: this.lapisFilter,
7806
7796
  lapisDateField: this.lapisDateField,
7807
7797
  views: this.views,
7808
- headline: this.headline,
7809
7798
  width: this.width,
7810
7799
  height: this.height,
7811
7800
  granularity: this.granularity,
@@ -7824,9 +7813,6 @@ __decorateClass$4([
7824
7813
  __decorateClass$4([
7825
7814
  n2({ type: Array })
7826
7815
  ], NumberSequencesOverTimeComponent.prototype, "views", 2);
7827
- __decorateClass$4([
7828
- n2({ type: String })
7829
- ], NumberSequencesOverTimeComponent.prototype, "headline", 2);
7830
7816
  __decorateClass$4([
7831
7817
  n2({ type: String })
7832
7818
  ], NumberSequencesOverTimeComponent.prototype, "width", 2);