@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
|
@@ -7,8 +7,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
9
9
|
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const MultiVariantCrosshairs_1 = __importDefault(require("../../shared/components/MultiVariantCrosshairs"));
|
|
11
|
+
const MultiVariantLegendBar_1 = __importDefault(require("../../shared/components/MultiVariantLegendBar"));
|
|
12
12
|
const MultiLinearVariantDisplayComponent = (0, mobx_react_1.observer)(function (props) {
|
|
13
13
|
const { model } = props;
|
|
14
14
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -24,6 +24,6 @@ const MultiLinearVariantDisplayComponent = (0, mobx_react_1.observer)(function (
|
|
|
24
24
|
}, onMouseLeave: () => {
|
|
25
25
|
setMouseY(undefined);
|
|
26
26
|
setMouseX(undefined);
|
|
27
|
-
}, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(
|
|
27
|
+
}, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model }), mouseX && mouseY ? ((0, jsx_runtime_1.jsx)(MultiVariantCrosshairs_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
|
|
28
28
|
});
|
|
29
29
|
exports.default = MultiLinearVariantDisplayComponent;
|
|
@@ -46,7 +46,7 @@ function MultiLinearVariantDisplayF(pluginManager) {
|
|
|
46
46
|
const configSchema = (0, configSchema_1.default)(pluginManager);
|
|
47
47
|
return new DisplayType_1.default({
|
|
48
48
|
name: 'MultiLinearVariantDisplay',
|
|
49
|
-
displayName: 'Multi-variant display (regular)',
|
|
49
|
+
displayName: 'Multi-sample variant display (regular)',
|
|
50
50
|
configSchema,
|
|
51
51
|
stateModel: (0, model_1.default)(configSchema),
|
|
52
52
|
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">> & {
|
|
@@ -46,7 +46,6 @@ function stateModelFactory(configSchema) {
|
|
|
46
46
|
type: mobx_state_tree_1.types.literal('MultiLinearVariantDisplay'),
|
|
47
47
|
rowHeightSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 11),
|
|
48
48
|
minorAlleleFrequencyFilter: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 0),
|
|
49
|
-
autoHeight: false,
|
|
50
49
|
}))
|
|
51
50
|
.views(() => ({
|
|
52
51
|
get rendererTypeName() {
|
|
@@ -7,9 +7,9 @@ exports.renderSvg = renderSvg;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const mobx_1 = require("mobx");
|
|
10
|
-
const
|
|
10
|
+
const MultiVariantLegendBar_1 = __importDefault(require("../shared/components/MultiVariantLegendBar"));
|
|
11
11
|
async function renderSvg(self, opts, superRenderSvg) {
|
|
12
12
|
await (0, mobx_1.when)(() => !!self.regionCannotBeRenderedText);
|
|
13
13
|
const { offsetPx } = (0, util_1.getContainingView)(self);
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: (0, jsx_runtime_1.jsx)(
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: self, orientation: "left", exportSVG: true }) })] }));
|
|
15
15
|
}
|
package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
7
|
const react_1 = require("react");
|
|
5
8
|
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
+
const BaseTooltip_1 = __importDefault(require("@jbrowse/core/ui/BaseTooltip"));
|
|
6
10
|
const util_1 = require("@jbrowse/core/util");
|
|
7
11
|
const mobx_react_1 = require("mobx-react");
|
|
8
12
|
const mui_1 = require("tss-react/mui");
|
|
@@ -37,15 +41,21 @@ const LinesConnectingMatrixToGenomicPosition = (0, mobx_react_1.observer)(functi
|
|
|
37
41
|
const assembly = assemblyManager.get(assemblyNames[0]);
|
|
38
42
|
const b0 = ((_a = dynamicBlocks.contentBlocks[0]) === null || _a === void 0 ? void 0 : _a.widthPx) || 0;
|
|
39
43
|
const w = b0 / ((featuresVolatile === null || featuresVolatile === void 0 ? void 0 : featuresVolatile.length) || 1);
|
|
40
|
-
return assembly && featuresVolatile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Wrapper, { exportSVG: exportSVG, model: model, children: [(0, jsx_runtime_1.jsx)(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? ((0, jsx_runtime_1.jsx)("line", { stroke: "#f00c", strokeWidth: 2, style: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
return assembly && featuresVolatile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Wrapper, { exportSVG: exportSVG, model: model, children: [(0, jsx_runtime_1.jsx)(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("line", { stroke: "#f00c", strokeWidth: 2, style: {
|
|
45
|
+
pointerEvents: 'none',
|
|
46
|
+
}, x1: mouseOverLine.idx * w + w / 2, x2: mouseOverLine.c, y1: lineZoneHeight, y2: 0, onMouseLeave: () => {
|
|
47
|
+
setMouseOverLine(undefined);
|
|
48
|
+
} }), (0, jsx_runtime_1.jsx)(LineTooltip, { contents: mouseOverLine.f.get('name') })] })) : null] }), !exportSVG ? ((0, jsx_runtime_1.jsx)(ui_1.ResizeHandle, { style: {
|
|
45
49
|
position: 'absolute',
|
|
46
50
|
top: lineZoneHeight - 4,
|
|
47
51
|
}, onDrag: n => model.setLineZoneHeight(lineZoneHeight + n), className: classes.resizeHandle })) : null] })) : null;
|
|
48
52
|
});
|
|
53
|
+
const TooltipContents = (0, react_1.forwardRef)(function TooltipContents2({ message }, ref) {
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, children: (0, react_1.isValidElement)(message) ? (message) : message ? ((0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: String(message) })) : null }));
|
|
55
|
+
});
|
|
56
|
+
const LineTooltip = (0, mobx_react_1.observer)(function ({ contents }) {
|
|
57
|
+
return contents ? ((0, jsx_runtime_1.jsx)(BaseTooltip_1.default, { children: (0, jsx_runtime_1.jsx)(TooltipContents, { message: contents }) })) : null;
|
|
58
|
+
});
|
|
49
59
|
const AllLines = (0, mobx_react_1.observer)(function ({ model, setMouseOverLine, }) {
|
|
50
60
|
var _a;
|
|
51
61
|
const { assemblyManager } = (0, util_1.getSession)(model);
|
|
@@ -7,9 +7,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
9
9
|
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const Crosshair_1 = __importDefault(require("./Crosshair"));
|
|
11
10
|
const LinesConnectingMatrixToGenomicPosition_1 = __importDefault(require("./LinesConnectingMatrixToGenomicPosition"));
|
|
12
|
-
const
|
|
11
|
+
const MultiVariantCrosshairs_1 = __importDefault(require("../../shared/components/MultiVariantCrosshairs"));
|
|
12
|
+
const MultiVariantLegendBar_1 = __importDefault(require("../../shared/components/MultiVariantLegendBar"));
|
|
13
13
|
const MultiLinearVariantMatrixDisplayComponent = (0, mobx_react_1.observer)(function (props) {
|
|
14
14
|
const { model } = props;
|
|
15
15
|
const { lineZoneHeight } = model;
|
|
@@ -26,6 +26,6 @@ const MultiLinearVariantMatrixDisplayComponent = (0, mobx_react_1.observer)(func
|
|
|
26
26
|
}, onMouseLeave: () => {
|
|
27
27
|
setMouseY(undefined);
|
|
28
28
|
setMouseX(undefined);
|
|
29
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { model: model }), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'absolute', top: lineZoneHeight }, children: [(0, jsx_runtime_1.jsx)(
|
|
29
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { model: model }), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'absolute', top: lineZoneHeight }, children: [(0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model }), (0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props })] })] }), mouseX && mouseY && mouseY > lineZoneHeight ? ((0, jsx_runtime_1.jsx)(MultiVariantCrosshairs_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
|
|
30
30
|
});
|
|
31
31
|
exports.default = MultiLinearVariantMatrixDisplayComponent;
|
|
@@ -13,7 +13,7 @@ function LinearVariantMatrixDisplayF(pluginManager) {
|
|
|
13
13
|
const configSchema = (0, configSchema_1.default)(pluginManager);
|
|
14
14
|
return new DisplayType_1.default({
|
|
15
15
|
name: 'LinearVariantMatrixDisplay',
|
|
16
|
-
displayName: 'Multi-variant display (matrix)',
|
|
16
|
+
displayName: 'Multi-sample variant display (matrix)',
|
|
17
17
|
configSchema,
|
|
18
18
|
stateModel: (0, model_1.default)(configSchema),
|
|
19
19
|
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">> & {
|
|
@@ -77,6 +77,7 @@ function stateModelFactory(configSchema) {
|
|
|
77
77
|
notReady: superProps.notReady || !self.sources || !self.featuresReady,
|
|
78
78
|
renderingMode: self.renderingMode,
|
|
79
79
|
minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
|
|
80
|
+
lengthCutoffFilter: self.lengthCutoffFilter,
|
|
80
81
|
height: self.totalHeight,
|
|
81
82
|
sources: self.sources,
|
|
82
83
|
};
|
|
@@ -8,10 +8,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const mobx_1 = require("mobx");
|
|
10
10
|
const LinesConnectingMatrixToGenomicPosition_1 = __importDefault(require("./components/LinesConnectingMatrixToGenomicPosition"));
|
|
11
|
-
const
|
|
11
|
+
const MultiVariantLegendBar_1 = __importDefault(require("../shared/components/MultiVariantLegendBar"));
|
|
12
12
|
async function renderSvg(model, opts, superRenderSvg) {
|
|
13
13
|
await (0, mobx_1.when)(() => !!model.regionCannotBeRenderedText);
|
|
14
14
|
const { offsetPx } = (0, util_1.getContainingView)(model);
|
|
15
15
|
const { lineZoneHeight } = model;
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { exportSVG: true, model: model }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${lineZoneHeight})`, children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)(
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { exportSVG: true, model: model }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${lineZoneHeight})`, children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model, orientation: "left", exportSVG: true })] })] }) }));
|
|
17
17
|
}
|
|
@@ -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/dist/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;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
6
|
+
const mobx_react_1 = require("mobx-react");
|
|
7
|
+
const MultiLinearVariantMatrixRendering = (0, mobx_react_1.observer)(function (props) {
|
|
8
|
+
const { arr, width, height, displayModel } = props;
|
|
9
|
+
const ref = (0, react_1.useRef)(null);
|
|
10
|
+
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
if (!ref.current) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const r = ref.current.getBoundingClientRect();
|
|
16
|
+
const offsetX = eventClientX - r.left;
|
|
17
|
+
const offsetY = eventClientY - r.top;
|
|
18
|
+
const dimY = arr.length;
|
|
19
|
+
const dimX = ((_a = arr[0]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
20
|
+
const name = (_b = displayModel.sources[Math.floor((offsetY / height) * dimX)]) === null || _b === void 0 ? void 0 : _b.name;
|
|
21
|
+
const genotype = (_c = arr[Math.floor((offsetX / width) * dimY)]) === null || _c === void 0 ? void 0 : _c[Math.floor((offsetY / height) * dimX)];
|
|
22
|
+
return genotype && name
|
|
23
|
+
? {
|
|
24
|
+
name,
|
|
25
|
+
genotype,
|
|
26
|
+
}
|
|
27
|
+
: undefined;
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onMouseMove: e => {
|
|
30
|
+
displayModel.setHoveredGenotype(getFeatureUnderMouse(e.clientX, e.clientY));
|
|
31
|
+
}, onMouseLeave: () => {
|
|
32
|
+
displayModel.setHoveredGenotype(undefined);
|
|
33
|
+
}, onMouseOut: () => {
|
|
34
|
+
displayModel.setHoveredGenotype(undefined);
|
|
35
|
+
}, style: {
|
|
36
|
+
overflow: 'visible',
|
|
37
|
+
position: 'relative',
|
|
38
|
+
height,
|
|
39
|
+
}, children: (0, jsx_runtime_1.jsx)(ui_1.PrerenderedCanvas, { ...props }) }));
|
|
40
|
+
});
|
|
41
|
+
exports.default = MultiLinearVariantMatrixRendering;
|
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = LinearVariantMatrixRendererF;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const MultiLinearVariantMatrixRenderer_1 = __importDefault(require("./MultiLinearVariantMatrixRenderer"));
|
|
8
|
+
const MultiLinearVariantMatrixRendering_1 = __importDefault(require("./components/MultiLinearVariantMatrixRendering"));
|
|
9
9
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
10
10
|
function LinearVariantMatrixRendererF(pluginManager) {
|
|
11
11
|
pluginManager.addRendererType(() => {
|
|
12
|
-
return new
|
|
12
|
+
return new MultiLinearVariantMatrixRenderer_1.default({
|
|
13
13
|
name: 'LinearVariantMatrixRenderer',
|
|
14
14
|
displayName: 'Linear variant matrix renderer',
|
|
15
|
-
ReactComponent:
|
|
15
|
+
ReactComponent: MultiLinearVariantMatrixRendering_1.default,
|
|
16
16
|
configSchema: configSchema_1.default,
|
|
17
17
|
pluginManager,
|
|
18
18
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RenderArgsDeserialized } from './types';
|
|
2
2
|
export declare function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }: {
|
|
3
3
|
ctx: CanvasRenderingContext2D;
|
|
4
4
|
canvasWidth: number;
|
|
5
5
|
canvasHeight: number;
|
|
6
|
-
renderArgs:
|
|
6
|
+
renderArgs: RenderArgsDeserialized;
|
|
7
7
|
}): Promise<{
|
|
8
8
|
mafs: {
|
|
9
9
|
feature: import("@jbrowse/core/util").Feature;
|
|
@@ -8,29 +8,28 @@ const drawAlleleCount_1 = require("../shared/drawAlleleCount");
|
|
|
8
8
|
const drawPhased_1 = require("../shared/drawPhased");
|
|
9
9
|
const minorAlleleFrequencyUtils_1 = require("../shared/minorAlleleFrequencyUtils");
|
|
10
10
|
async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
|
|
11
|
-
const { renderingMode
|
|
11
|
+
const { renderingMode, minorAlleleFrequencyFilter, sources, features, stopToken, lengthCutoffFilter, } = renderArgs;
|
|
12
12
|
const { statusCallback = () => { } } = renderArgs;
|
|
13
13
|
const h = canvasHeight / sources.length;
|
|
14
14
|
(0, stopToken_1.checkStopToken)(stopToken);
|
|
15
|
-
const mafs = (0, minorAlleleFrequencyUtils_1.getFeaturesThatPassMinorAlleleFrequencyFilter)(
|
|
15
|
+
const mafs = (0, minorAlleleFrequencyUtils_1.getFeaturesThatPassMinorAlleleFrequencyFilter)({
|
|
16
|
+
stopToken,
|
|
17
|
+
features: features.values(),
|
|
18
|
+
minorAlleleFrequencyFilter,
|
|
19
|
+
lengthCutoffFilter,
|
|
20
|
+
});
|
|
16
21
|
(0, stopToken_1.checkStopToken)(stopToken);
|
|
17
22
|
const arr = [];
|
|
18
23
|
const m = mafs.length;
|
|
19
24
|
const w = canvasWidth / m;
|
|
20
25
|
await (0, util_1.updateStatus)('Drawing variant matrix', statusCallback, () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
for (let i = 0; i < m; i++) {
|
|
24
|
-
if (performance.now() - start > 400) {
|
|
25
|
-
(0, stopToken_1.checkStopToken)(stopToken);
|
|
26
|
-
start = performance.now();
|
|
27
|
-
}
|
|
26
|
+
(0, util_1.forEachWithStopTokenCheck)(mafs, stopToken, ({ feature, mostFrequentAlt }, idx) => {
|
|
27
|
+
var _a, _b, _c;
|
|
28
28
|
const arr2 = [];
|
|
29
|
-
const { feature, mostFrequentAlt } = mafs[i];
|
|
30
29
|
const hasPhaseSet = (_a = feature.get('FORMAT')) === null || _a === void 0 ? void 0 : _a.includes('PS');
|
|
31
30
|
if (hasPhaseSet) {
|
|
32
31
|
const samp = feature.get('samples');
|
|
33
|
-
const x = (
|
|
32
|
+
const x = (idx / mafs.length) * canvasWidth;
|
|
34
33
|
const sln = sources.length;
|
|
35
34
|
for (let j = 0; j < sln; j++) {
|
|
36
35
|
const y = (j / sln) * canvasHeight;
|
|
@@ -62,7 +61,7 @@ async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
|
|
|
62
61
|
}
|
|
63
62
|
else {
|
|
64
63
|
const samp = feature.get('genotypes');
|
|
65
|
-
const x = (
|
|
64
|
+
const x = (idx / mafs.length) * canvasWidth;
|
|
66
65
|
const sln = sources.length;
|
|
67
66
|
for (let j = 0; j < sln; j++) {
|
|
68
67
|
const y = (j / sln) * canvasHeight;
|
|
@@ -89,7 +88,7 @@ async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
arr.push(arr2);
|
|
92
|
-
}
|
|
91
|
+
});
|
|
93
92
|
});
|
|
94
93
|
return {
|
|
95
94
|
mafs,
|
|
@@ -6,11 +6,9 @@ export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
|
|
|
6
6
|
minorAlleleFrequencyFilter: number;
|
|
7
7
|
highResolutionScaling: number;
|
|
8
8
|
height: number;
|
|
9
|
-
renderingMode: string;
|
|
10
|
-
}
|
|
11
|
-
export interface RenderArgsDeserializedWithFeaturesAndLayout extends RenderArgsDeserialized {
|
|
12
|
-
sources: Source[];
|
|
13
9
|
features: Map<string, Feature>;
|
|
14
10
|
renderingMode: string;
|
|
15
11
|
statusCallback?: (arg: string) => void;
|
|
12
|
+
lengthCutoffFilter: number;
|
|
13
|
+
stopToken: string;
|
|
16
14
|
}
|
|
@@ -8,6 +8,16 @@ export default class MultiVariantBaseRenderer extends FeatureRendererType {
|
|
|
8
8
|
height: number;
|
|
9
9
|
width: number;
|
|
10
10
|
containsNoTransferables: boolean;
|
|
11
|
+
rbush: any;
|
|
12
|
+
featureGenotypeMap: {
|
|
13
|
+
[k: string]: {
|
|
14
|
+
alt: any;
|
|
15
|
+
ref: any;
|
|
16
|
+
name: any;
|
|
17
|
+
description: any;
|
|
18
|
+
length: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
11
21
|
canvasRecordedData: any;
|
|
12
22
|
reactElement?: React.ReactElement;
|
|
13
23
|
html?: string;
|
|
@@ -16,6 +26,16 @@ export default class MultiVariantBaseRenderer extends FeatureRendererType {
|
|
|
16
26
|
height: number;
|
|
17
27
|
width: number;
|
|
18
28
|
containsNoTransferables: boolean;
|
|
29
|
+
rbush: any;
|
|
30
|
+
featureGenotypeMap: {
|
|
31
|
+
[k: string]: {
|
|
32
|
+
alt: any;
|
|
33
|
+
ref: any;
|
|
34
|
+
name: any;
|
|
35
|
+
description: any;
|
|
36
|
+
length: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
19
39
|
reactElement: import("react/jsx-runtime").JSX.Element;
|
|
20
40
|
html?: string;
|
|
21
41
|
} | {
|
|
@@ -23,9 +43,18 @@ export default class MultiVariantBaseRenderer extends FeatureRendererType {
|
|
|
23
43
|
height: number;
|
|
24
44
|
width: number;
|
|
25
45
|
containsNoTransferables: boolean;
|
|
46
|
+
rbush: any;
|
|
47
|
+
featureGenotypeMap: {
|
|
48
|
+
[k: string]: {
|
|
49
|
+
alt: any;
|
|
50
|
+
ref: any;
|
|
51
|
+
name: any;
|
|
52
|
+
description: any;
|
|
53
|
+
length: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
26
56
|
imageData: any;
|
|
27
57
|
reactElement?: React.ReactElement;
|
|
28
58
|
html?: string;
|
|
29
59
|
}>;
|
|
30
60
|
}
|
|
31
|
-
export type { RenderArgsSerialized, RenderResults, ResultsDeserialized, ResultsSerialized, } from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType';
|
|
@@ -45,14 +45,20 @@ class MultiVariantBaseRenderer extends FeatureRendererType_1.default {
|
|
|
45
45
|
}
|
|
46
46
|
async render(renderProps) {
|
|
47
47
|
const features = await this.getFeatures(renderProps);
|
|
48
|
-
const { height, regions, bpPerPx } = renderProps;
|
|
48
|
+
const { height, referenceDrawingMode, regions, bpPerPx } = renderProps;
|
|
49
49
|
const region = regions[0];
|
|
50
50
|
const width = (region.end - region.start) / bpPerPx;
|
|
51
51
|
const { makeImageData } = await Promise.resolve().then(() => __importStar(require('./makeImageData')));
|
|
52
|
-
const rest = await (0, util_1.renderToAbstractCanvas)(width, height, renderProps, ctx =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
const rest = await (0, util_1.renderToAbstractCanvas)(width, height, renderProps, ctx => {
|
|
53
|
+
if (referenceDrawingMode === 'skip') {
|
|
54
|
+
ctx.fillStyle = '#ccc';
|
|
55
|
+
ctx.fillRect(0, 0, width, height);
|
|
56
|
+
}
|
|
57
|
+
return makeImageData(ctx, {
|
|
58
|
+
...renderProps,
|
|
59
|
+
features,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
56
62
|
const results = await super.render({
|
|
57
63
|
...renderProps,
|
|
58
64
|
...rest,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import RBush from 'rbush';
|
|
2
1
|
import type { Source } from '../../shared/types';
|
|
3
2
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
3
|
import type { Region } from '@jbrowse/core/util/types';
|
|
4
|
+
type SerializedRBush = any;
|
|
5
|
+
interface MinimizedVariantRecord {
|
|
6
|
+
alt: string[];
|
|
7
|
+
ref: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
5
12
|
declare const MultiVariantRendering: (props: {
|
|
6
13
|
regions: Region[];
|
|
7
14
|
features: Map<string, Feature>;
|
|
@@ -10,10 +17,9 @@ declare const MultiVariantRendering: (props: {
|
|
|
10
17
|
height: number;
|
|
11
18
|
sources: Source[];
|
|
12
19
|
scrollTop: number;
|
|
20
|
+
featureGenotypeMap: Record<string, MinimizedVariantRecord>;
|
|
13
21
|
totalHeight: number;
|
|
14
|
-
rbush:
|
|
15
|
-
genotype: string;
|
|
16
|
-
}>;
|
|
22
|
+
rbush: SerializedRBush;
|
|
17
23
|
displayModel: any;
|
|
18
24
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
19
25
|
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|