@genspectrum/dashboard-components 0.15.0 → 0.16.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 (86) hide show
  1. package/custom-elements.json +255 -57
  2. package/dist/components.d.ts +49 -32
  3. package/dist/components.js +361 -212
  4. package/dist/components.js.map +1 -1
  5. package/dist/style.css +9 -0
  6. package/dist/util.d.ts +43 -43
  7. package/package.json +1 -1
  8. package/src/preact/ReferenceGenomeContext.ts +16 -1
  9. package/src/preact/aggregatedData/aggregate-bar-chart.tsx +26 -5
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +0 -1
  11. package/src/preact/aggregatedData/aggregate.tsx +5 -1
  12. package/src/preact/components/ReferenceGenomesAwaiter.tsx +1 -6
  13. package/src/preact/components/info.tsx +1 -0
  14. package/src/preact/components/resize-container.tsx +1 -1
  15. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +4 -2
  16. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -1
  17. package/src/preact/mutationComparison/mutation-comparison.tsx +5 -1
  18. package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -1
  19. package/src/preact/mutationFilter/mutation-filter.tsx +8 -0
  20. package/src/preact/mutations/mutations.stories.tsx +0 -1
  21. package/src/preact/mutations/mutations.tsx +1 -1
  22. package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +70 -14
  23. package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +30 -7
  24. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +56 -55
  25. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +26 -39
  26. package/src/preact/mutationsOverTime/mutations-over-time.tsx +22 -7
  27. package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +8 -3
  28. package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +8 -3
  29. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
  30. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +18 -3
  31. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +48 -35
  32. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +83 -70
  33. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +48 -37
  34. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -3
  35. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +6 -1
  36. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +31 -23
  37. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -1
  38. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +5 -1
  39. package/src/preact/sequencesByLocation/__mockData__/worldAtlas.json +1 -0
  40. package/src/preact/{map → sequencesByLocation}/sequences-by-location-map.tsx +6 -3
  41. package/src/preact/{map → sequencesByLocation}/sequences-by-location-table.tsx +1 -1
  42. package/src/preact/{map → sequencesByLocation}/sequences-by-location.stories.tsx +58 -1
  43. package/src/preact/{map → sequencesByLocation}/sequences-by-location.tsx +10 -1
  44. package/src/preact/shared/aspectRatio/AspectRatio.tsx +13 -0
  45. package/src/preact/shared/charts/getMaintainAspectRatio.ts +3 -0
  46. package/src/preact/statistic/statistics.stories.tsx +0 -1
  47. package/src/preact/statistic/statistics.tsx +4 -4
  48. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +0 -1
  49. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
  50. package/src/query/computeMapLocationData.spec.ts +1 -1
  51. package/src/query/computeMapLocationData.ts +1 -1
  52. package/src/query/querySequencesByLocationData.ts +1 -1
  53. package/src/utilEntrypoint.ts +1 -1
  54. package/src/web-components/PreactLitAdapter.tsx +2 -5
  55. package/src/web-components/ResizeContainer.mdx +4 -1
  56. package/src/web-components/gs-app.ts +2 -4
  57. package/src/web-components/visualization/gs-aggregate.stories.ts +13 -6
  58. package/src/web-components/visualization/gs-aggregate.tsx +1 -1
  59. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +8 -1
  60. package/src/web-components/visualization/gs-mutation-comparison.tsx +1 -1
  61. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +24 -1
  62. package/src/web-components/visualization/gs-mutations-over-time.tsx +30 -1
  63. package/src/web-components/visualization/gs-mutations.stories.ts +8 -1
  64. package/src/web-components/visualization/gs-mutations.tsx +1 -1
  65. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +11 -1
  66. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -1
  67. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -2
  68. package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
  69. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +8 -1
  70. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -1
  71. package/src/web-components/visualization/gs-sequences-by-location.stories.ts +13 -7
  72. package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -3
  73. package/src/web-components/visualization/gs-statistics.stories.ts +0 -1
  74. package/src/web-components/visualization/gs-statistics.tsx +1 -1
  75. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +9 -1
  76. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +1 -1
  77. package/standalone-bundle/dashboard-components.js +5817 -5706
  78. package/standalone-bundle/dashboard-components.js.map +1 -1
  79. package/standalone-bundle/style.css +1 -1
  80. package/src/preact/map/__mockData__/worldAtlas.json +0 -497127
  81. /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedGermany.json +0 -0
  82. /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedWorld.json +0 -0
  83. /package/src/preact/{map → sequencesByLocation}/__mockData__/germanyMap.json +0 -0
  84. /package/src/preact/{map → sequencesByLocation}/__mockData__/howToGenerateWorldMap.md +0 -0
  85. /package/src/preact/{map → sequencesByLocation}/leafletStyleModifications.css +0 -0
  86. /package/src/preact/{map → sequencesByLocation}/loadMapSource.tsx +0 -0
