@genspectrum/dashboard-components 0.16.3 → 0.16.4

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 (25) hide show
  1. package/dist/assets/{mutationOverTimeWorker-DJcZmEH9.js.map → mutationOverTimeWorker-CPfQDLe6.js.map} +1 -1
  2. package/dist/components.d.ts +30 -29
  3. package/dist/components.js +833 -794
  4. package/dist/components.js.map +1 -1
  5. package/dist/style.css +5 -0
  6. package/dist/util.d.ts +77 -33
  7. package/package.json +2 -1
  8. package/src/preact/components/annotated-mutation.stories.tsx +2 -1
  9. package/src/preact/components/annotated-mutation.tsx +6 -2
  10. package/src/preact/mutationComparison/mutation-comparison-table.tsx +14 -1
  11. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +39 -8
  12. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +36 -12
  13. package/src/preact/mutationComparison/mutation-comparison.tsx +2 -0
  14. package/src/preact/mutations/mutations.stories.tsx +3 -9
  15. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +3 -8
  16. package/src/preact/shared/stories/expectMutationAnnotation.ts +13 -0
  17. package/src/utilEntrypoint.ts +2 -0
  18. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +18 -1
  19. package/src/web-components/visualization/gs-mutation-comparison.tsx +19 -8
  20. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +2 -1
  21. package/src/web-components/visualization/gs-mutations.stories.ts +2 -1
  22. package/standalone-bundle/assets/mutationOverTimeWorker-CERZSdcA.js.map +1 -1
  23. package/standalone-bundle/dashboard-components.js +12787 -12215
  24. package/standalone-bundle/dashboard-components.js.map +1 -1
  25. package/standalone-bundle/style.css +1 -1
@@ -36,3 +36,5 @@ export type { AxisMax, YAxisMaxConfig } from './preact/shared/charts/getYAxisMax
36
36
  export { LocationChangedEvent } from './preact/locationFilter/LocationChangedEvent';
37
37
  export { LineageFilterChangedEvent } from './preact/lineageFilter/LineageFilterChangedEvent';
38
38
  export { TextFilterChangedEvent } from './preact/textFilter/TextFilterChangedEvent';
39
+
40
+ export type { MutationAnnotations, MutationAnnotation } from './web-components/mutation-annotations-context';
@@ -50,9 +50,26 @@ const meta: Meta<Required<MutationComparisonProps>> = {
50
50
 
51
51
  export default meta;
52
52
 
53
+ const mutationAnnotations = [
54
+ {
55
+ name: 'I am a mutation annotation!',
56
+ description: 'This describes what is special about these mutations.',
57
+ symbol: '#',
58
+ nucleotideMutations: ['G199-', 'C3037T'],
59
+ aminoAcidMutations: ['N:G204R'],
60
+ },
61
+ {
62
+ name: 'I am another mutation annotation!',
63
+ description: 'This describes what is special about these other mutations.',
64
+ symbol: '+',
65
+ nucleotideMutations: ['C3037T', 'A23403G'],
66
+ aminoAcidMutations: ['ORF1a:I2230T'],
67
+ },
68
+ ];
69
+
53
70
  const Template: StoryObj<Required<MutationComparisonProps>> = {
54
71
  render: (args) => html`
55
- <gs-app lapis="${LAPIS_URL}">
72
+ <gs-app lapis="${LAPIS_URL}" .mutationAnnotations=${mutationAnnotations}>
56
73
  <gs-mutation-comparison
57
74
  .lapisFilters=${args.lapisFilters}
58
75
  .sequenceType=${args.sequenceType}
@@ -1,9 +1,12 @@
1
+ import { consume } from '@lit/context';
1
2
  import { customElement, property } from 'lit/decorators.js';
2
3
  import type { DetailedHTMLProps, HTMLAttributes } from 'react';
3
4
 
5
+ import { MutationAnnotationsContextProvider } from '../../preact/MutationAnnotationsContext';
4
6
  import { MutationComparison, type MutationComparisonProps } from '../../preact/mutationComparison/mutation-comparison';
5
7
  import { type Equals, type Expect } from '../../utils/typeAssertions';
6
8
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
9
+ import { type MutationAnnotations, mutationAnnotationsContext } from '../mutation-annotations-context';
7
10
 
8
11
  /**
9
12
  * ## Context
@@ -88,16 +91,24 @@ export class MutationComparisonComponent extends PreactLitAdapterWithGridJsStyle
88
91
  @property({ type: Object })
89
92
  pageSize: boolean | number = false;
90
93
 
94
+ /**
95
+ * @internal
96
+ */
97
+ @consume({ context: mutationAnnotationsContext, subscribe: true })
98
+ mutationAnnotations: MutationAnnotations = [];
99
+
91
100
  override render() {
92
101
  return (
93
- <MutationComparison
94
- lapisFilters={this.lapisFilters}
95
- sequenceType={this.sequenceType}
96
- views={this.views}
97
- width={this.width}
98
- height={this.height}
99
- pageSize={this.pageSize}
100
- />
102
+ <MutationAnnotationsContextProvider value={this.mutationAnnotations}>
103
+ <MutationComparison
104
+ lapisFilters={this.lapisFilters}
105
+ sequenceType={this.sequenceType}
106
+ views={this.views}
107
+ width={this.width}
108
+ height={this.height}
109
+ pageSize={this.pageSize}
110
+ />
111
+ </MutationAnnotationsContextProvider>
101
112
  );
102
113
  }
103
114
  }
@@ -67,7 +67,8 @@ export default meta;
67
67
  const mutationAnnotations = [
68
68
  {
69
69
  name: 'I am a mutation annotation!',
70
- description: 'This describes what is special about these mutations.',
70
+ description:
71
+ 'This describes what is special about these mutations. <a class="link" href="/">And it has a link.</a>',
71
72
  symbol: '#',
72
73
  nucleotideMutations: ['C44T', 'C774T', 'G24872T', 'T23011-'],
73
74
  aminoAcidMutations: ['S:501Y', 'S:S31-', 'ORF1a:S4286C'],
@@ -71,7 +71,8 @@ export default meta;
71
71
  const mutationAnnotations = [
72
72
  {
73
73
  name: 'I am a mutation annotation!',
74
- description: 'This describes what is special about these mutations.',
74
+ description:
75
+ 'This describes what is special about these mutations. <a class="link" href="/">And it has a link.</a>',
75
76
  symbol: '#',
76
77
  nucleotideMutations: ['C241T', 'C3037T'],
77
78
  aminoAcidMutations: ['S:501Y', 'S:S31-', 'ORF1a:S4286C'],