@genspectrum/dashboard-components 0.13.0 → 0.13.2

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 (39) hide show
  1. package/custom-elements.json +178 -0
  2. package/dist/assets/mutationOverTimeWorker-B1-WrM4b.js.map +1 -0
  3. package/dist/components.d.ts +108 -43
  4. package/dist/components.js +564 -295
  5. package/dist/components.js.map +1 -1
  6. package/dist/style.css +3 -0
  7. package/dist/util.d.ts +59 -43
  8. package/package.json +2 -2
  9. package/src/constants.ts +6 -0
  10. package/src/lapisApi/__mockData__/wiseReferenceGenome.json +9 -0
  11. package/src/lapisApi/lapisApi.ts +17 -0
  12. package/src/lapisApi/lapisTypes.ts +7 -1
  13. package/src/operator/FetchDetailsOperator.ts +28 -0
  14. package/src/preact/components/downshift-combobox.tsx +18 -20
  15. package/src/preact/components/tabs.tsx +1 -1
  16. package/src/preact/mutationsOverTime/MutationOverTimeData.ts +9 -5
  17. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +5 -3
  18. package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +4 -7
  19. package/src/preact/textInput/fetchStringAutocompleteList.spec.ts +34 -0
  20. package/src/preact/textInput/fetchStringAutocompleteList.ts +16 -2
  21. package/src/preact/textInput/text-input.tsx +22 -8
  22. package/src/preact/wastewater/mutationsOverTime/__mockData__/details.json +88 -0
  23. package/src/preact/wastewater/mutationsOverTime/computeWastewaterMutationsOverTimeDataPerLocation.spec.ts +159 -0
  24. package/src/preact/wastewater/mutationsOverTime/computeWastewaterMutationsOverTimeDataPerLocation.ts +51 -0
  25. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +71 -0
  26. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +151 -0
  27. package/src/query/queryMutationsOverTime.ts +6 -14
  28. package/src/query/queryWastewaterMutationsOverTime.spec.ts +94 -0
  29. package/src/query/queryWastewaterMutationsOverTime.ts +55 -0
  30. package/src/utils/map2d.ts +39 -0
  31. package/src/web-components/index.ts +1 -0
  32. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +82 -0
  33. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +112 -0
  34. package/src/web-components/wastewaterVisualization/index.ts +1 -0
  35. package/standalone-bundle/assets/{mutationOverTimeWorker-DEybsZ5r.js.map → mutationOverTimeWorker-Cls1J0cl.js.map} +1 -1
  36. package/standalone-bundle/dashboard-components.js +6228 -6008
  37. package/standalone-bundle/dashboard-components.js.map +1 -1
  38. package/standalone-bundle/style.css +1 -1
  39. package/dist/assets/mutationOverTimeWorker-DTv93Ere.js.map +0 -1
@@ -270,6 +270,14 @@
270
270
  "package": "./visualization"
271
271
  }
272
272
  },
273
+ {
274
+ "kind": "js",
275
+ "name": "*",
276
+ "declaration": {
277
+ "name": "*",
278
+ "package": "./wastewaterVisualization"
279
+ }
280
+ },
273
281
  {
274
282
  "kind": "js",
275
283
  "name": "*",
@@ -3945,6 +3953,176 @@
3945
3953
  }
3946
3954
  ]
3947
3955
  },
