@genspectrum/dashboard-components 1.4.0 → 1.5.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.
- package/custom-elements.json +97 -5
- package/dist/assets/{mutationOverTimeWorker-CQxrFo53.js.map → mutationOverTimeWorker-BJ_P2T8Y.js.map} +1 -1
- package/dist/components.d.ts +45 -25
- package/dist/components.js +117 -20
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +25 -25
- package/package.json +1 -1
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +24 -0
- package/src/preact/lineageFilter/lineage-filter.tsx +13 -2
- package/src/preact/locationFilter/location-filter.stories.tsx +24 -0
- package/src/preact/locationFilter/location-filter.tsx +19 -3
- package/src/preact/mutationsOverTime/__mockData__/withGaps.ts +352 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +38 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +10 -0
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +2 -0
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +35 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +28 -4
- package/src/preact/textFilter/text-filter.stories.tsx +29 -4
- package/src/preact/textFilter/text-filter.tsx +13 -2
- package/src/query/queryMutationsOverTime.ts +37 -4
- package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +122 -0
- package/src/utils/map2d.spec.ts +30 -0
- package/src/utils/map2d.ts +14 -1
- package/src/web-components/input/gs-lineage-filter.stories.ts +7 -0
- package/src/web-components/input/gs-lineage-filter.tsx +8 -0
- package/src/web-components/input/gs-location-filter.stories.ts +7 -0
- package/src/web-components/input/gs-location-filter.tsx +9 -1
- package/src/web-components/input/gs-text-filter.stories.ts +7 -0
- package/src/web-components/input/gs-text-filter.tsx +8 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +14 -1
- package/src/web-components/visualization/gs-mutations-over-time.tsx +8 -0
- package/standalone-bundle/assets/{mutationOverTimeWorker-CDACUs6w.js.map → mutationOverTimeWorker-CkeGpKWp.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +1412 -1329
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
"type": {
|
|
564
564
|
"text": "Meta<Required<LineageFilterProps>>"
|
|
565
565
|
},
|
|
566
|
-
"default": "{ title: 'Input/Lineage filter', component: 'gs-lineage-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.lineageFilterChanged, ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'pangoLineage', url: AGGREGATED_ENDPOINT, body: { fields: ['pangoLineage'], country: 'Germany', }, }, response: { status: 200, body: aggregatedData, }, }, { matcher: { name: 'lineageDefinition', url: lineageDefinitionEndpoint(LAPIS_URL, 'pangoLineage'), }, response: { status: 200, body: lineageDefinition, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], argTypes: { lapisField: { control: { type: 'select', }, options: ['host'], }, placeholderText: { control: { type: 'text', }, }, value: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, lapisFilter: { control: { type: 'object', }, }, }, }"
|
|
566
|
+
"default": "{ title: 'Input/Lineage filter', component: 'gs-lineage-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.lineageFilterChanged, ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'pangoLineage', url: AGGREGATED_ENDPOINT, body: { fields: ['pangoLineage'], country: 'Germany', }, }, response: { status: 200, body: aggregatedData, }, }, { matcher: { name: 'lineageDefinition', url: lineageDefinitionEndpoint(LAPIS_URL, 'pangoLineage'), }, response: { status: 200, body: lineageDefinition, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], argTypes: { lapisField: { control: { type: 'select', }, options: ['host'], }, placeholderText: { control: { type: 'text', }, }, value: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, lapisFilter: { control: { type: 'object', }, }, hideCounts: { control: { type: 'boolean', }, }, }, }"
|
|
567
567
|
},
|
|
568
568
|
{
|
|
569
569
|
"kind": "variable",
|
|
@@ -699,6 +699,16 @@
|
|
|
699
699
|
"default": "'100%'",
|
|
700
700
|
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
|
|
701
701
|
"attribute": "width"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"kind": "field",
|
|
705
|
+
"name": "hideCounts",
|
|
706
|
+
"type": {
|
|
707
|
+
"text": "boolean | undefined"
|
|
708
|
+
},
|
|
709
|
+
"default": "false",
|
|
710
|
+
"description": "Whether to hide counts behind lineage options in the drop down selection.\nDefaults to false.",
|
|
711
|
+
"attribute": "hideCounts"
|
|
702
712
|
}
|
|
703
713
|
],
|
|
704
714
|
"events": [
|
|
@@ -755,6 +765,15 @@
|
|
|
755
765
|
"default": "'100%'",
|
|
756
766
|
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
|
|
757
767
|
"fieldName": "width"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "hideCounts",
|
|
771
|
+
"type": {
|
|
772
|
+
"text": "boolean | undefined"
|
|
773
|
+
},
|
|
774
|
+
"default": "false",
|
|
775
|
+
"description": "Whether to hide counts behind lineage options in the drop down selection.\nDefaults to false.",
|
|
776
|
+
"fieldName": "hideCounts"
|
|
758
777
|
}
|
|
759
778
|
],
|
|
760
779
|
"superclass": {
|
|
@@ -794,7 +813,7 @@
|
|
|
794
813
|
"type": {
|
|
795
814
|
"text": "Meta"
|
|
796
815
|
},
|
|
797
|
-
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.locationChanged, ...previewHandles], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, value: { control: { type: 'object', }, }, width: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, lapisFilter: { age: 18, }, }, tags: ['autodocs'], }"
|
|
816
|
+
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.locationChanged, ...previewHandles], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, value: { control: { type: 'object', }, }, width: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, hideCounts: { control: { type: 'boolean', }, }, lapisFilter: { age: 18, }, }, tags: ['autodocs'], }"
|
|
798
817
|
},
|
|
799
818
|
{
|
|
800
819
|
"kind": "variable",
|
|
@@ -930,6 +949,16 @@
|
|
|
930
949
|
"default": "undefined",
|
|
931
950
|
"description": "The placeholder text to display in the input field, if it is empty.",
|
|
932
951
|
"attribute": "placeholderText"
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"kind": "field",
|
|
955
|
+
"name": "hideCounts",
|
|
956
|
+
"type": {
|
|
957
|
+
"text": "boolean | undefined"
|
|
958
|
+
},
|
|
959
|
+
"default": "false",
|
|
960
|
+
"description": "Whether to hide counts behind location options in the drop down selection.\nDefaults to false.",
|
|
961
|
+
"attribute": "hideCounts"
|
|
933
962
|
}
|
|
934
963
|
],
|
|
935
964
|
"events": [
|
|
@@ -986,6 +1015,15 @@
|
|
|
986
1015
|
"default": "undefined",
|
|
987
1016
|
"description": "The placeholder text to display in the input field, if it is empty.",
|
|
988
1017
|
"fieldName": "placeholderText"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"name": "hideCounts",
|
|
1021
|
+
"type": {
|
|
1022
|
+
"text": "boolean | undefined"
|
|
1023
|
+
},
|
|
1024
|
+
"default": "false",
|
|
1025
|
+
"description": "Whether to hide counts behind location options in the drop down selection.\nDefaults to false.",
|
|
1026
|
+
"fieldName": "hideCounts"
|
|
989
1027
|
}
|
|
990
1028
|
],
|
|
991
1029
|
"superclass": {
|
|
@@ -1398,7 +1436,7 @@
|
|
|
1398
1436
|
"type": {
|
|
1399
1437
|
"text": "Meta<Required<TextFilterProps>>"
|
|
1400
1438
|
},
|
|
1401
|
-
"default": "{ title: 'Input/Text filter', component: 'gs-text-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.textFilterChanged, ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'hosts', url: AGGREGATED_ENDPOINT, body: { fields: ['host'], country: 'Germany', }, }, response: { status: 200, body: data, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { lapisField: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, value: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, lapisFilter: { control: { type: 'object', }, }, }, tags: ['autodocs'], }"
|
|
1439
|
+
"default": "{ title: 'Input/Text filter', component: 'gs-text-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.textFilterChanged, ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'hosts', url: AGGREGATED_ENDPOINT, body: { fields: ['host'], country: 'Germany', }, }, response: { status: 200, body: data, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { lapisField: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, hideCounts: { control: { type: 'boolean', }, }, value: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, lapisFilter: { control: { type: 'object', }, }, }, tags: ['autodocs'], }"
|
|
1402
1440
|
},
|
|
1403
1441
|
{
|
|
1404
1442
|
"kind": "variable",
|
|
@@ -1406,7 +1444,7 @@
|
|
|
1406
1444
|
"type": {
|
|
1407
1445
|
"text": "StoryObj<Required<TextFilterProps>>"
|
|
1408
1446
|
},
|
|
1409
|
-
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-(--breakpoint-lg)\"> <gs-text-filter .lapisField=${args.lapisField} .lapisFilter=${args.lapisFilter} .placeholderText=${args.placeholderText} .value=${args.value} .width=${args.width} ></gs-text-filter> </div> </gs-app>`; }, args: { lapisField: 'host', lapisFilter: { country: 'Germany' }, placeholderText: 'Enter host name', value: 'Homo sapiens', width: '100%', }, }"
|
|
1447
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-(--breakpoint-lg)\"> <gs-text-filter .lapisField=${args.lapisField} .lapisFilter=${args.lapisFilter} .placeholderText=${args.placeholderText} .hideCounts=${args.hideCounts} .value=${args.value} .width=${args.width} ></gs-text-filter> </div> </gs-app>`; }, args: { lapisField: 'host', lapisFilter: { country: 'Germany' }, placeholderText: 'Enter host name', hideCounts: false, value: 'Homo sapiens', width: '100%', }, }"
|
|
1410
1448
|
},
|
|
1411
1449
|
{
|
|
1412
1450
|
"kind": "variable",
|
|
@@ -1493,6 +1531,16 @@
|
|
|
1493
1531
|
"description": "The placeholder text to display in the input field.",
|
|
1494
1532
|
"attribute": "placeholderText"
|
|
1495
1533
|
},
|
|
1534
|
+
{
|
|
1535
|
+
"kind": "field",
|
|
1536
|
+
"name": "hideCounts",
|
|
1537
|
+
"type": {
|
|
1538
|
+
"text": "boolean | undefined"
|
|
1539
|
+
},
|
|
1540
|
+
"default": "false",
|
|
1541
|
+
"description": "Whether to hide counts behind options in the drop down selection.\nDefaults to false.",
|
|
1542
|
+
"attribute": "hideCounts"
|
|
1543
|
+
},
|
|
1496
1544
|
{
|
|
1497
1545
|
"kind": "field",
|
|
1498
1546
|
"name": "width",
|
|
@@ -1550,6 +1598,15 @@
|
|
|
1550
1598
|
"description": "The placeholder text to display in the input field.",
|
|
1551
1599
|
"fieldName": "placeholderText"
|
|
1552
1600
|
},
|
|
1601
|
+
{
|
|
1602
|
+
"name": "hideCounts",
|
|
1603
|
+
"type": {
|
|
1604
|
+
"text": "boolean | undefined"
|
|
1605
|
+
},
|
|
1606
|
+
"default": "false",
|
|
1607
|
+
"description": "Whether to hide counts behind options in the drop down selection.\nDefaults to false.",
|
|
1608
|
+
"fieldName": "hideCounts"
|
|
1609
|
+
},
|
|
1553
1610
|
{
|
|
1554
1611
|
"name": "width",
|
|
1555
1612
|
"type": {
|
|
@@ -2464,7 +2521,7 @@
|
|
|
2464
2521
|
"type": {
|
|
2465
2522
|
"text": "Meta<Required<MutationsOverTimeProps>>"
|
|
2466
2523
|
},
|
|
2467
|
-
"default": "{ title: 'Visualization/Mutations over time', component: 'gs-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, displayMutations: { control: 'object' }, initialMeanProportionInterval: { control: 'object' }, useNewEndpoint: { control: 'boolean' }, pageSizes: { control: 'object' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, sequenceType: 'nucleotide', views: ['grid'], width: '100%', granularity: 'month', lapisDateField: 'date', initialMeanProportionInterval: { min: 0.05, max: 0.9 }, useNewEndpoint: false, pageSizes: [10, 20, 30, 40, 50], }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: {}, }), tags: ['autodocs'], }"
|
|
2524
|
+
"default": "{ title: 'Visualization/Mutations over time', component: 'gs-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, displayMutations: { control: 'object' }, initialMeanProportionInterval: { control: 'object' }, hideGaps: { control: 'boolean' }, useNewEndpoint: { control: 'boolean' }, pageSizes: { control: 'object' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, sequenceType: 'nucleotide', views: ['grid'], width: '100%', granularity: 'month', lapisDateField: 'date', initialMeanProportionInterval: { min: 0.05, max: 0.9 }, hideGaps: false, useNewEndpoint: false, pageSizes: [10, 20, 30, 40, 50], }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, fetchMock: {}, }), tags: ['autodocs'], }"
|
|
2468
2525
|
},
|
|
2469
2526
|
{
|
|
2470
2527
|
"kind": "variable",
|
|
@@ -2482,6 +2539,14 @@
|
|
|
2482
2539
|
},
|
|
2483
2540
|
"default": "{ ...Template, args: { ...Template.args, displayMutations: ['A19722G', 'G21641T', 'T21653-'], }, }"
|
|
2484
2541
|
},
|
|
2542
|
+
{
|
|
2543
|
+
"kind": "variable",
|
|
2544
|
+
"name": "ByMonthWithFilterOnDisplayedMutationsAndGaps",
|
|
2545
|
+
"type": {
|
|
2546
|
+
"text": "StoryObj<Required<MutationsOverTimeProps>>"
|
|
2547
|
+
},
|
|
2548
|
+
"default": "{ ...Template, args: { ...Template.args, displayMutations: ['A19722G', 'G21641T', 'T21652-'], hideGaps: true, }, }"
|
|
2549
|
+
},
|
|
2485
2550
|
{
|
|
2486
2551
|
"kind": "variable",
|
|
2487
2552
|
"name": "ByWeek",
|
|
@@ -2540,6 +2605,14 @@
|
|
|
2540
2605
|
"module": "src/web-components/visualization/gs-mutations-over-time.stories.ts"
|
|
2541
2606
|
}
|
|
2542
2607
|
},
|
|
2608
|
+
{
|
|
2609
|
+
"kind": "js",
|
|
2610
|
+
"name": "ByMonthWithFilterOnDisplayedMutationsAndGaps",
|
|
2611
|
+
"declaration": {
|
|
2612
|
+
"name": "ByMonthWithFilterOnDisplayedMutationsAndGaps",
|
|
2613
|
+
"module": "src/web-components/visualization/gs-mutations-over-time.stories.ts"
|
|
2614
|
+
}
|
|
2615
|
+
},
|
|
2543
2616
|
{
|
|
2544
2617
|
"kind": "js",
|
|
2545
2618
|
"name": "ByWeek",
|
|
@@ -2673,6 +2746,16 @@
|
|
|
2673
2746
|
"description": "The initial proportion interval for the grid view.\nThe values must be between 0 and 1, inclusive.",
|
|
2674
2747
|
"attribute": "initialMeanProportionInterval"
|
|
2675
2748
|
},
|
|
2749
|
+
{
|
|
2750
|
+
"kind": "field",
|
|
2751
|
+
"name": "hideGaps",
|
|
2752
|
+
"type": {
|
|
2753
|
+
"text": "boolean"
|
|
2754
|
+
},
|
|
2755
|
+
"default": "false",
|
|
2756
|
+
"description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
|
|
2757
|
+
"attribute": "hideGaps"
|
|
2758
|
+
},
|
|
2676
2759
|
{
|
|
2677
2760
|
"kind": "field",
|
|
2678
2761
|
"name": "useNewEndpoint",
|
|
@@ -2785,6 +2868,15 @@
|
|
|
2785
2868
|
"description": "The initial proportion interval for the grid view.\nThe values must be between 0 and 1, inclusive.",
|
|
2786
2869
|
"fieldName": "initialMeanProportionInterval"
|
|
2787
2870
|
},
|
|
2871
|
+
{
|
|
2872
|
+
"name": "hideGaps",
|
|
2873
|
+
"type": {
|
|
2874
|
+
"text": "boolean"
|
|
2875
|
+
},
|
|
2876
|
+
"default": "false",
|
|
2877
|
+
"description": "If true, date ranges with no data will be hidden initially; if false, not.\nCan be switched with a button in the toolbar.",
|
|
2878
|
+
"fieldName": "hideGaps"
|
|
2879
|
+
},
|
|
2788
2880
|
{
|
|
2789
2881
|
"name": "useNewEndpoint",
|
|
2790
2882
|
"type": {
|