@@ -99,7 +99,6 @@ export const TwoDatasets: StoryObj<Required<PrevalenceOverTimeProps>> = {
99
99
  views: ['bar', 'line', 'bubble', 'table'],
100
100
  confidenceIntervalMethods: ['wilson'],
101
101
  width: '100%',
102
- height: '700px',
103
102
  lapisDateField: 'date',
104
103
  pageSize: 10,
105
104
  yAxisMaxLinear: 1,
@@ -175,7 +174,6 @@ export const OneDataset: StoryObj<Required<PrevalenceOverTimeProps>> = {
175
174
  views: ['bar', 'line', 'bubble', 'table'],
176
175
  confidenceIntervalMethods: ['wilson'],
177
176
  width: '100%',
178
- height: '700px',
179
177
  lapisDateField: 'date',
180
178
  pageSize: 10,
181
179
  yAxisMaxLinear: 1,
@@ -252,3 +250,11 @@ export const OneDatasetOnTableTab: StoryObj<Required<PrevalenceOverTimeProps>> =
252
250
  await fireEvent.click(canvas.getByRole('button', { name: 'Table' }));
253
251
  },
254
252
  };
253
+
254
+ export const WithFixedHeight: StoryObj<Required<PrevalenceOverTimeProps>> = {
255
+ ...TwoDatasets,
256
+ args: {
257
+ ...TwoDatasets.args,
258
+ height: '700px',
259
+ },
260
+ };
@@ -123,7 +123,7 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
123
123
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
124
124
  */
125
125
  @property({ type: String })
126
- height: string = '700px';
126
+ height: string | undefined = undefined;
127
127
 
128
128
  /**
129
129
  * Required.
@@ -81,7 +81,6 @@ export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
81
81
  generationTime: 7,
82
82
  views: ['line'],
83
83
  width: '100%',
84
- height: '700px',
85
84
  lapisDateField: 'date',
86
85
  yAxisMaxLinear: 1,
87
86
  yAxisMaxLogarithmic: 'limitTo1',
@@ -126,3 +125,11 @@ export const Default: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
126
125
  },
127
126
  },
128
127
  };
128
+
129
+ export const WithFixedHeight: StoryObj<Required<RelativeGrowthAdvantageProps>> = {
130
+ ...Default,
131
+ args: {
132
+ ...Default.args,
133
+ height: '700px',
134
+ },
135
+ };
@@ -87,7 +87,7 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
87
87
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
88
88
  */
89
89
  @property({ type: String })
90
- height: string = '700px';
90
+ height: string | undefined = undefined;
91
91
 
