@jbrowse/plugin-variants 2.17.0 → 2.18.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/ChordVariantDisplay/index.d.ts +1 -1
- package/dist/ChordVariantDisplay/index.js +1 -2
- package/dist/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/dist/ChordVariantDisplay/models/configSchema.js +1 -10
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
- package/dist/ChordVariantDisplay/models/stateModelFactory.js +2 -23
- package/dist/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/dist/LinearVariantDisplay/configSchema.js +1 -10
- package/dist/LinearVariantDisplay/index.d.ts +1 -1
- package/dist/LinearVariantDisplay/index.js +2 -2
- package/dist/LinearVariantDisplay/model.d.ts +8 -38
- package/dist/LinearVariantDisplay/model.js +1 -17
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +73 -0
- package/dist/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/dist/MultiLinearVariantDisplay/configSchema.js +30 -0
- package/dist/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantDisplay/index.js +47 -0
- package/dist/MultiLinearVariantDisplay/model.d.ts +278 -0
- package/dist/MultiLinearVariantDisplay/model.js +235 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.js +18 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +42 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +81 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +22 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.js +24 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.js +218 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +21 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +106 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +12 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +6 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +20 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +60 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +43 -0
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
- package/dist/MultiLinearVariantRenderer/configSchema.js +13 -0
- package/dist/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantRenderer/index.js +19 -0
- package/dist/MultiVariantBaseRenderer.d.ts +46 -0
- package/dist/MultiVariantBaseRenderer.js +39 -0
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -2
- package/dist/StructuralVariantChordRenderer/Chord.js +5 -9
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +0 -1
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/dist/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/dist/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/dist/StructuralVariantChordRenderer/index.js +1 -1
- package/dist/Tooltip.d.ts +19 -0
- package/dist/Tooltip.js +58 -0
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
- package/dist/VariantFeatureWidget/AnnotGrid.js +2 -2
- package/dist/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +4 -6
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +9 -13
- package/dist/VariantFeatureWidget/index.d.ts +1 -1
- package/dist/VariantFeatureWidget/index.js +1 -1
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/dist/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +67 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +63 -0
- package/dist/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/dist/VariantRPC/MultiVariantGetSources.js +22 -0
- package/dist/VariantTrack/configSchema.d.ts +2 -3
- package/dist/VariantTrack/configSchema.js +6 -13
- package/dist/VariantTrack/index.d.ts +1 -1
- package/dist/VcfAdapter/VcfAdapter.d.ts +3 -2
- package/dist/VcfAdapter/VcfAdapter.js +3 -5
- package/dist/VcfAdapter/configSchema.d.ts +0 -3
- package/dist/VcfAdapter/configSchema.js +1 -7
- package/dist/VcfAdapter/index.d.ts +1 -1
- package/dist/VcfFeature/index.d.ts +5 -29
- package/dist/VcfFeature/index.js +35 -26
- package/dist/VcfFeature/util.d.ts +1 -4
- package/dist/VcfFeature/util.js +0 -12
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +10 -5
- package/dist/VcfTabixAdapter/configSchema.d.ts +0 -9
- package/dist/VcfTabixAdapter/configSchema.js +2 -14
- package/dist/VcfTabixAdapter/index.d.ts +1 -1
- package/dist/configSchema.d.ts +34 -0
- package/dist/configSchema.js +44 -0
- package/dist/extensionPoints.d.ts +1 -1
- package/dist/getMultiVariantFeaturesAutorun.d.ts +19 -0
- package/dist/getMultiVariantFeaturesAutorun.js +40 -0
- package/dist/getMultiVariantSourcesAutorun.d.ts +16 -0
- package/dist/getMultiVariantSourcesAutorun.js +37 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -4
- package/dist/shared/BulkEditPanel.d.ts +6 -0
- package/dist/shared/BulkEditPanel.js +103 -0
- package/dist/shared/ClusterDialog.d.ts +12 -0
- package/dist/shared/ClusterDialog.js +150 -0
- package/dist/shared/ColorLegend.d.ts +11 -0
- package/dist/shared/ColorLegend.js +24 -0
- package/dist/shared/DraggableDialog.d.ts +6 -0
- package/dist/shared/DraggableDialog.js +62 -0
- package/dist/shared/LegendBar.d.ts +18 -0
- package/dist/shared/LegendBar.js +38 -0
- package/dist/shared/MAFFilterDialog.d.ts +9 -0
- package/dist/shared/MAFFilterDialog.js +56 -0
- package/dist/shared/RectBg.d.ts +9 -0
- package/dist/shared/RectBg.js +12 -0
- package/dist/shared/RowPalettizer.d.ts +6 -0
- package/dist/shared/RowPalettizer.js +38 -0
- package/dist/shared/SetColorDialog.d.ts +12 -0
- package/dist/shared/SetColorDialog.js +94 -0
- package/dist/shared/SetMinMaxDialog.d.ts +11 -0
- package/dist/shared/SetMinMaxDialog.js +56 -0
- package/dist/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/dist/shared/SharedVariantConfigSchema.js +56 -0
- package/dist/shared/SharedVariantMixin.d.ts +309 -0
- package/dist/shared/SharedVariantMixin.js +58 -0
- package/dist/shared/SourcesGrid.d.ts +8 -0
- package/dist/shared/SourcesGrid.js +143 -0
- package/dist/shared/Tooltip.d.ts +18 -0
- package/dist/shared/Tooltip.js +38 -0
- package/dist/shared/util.d.ts +10 -0
- package/dist/shared/util.js +32 -0
- package/dist/util.d.ts +11 -0
- package/dist/util.js +53 -0
- package/esm/ChordVariantDisplay/index.d.ts +1 -1
- package/esm/ChordVariantDisplay/index.js +1 -2
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/esm/ChordVariantDisplay/models/configSchema.js +1 -10
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
- package/esm/ChordVariantDisplay/models/stateModelFactory.js +3 -24
- package/esm/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/esm/LinearVariantDisplay/configSchema.js +1 -10
- package/esm/LinearVariantDisplay/index.d.ts +1 -1
- package/esm/LinearVariantDisplay/index.js +2 -2
- package/esm/LinearVariantDisplay/model.d.ts +8 -38
- package/esm/LinearVariantDisplay/model.js +2 -18
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +45 -0
- package/esm/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/esm/MultiLinearVariantDisplay/configSchema.js +24 -0
- package/esm/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantDisplay/index.js +18 -0
- package/esm/MultiLinearVariantDisplay/model.d.ts +278 -0
- package/esm/MultiLinearVariantDisplay/model.js +206 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.js +12 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +53 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +16 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.js +18 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.js +189 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +15 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +100 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +7 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.js +4 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +14 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +54 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +18 -0
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
- package/esm/MultiLinearVariantRenderer/configSchema.js +8 -0
- package/esm/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantRenderer/index.js +13 -0
- package/esm/MultiVariantBaseRenderer.d.ts +46 -0
- package/esm/MultiVariantBaseRenderer.js +33 -0
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -2
- package/esm/StructuralVariantChordRenderer/Chord.js +5 -9
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +0 -1
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/esm/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/esm/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/esm/StructuralVariantChordRenderer/index.js +1 -1
- package/esm/Tooltip.d.ts +19 -0
- package/esm/Tooltip.js +30 -0
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
- package/esm/VariantFeatureWidget/AnnotGrid.js +2 -2
- package/esm/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +5 -7
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +10 -14
- package/esm/VariantFeatureWidget/index.d.ts +1 -1
- package/esm/VariantFeatureWidget/index.js +1 -1
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +60 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +56 -0
- package/esm/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/esm/VariantRPC/MultiVariantGetSources.js +15 -0
- package/esm/VariantTrack/configSchema.d.ts +2 -3
- package/esm/VariantTrack/configSchema.js +5 -13
- package/esm/VariantTrack/index.d.ts +1 -1
- package/esm/VcfAdapter/VcfAdapter.d.ts +3 -2
- package/esm/VcfAdapter/VcfAdapter.js +4 -6
- package/esm/VcfAdapter/configSchema.d.ts +0 -3
- package/esm/VcfAdapter/configSchema.js +1 -7
- package/esm/VcfAdapter/index.d.ts +1 -1
- package/esm/VcfFeature/index.d.ts +5 -29
- package/esm/VcfFeature/index.js +35 -26
- package/esm/VcfFeature/util.d.ts +1 -4
- package/esm/VcfFeature/util.js +0 -12
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +11 -6
- package/esm/VcfTabixAdapter/configSchema.d.ts +0 -9
- package/esm/VcfTabixAdapter/configSchema.js +2 -14
- package/esm/VcfTabixAdapter/index.d.ts +1 -1
- package/esm/configSchema.d.ts +34 -0
- package/esm/configSchema.js +42 -0
- package/esm/extensionPoints.d.ts +1 -1
- package/esm/extensionPoints.js +1 -1
- package/esm/getMultiVariantFeaturesAutorun.d.ts +19 -0
- package/esm/getMultiVariantFeaturesAutorun.js +37 -0
- package/esm/getMultiVariantSourcesAutorun.d.ts +16 -0
- package/esm/getMultiVariantSourcesAutorun.js +34 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +18 -4
- package/esm/shared/BulkEditPanel.d.ts +6 -0
- package/esm/shared/BulkEditPanel.js +77 -0
- package/esm/shared/ClusterDialog.d.ts +12 -0
- package/esm/shared/ClusterDialog.js +121 -0
- package/esm/shared/ColorLegend.d.ts +11 -0
- package/esm/shared/ColorLegend.js +19 -0
- package/esm/shared/DraggableDialog.d.ts +6 -0
- package/esm/shared/DraggableDialog.js +34 -0
- package/esm/shared/LegendBar.d.ts +18 -0
- package/esm/shared/LegendBar.js +32 -0
- package/esm/shared/MAFFilterDialog.d.ts +9 -0
- package/esm/shared/MAFFilterDialog.js +31 -0
- package/esm/shared/RectBg.d.ts +9 -0
- package/esm/shared/RectBg.js +7 -0
- package/esm/shared/RowPalettizer.d.ts +6 -0
- package/esm/shared/RowPalettizer.js +32 -0
- package/esm/shared/SetColorDialog.d.ts +12 -0
- package/esm/shared/SetColorDialog.js +65 -0
- package/esm/shared/SetMinMaxDialog.d.ts +11 -0
- package/esm/shared/SetMinMaxDialog.js +30 -0
- package/esm/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/esm/shared/SharedVariantConfigSchema.js +53 -0
- package/esm/shared/SharedVariantMixin.d.ts +309 -0
- package/esm/shared/SharedVariantMixin.js +55 -0
- package/esm/shared/SourcesGrid.d.ts +8 -0
- package/esm/shared/SourcesGrid.js +115 -0
- package/esm/shared/Tooltip.d.ts +18 -0
- package/esm/shared/Tooltip.js +33 -0
- package/esm/shared/util.d.ts +10 -0
- package/esm/shared/util.js +28 -0
- package/esm/util.d.ts +11 -0
- package/esm/util.js +47 -0
- package/package.json +4 -4
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { set1 } from '@jbrowse/core/ui/colors';
|
|
3
|
+
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
5
|
+
import { linearBareDisplayStateModelFactory, } from '@jbrowse/plugin-linear-genome-view';
|
|
6
|
+
import deepEqual from 'fast-deep-equal';
|
|
7
|
+
import { isAlive, types } from 'mobx-state-tree';
|
|
8
|
+
import { randomColor } from '../util';
|
|
9
|
+
const Tooltip = lazy(() => import('../shared/Tooltip'));
|
|
10
|
+
const SetColorDialog = lazy(() => import('../shared/SetColorDialog'));
|
|
11
|
+
const ClusterDialog = lazy(() => import('../shared/ClusterDialog'));
|
|
12
|
+
export function stateModelFactory(pluginManager, configSchema) {
|
|
13
|
+
return types
|
|
14
|
+
.compose('MultiLinearVariantDisplay', linearBareDisplayStateModelFactory(configSchema), types.model({
|
|
15
|
+
type: types.literal('MultiLinearVariantDisplay'),
|
|
16
|
+
layout: types.optional(types.frozen(), []),
|
|
17
|
+
rowHeightSetting: types.optional(types.number, 11),
|
|
18
|
+
autoHeight: false,
|
|
19
|
+
showSidebarLabelsSetting: true,
|
|
20
|
+
}))
|
|
21
|
+
.volatile(() => ({
|
|
22
|
+
sourcesLoadingStopToken: undefined,
|
|
23
|
+
featureUnderMouseVolatile: undefined,
|
|
24
|
+
sourcesVolatile: undefined,
|
|
25
|
+
}))
|
|
26
|
+
.actions(self => ({
|
|
27
|
+
setSourcesLoading(str) {
|
|
28
|
+
if (self.sourcesLoadingStopToken) {
|
|
29
|
+
stopStopToken(self.sourcesLoadingStopToken);
|
|
30
|
+
}
|
|
31
|
+
self.sourcesLoadingStopToken = str;
|
|
32
|
+
},
|
|
33
|
+
setLayout(layout) {
|
|
34
|
+
self.layout = layout;
|
|
35
|
+
},
|
|
36
|
+
clearLayout() {
|
|
37
|
+
self.layout = [];
|
|
38
|
+
},
|
|
39
|
+
setSources(sources) {
|
|
40
|
+
if (!deepEqual(sources, self.sourcesVolatile)) {
|
|
41
|
+
self.sourcesVolatile = sources;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
setFeatureUnderMouse(f) {
|
|
45
|
+
self.featureUnderMouseVolatile = f;
|
|
46
|
+
},
|
|
47
|
+
setRowHeight(arg) {
|
|
48
|
+
self.rowHeightSetting = arg;
|
|
49
|
+
},
|
|
50
|
+
setAutoHeight(arg) {
|
|
51
|
+
self.autoHeight = arg;
|
|
52
|
+
},
|
|
53
|
+
setShowSidebarLabels(arg) {
|
|
54
|
+
self.showSidebarLabelsSetting = arg;
|
|
55
|
+
},
|
|
56
|
+
}))
|
|
57
|
+
.views(self => ({
|
|
58
|
+
get featureUnderMouse() {
|
|
59
|
+
return self.featureUnderMouseVolatile;
|
|
60
|
+
},
|
|
61
|
+
get TooltipComponent() {
|
|
62
|
+
return Tooltip;
|
|
63
|
+
},
|
|
64
|
+
}))
|
|
65
|
+
.views(self => ({
|
|
66
|
+
get rendererTypeName() {
|
|
67
|
+
return 'MultiVariantRenderer';
|
|
68
|
+
},
|
|
69
|
+
get sources() {
|
|
70
|
+
var _a;
|
|
71
|
+
const sources = Object.fromEntries(((_a = self.sourcesVolatile) === null || _a === void 0 ? void 0 : _a.map(s => [s.name, s])) || []);
|
|
72
|
+
const iter = self.layout.length ? self.layout : self.sourcesVolatile;
|
|
73
|
+
return iter === null || iter === void 0 ? void 0 : iter.map(s => ({
|
|
74
|
+
...sources[s.name],
|
|
75
|
+
...s,
|
|
76
|
+
})).map((s, i) => ({
|
|
77
|
+
...s,
|
|
78
|
+
color: s.color || set1[i] || randomColor(s.name),
|
|
79
|
+
}));
|
|
80
|
+
},
|
|
81
|
+
}))
|
|
82
|
+
.views(self => ({
|
|
83
|
+
get rowHeight() {
|
|
84
|
+
const { autoHeight, sources, rowHeightSetting, height } = self;
|
|
85
|
+
return autoHeight ? height / ((sources === null || sources === void 0 ? void 0 : sources.length) || 1) : rowHeightSetting;
|
|
86
|
+
},
|
|
87
|
+
}))
|
|
88
|
+
.views(self => {
|
|
89
|
+
const { renderProps: superRenderProps } = self;
|
|
90
|
+
return {
|
|
91
|
+
get canDisplayLabels() {
|
|
92
|
+
return self.rowHeight > 8 && self.showSidebarLabelsSetting;
|
|
93
|
+
},
|
|
94
|
+
get totalHeight() {
|
|
95
|
+
var _a;
|
|
96
|
+
return self.rowHeight * (((_a = self.sources) === null || _a === void 0 ? void 0 : _a.length) || 1);
|
|
97
|
+
},
|
|
98
|
+
adapterProps() {
|
|
99
|
+
const superProps = superRenderProps();
|
|
100
|
+
return {
|
|
101
|
+
...superProps,
|
|
102
|
+
displayModel: self,
|
|
103
|
+
config: self.rendererConfig,
|
|
104
|
+
rpcDriverName: self.rpcDriverName,
|
|
105
|
+
sources: self.sources,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
})
|
|
110
|
+
.views(self => ({
|
|
111
|
+
renderProps() {
|
|
112
|
+
const superProps = self.adapterProps();
|
|
113
|
+
return {
|
|
114
|
+
...superProps,
|
|
115
|
+
notReady: superProps.notReady || !self.sources,
|
|
116
|
+
displayModel: self,
|
|
117
|
+
rpcDriverName: self.rpcDriverName,
|
|
118
|
+
height: self.height,
|
|
119
|
+
totalHeight: self.totalHeight,
|
|
120
|
+
rowHeight: self.rowHeight,
|
|
121
|
+
scrollTop: self.scrollTop,
|
|
122
|
+
onMouseMove: (_, f) => {
|
|
123
|
+
self.setFeatureUnderMouse(f);
|
|
124
|
+
},
|
|
125
|
+
onMouseLeave: () => {
|
|
126
|
+
self.setFeatureUnderMouse(undefined);
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
}))
|
|
131
|
+
.views(self => {
|
|
132
|
+
const { trackMenuItems: superTrackMenuItems } = self;
|
|
133
|
+
return {
|
|
134
|
+
trackMenuItems() {
|
|
135
|
+
return [
|
|
136
|
+
...superTrackMenuItems(),
|
|
137
|
+
{
|
|
138
|
+
label: 'Adjust to height of display?',
|
|
139
|
+
type: 'checkbox',
|
|
140
|
+
checked: self.autoHeight,
|
|
141
|
+
onClick: () => {
|
|
142
|
+
self.setAutoHeight(!self.autoHeight);
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
label: 'Show sidebar labels',
|
|
147
|
+
type: 'checkbox',
|
|
148
|
+
checked: self.showSidebarLabelsSetting,
|
|
149
|
+
onClick: () => {
|
|
150
|
+
self.setShowSidebarLabels(!self.showSidebarLabelsSetting);
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: 'Cluster by genotype',
|
|
155
|
+
onClick: () => {
|
|
156
|
+
getSession(self).queueDialog(handleClose => [
|
|
157
|
+
ClusterDialog,
|
|
158
|
+
{
|
|
159
|
+
model: self,
|
|
160
|
+
handleClose,
|
|
161
|
+
},
|
|
162
|
+
]);
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: 'Edit colors/arrangement...',
|
|
167
|
+
onClick: () => {
|
|
168
|
+
getSession(self).queueDialog(handleClose => [
|
|
169
|
+
SetColorDialog,
|
|
170
|
+
{
|
|
171
|
+
model: self,
|
|
172
|
+
handleClose,
|
|
173
|
+
},
|
|
174
|
+
]);
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
})
|
|
181
|
+
.actions(self => {
|
|
182
|
+
const { renderSvg: superRenderSvg } = self;
|
|
183
|
+
return {
|
|
184
|
+
afterAttach() {
|
|
185
|
+
;
|
|
186
|
+
(async () => {
|
|
187
|
+
try {
|
|
188
|
+
const { getMultiVariantSourcesAutorun } = await import('../getMultiVariantSourcesAutorun');
|
|
189
|
+
getMultiVariantSourcesAutorun(self);
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
if (isAlive(self)) {
|
|
193
|
+
console.error(e);
|
|
194
|
+
getSession(self).notifyError(`${e}`, e);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})();
|
|
198
|
+
},
|
|
199
|
+
async renderSvg(opts) {
|
|
200
|
+
const { renderSvg } = await import('./renderSvg');
|
|
201
|
+
return renderSvg(self, opts, superRenderSvg);
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
export default stateModelFactory;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MultiLinearVariantDisplayModel } from './model';
|
|
3
|
+
import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
+
export declare function renderSvg(self: MultiLinearVariantDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<React.JSX.Element>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
+
import { when } from 'mobx';
|
|
4
|
+
import LegendBar from '../shared/LegendBar';
|
|
5
|
+
export async function renderSvg(self, opts, superRenderSvg) {
|
|
6
|
+
await when(() => !!self.regionCannotBeRenderedText);
|
|
7
|
+
const { offsetPx } = getContainingView(self);
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement("g", null, await superRenderSvg(opts)),
|
|
10
|
+
React.createElement("g", { transform: `translate(${Math.max(-offsetPx, 0)})` },
|
|
11
|
+
React.createElement(LegendBar, { model: self, orientation: "left", exportSVG: true }))));
|
|
12
|
+
}
|
package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MultiLinearVariantMatrixDisplayModel } from '../model';
|
|
3
|
+
declare const LinesConnectingMatrixToGenomicPosition: ({ model, exportSVG, }: {
|
|
4
|
+
model: MultiLinearVariantMatrixDisplayModel;
|
|
5
|
+
exportSVG?: boolean;
|
|
6
|
+
}) => React.JSX.Element | null;
|
|
7
|
+
export default LinesConnectingMatrixToGenomicPosition;
|
package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
5
|
+
const { height } = model;
|
|
6
|
+
const { width, offsetPx } = getContainingView(model);
|
|
7
|
+
const left = Math.max(0, -offsetPx);
|
|
8
|
+
return exportSVG ? (React.createElement("g", { transform: `translate(${left})` }, children)) : (React.createElement("svg", { style: {
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
top: 0,
|
|
11
|
+
left,
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
height,
|
|
14
|
+
width,
|
|
15
|
+
} }, children));
|
|
16
|
+
});
|
|
17
|
+
const LinesConnectingMatrixToGenomicPosition = observer(function ({ model, exportSVG, }) {
|
|
18
|
+
var _a;
|
|
19
|
+
const { assemblyManager } = getSession(model);
|
|
20
|
+
const view = getContainingView(model);
|
|
21
|
+
const { featuresVolatile } = model;
|
|
22
|
+
const { offsetPx, assemblyNames, dynamicBlocks } = view;
|
|
23
|
+
const assembly = assemblyManager.get(assemblyNames[0]);
|
|
24
|
+
const b0 = ((_a = dynamicBlocks.contentBlocks[0]) === null || _a === void 0 ? void 0 : _a.widthPx) || 0;
|
|
25
|
+
const w = b0 / ((featuresVolatile === null || featuresVolatile === void 0 ? void 0 : featuresVolatile.length) || 1);
|
|
26
|
+
const l = Math.max(offsetPx, 0);
|
|
27
|
+
return assembly && featuresVolatile ? (React.createElement(Wrapper, { exportSVG: exportSVG, model: model }, featuresVolatile.map((f, i) => {
|
|
28
|
+
var _a;
|
|
29
|
+
const ref = f.get('refName');
|
|
30
|
+
const c = (((_a = view.bpToPx({
|
|
31
|
+
refName: assembly.getCanonicalRefName(ref) || ref,
|
|
32
|
+
coord: f.get('start'),
|
|
33
|
+
})) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - l;
|
|
34
|
+
return (React.createElement("line", { stroke: "black", key: f.id(), x1: i * w + w / 2, x2: c, y1: 20, y2: 0 }));
|
|
35
|
+
}))) : null;
|
|
36
|
+
});
|
|
37
|
+
export default LinesConnectingMatrixToGenomicPosition;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MultiLinearVariantMatrixDisplayModel } from '../model';
|
|
3
|
+
declare const MultiLinearVariantMatrixDisplayComponent: (props: {
|
|
4
|
+
model: MultiLinearVariantMatrixDisplayModel;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
export default MultiLinearVariantMatrixDisplayComponent;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
|
+
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
5
|
+
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
8
|
+
import LinesConnectingMatrixToGenomicPosition from './LinesConnectingMatrixToGenomicPosition';
|
|
9
|
+
import LegendBar from '../../shared/LegendBar';
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
|
+
cursor: {
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
zIndex: 1000,
|
|
14
|
+
position: 'relative',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
const MultiLinearVariantMatrixDisplayComponent = observer(function (props) {
|
|
18
|
+
const { classes } = useStyles();
|
|
19
|
+
const { model } = props;
|
|
20
|
+
const { height, sources, rowHeight } = model;
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
const [mouseY, setMouseY] = useState();
|
|
23
|
+
const [mouseX, setMouseX] = useState();
|
|
24
|
+
const { width } = getContainingView(model);
|
|
25
|
+
return (React.createElement("div", { ref: ref, onMouseMove: event => {
|
|
26
|
+
var _a;
|
|
27
|
+
const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
28
|
+
const top = (rect === null || rect === void 0 ? void 0 : rect.top) || 0;
|
|
29
|
+
const left = (rect === null || rect === void 0 ? void 0 : rect.left) || 0;
|
|
30
|
+
setMouseY(event.clientY - top);
|
|
31
|
+
setMouseX(event.clientX - left);
|
|
32
|
+
}, onMouseLeave: () => {
|
|
33
|
+
setMouseY(undefined);
|
|
34
|
+
setMouseX(undefined);
|
|
35
|
+
} },
|
|
36
|
+
React.createElement("div", { style: { position: 'relative' } },
|
|
37
|
+
React.createElement(LinesConnectingMatrixToGenomicPosition, { model: model }),
|
|
38
|
+
React.createElement("div", { style: { position: 'absolute', top: 20 } },
|
|
39
|
+
React.createElement(LegendBar, { model: model }),
|
|
40
|
+
React.createElement(BaseLinearDisplayComponent, { ...props }))),
|
|
41
|
+
mouseY &&
|
|
42
|
+
mouseY > 20 &&
|
|
43
|
+
(sources === null || sources === void 0 ? void 0 : sources[Math.floor((mouseY - 20) / rowHeight)]) ? (React.createElement(React.Fragment, null,
|
|
44
|
+
React.createElement("svg", { className: classes.cursor, width: width, height: height },
|
|
45
|
+
React.createElement("line", { x1: 0, x2: width, y1: mouseY, y2: mouseY, stroke: "black" }),
|
|
46
|
+
React.createElement("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: "black" })),
|
|
47
|
+
React.createElement(BaseTooltip, null,
|
|
48
|
+
React.createElement(SanitizedHTML, { html: Object.entries(sources[Math.floor((mouseY - 20) / rowHeight)] || {})
|
|
49
|
+
.filter(([key]) => key !== 'color')
|
|
50
|
+
.map(([key, value]) => `${key}:${value}`)
|
|
51
|
+
.join('\n') })))) : null));
|
|
52
|
+
});
|
|
53
|
+
export default MultiLinearVariantMatrixDisplayComponent;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
export default function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
|
+
renderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
4
|
+
height: {
|
|
5
|
+
type: string;
|
|
6
|
+
defaultValue: number;
|
|
7
|
+
};
|
|
8
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
9
|
+
renderer: import("mobx-state-tree").IAnyModelType;
|
|
10
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
11
|
+
maxFeatureScreenDensity: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
defaultValue: number;
|
|
15
|
+
};
|
|
16
|
+
fetchSizeLimit: {
|
|
17
|
+
type: string;
|
|
18
|
+
defaultValue: number;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
height: {
|
|
22
|
+
type: string;
|
|
23
|
+
defaultValue: number;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
mouseover: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
defaultValue: string;
|
|
30
|
+
contextVariable: string[];
|
|
31
|
+
};
|
|
32
|
+
jexlFilters: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
defaultValue: never[];
|
|
36
|
+
};
|
|
37
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
import { linearBasicDisplayConfigSchemaFactory } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
+
import configSchema from '../MultiLinearVariantMatrixRenderer/configSchema';
|
|
4
|
+
function x() { }
|
|
5
|
+
export default function configSchemaF(pluginManager) {
|
|
6
|
+
return ConfigurationSchema('LinearVariantMatrixDisplay', {
|
|
7
|
+
renderer: configSchema,
|
|
8
|
+
height: {
|
|
9
|
+
type: 'number',
|
|
10
|
+
defaultValue: 250,
|
|
11
|
+
},
|
|
12
|
+
}, {
|
|
13
|
+
baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager),
|
|
14
|
+
explicitlyTyped: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
|
|
2
|
+
import MultiLinearVariantMatrixDisplayComponent from './components/VariantDisplayComponent';
|
|
3
|
+
import configSchemaF from './configSchema';
|
|
4
|
+
import stateModelFactory from './model';
|
|
5
|
+
export default function LinearVariantMatrixDisplayF(pluginManager) {
|
|
6
|
+
pluginManager.addDisplayType(() => {
|
|
7
|
+
const configSchema = configSchemaF(pluginManager);
|
|
8
|
+
return new DisplayType({
|
|
9
|
+
name: 'LinearVariantMatrixDisplay',
|
|
10
|
+
displayName: 'Multi-variant display (matrix)',
|
|
11
|
+
configSchema,
|
|
12
|
+
stateModel: stateModelFactory(configSchema),
|
|
13
|
+
trackType: 'VariantTrack',
|
|
14
|
+
viewType: 'LinearGenomeView',
|
|
15
|
+
ReactComponent: MultiLinearVariantMatrixDisplayComponent,
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|