@jbrowse/plugin-variants 3.2.0 → 3.3.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/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +39 -3
- package/dist/MultiLinearVariantDisplay/model.js +0 -1
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
- package/dist/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +12 -13
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
- package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
- package/dist/MultiLinearVariantRenderer/index.js +2 -2
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +60 -28
- package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
- package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
- package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/dist/VariantFeatureWidget/Formatter.js +23 -0
- package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/dist/VariantRPC/getGenotypeMatrix.js +10 -5
- package/dist/VariantRPC/types.d.ts +23 -0
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +123 -25
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +12 -7
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/shared/MultiVariantBaseModel.d.ts +40 -3
- package/dist/shared/MultiVariantBaseModel.js +69 -3
- package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
- package/dist/shared/components/AddFiltersDialog.js +61 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +8 -3
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
- package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
- package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
- package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
- package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/dist/shared/components/MultiVariantTooltip.js +3 -2
- package/dist/shared/components/RectBg.js +4 -2
- package/dist/shared/components/SetColorDialog.js +1 -1
- package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
- package/dist/shared/components/SourcesDataGrid.js +40 -47
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/drawAlleleCount.d.ts +1 -1
- package/dist/shared/drawAlleleCount.js +29 -5
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +39 -3
- package/esm/MultiLinearVariantDisplay/model.js +0 -1
- package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
- package/esm/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +13 -14
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
- package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
- package/esm/MultiLinearVariantRenderer/index.js +1 -1
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +61 -29
- package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
- package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/esm/VariantFeatureWidget/Formatter.js +17 -0
- package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/esm/VariantRPC/getGenotypeMatrix.js +10 -5
- package/esm/VariantRPC/types.d.ts +23 -0
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +121 -25
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +13 -8
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/shared/MultiVariantBaseModel.d.ts +40 -3
- package/esm/shared/MultiVariantBaseModel.js +71 -5
- package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
- package/esm/shared/components/AddFiltersDialog.js +59 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +9 -4
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
- package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
- package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
- package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
- package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/esm/shared/components/MultiVariantTooltip.js +3 -2
- package/esm/shared/components/RectBg.js +4 -2
- package/esm/shared/components/SetColorDialog.js +1 -1
- package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
- package/esm/shared/components/SourcesDataGrid.js +40 -47
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/drawAlleleCount.d.ts +1 -1
- package/esm/shared/drawAlleleCount.js +29 -5
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +10 -9
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
- package/dist/VariantRPC/cluster.d.ts +0 -17
- package/dist/VariantRPC/cluster.js +0 -84
- package/dist/shared/components/LegendBar.d.ts +0 -18
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
- package/esm/VariantRPC/cluster.d.ts +0 -17
- package/esm/VariantRPC/cluster.js +0 -79
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
- /package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
|
@@ -20,56 +20,49 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
20
20
|
});
|
|
21
21
|
function SourcesDataGrid({ rows, onChange, setSelected, }) {
|
|
22
22
|
const { classes } = useStyles();
|
|
23
|
+
const { id: _id, name: _name, label: _label, color: _color, baseUri: _baseUri, HP: _HP, ...rest } = rows[0];
|
|
23
24
|
const [currSort, setCurrSort] = (0, react_1.useState)({
|
|
24
25
|
idx: 0,
|
|
25
26
|
field: null,
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onChange([...rows]);
|
|
43
|
-
} }));
|
|
44
|
-
},
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { height: 400, width: '100%' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { checkboxSelection: true, onRowSelectionModelChange: arg => {
|
|
29
|
+
setSelected([...arg.ids]);
|
|
30
|
+
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
31
|
+
{
|
|
32
|
+
field: 'color',
|
|
33
|
+
headerName: 'Color',
|
|
34
|
+
renderCell: params => {
|
|
35
|
+
const { value, id } = params;
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(ColorPicker_1.default, { color: value || 'blue', onChange: c => {
|
|
37
|
+
const elt = rows.find(f => f.name === id);
|
|
38
|
+
if (elt) {
|
|
39
|
+
elt.color = c;
|
|
40
|
+
}
|
|
41
|
+
onChange([...rows]);
|
|
42
|
+
} }));
|
|
45
43
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} }) }));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "No rows, check sample metadata configuration" });
|
|
74
|
-
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
field: 'label',
|
|
47
|
+
headerName: 'Name',
|
|
48
|
+
width: (0, util_1.measureGridWidth)(rows.map(r => r.label)),
|
|
49
|
+
},
|
|
50
|
+
...Object.keys(rest).map(val => ({
|
|
51
|
+
field: val,
|
|
52
|
+
renderCell: ({ value }) => ((0, jsx_runtime_1.jsx)("div", { className: classes.cell, children: (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: (0, util_1.getStr)(value) }) })),
|
|
53
|
+
width: (0, util_1.measureGridWidth)(rows.map(r => `${r[val]}`)),
|
|
54
|
+
})),
|
|
55
|
+
], sortModel: [], onSortModelChange: args => {
|
|
56
|
+
const sort = args[0];
|
|
57
|
+
const idx = (currSort.idx + 1) % 2;
|
|
58
|
+
const field = sort.field || currSort.field;
|
|
59
|
+
setCurrSort({ idx, field });
|
|
60
|
+
onChange(field
|
|
61
|
+
? [...rows].sort((a, b) => {
|
|
62
|
+
const aa = (0, util_1.getStr)(a[field]);
|
|
63
|
+
const bb = (0, util_1.getStr)(b[field]);
|
|
64
|
+
return idx === 1 ? aa.localeCompare(bb) : bb.localeCompare(aa);
|
|
65
|
+
})
|
|
66
|
+
: rows);
|
|
67
|
+
} }) }));
|
|
75
68
|
}
|
|
@@ -9,6 +9,6 @@ const SourcesDataGrid_1 = __importDefault(require("./SourcesDataGrid"));
|
|
|
9
9
|
const SourcesGridHeader_1 = __importDefault(require("./SourcesGridHeader"));
|
|
10
10
|
function SourcesGrid({ rows, onChange, showTips, }) {
|
|
11
11
|
const [selected, setSelected] = (0, react_1.useState)([]);
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SourcesGridHeader_1.default, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }), (0, jsx_runtime_1.jsx)(SourcesDataGrid_1.default, { rows: rows, onChange: onChange, setSelected: setSelected })] }));
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SourcesGridHeader_1.default, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }), rows.length ? ((0, jsx_runtime_1.jsx)(SourcesDataGrid_1.default, { rows: rows, onChange: onChange, setSelected: setSelected })) : ((0, jsx_runtime_1.jsx)("div", { children: "No rows" }))] }));
|
|
13
13
|
}
|
|
14
14
|
exports.default = SourcesGrid;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
2
3
|
export default function SourcesGridHeader({ selected, onChange, rows, showTips, }: {
|
|
3
4
|
onChange: (arg: Source[]) => void;
|
|
4
5
|
rows: Source[];
|
|
5
|
-
selected:
|
|
6
|
+
selected: GridRowId[];
|
|
6
7
|
showTips: boolean;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function drawColorAlleleCount(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, mostFrequentAlt: string):
|
|
1
|
+
export declare function drawColorAlleleCount(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, mostFrequentAlt: string, drawReference?: boolean, featureType?: string, featureStrand?: number, alpha?: number): any;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.drawColorAlleleCount = drawColorAlleleCount;
|
|
4
4
|
const colord_1 = require("@jbrowse/core/util/colord");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
|
-
function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
6
|
+
function getColorAlleleCount(alleles, mostFrequentAlt, drawReference = true) {
|
|
7
7
|
const total = alleles.length;
|
|
8
8
|
let alt = 0;
|
|
9
9
|
let uncalled = 0;
|
|
@@ -24,7 +24,7 @@ function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
if (ref === total) {
|
|
27
|
-
return
|
|
27
|
+
return drawReference ? '#ccc' : undefined;
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
let a1;
|
|
@@ -42,7 +42,31 @@ function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
|
42
42
|
return (a1 === null || a1 === void 0 ? void 0 : a1.toHex()) || 'black';
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function drawColorAlleleCount(alleles, ctx, x, y, w, h, mostFrequentAlt) {
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
function drawColorAlleleCount(alleles, ctx, x, y, w, h, mostFrequentAlt, drawReference = true, featureType = '', featureStrand, alpha = 1) {
|
|
46
|
+
const c = getColorAlleleCount(alleles, mostFrequentAlt, drawReference);
|
|
47
|
+
if (c) {
|
|
48
|
+
ctx.fillStyle = alpha !== 1 ? (0, colord_1.colord)(c).alpha(alpha).toHex() : c;
|
|
49
|
+
if (featureType === 'inversion') {
|
|
50
|
+
if (featureStrand === 1) {
|
|
51
|
+
ctx.beginPath();
|
|
52
|
+
ctx.moveTo(x - constants_1.f2, y - constants_1.f2);
|
|
53
|
+
ctx.lineTo(x - constants_1.f2, y + h + constants_1.f2);
|
|
54
|
+
ctx.lineTo(x + w + constants_1.f2, y + h / 2);
|
|
55
|
+
ctx.closePath();
|
|
56
|
+
ctx.fill();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
ctx.beginPath();
|
|
60
|
+
ctx.moveTo(x + w + constants_1.f2, y - constants_1.f2);
|
|
61
|
+
ctx.lineTo(x + w + constants_1.f2, y + h + constants_1.f2);
|
|
62
|
+
ctx.lineTo(x - constants_1.f2, y + h / 2);
|
|
63
|
+
ctx.closePath();
|
|
64
|
+
ctx.fill();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
ctx.fillRect(x - constants_1.f2, y - constants_1.f2, w + constants_1.f2, h + constants_1.f2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return c;
|
|
48
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function drawPhased(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, HP: number, PS?: string):
|
|
1
|
+
export declare function drawPhased(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, HP: number, PS?: string, drawReference?: boolean, alpha?: number): string | undefined;
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.drawPhased = drawPhased;
|
|
4
4
|
const colors_1 = require("@jbrowse/core/ui/colors");
|
|
5
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
5
6
|
const constants_1 = require("./constants");
|
|
6
7
|
const util_1 = require("./util");
|
|
7
|
-
function getColorPhased(alleles, HP) {
|
|
8
|
+
function getColorPhased(alleles, HP, drawReference = true) {
|
|
8
9
|
const c = +alleles[HP];
|
|
9
|
-
return c ? colors_1.set1[c - 1] || 'black' : '#ccc';
|
|
10
|
+
return c ? colors_1.set1[c - 1] || 'black' : drawReference ? '#ccc' : undefined;
|
|
10
11
|
}
|
|
11
|
-
function getColorPhasedWithPhaseSet(alleles, HP, PS) {
|
|
12
|
+
function getColorPhasedWithPhaseSet(alleles, HP, PS, drawReference = true) {
|
|
12
13
|
const c = +alleles[HP];
|
|
13
|
-
return c ? (0, util_1.colorify)(+PS) || 'black' : '#ccc';
|
|
14
|
+
return c ? (0, util_1.colorify)(+PS) || 'black' : drawReference ? '#ccc' : undefined;
|
|
14
15
|
}
|
|
15
|
-
function drawPhased(alleles, ctx, x, y, w, h, HP, PS) {
|
|
16
|
-
|
|
17
|
-
PS
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
function drawPhased(alleles, ctx, x, y, w, h, HP, PS, drawReference = true, alpha = 1) {
|
|
17
|
+
const c = PS !== undefined
|
|
18
|
+
? getColorPhasedWithPhaseSet(alleles, HP, PS, drawReference)
|
|
19
|
+
: getColorPhased(alleles, HP, drawReference);
|
|
20
|
+
if (c) {
|
|
21
|
+
ctx.fillStyle = alpha !== 1 ? (0, colord_1.colord)(c).alpha(alpha).toHex() : c;
|
|
22
|
+
ctx.fillRect(x - constants_1.f2, y - constants_1.f2, w + constants_1.f2, h + constants_1.f2);
|
|
23
|
+
}
|
|
24
|
+
return c;
|
|
21
25
|
}
|
|
@@ -2,7 +2,12 @@ import type { Feature } from '@jbrowse/core/util';
|
|
|
2
2
|
export declare function findSecondLargestNumber(arr: Iterable<number>): number;
|
|
3
3
|
export declare function calculateAlleleCounts(feat: Feature): Map<any, any>;
|
|
4
4
|
export declare function calculateMinorAlleleFrequency(alleleCounts: Map<string, number>): number;
|
|
5
|
-
export declare function getFeaturesThatPassMinorAlleleFrequencyFilter(
|
|
5
|
+
export declare function getFeaturesThatPassMinorAlleleFrequencyFilter({ features, minorAlleleFrequencyFilter, lengthCutoffFilter, stopToken, }: {
|
|
6
|
+
features: Iterable<Feature>;
|
|
7
|
+
minorAlleleFrequencyFilter: number;
|
|
8
|
+
lengthCutoffFilter: number;
|
|
9
|
+
stopToken?: string;
|
|
10
|
+
}): {
|
|
6
11
|
feature: Feature;
|
|
7
12
|
mostFrequentAlt: string;
|
|
8
13
|
alleleCounts: Map<string, number>;
|
|
@@ -47,21 +47,20 @@ function getMostFrequentAlt(alleleCounts) {
|
|
|
47
47
|
}
|
|
48
48
|
return mostFrequentAlt;
|
|
49
49
|
}
|
|
50
|
-
function getFeaturesThatPassMinorAlleleFrequencyFilter(
|
|
50
|
+
function getFeaturesThatPassMinorAlleleFrequencyFilter({ features, minorAlleleFrequencyFilter, lengthCutoffFilter, stopToken, }) {
|
|
51
51
|
const results = [];
|
|
52
|
-
|
|
52
|
+
(0, util_1.forEachWithStopTokenCheck)(features, stopToken, feature => {
|
|
53
53
|
if (feature.get('end') - feature.get('start') <= lengthCutoffFilter) {
|
|
54
54
|
const alleleCounts = calculateAlleleCounts(feature);
|
|
55
55
|
if (calculateMinorAlleleFrequency(alleleCounts) >=
|
|
56
56
|
minorAlleleFrequencyFilter) {
|
|
57
|
-
const mostFrequentAlt = getMostFrequentAlt(alleleCounts);
|
|
58
57
|
results.push({
|
|
59
58
|
feature,
|
|
60
|
-
mostFrequentAlt,
|
|
59
|
+
mostFrequentAlt: getMostFrequentAlt(alleleCounts),
|
|
61
60
|
alleleCounts,
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
}
|
|
64
|
+
});
|
|
66
65
|
return results;
|
|
67
66
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
1
2
|
export declare function moveUp(arr: {
|
|
2
3
|
name: string;
|
|
3
|
-
}[], sel:
|
|
4
|
+
}[], sel: GridRowId[], by?: number): {
|
|
4
5
|
name: string;
|
|
5
6
|
}[];
|
|
6
7
|
export declare function moveDown(arr: {
|
|
7
8
|
name: string;
|
|
8
|
-
}[], sel:
|
|
9
|
+
}[], sel: GridRowId[], by?: number): {
|
|
9
10
|
name: string;
|
|
10
11
|
}[];
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import Crosshair from '
|
|
6
|
-
import LegendBar from '../../shared/components/
|
|
5
|
+
import Crosshair from '../../shared/components/MultiVariantCrosshairs';
|
|
6
|
+
import LegendBar from '../../shared/components/MultiVariantLegendBar';
|
|
7
7
|
const MultiLinearVariantDisplayComponent = observer(function (props) {
|
|
8
8
|
const { model } = props;
|
|
9
9
|
const ref = useRef(null);
|
|
@@ -7,7 +7,7 @@ export default function MultiLinearVariantDisplayF(pluginManager) {
|
|
|
7
7
|
const configSchema = configSchemaFactory(pluginManager);
|
|
8
8
|
return new DisplayType({
|
|
9
9
|
name: 'MultiLinearVariantDisplay',
|
|
10
|
-
displayName: 'Multi-variant display (regular)',
|
|
10
|
+
displayName: 'Multi-sample variant display (regular)',
|
|
11
11
|
configSchema,
|
|
12
12
|
stateModel: modelFactory(configSchema),
|
|
13
13
|
trackType: 'VariantTrack',
|
|
@@ -89,11 +89,13 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
89
89
|
renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
90
90
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
91
91
|
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
92
|
+
lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
93
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
94
|
+
referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
92
95
|
} & {
|
|
93
96
|
type: import("mobx-state-tree").ISimpleType<"MultiLinearVariantDisplay">;
|
|
94
97
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
95
98
|
minorAlleleFrequencyFilter: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
96
|
-
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
97
99
|
}, {
|
|
98
100
|
rendererTypeName: string;
|
|
99
101
|
error: unknown;
|
|
@@ -237,19 +239,28 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
237
239
|
renderProps(): any;
|
|
238
240
|
} & {
|
|
239
241
|
sourcesLoadingStopToken: string | undefined;
|
|
242
|
+
simplifiedFeaturesStopToken: string | undefined;
|
|
240
243
|
featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
|
|
241
244
|
sourcesVolatile: import("../shared/types").Source[] | undefined;
|
|
242
245
|
featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
|
|
243
246
|
hasPhased: boolean;
|
|
244
247
|
sampleInfo: undefined | Record<string, import("../shared/types").SampleInfo>;
|
|
245
|
-
hoveredGenotype:
|
|
248
|
+
hoveredGenotype: {
|
|
249
|
+
genotype: string;
|
|
250
|
+
name: string;
|
|
251
|
+
} | undefined;
|
|
246
252
|
} & {
|
|
253
|
+
setJexlFilters(f?: string[]): void;
|
|
247
254
|
setRowHeight(arg: number): void;
|
|
248
|
-
setHoveredGenotype(arg
|
|
255
|
+
setHoveredGenotype(arg?: {
|
|
256
|
+
genotype: string;
|
|
257
|
+
name: string;
|
|
258
|
+
}): void;
|
|
249
259
|
setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
|
|
250
260
|
setLayout(layout: import("../shared/types").Source[]): void;
|
|
251
261
|
clearLayout(): void;
|
|
252
262
|
setSourcesLoading(str: string): void;
|
|
263
|
+
setSimplifiedFeaturesLoading(str: string): void;
|
|
253
264
|
setSources(sources: import("../shared/types").Source[]): void;
|
|
254
265
|
setMafFilter(arg: number): void;
|
|
255
266
|
setShowSidebarLabels(arg: boolean): void;
|
|
@@ -257,7 +268,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
257
268
|
setAutoHeight(arg: boolean): void;
|
|
258
269
|
setHasPhased(arg: boolean): void;
|
|
259
270
|
setSampleInfo(arg: Record<string, import("../shared/types").SampleInfo>): void;
|
|
271
|
+
setReferenceDrawingMode(arg: string): void;
|
|
260
272
|
} & {
|
|
273
|
+
readonly activeFilters: any;
|
|
261
274
|
readonly preSources: import("../shared/types").Source[] | undefined;
|
|
262
275
|
readonly sourcesWithoutLayout: {
|
|
263
276
|
label: string;
|
|
@@ -278,6 +291,17 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
278
291
|
HP?: number;
|
|
279
292
|
}[] | undefined;
|
|
280
293
|
} & {
|
|
294
|
+
readonly sourceMap: {
|
|
295
|
+
[k: string]: {
|
|
296
|
+
label: string;
|
|
297
|
+
id: string;
|
|
298
|
+
baseUri?: string;
|
|
299
|
+
name: string;
|
|
300
|
+
color?: string;
|
|
301
|
+
group?: string;
|
|
302
|
+
HP?: number;
|
|
303
|
+
};
|
|
304
|
+
} | undefined;
|
|
281
305
|
readonly rowHeight: number;
|
|
282
306
|
adapterProps(): any;
|
|
283
307
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
@@ -331,6 +355,18 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
331
355
|
type?: undefined;
|
|
332
356
|
checked?: undefined;
|
|
333
357
|
onClick?: undefined;
|
|
358
|
+
} | {
|
|
359
|
+
label: string;
|
|
360
|
+
type: string;
|
|
361
|
+
subMenu: {
|
|
362
|
+
label: string;
|
|
363
|
+
type: string;
|
|
364
|
+
checked: boolean;
|
|
365
|
+
onClick: () => void;
|
|
366
|
+
}[];
|
|
367
|
+
icon?: undefined;
|
|
368
|
+
checked?: undefined;
|
|
369
|
+
onClick?: undefined;
|
|
334
370
|
} | {
|
|
335
371
|
label: string;
|
|
336
372
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
@@ -7,7 +7,6 @@ export function stateModelFactory(configSchema) {
|
|
|
7
7
|
type: types.literal('MultiLinearVariantDisplay'),
|
|
8
8
|
rowHeightSetting: types.optional(types.number, 11),
|
|
9
9
|
minorAlleleFrequencyFilter: types.optional(types.number, 0),
|
|
10
|
-
autoHeight: false,
|
|
11
10
|
}))
|
|
12
11
|
.views(() => ({
|
|
13
12
|
get rendererTypeName() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { when } from 'mobx';
|
|
4
|
-
import LegendBar from '../shared/components/
|
|
4
|
+
import LegendBar from '../shared/components/MultiVariantLegendBar';
|
|
5
5
|
export async function renderSvg(self, opts, superRenderSvg) {
|
|
6
6
|
await when(() => !!self.regionCannotBeRenderedText);
|
|
7
7
|
const { offsetPx } = getContainingView(self);
|
package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ResizeHandle } from '@jbrowse/core/ui';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, isValidElement, useState } from 'react';
|
|
3
|
+
import { ResizeHandle, SanitizedHTML } from '@jbrowse/core/ui';
|
|
4
|
+
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
5
|
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
7
|
import { makeStyles } from 'tss-react/mui';
|
|
@@ -35,15 +36,21 @@ const LinesConnectingMatrixToGenomicPosition = observer(function ({ model, expor
|
|
|
35
36
|
const assembly = assemblyManager.get(assemblyNames[0]);
|
|
36
37
|
const b0 = ((_a = dynamicBlocks.contentBlocks[0]) === null || _a === void 0 ? void 0 : _a.widthPx) || 0;
|
|
37
38
|
const w = b0 / ((featuresVolatile === null || featuresVolatile === void 0 ? void 0 : featuresVolatile.length) || 1);
|
|
38
|
-
return assembly && featuresVolatile ? (_jsxs(_Fragment, { children: [_jsxs(Wrapper, { exportSVG: exportSVG, model: model, children: [_jsx(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? (_jsx("line", { stroke: "#f00c", strokeWidth: 2, style: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
return assembly && featuresVolatile ? (_jsxs(_Fragment, { children: [_jsxs(Wrapper, { exportSVG: exportSVG, model: model, children: [_jsx(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? (_jsxs(_Fragment, { children: [_jsx("line", { stroke: "#f00c", strokeWidth: 2, style: {
|
|
40
|
+
pointerEvents: 'none',
|
|
41
|
+
}, x1: mouseOverLine.idx * w + w / 2, x2: mouseOverLine.c, y1: lineZoneHeight, y2: 0, onMouseLeave: () => {
|
|
42
|
+
setMouseOverLine(undefined);
|
|
43
|
+
} }), _jsx(LineTooltip, { contents: mouseOverLine.f.get('name') })] })) : null] }), !exportSVG ? (_jsx(ResizeHandle, { style: {
|
|
43
44
|
position: 'absolute',
|
|
44
45
|
top: lineZoneHeight - 4,
|
|
45
46
|
}, onDrag: n => model.setLineZoneHeight(lineZoneHeight + n), className: classes.resizeHandle })) : null] })) : null;
|
|
46
47
|
});
|
|
48
|
+
const TooltipContents = forwardRef(function TooltipContents2({ message }, ref) {
|
|
49
|
+
return (_jsx("div", { ref: ref, children: isValidElement(message) ? (message) : message ? (_jsx(SanitizedHTML, { html: String(message) })) : null }));
|
|
50
|
+
});
|
|
51
|
+
const LineTooltip = observer(function ({ contents }) {
|
|
52
|
+
return contents ? (_jsx(BaseTooltip, { children: _jsx(TooltipContents, { message: contents }) })) : null;
|
|
53
|
+
});
|
|
47
54
|
const AllLines = observer(function ({ model, setMouseOverLine, }) {
|
|
48
55
|
var _a;
|
|
49
56
|
const { assemblyManager } = getSession(model);
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import Crosshair from './Crosshair';
|
|
6
5
|
import LinesConnectingMatrixToGenomicPosition from './LinesConnectingMatrixToGenomicPosition';
|
|
7
|
-
import
|
|
6
|
+
import Crosshair from '../../shared/components/MultiVariantCrosshairs';
|
|
7
|
+
import LegendBar from '../../shared/components/MultiVariantLegendBar';
|
|
8
8
|
const MultiLinearVariantMatrixDisplayComponent = observer(function (props) {
|
|
9
9
|
const { model } = props;
|
|
10
10
|
const { lineZoneHeight } = model;
|
|
@@ -7,7 +7,7 @@ export default function LinearVariantMatrixDisplayF(pluginManager) {
|
|
|
7
7
|
const configSchema = configSchemaF(pluginManager);
|
|
8
8
|
return new DisplayType({
|
|
9
9
|
name: 'LinearVariantMatrixDisplay',
|
|
10
|
-
displayName: 'Multi-variant display (matrix)',
|
|
10
|
+
displayName: 'Multi-sample variant display (matrix)',
|
|
11
11
|
configSchema,
|
|
12
12
|
stateModel: stateModelFactory(configSchema),
|
|
13
13
|
trackType: 'VariantTrack',
|
|
@@ -89,6 +89,9 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
89
89
|
renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
90
90
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
91
91
|
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
92
|
+
lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
93
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
94
|
+
referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
92
95
|
} & {
|
|
93
96
|
type: import("mobx-state-tree").ISimpleType<"LinearVariantMatrixDisplay">;
|
|
94
97
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
@@ -236,19 +239,28 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
236
239
|
renderProps(): any;
|
|
237
240
|
} & {
|
|
238
241
|
sourcesLoadingStopToken: string | undefined;
|
|
242
|
+
simplifiedFeaturesStopToken: string | undefined;
|
|
239
243
|
featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
|
|
240
244
|
sourcesVolatile: import("../shared/types").Source[] | undefined;
|
|
241
245
|
featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
|
|
242
246
|
hasPhased: boolean;
|
|
243
247
|
sampleInfo: undefined | Record<string, import("../shared/types").SampleInfo>;
|
|
244
|
-
hoveredGenotype:
|
|
248
|
+
hoveredGenotype: {
|
|
249
|
+
genotype: string;
|
|
250
|
+
name: string;
|
|
251
|
+
} | undefined;
|
|
245
252
|
} & {
|
|
253
|
+
setJexlFilters(f?: string[]): void;
|
|
246
254
|
setRowHeight(arg: number): void;
|
|
247
|
-
setHoveredGenotype(arg
|
|
255
|
+
setHoveredGenotype(arg?: {
|
|
256
|
+
genotype: string;
|
|
257
|
+
name: string;
|
|
258
|
+
}): void;
|
|
248
259
|
setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
|
|
249
260
|
setLayout(layout: import("../shared/types").Source[]): void;
|
|
250
261
|
clearLayout(): void;
|
|
251
262
|
setSourcesLoading(str: string): void;
|
|
263
|
+
setSimplifiedFeaturesLoading(str: string): void;
|
|
252
264
|
setSources(sources: import("../shared/types").Source[]): void;
|
|
253
265
|
setMafFilter(arg: number): void;
|
|
254
266
|
setShowSidebarLabels(arg: boolean): void;
|
|
@@ -256,7 +268,9 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
256
268
|
setAutoHeight(arg: boolean): void;
|
|
257
269
|
setHasPhased(arg: boolean): void;
|
|
258
270
|
setSampleInfo(arg: Record<string, import("../shared/types").SampleInfo>): void;
|
|
271
|
+
setReferenceDrawingMode(arg: string): void;
|
|
259
272
|
} & {
|
|
273
|
+
readonly activeFilters: any;
|
|
260
274
|
readonly preSources: import("../shared/types").Source[] | undefined;
|
|
261
275
|
readonly sourcesWithoutLayout: {
|
|
262
276
|
label: string;
|
|
@@ -277,6 +291,17 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
277
291
|
HP?: number;
|
|
278
292
|
}[] | undefined;
|
|
279
293
|
} & {
|
|
294
|
+
readonly sourceMap: {
|
|
295
|
+
[k: string]: {
|
|
296
|
+
label: string;
|
|
297
|
+
id: string;
|
|
298
|
+
baseUri?: string;
|
|
299
|
+
name: string;
|
|
300
|
+
color?: string;
|
|
301
|
+
group?: string;
|
|
302
|
+
HP?: number;
|
|
303
|
+
};
|
|
304
|
+
} | undefined;
|
|
280
305
|
readonly rowHeight: number;
|
|
281
306
|
adapterProps(): any;
|
|
282
307
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
@@ -330,6 +355,18 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
330
355
|
type?: undefined;
|
|
331
356
|
checked?: undefined;
|
|
332
357
|
onClick?: undefined;
|
|
358
|
+
} | {
|
|
359
|
+
label: string;
|
|
360
|
+
type: string;
|
|
361
|
+
subMenu: {
|
|
362
|
+
label: string;
|
|
363
|
+
type: string;
|
|
364
|
+
checked: boolean;
|
|
365
|
+
onClick: () => void;
|
|
366
|
+
}[];
|
|
367
|
+
icon?: undefined;
|
|
368
|
+
checked?: undefined;
|
|
369
|
+
onClick?: undefined;
|
|
333
370
|
} | {
|
|
334
371
|
label: string;
|
|
335
372
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
@@ -38,6 +38,7 @@ export default function stateModelFactory(configSchema) {
|
|
|
38
38
|
notReady: superProps.notReady || !self.sources || !self.featuresReady,
|
|
39
39
|
renderingMode: self.renderingMode,
|
|
40
40
|
minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
|
|
41
|
+
lengthCutoffFilter: self.lengthCutoffFilter,
|
|
41
42
|
height: self.totalHeight,
|
|
42
43
|
sources: self.sources,
|
|
43
44
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { when } from 'mobx';
|
|
4
4
|
import LinesConnectingMatrixToGenomicPosition from './components/LinesConnectingMatrixToGenomicPosition';
|
|
5
|
-
import LegendBar from '../shared/components/
|
|
5
|
+
import LegendBar from '../shared/components/MultiVariantLegendBar';
|
|
6
6
|
export async function renderSvg(model, opts, superRenderSvg) {
|
|
7
7
|
await when(() => !!model.regionCannotBeRenderedText);
|
|
8
8
|
const { offsetPx } = getContainingView(model);
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import BoxRendererType from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
2
|
+
import { SimpleFeature } from '@jbrowse/core/util';
|
|
2
3
|
import type { RenderArgsDeserialized } from './types';
|
|
3
4
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
5
|
export default class LinearVariantMatrixRenderer extends BoxRendererType {
|
|
5
6
|
supportsSVG: boolean;
|
|
6
7
|
render(renderProps: RenderArgsDeserialized): Promise<{
|
|
7
8
|
features: Map<any, any>;
|
|
8
|
-
simplifiedFeatures:
|
|
9
|
+
simplifiedFeatures: SimpleFeature[];
|
|
9
10
|
height: number;
|
|
10
11
|
width: number;
|
|
12
|
+
arr: string[][];
|
|
11
13
|
canvasRecordedData: any;
|
|
12
14
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
13
15
|
reactElement?: React.ReactElement;
|
|
14
16
|
html?: string;
|
|
15
17
|
} | {
|
|
16
18
|
features: Map<any, any>;
|
|
17
|
-
simplifiedFeatures:
|
|
19
|
+
simplifiedFeatures: SimpleFeature[];
|
|
18
20
|
height: number;
|
|
19
21
|
width: number;
|
|
22
|
+
arr: string[][];
|
|
20
23
|
reactElement: import("react/jsx-runtime").JSX.Element;
|
|
21
24
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
22
25
|
html?: string;
|
|
23
26
|
} | {
|
|
24
27
|
features: Map<any, any>;
|
|
25
|
-
simplifiedFeatures:
|
|
28
|
+
simplifiedFeatures: SimpleFeature[];
|
|
26
29
|
height: number;
|
|
27
30
|
width: number;
|
|
31
|
+
arr: string[][];
|
|
28
32
|
imageData: any;
|
|
29
33
|
layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
|
|
30
34
|
reactElement?: React.ReactElement;
|
package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MultiVariantBaseModel } from '../../shared/MultiVariantBaseModel';
|
|
2
|
+
declare const MultiLinearVariantMatrixRendering: (props: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
displayModel: MultiVariantBaseModel;
|
|
6
|
+
arr: string[][];
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default MultiLinearVariantMatrixRendering;
|