92
92
  /**
93
93
  * Required.
@@ -5,11 +5,11 @@ import { html } from 'lit';
5
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
6
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
7
7
  import aggregatedData from '../../preact/aggregatedData/__mockData__/aggregated.json';
8
- import aggregatedGermany from '../../preact/map/__mockData__/aggregatedGermany.json';
9
- import aggregatedWorld from '../../preact/map/__mockData__/aggregatedWorld.json';
10
- import mapOfGermany from '../../preact/map/__mockData__/germanyMap.json';
11
- import worldAtlas from '../../preact/map/__mockData__/worldAtlas.json';
12
- import { type SequencesByLocationProps } from '../../preact/map/sequences-by-location';
8
+ import aggregatedGermany from '../../preact/sequencesByLocation/__mockData__/aggregatedGermany.json';
9
+ import aggregatedWorld from '../../preact/sequencesByLocation/__mockData__/aggregatedWorld.json';
10
+ import mapOfGermany from '../../preact/sequencesByLocation/__mockData__/germanyMap.json';
11
+ import worldAtlas from '../../preact/sequencesByLocation/__mockData__/worldAtlas.json';
12
+ import { type SequencesByLocationProps } from '../../preact/sequencesByLocation/sequences-by-location';
13
13
  import { withinShadowRoot } from '../withinShadowRoot.story';
14
14
 
15
15
  import './gs-sequences-by-location';
@@ -86,7 +86,6 @@ const Template: StoryObj<SequencesByLocationProps> = {
86
86
  args: {
87
87
  enableMapNavigation: false,
88
88
  width: '1100px',
89
- height: '700px',
90
89
  views: ['map', 'table'],
91
90
  pageSize: 10,
92
91
  },
@@ -222,7 +221,6 @@ export const GermanyTableOnly: StoryObj<SequencesByLocationProps> = {
222
221
  lapisFilter: { dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany' },
223
222
  lapisLocationField: 'division',
224
223
  width: '100%',
225
- height: '700px',
226
224
  views: ['table'],
227
225
  pageSize: 10,
228
226
  },
@@ -249,3 +247,11 @@ export const GermanyTableOnly: StoryObj<SequencesByLocationProps> = {
249
247
  },
250
248
  },
251
249
  };
250
+
251
+ export const WithFixedHeight: StoryObj<SequencesByLocationProps> = {
252
+ ...WorldMap,
253
+ args: {
254
+ ...WorldMap.args,
255
+ height: '700px',
256
+ },
257
+ };
@@ -3,8 +3,11 @@ import { unsafeCSS } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import type { DetailedHTMLProps, HTMLAttributes } from 'react';
5
5
 
6
- import leafletStyleModifications from '../../preact/map/leafletStyleModifications.css?inline';
7
- import { SequencesByLocation, type SequencesByLocationProps } from '../../preact/map/sequences-by-location';
6
+ import leafletStyleModifications from '../../preact/sequencesByLocation/leafletStyleModifications.css?inline';
7
+ import {
8
+ SequencesByLocation,
9
+ type SequencesByLocationProps,
10
+ } from '../../preact/sequencesByLocation/sequences-by-location';
8
11
  import type { Equals, Expect } from '../../utils/typeAssertions';
9
12
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
10
13
 
@@ -148,7 +151,7 @@ export class SequencesByLocationComponent extends PreactLitAdapterWithGridJsStyl
148
151
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
149
152
  */
150
153
  @property({ type: String })
151
- height: string = '700px';
154
+ height: string | undefined = undefined;
152
155
 
153
156
  /**
154
157
  A list of tabs with views that this component should provide.
@@ -90,6 +90,5 @@ export const Default: StoryObj<Required<StatisticsProps>> = {
90
90
  division: 'Alabama',
91
91
  },
92
92
  width: '100%',
93
- height: '700px',
94
93
  },
95
94
  };
@@ -51,7 +51,7 @@ export class StatisticsComponent extends PreactLitAdapterWithGridJsStyles {
51
51
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
52
52
  */
53
53
  @property({ type: String })
54
- height: string = '100%';
54
+ height: string | undefined = undefined;
55
55
 
56
56
  override render() {
57
57
  return (
@@ -35,7 +35,7 @@ const meta: Meta<WastewaterMutationsOverTimeProps & { infoText: string }> = {
35
35
  lapisFilter: { versionStatus: 'LATEST_VERSION', isRevocation: false },
36
36
  sequenceType: 'nucleotide',
37
37
  width: '100%',
38
- height: '700px',
38
+ height: undefined,
39
39
  infoText: 'Some info text',
40
40
  maxNumberOfGridRows: 100,
41
41
  },
@@ -88,3 +88,11 @@ export const WastewaterMutationsOverTime: StoryObj<WastewaterMutationsOverTimePr
88
88
  },
89
89
  },
90
90
  };
91
+
92
+ export const WithFixedHeight: StoryObj<WastewaterMutationsOverTimeProps & { infoText: string }> = {
93
+ ...WastewaterMutationsOverTime,
94
+ args: {
95
+ ...WastewaterMutationsOverTime.args,
96
+ height: '700px',
97
+ },
98
+ };
@@ -63,7 +63,7 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
63
63
  * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
64
64
  */
65
65
  @property({ type: String })
66
- height: string = '700px';
66
+ height: string | undefined = undefined;
67
67
 
68
68
  /**
69
69
  * The maximum number of grid rows to display.