3956
+ {
3957
+ "kind": "javascript-module",
3958
+ "path": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts",
3959
+ "declarations": [
3960
+ {
3961
+ "kind": "variable",
3962
+ "name": "meta",
3963
+ "type": {
3964
+ "text": "Meta<Required<WastewaterMutationsOverTimeProps>>"
3965
+ },
3966
+ "default": "{ title: 'Wastewater visualization/Wastewater mutations over time', component: 'gs-wastewater-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, width: { control: 'text' }, height: { control: 'text' }, }, args: { lapisFilter: { versionStatus: 'LATEST_VERSION', isRevocation: false }, sequenceType: 'nucleotide', width: '100%', height: '700px', }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: {}, }), tags: ['autodocs'], }"
3967
+ },
3968
+ {
3969
+ "kind": "variable",
3970
+ "name": "WastewaterMutationsOverTime",
3971
+ "type": {
3972
+ "text": "StoryObj<Required<WastewaterMutationsOverTimeProps>>"
3973
+ },
3974
+ "default": "{ render: (args) => html` <gs-app lapis=\"${WISE_LAPIS_URL}\"> <gs-wastewater-mutations-over-time .lapisFilter=${args.lapisFilter} .sequenceType=${args.sequenceType} .width=${args.width} .height=${args.height} ></gs-wastewater-mutations-over-time> </gs-app> `, parameters: { fetchMock: { mocks: [ { matcher: { name: 'details', url: WISE_DETAILS_ENDPOINT, body: { fields: ['date', 'location', 'nucleotideMutationFrequency', 'aminoAcidMutationFrequency'], versionStatus: 'LATEST_VERSION', isRevocation: false, }, }, response: { status: 200, body: details, }, }, ], }, }, }"
3975
+ }
3976
+ ],
3977
+ "exports": [
3978
+ {
3979
+ "kind": "js",
3980
+ "name": "default",
3981
+ "declaration": {
3982
+ "name": "meta",
3983
+ "module": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts"
3984
+ }
3985
+ },
3986
+ {
3987
+ "kind": "js",
3988
+ "name": "WastewaterMutationsOverTime",
3989
+ "declaration": {
3990
+ "name": "WastewaterMutationsOverTime",
3991
+ "module": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts"
3992
+ }
3993
+ }
3994
+ ]
3995
+ },
3996
+ {
3997
+ "kind": "javascript-module",
3998
+ "path": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx",
3999
+ "declarations": [
4000
+ {
4001
+ "kind": "class",
4002
+ "description": "## Context\n\nThis component displays mutations for Swiss wastewater data generated within the WISE consortium. It is designed\nonly for this purpose and is not designed to be reused outside the WISE project.\n\nIt relies on a LAPIS instance that has the fields `nucleotideMutationFrequency` and `aminoAcidMutationFrequency`.\nThose fields are expected to be JSON strings of the format `{ [mutation]: frequency | null }`\n(e.g. `{ \"A123T\": 0.5, \"C456G\": 0.7, \"T789G\": null }`).\n\nThe component will stratify by `location`.\nEvery location will be rendered in a separate tab.\nThe content of the tab is a \"mutations over time\" grid, similar to the one used in the `gs-mutations-over-time` component.\n\nThis component also assumes that the LAPIS instance has the field `date` which can be used for the time axis.",
4003
+ "name": "WastewaterMutationsOverTimeComponent",
4004
+ "members": [
4005
+ {
4006
+ "kind": "field",
4007
+ "name": "lapisFilter",
4008
+ "type": {
4009
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
4010
+ },
4011
+ "default": "{}",
4012
+ "description": "Required.\n\nLAPIS filter to select the displayed data.",
4013
+ "attribute": "lapisFilter"
4014
+ },
4015
+ {
4016
+ "kind": "field",
4017
+ "name": "sequenceType",
4018
+ "type": {
4019
+ "text": "'nucleotide' | 'amino acid'"
4020
+ },
4021
+ "default": "'nucleotide'",
4022
+ "description": "Required.\n\nWhether to display nucleotide or amino acid mutations.",
4023
+ "attribute": "sequenceType"
4024
+ },
4025
+ {
4026
+ "kind": "field",
4027
+ "name": "width",
4028
+ "type": {
4029
+ "text": "string"
4030
+ },
4031
+ "default": "'100%'",
4032
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
4033
+ "attribute": "width"
4034
+ },
4035
+ {
4036
+ "kind": "field",
4037
+ "name": "height",
4038
+ "type": {
4039
+ "text": "string"
4040
+ },
4041
+ "default": "'700px'",
4042
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
4043
+ "attribute": "height"
4044
+ }
4045
+ ],
4046
+ "attributes": [
4047
+ {
4048
+ "name": "lapisFilter",
4049
+ "type": {
4050
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
4051
+ },
4052
+ "default": "{}",
4053
+ "description": "Required.\n\nLAPIS filter to select the displayed data.",
4054
+ "fieldName": "lapisFilter"
4055
+ },
4056
+ {
4057
+ "name": "sequenceType",
4058
+ "type": {
4059
+ "text": "'nucleotide' | 'amino acid'"
4060
+ },
4061
+ "default": "'nucleotide'",
4062
+ "description": "Required.\n\nWhether to display nucleotide or amino acid mutations.",
4063
+ "fieldName": "sequenceType"
4064
+ },
4065
+ {
4066
+ "name": "width",
4067
+ "type": {
4068
+ "text": "string"
4069
+ },
4070
+ "default": "'100%'",
4071
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
4072
+ "fieldName": "width"
4073
+ },
4074
+ {
4075
+ "name": "height",
4076
+ "type": {
4077
+ "text": "string"
4078
+ },
4079
+ "default": "'700px'",
4080
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
4081
+ "fieldName": "height"
4082
+ }
4083
+ ],
4084
+ "superclass": {
4085
+ "name": "PreactLitAdapterWithGridJsStyles",
4086
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
4087
+ },
4088
+ "tagName": "gs-wastewater-mutations-over-time",
4089
+ "customElement": true
4090
+ }
4091
+ ],
4092
+ "exports": [
4093
+ {
4094
+ "kind": "js",
4095
+ "name": "WastewaterMutationsOverTimeComponent",
4096
+ "declaration": {
4097
+ "name": "WastewaterMutationsOverTimeComponent",
4098
+ "module": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx"
4099
+ }
4100
+ },
4101
+ {
4102
+ "kind": "custom-element-definition",
4103
+ "name": "gs-wastewater-mutations-over-time",
4104
+ "declaration": {
4105
+ "name": "WastewaterMutationsOverTimeComponent",
4106
+ "module": "src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx"
4107
+ }
4108
+ }
4109
+ ]
4110
+ },
4111
+ {
4112
+ "kind": "javascript-module",
4113
+ "path": "src/web-components/wastewaterVisualization/index.ts",
4114
+ "declarations": [],
4115
+ "exports": [
4116
+ {
4117
+ "kind": "js",
4118
+ "name": "WastewaterMutationsOverTimeComponent",
4119
+ "declaration": {
4120
+ "name": "WastewaterMutationsOverTimeComponent",
4121
+ "module": "./gs-wastewater-mutations-over-time"
4122
+ }
4123
+ }
4124
+ ]
4125
+ },
3948
4126
  {
3949
4127
  "kind": "javascript-module",
3950
4128
  "path": "src/web-components/withinShadowRoot.story.ts",